eve 0.75.1 → 0.76.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 (599) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/src/acp/adapter.js +1 -1
  4. package/dist/src/channel/task-card.js +1 -1
  5. package/dist/src/channel/tool-eligibility.d.ts +1 -2
  6. package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-D2V9UhLt.js} +68 -10
  7. package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-QmriPA-w.js} +68 -10
  8. package/dist/src/cli/dev/environment.d.ts +0 -6
  9. package/dist/src/cli/dev/environment.js +1 -1
  10. package/dist/src/cli/dev/tui/conversation-view.js +1 -1
  11. package/dist/src/cli/dev/tui/runner.js +1 -1
  12. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  13. package/dist/src/cli/dev/tui/transcript.js +1 -1
  14. package/dist/src/client/message-action-parts.d.ts +3 -0
  15. package/dist/src/client/message-action-parts.js +1 -1
  16. package/dist/src/client/message-reducer-types.d.ts +6 -1
  17. package/dist/src/client/message-reducer.js +1 -1
  18. package/dist/src/compiled/.vendor-stamp.json +3 -2
  19. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  20. package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
  21. package/dist/src/compiled/@vercel/queue/index.js +47 -0
  22. package/dist/src/compiler/connection-ownership.d.ts +6 -0
  23. package/dist/src/compiler/connection-ownership.js +1 -0
  24. package/dist/src/compiler/default-tool-policy.d.ts +0 -3
  25. package/dist/src/compiler/default-tool-policy.js +1 -1
  26. package/dist/src/compiler/extension-compatibility.d.ts +21 -20
  27. package/dist/src/compiler/extension-compatibility.js +1 -1
  28. package/dist/src/compiler/manifest.d.ts +9 -6
  29. package/dist/src/compiler/manifest.js +1 -1
  30. package/dist/src/compiler/normalize-connection.js +1 -1
  31. package/dist/src/compiler/normalize-manifest.js +1 -1
  32. package/dist/src/compiler/normalize-skill.d.ts +5 -0
  33. package/dist/src/compiler/normalize-skill.js +1 -1
  34. package/dist/src/compiler/normalize-subagent.d.ts +2 -1
  35. package/dist/src/compiler/normalize-subagent.js +1 -1
  36. package/dist/src/compiler/normalize-tool.js +1 -1
  37. package/dist/src/compiler/remote-agent-node.d.ts +2 -1
  38. package/dist/src/compiler/remote-agent-node.js +1 -1
  39. package/dist/src/connections/ownership.d.ts +18 -0
  40. package/dist/src/connections/ownership.js +1 -0
  41. package/dist/src/context/build-dynamic-tools.d.ts +3 -9
  42. package/dist/src/context/build-dynamic-tools.js +1 -1
  43. package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
  44. package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
  45. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  46. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  47. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  48. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  49. package/dist/src/context/keys.d.ts +5 -4
  50. package/dist/src/context/memory-tools.js +1 -1
  51. package/dist/src/context/schedule-collection-tools.js +1 -1
  52. package/dist/src/discover/grammar.d.ts +11 -0
  53. package/dist/src/discover/grammar.js +1 -1
  54. package/dist/src/discover/manifest.d.ts +1 -0
  55. package/dist/src/discover/manifest.js +1 -1
  56. package/dist/src/discover/skills.d.ts +1 -0
  57. package/dist/src/discover/skills.js +1 -1
  58. package/dist/src/dynamic/definition.d.ts +7 -5
  59. package/dist/src/evals/assertions/collector.d.ts +4 -0
  60. package/dist/src/evals/assertions/collector.js +1 -1
  61. package/dist/src/evals/assertions/run.d.ts +2 -3
  62. package/dist/src/evals/assertions/run.js +2 -2
  63. package/dist/src/evals/assertions/scoped.js +1 -1
  64. package/dist/src/evals/index.d.ts +1 -1
  65. package/dist/src/evals/match.d.ts +9 -6
  66. package/dist/src/evals/reported-tool-name.d.ts +9 -0
  67. package/dist/src/evals/reported-tool-name.js +1 -0
  68. package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
  69. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  70. package/dist/src/evals/runner/execute-task.js +1 -1
  71. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  72. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
  73. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
  74. package/dist/src/evals/runner/reporters/datadog.js +2 -2
  75. package/dist/src/evals/session.js +2 -2
  76. package/dist/src/evals/target.d.ts +7 -0
  77. package/dist/src/evals/target.js +1 -1
  78. package/dist/src/evals/types.d.ts +17 -1
  79. package/dist/src/execution/agent-sessions/remote.js +1 -1
  80. package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
  81. package/dist/src/execution/catalog/connection-auth.js +1 -0
  82. package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
  83. package/dist/src/execution/catalog/connection-entry.js +1 -0
  84. package/dist/src/execution/catalog/listing.d.ts +9 -0
  85. package/dist/src/execution/catalog/listing.js +3 -0
  86. package/dist/src/execution/catalog/rank.d.ts +44 -0
  87. package/dist/src/execution/catalog/rank.js +1 -0
  88. package/dist/src/execution/catalog/search.d.ts +28 -0
  89. package/dist/src/execution/catalog/search.js +1 -0
  90. package/dist/src/execution/catalog/signatures.d.ts +11 -0
  91. package/dist/src/execution/catalog/signatures.js +1 -0
  92. package/dist/src/execution/catalog/skills.d.ts +24 -0
  93. package/dist/src/execution/catalog/skills.js +1 -0
  94. package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
  95. package/dist/src/execution/catalog/step-catalog.js +1 -0
  96. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  97. package/dist/src/execution/dynamic-connections.js +1 -1
  98. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  99. package/dist/src/execution/invoke-tool.js +1 -1
  100. package/dist/src/execution/node-step.js +1 -1
  101. package/dist/src/execution/session/active-turn.d.ts +1 -1
  102. package/dist/src/execution/session/pending-turn-state.js +1 -1
  103. package/dist/src/execution/session/turn-step.js +1 -1
  104. package/dist/src/execution/session/turn.d.ts +5 -5
  105. package/dist/src/execution/session/turn.js +1 -1
  106. package/dist/src/execution/session.js +1 -1
  107. package/dist/src/execution/skills/instructions.d.ts +20 -10
  108. package/dist/src/execution/skills/instructions.js +2 -2
  109. package/dist/src/execution/tasks/calls.d.ts +6 -5
  110. package/dist/src/execution/tasks/calls.js +1 -1
  111. package/dist/src/execution/tasks/model-step.d.ts +10 -10
  112. package/dist/src/execution/tasks/model-step.js +1 -1
  113. package/dist/src/execution/tasks/render.d.ts +3 -3
  114. package/dist/src/execution/tasks/render.js +3 -3
  115. package/dist/src/execution/tasks/session.d.ts +2 -1
  116. package/dist/src/execution/tasks/table.d.ts +1 -1
  117. package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
  118. package/dist/src/execution/tool-auth.js +1 -1
  119. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  120. package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
  121. package/dist/src/extensions/code/extension/extension.d.ts +4 -18
  122. package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
  123. package/dist/src/extensions/code/extension/instructions/github.js +1 -0
  124. package/dist/src/extensions/code/extension/instructions.md +1 -13
  125. package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
  126. package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
  127. package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
  128. package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
  129. package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
  130. package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
  131. package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
  132. package/dist/src/extensions/code/extension/lib/patch.js +4 -4
  133. package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
  134. package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
  135. package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
  136. package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
  137. package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
  138. package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
  139. package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
  140. package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
  141. package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
  142. package/dist/src/extensions/code/extension/skills/pr.js +1 -0
  143. package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
  144. package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
  145. package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
  146. package/dist/src/extensions/code/extension/tools/gh.js +1 -1
  147. package/dist/src/extensions/code/extension/tools/grep.js +1 -1
  148. package/dist/src/extensions/code/tools.d.ts +2 -1
  149. package/dist/src/extensions/code/tools.js +1 -1
  150. package/dist/src/extensions/git/extension/extension.d.ts +12 -0
  151. package/dist/src/extensions/git/extension/extension.js +1 -0
  152. package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
  153. package/dist/src/extensions/git/extension/instructions/github.js +1 -0
  154. package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
  155. package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
  156. package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
  157. package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
  158. package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
  159. package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
  160. package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
  161. package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
  162. package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
  163. package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
  164. package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
  165. package/dist/src/extensions/git/extension/lib/shell.js +1 -0
  166. package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
  167. package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
  168. package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
  169. package/dist/src/extensions/git/extension/skills/pr.js +1 -0
  170. package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
  171. package/dist/src/extensions/git/extension/tools/gh.js +1 -0
  172. package/dist/src/extensions/git/tools.d.ts +27 -0
  173. package/dist/src/extensions/git/tools.js +1 -0
  174. package/dist/src/framework/sources/registry.js +1 -1
  175. package/dist/src/harness/action-presentation.d.ts +2 -2
  176. package/dist/src/harness/action-result-helpers.d.ts +10 -2
  177. package/dist/src/harness/action-result-helpers.js +1 -1
  178. package/dist/src/harness/announcements.d.ts +2 -8
  179. package/dist/src/harness/announcements.js +1 -1
  180. package/dist/src/harness/coordination.d.ts +11 -11
  181. package/dist/src/harness/coordination.js +1 -1
  182. package/dist/src/harness/current-messages.d.ts +1 -5
  183. package/dist/src/harness/current-messages.js +1 -1
  184. package/dist/src/harness/emission.d.ts +2 -2
  185. package/dist/src/harness/emission.js +1 -1
  186. package/dist/src/harness/execute-call.d.ts +48 -0
  187. package/dist/src/harness/execute-call.js +1 -0
  188. package/dist/src/harness/execute-tool.d.ts +3 -1
  189. package/dist/src/harness/final-output.d.ts +2 -6
  190. package/dist/src/harness/final-output.js +1 -1
  191. package/dist/src/harness/hitl/approvals.d.ts +5 -0
  192. package/dist/src/harness/hitl/approvals.js +1 -1
  193. package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
  194. package/dist/src/harness/hitl/approved-calls.js +1 -1
  195. package/dist/src/harness/hitl/candidates.d.ts +13 -2
  196. package/dist/src/harness/hitl/candidates.js +1 -1
  197. package/dist/src/harness/hitl/coordinator.d.ts +3 -3
  198. package/dist/src/harness/hitl/coordinator.js +1 -1
  199. package/dist/src/harness/hitl/index.d.ts +6 -4
  200. package/dist/src/harness/hitl/index.js +1 -1
  201. package/dist/src/harness/hitl/intake.d.ts +3 -3
  202. package/dist/src/harness/hitl/intake.js +1 -1
  203. package/dist/src/harness/input-extraction.d.ts +4 -1
  204. package/dist/src/harness/input-extraction.js +1 -1
  205. package/dist/src/harness/input-request-resolution.d.ts +15 -0
  206. package/dist/src/harness/input-request-resolution.js +1 -1
  207. package/dist/src/harness/model-call/call.d.ts +3 -5
  208. package/dist/src/harness/model-call/call.js +1 -1
  209. package/dist/src/harness/model-call/errors.js +1 -1
  210. package/dist/src/harness/model-call/request.d.ts +3 -2
  211. package/dist/src/harness/model-call/request.js +1 -1
  212. package/dist/src/harness/model-call/response.d.ts +2 -1
  213. package/dist/src/harness/model-call/response.js +1 -1
  214. package/dist/src/harness/model-call/run.d.ts +5 -3
  215. package/dist/src/harness/model-call/run.js +1 -1
  216. package/dist/src/harness/model-call/tools.d.ts +12 -21
  217. package/dist/src/harness/model-call/tools.js +1 -1
  218. package/dist/src/harness/model-profile.d.ts +5 -0
  219. package/dist/src/harness/model-profile.js +1 -1
  220. package/dist/src/harness/provider-tools.d.ts +6 -5
  221. package/dist/src/harness/provider-tools.js +1 -1
  222. package/dist/src/harness/session-machine/commit.js +1 -1
  223. package/dist/src/harness/session-machine/transitions.d.ts +5 -2
  224. package/dist/src/harness/session-machine/transitions.js +1 -1
  225. package/dist/src/harness/step/after-model.js +1 -1
  226. package/dist/src/harness/step-hooks.d.ts +4 -6
  227. package/dist/src/harness/step-hooks.js +1 -1
  228. package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
  229. package/dist/src/harness/tool-call-io.d.ts +3 -0
  230. package/dist/src/harness/tool-call-io.js +1 -1
  231. package/dist/src/harness/tools.d.ts +22 -19
  232. package/dist/src/harness/tools.js +1 -1
  233. package/dist/src/harness/types.d.ts +14 -0
  234. package/dist/src/instrumentation/lifecycle.d.ts +0 -1
  235. package/dist/src/instrumentation/native-events.js +1 -1
  236. package/dist/src/instrumentation/runtime.d.ts +2 -1
  237. package/dist/src/internal/application/package.js +1 -1
  238. package/dist/src/internal/authored-definition/core.js +1 -1
  239. package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
  240. package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
  241. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  242. package/dist/src/internal/authored-module.d.ts +2 -1
  243. package/dist/src/internal/authored-module.js +1 -1
  244. package/dist/src/internal/helpers/markdown.js +1 -1
  245. package/dist/src/internal/mcp/skills.js +1 -1
  246. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  247. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  248. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
  249. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
  250. package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
  251. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
  252. package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
  253. package/dist/src/internal/schedules/consumer-route.js +1 -1
  254. package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
  255. package/dist/src/internal/schedules/dev-environment.js +1 -0
  256. package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
  257. package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
  258. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
  259. package/dist/src/protocol/catalog-tools.d.ts +12 -0
  260. package/dist/src/protocol/catalog-tools.js +1 -0
  261. package/dist/src/protocol/message-version.js +1 -1
  262. package/dist/src/protocol/message.d.ts +1 -1
  263. package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
  264. package/dist/src/protocol/remote-agent-protocol.js +1 -1
  265. package/dist/src/protocol/reply-tool.d.ts +2 -0
  266. package/dist/src/protocol/reply-tool.js +1 -0
  267. package/dist/src/protocol/runtime-tools.d.ts +6 -0
  268. package/dist/src/protocol/runtime-tools.js +1 -0
  269. package/dist/src/protocol/session-projection.js +1 -1
  270. package/dist/src/protocol/task-tools.d.ts +4 -4
  271. package/dist/src/protocol/task-tools.js +1 -1
  272. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
  273. package/dist/src/public/channels/linear/defaults.js +2 -2
  274. package/dist/src/public/channels/slack/action-status.d.ts +0 -9
  275. package/dist/src/public/channels/slack/action-status.js +1 -1
  276. package/dist/src/public/channels/slack/defaults.js +2 -2
  277. package/dist/src/public/channels/slack/task-card.d.ts +1 -1
  278. package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
  279. package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
  280. package/dist/src/public/definitions/remote-agent.d.ts +6 -3
  281. package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
  282. package/dist/src/public/experimental/schedules/index.d.ts +1 -1
  283. package/dist/src/public/schedules/providers/in-memory.js +1 -1
  284. package/dist/src/public/schedules/providers/vercel.js +1 -1
  285. package/dist/src/public/schedules/subscription.d.ts +36 -16
  286. package/dist/src/public/tools/web-search.d.ts +1 -1
  287. package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
  288. package/dist/src/runtime/agent/bootstrap.js +1 -1
  289. package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
  290. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  291. package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
  292. package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
  293. package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
  294. package/dist/src/runtime/connections/mcp-client.js +1 -1
  295. package/dist/src/runtime/connections/registry.js +1 -1
  296. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  297. package/dist/src/runtime/connections/tool-result.d.ts +2 -2
  298. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  299. package/dist/src/runtime/resolve-tool.js +1 -1
  300. package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
  301. package/dist/src/runtime/schedules/collection-client.js +1 -1
  302. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
  303. package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
  304. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  305. package/dist/src/runtime/subagents/registry.d.ts +2 -1
  306. package/dist/src/runtime/subagents/registry.js +1 -1
  307. package/dist/src/runtime/tools/registry.d.ts +2 -0
  308. package/dist/src/runtime/tools/registry.js +1 -1
  309. package/dist/src/runtime/types.d.ts +3 -3
  310. package/dist/src/setup/connection-connector.js +1 -2
  311. package/dist/src/setup/index.d.ts +1 -1
  312. package/dist/src/setup/index.js +1 -1
  313. package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
  314. package/dist/src/setup/integrations/slack/setup.js +1 -1
  315. package/dist/src/setup/primitives/process-output.d.ts +5 -0
  316. package/dist/src/setup/primitives/process-output.js +2 -1
  317. package/dist/src/setup/scaffold/create/project.js +1 -1
  318. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  319. package/dist/src/setup/scaffold/create/web-template.js +1 -1
  320. package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
  321. package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
  322. package/dist/src/setup/slack-connect-create.d.ts +10 -2
  323. package/dist/src/setup/slack-connect-create.js +1 -1
  324. package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
  325. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  326. package/dist/src/setup/slack-connect.d.ts +30 -11
  327. package/dist/src/setup/slack-connect.js +1 -1
  328. package/dist/src/setup/slack-setup-plan.d.ts +72 -0
  329. package/dist/src/setup/slack-setup-plan.js +1 -0
  330. package/dist/src/setup/slackbot.d.ts +75 -35
  331. package/dist/src/setup/slackbot.js +2 -1
  332. package/dist/src/shared/action-label.d.ts +10 -0
  333. package/dist/src/shared/action-label.js +1 -0
  334. package/dist/src/shared/action-request-name.d.ts +3 -1
  335. package/dist/src/shared/action-request-name.js +1 -1
  336. package/dist/src/shared/action-types.d.ts +7 -8
  337. package/dist/src/shared/action-types.js +1 -1
  338. package/dist/src/shared/agent-definition.d.ts +11 -3
  339. package/dist/src/shared/development-env-files.d.ts +4 -0
  340. package/dist/src/shared/development-env-files.js +1 -0
  341. package/dist/src/shared/input.d.ts +0 -1
  342. package/dist/src/shared/map-with-concurrency.d.ts +2 -0
  343. package/dist/src/shared/map-with-concurrency.js +1 -0
  344. package/dist/src/shared/skill-definition.d.ts +6 -0
  345. package/dist/src/shared/skill-package.d.ts +1 -0
  346. package/dist/src/shared/skill-package.js +1 -1
  347. package/dist/src/shared/web-search.d.ts +15 -2
  348. package/dist/src/shared/web-search.js +1 -1
  349. package/dist/src/svelte/index.js +1 -1
  350. package/dist/src/svelte/use-eve-agent.js +1 -1
  351. package/dist/src/tool-stubs/execute.d.ts +0 -3
  352. package/dist/src/tool-stubs/execute.js +1 -1
  353. package/dist/src/tool-stubs/rules.js +1 -1
  354. package/dist/src/tool-stubs/validate-targets.js +1 -1
  355. package/dist/src/tools/behavior.d.ts +3 -6
  356. package/dist/src/tools/definition.d.ts +5 -0
  357. package/dist/src/tools/dynamic.d.ts +5 -2
  358. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  359. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  360. package/dist/src/tools/provided/task-cancel.d.ts +1 -1
  361. package/dist/src/tools/provided/task-wait.d.ts +1 -1
  362. package/dist/src/tools/provided/web-search.d.ts +20 -7
  363. package/dist/src/tools/provided/web-search.js +1 -1
  364. package/dist/src/tools/schema.d.ts +5 -0
  365. package/dist/src/tools/schema.js +1 -1
  366. package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
  367. package/dist/src/tools/workflow-definition.d.ts +1 -1
  368. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  369. package/dist/src/tracing/agent-otel-provider.js +2 -2
  370. package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
  371. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  372. package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
  373. package/dist/src/tracing/agent-otel-turn-state.js +1 -0
  374. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  375. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  376. package/dist/src/tracing/agent-trace-state.d.ts +4 -1
  377. package/dist/src/vue/index.js +1 -1
  378. package/dist/src/vue/use-eve-agent.js +1 -1
  379. package/docs/agent-config.md +8 -8
  380. package/docs/channels/chat-sdk.mdx +1 -1
  381. package/docs/channels/slack.mdx +32 -82
  382. package/docs/code-extension.mdx +28 -7
  383. package/docs/concepts/built-in-tools.md +43 -43
  384. package/docs/concepts/context-control.md +1 -1
  385. package/docs/concepts/execution-model-and-durability.mdx +1 -1
  386. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  387. package/docs/connections/mcp.mdx +5 -5
  388. package/docs/connections/openapi.mdx +1 -1
  389. package/docs/connections/overview.mdx +4 -2
  390. package/docs/evals/assertions.mdx +5 -3
  391. package/docs/evals/reporters.mdx +3 -1
  392. package/docs/evals/tool-stubs.mdx +3 -1
  393. package/docs/extensions.md +2 -0
  394. package/docs/guides/dev-tui.md +2 -2
  395. package/docs/guides/dynamic-capabilities.md +14 -4
  396. package/docs/guides/frontend/overview.mdx +1 -1
  397. package/docs/guides/remote-agents.md +10 -3
  398. package/docs/instructions.mdx +5 -5
  399. package/docs/reference/cli.md +2 -2
  400. package/docs/reference/typescript-api.md +3 -3
  401. package/docs/skills.mdx +19 -4
  402. package/docs/subagents/index.mdx +5 -3
  403. package/docs/tools/overview.mdx +22 -1
  404. package/docs/tools/tasks-upgrade.md +1 -1
  405. package/docs/tools/tasks.md +32 -32
  406. package/docs/tools/workflows.mdx +6 -6
  407. package/docs/tutorial/team-playbooks.mdx +2 -2
  408. package/package.json +22 -6
  409. package/dist/src/execution/connection-announcement.d.ts +0 -7
  410. package/dist/src/execution/connection-announcement.js +0 -4
  411. package/dist/src/execution/tools/connection-approval.d.ts +0 -25
  412. package/dist/src/execution/tools/connection-approval.js +0 -1
  413. package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
  414. package/dist/src/execution/tools/connection-search-rank.js +0 -1
  415. package/dist/src/execution/tools/connection-target.d.ts +0 -18
  416. package/dist/src/execution/tools/connection-target.js +0 -1
  417. package/dist/src/execution/tools/connection-tools.d.ts +0 -4
  418. package/dist/src/execution/tools/connection-tools.js +0 -2
  419. package/dist/src/execution/tools/load-skill.d.ts +0 -10
  420. package/dist/src/execution/tools/load-skill.js +0 -1
  421. package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
  422. package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
  423. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
  424. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
  425. package/dist/src/harness/advertised-tools.d.ts +0 -26
  426. package/dist/src/harness/advertised-tools.js +0 -1
  427. package/dist/src/harness/nested-actions.d.ts +0 -23
  428. package/dist/src/harness/nested-actions.js +0 -1
  429. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
  430. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
  431. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
  432. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
  433. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
  434. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
  435. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
  436. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
  437. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
  438. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
  439. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
  440. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
  441. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
  442. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
  443. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
  444. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
  445. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
  446. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
  447. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
  448. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
  449. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
  450. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
  451. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
  452. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
  453. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
  454. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
  455. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
  456. package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
  457. package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
  458. package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
  459. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
  460. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
  461. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
  462. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
  463. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
  464. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
  465. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
  466. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
  467. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
  468. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
  469. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
  470. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
  471. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
  472. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
  473. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
  474. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
  475. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
  476. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
  477. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
  478. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
  479. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
  480. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
  481. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
  482. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
  483. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
  484. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
  485. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
  486. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
  487. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
  488. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
  489. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
  490. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
  491. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
  492. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
  493. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
  494. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
  495. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
  496. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
  497. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
  498. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
  499. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
  500. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
  501. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
  502. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
  503. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
  504. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
  505. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
  506. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
  507. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
  508. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
  509. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
  510. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
  511. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
  512. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
  513. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
  514. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
  515. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
  516. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
  517. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
  518. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
  519. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
  520. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
  521. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
  522. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
  523. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
  524. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
  525. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
  526. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
  527. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
  528. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
  529. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
  530. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
  531. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
  532. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
  533. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
  534. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
  535. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
  536. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
  537. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
  538. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
  539. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
  540. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
  541. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
  542. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
  543. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
  544. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
  545. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
  546. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
  547. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
  548. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
  549. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
  550. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
  551. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
  552. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
  553. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
  554. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
  555. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
  556. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
  557. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
  558. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
  559. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
  560. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
  561. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
  562. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
  563. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
  564. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
  565. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
  566. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
  567. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
  568. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
  569. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
  570. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
  571. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
  572. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
  573. package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
  574. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
  575. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
  576. package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
  577. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
  578. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
  579. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
  580. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
  581. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
  582. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
  583. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
  584. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
  585. package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
  586. package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
  587. package/dist/src/public/tools/load-skill.d.ts +0 -3
  588. package/dist/src/public/tools/load-skill.js +0 -1
  589. package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
  590. package/dist/src/runtime/skills/fragment-context.js +0 -1
  591. package/dist/src/tools/framework/connection-tools.d.ts +0 -3
  592. package/dist/src/tools/framework/connection-tools.js +0 -1
  593. package/dist/src/tools/provided/load-skill.d.ts +0 -2
  594. package/dist/src/tools/provided/load-skill.js +0 -1
  595. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
  596. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
  597. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
  598. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
  599. /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
@@ -1 +1 @@
1
- import{TASK_CANCEL_TOOL_NAME,TASK_WAIT_TOOL_NAME}from"#protocol/task-tools.js";import{createFrameworkUserMessage}from"#harness/messages.js";import{FINAL_REPLY_TASK_SYSTEM_BLOCK,TASKS_NOTE_LABEL,TASK_SYSTEM_BLOCK,renderModelOutputText,renderTaskResults,renderTasksNote}from"#execution/tasks/render.js";import{createTask,idleTasks,readTaskTable,takeTaskResults,workingTasks,writeTaskTable}from"#execution/tasks/table.js";import{observeToolOutput}from"#tool-stubs/execute.js";import{splitTaskIdInput}from"#execution/tasks/task-id-input.js";import{entryPointOf,isAgentTool,startsTasks}from"#execution/tasks/tool-entry-point.js";import{taskCancelTool}from"#tools/provided/task-cancel.js";import{taskWaitTool}from"#tools/provided/task-wait.js";function isTaskTool(e){return e?.frameworkAction===`task-wait`||e?.frameworkAction===`task-cancel`}function offersTasks(e){for(let t of e.values())if(startsTasks(t))return!0;return!1}function withTaskTools(e){return offersTasks(e)?new Map([...e,[TASK_WAIT_TOOL_NAME,taskWaitTool],[TASK_CANCEL_TOOL_NAME,taskCancelTool]]):e}function taskSystemMessages(e,t){return offersTasks(e)?[{content:t.finalReplyOnly?FINAL_REPLY_TASK_SYSTEM_BLOCK:TASK_SYSTEM_BLOCK,role:`system`}]:[]}function commitCallEntry(e,t){let n=entryPointOf(t.definition);switch(n){case`execute`:return{entry:{entryPoint:n},input:t.input,session:e};case`task`:return commitTask(e,t,n,t.input);case`serve`:{let{input:r,taskId:i}=splitTaskIdInput(t.input);return i===void 0?commitTask(e,t,n,r):{entry:{entryPoint:`receive`,taskId:i},input:r,session:e}}}}function commitTask(e,t,n,r){let i=createTask(readTaskTable(e.state),{callId:t.callId,kind:isAgentTool(t.definition)?`agent`:`tool`,name:t.toolName,resumable:n===`serve`,turnId:t.turnId});return{entry:{entryPoint:n,taskId:i.taskId},input:r,session:writeTaskTable(e,i.table)}}function workingTaskIds(e){return workingTasks(readTaskTable(e.state)).map(e=>e.id)}async function appendTaskContext(e){let t=[],n=await deliverTaskResults(e);n.message!==void 0&&t.push(createFrameworkUserMessage(`task.result`,n.message));let r=resolveTasksNote({messages:e.projectHistory([...e.messages,...t],n.session.state),session:n.session});return r!==void 0&&t.push(createFrameworkUserMessage(`context.state`,r)),{messages:t,session:n.session}}async function deliverTaskResults(e){let{table:t,taken:n}=takeTaskResults(readTaskTable(e.session.state));if(n.length===0)return{session:e.session};let r=[];for(let t of n)for(let n of t.results)r.push(await toResultBlock(t,n,e.tools.get(t.name)));return{message:renderTaskResults(r),session:writeTaskTable(e.session,t)}}async function toResultBlock(e,t,n){let r={taskId:e.id,tool:e.name};return t.status===`failed`?{...r,body:t.error,status:`failed`}:{...r,body:await projectOutput(e.name,t,n),status:`completed`}}async function projectOutput(e,t,n){return n?.toModelOutput===void 0?renderModelOutputText(t.output):await observeToolOutput(e,t.calls??[],async()=>renderModelOutputText(await n.toModelOutput(t.output)),()=>renderModelOutputText(t.output))}function resolveTasksNote(e){let t=readTaskTable(e.session.state),n=workingTasks(t).map(toListedTask),r=idleTasks(t).map(toListedTask),i=e.messages.findLast(isTasksNote);if(i===void 0&&n.length===0&&r.length===0)return;let a=renderTasksNote({idle:r,working:n});return i?.content===a?void 0:a}function toListedTask(e){return{id:e.id,tool:e.name}}function isTasksNote(e){return e.role===`user`&&typeof e.content==`string`&&e.content.startsWith(TASKS_NOTE_LABEL)}export{appendTaskContext,commitCallEntry,isTaskTool,offersTasks,taskSystemMessages,withTaskTools,workingTaskIds};
1
+ import{TASK_CANCEL_TOOL_NAME,TASK_WAIT_TOOL_NAME}from"#protocol/task-tools.js";import{createFrameworkUserMessage}from"#harness/messages.js";import{FINAL_REPLY_TASK_SYSTEM_BLOCK,TASKS_NOTE_LABEL,TASK_SYSTEM_BLOCK,renderModelOutputText,renderTaskResults,renderTasksNote}from"#execution/tasks/render.js";import{createTask,idleTasks,readTaskTable,takeTaskResults,workingTasks,writeTaskTable}from"#execution/tasks/table.js";import{entryPointOf,isAgentTool}from"#execution/tasks/tool-entry-point.js";import{observeToolOutput}from"#tool-stubs/execute.js";import{splitTaskIdInput}from"#execution/tasks/task-id-input.js";import{taskCancelTool}from"#tools/provided/task-cancel.js";import{taskWaitTool}from"#tools/provided/task-wait.js";function isTaskTool(e){return e?.frameworkAction===`task-wait`||e?.frameworkAction===`task-cancel`}function isWorkflowTool(e){return e?.workflowId!==void 0||isTaskTool(e)}function withTaskTools(e){return new Map([...e,[TASK_WAIT_TOOL_NAME,taskWaitTool],[TASK_CANCEL_TOOL_NAME,taskCancelTool]])}function taskSystemMessages(e,t){return e?[{content:t.finalReplyOnly?FINAL_REPLY_TASK_SYSTEM_BLOCK:TASK_SYSTEM_BLOCK,role:`system`}]:[]}function commitCallEntry(e,t){let n=entryPointOf(t.definition);switch(n){case`execute`:return{entry:{entryPoint:n},input:t.input,session:e};case`task`:return commitTask(e,t,n,t.input);case`serve`:{let{input:r,taskId:i}=splitTaskIdInput(t.input);return i===void 0?commitTask(e,t,n,r):{entry:{entryPoint:`receive`,taskId:i},input:r,session:e}}}}function commitTask(e,t,n,r){let i=createTask(readTaskTable(e.state),{callId:t.callId,kind:isAgentTool(t.definition)?`agent`:`tool`,name:t.toolName,resumable:n===`serve`,turnId:t.turnId});return{entry:{entryPoint:n,taskId:i.taskId},input:r,session:writeTaskTable(e,i.table)}}function workingTaskIds(e){return workingTasks(readTaskTable(e.state)).map(e=>e.id)}async function appendTaskContext(e){let t=[],n=await deliverTaskResults(e);n.message!==void 0&&t.push(createFrameworkUserMessage(`task.result`,n.message));let r=resolveTasksNote({messages:e.projectHistory([...e.messages,...t],n.session.state),session:n.session});return r!==void 0&&t.push(createFrameworkUserMessage(`context.state`,r)),{messages:t,session:n.session}}async function deliverTaskResults(e){let{table:t,taken:n}=takeTaskResults(readTaskTable(e.session.state));if(n.length===0)return{session:e.session};let r=[];for(let t of n)for(let n of t.results)r.push(await toResultBlock(t,n,e.tools.get(t.name)));return{message:renderTaskResults(r),session:writeTaskTable(e.session,t)}}async function toResultBlock(e,t,n){let r={taskId:e.id,tool:e.name};return t.status===`failed`?{...r,body:t.error,status:`failed`}:{...r,body:await projectOutput(e.name,t,n),status:`completed`}}async function projectOutput(e,t,n){return n?.toModelOutput===void 0?renderModelOutputText(t.output):await observeToolOutput(e,t.calls??[],async()=>renderModelOutputText(await n.toModelOutput(t.output)),()=>renderModelOutputText(t.output))}function resolveTasksNote(e){let t=readTaskTable(e.session.state),n=workingTasks(t).map(toListedTask),r=idleTasks(t).map(toListedTask),i=e.messages.findLast(isTasksNote);if(i===void 0&&n.length===0&&r.length===0)return;let a=renderTasksNote({idle:r,working:n});return i?.content===a?void 0:a}function toListedTask(e){return{id:e.id,tool:e.name}}function isTasksNote(e){return e.role===`user`&&typeof e.content==`string`&&e.content.startsWith(TASKS_NOTE_LABEL)}export{appendTaskContext,commitCallEntry,isTaskTool,isWorkflowTool,taskSystemMessages,withTaskTools,workingTaskIds};
@@ -1,5 +1,5 @@
1
1
  import type { TaskCancelResult, TaskWaitResult } from "#execution/tasks/calls.js";
2
- export declare const TASK_WAIT_DESCRIPTION = "Call task_wait sparingly, only when you deliberately want to withhold a message from the user while waiting for a task result. Tasks keep running and their results reach you without calling task_wait. If the user should hear from you now, reply instead. Wait silently until any of your tasks has a result, a new message arrives, or timeoutSeconds pass. It returns after the first result, which follows in a <task_result> message; wait again only if you still want to withhold a reply until another result arrives. Waiting never stops a task.";
2
+ export declare const TASK_WAIT_DESCRIPTION = "Call eve__task_wait sparingly, only when you deliberately want to withhold a message from the user while waiting for a task result. Tasks keep running and their results reach you without calling eve__task_wait. If the user should hear from you now, reply instead. Wait silently until any of your tasks has a result, a new message arrives, or timeoutSeconds pass. It returns after the first result, which follows in a <task_result> message; wait again only if you still want to withhold a reply until another result arrives. Waiting never stops a task.";
3
3
  export declare const TASK_WAIT_TIMEOUT_DESCRIPTION = "Optional. Seconds to wait before returning without a result. Omit it to wait for a result or a new message, which is almost always right. Don't use short timeouts to check on tasks: results reach you without checking.";
4
4
  export declare const TASK_CANCEL_DESCRIPTION = "Stop a task's current work. That work never reports back; if it already had a result, that result is still delivered. An agent, or any task that accepts more input, stays available: call its tool with its taskId to give it new work.";
5
5
  export declare const TASK_CANCEL_TASK_ID_DESCRIPTION = "The id of the task to stop, copied from its \"Started task\" receipt or the [Tasks] note.";
@@ -29,11 +29,11 @@ export declare function renderTaskReceipt(task: {
29
29
  export declare function renderTaskSentReceipt(taskId: string): string;
30
30
  export declare function renderUnknownTaskError(taskId: string, tool: string): string;
31
31
  export declare function renderUnknownCancelTaskError(taskId: string): string;
32
- /** What the model reads when `task_cancel` answers. */
32
+ /** What the model reads when `eve__task_cancel` answers. */
33
33
  export declare function renderTaskCancelResult(taskId: string, result: TaskCancelResult): string;
34
34
  export declare function renderTooManyTasksError(max: number, workingIds: readonly string[]): string;
35
35
  export declare function renderFinalOutputWhileWorkingError(workingIds: readonly string[]): string;
36
- /** What the model reads when `task_wait` returns after waiting `waitedMs`. */
36
+ /** What the model reads when `eve__task_wait` returns after waiting `waitedMs`. */
37
37
  export declare function renderTaskWaitResult(result: TaskWaitResult, waitedMs: number): string;
38
38
  /** One `<task_result>` block of a `task.result` message. */
39
39
  export interface TaskResultBlock {
@@ -1,6 +1,6 @@
1
- import{formatDuration}from"#shared/format-duration.js";const TASK_WAIT_DESCRIPTION=`Call task_wait sparingly, only when you deliberately want to withhold a message from the user while waiting for a task result. Tasks keep running and their results reach you without calling task_wait. If the user should hear from you now, reply instead. Wait silently until any of your tasks has a result, a new message arrives, or timeoutSeconds pass. It returns after the first result, which follows in a <task_result> message; wait again only if you still want to withhold a reply until another result arrives. Waiting never stops a task.`,TASK_WAIT_TIMEOUT_DESCRIPTION=`Optional. Seconds to wait before returning without a result. Omit it to wait for a result or a new message, which is almost always right. Don't use short timeouts to check on tasks: results reach you without checking.`,TASK_CANCEL_DESCRIPTION=`Stop a task's current work. That work never reports back; if it already had a result, that result is still delivered. An agent, or any task that accepts more input, stays available: call its tool with its taskId to give it new work.`,TASK_ID_SOURCE=`copied from its "Started task" receipt or the [Tasks] note`,TASK_CANCEL_TASK_ID_DESCRIPTION=`The id of the task to stop, ${TASK_ID_SOURCE}.`,TASK_SYSTEM_BLOCK_OPENING=[`Tasks`,`- A call that returns "Started task <id>" is a task: it keeps working while you continue. Every agent call is a task.`,`- Each result arrives once, in a <task_result> message. Until then you know nothing about it, so don't guess or report its result.`,`- Ending your reply doesn't end your turn. While tasks work, eve holds your turn and calls you again with each result.`],TASK_SYSTEM_BLOCK_CLOSING=[`- Don't redo work you delegated. Never use sleep or shell commands to wait for a task.`,`- To correct or continue an agent, or any task that accepts more input, call its tool again with its taskId. A new message never stops your tasks: answer it if it asks you something, decide whether it changes the work, then keep each task, correct an agent by taskId, or stop a task with task_cancel.`],TASK_SYSTEM_BLOCK=[...TASK_SYSTEM_BLOCK_OPENING,`- If you have nothing to tell the person until a result arrives, call task_wait. Start every independent task first, then wait.`,`- If the person should hear from you now, for example to confirm work is underway when they don't need the result yet, reply. When results arrive, report them without repeating yourself.`,...TASK_SYSTEM_BLOCK_CLOSING].join(`
2
- `),FINAL_REPLY_TASK_SYSTEM_BLOCK=[...TASK_SYSTEM_BLOCK_OPENING,`- Only your final reply reaches your caller. While tasks work, call task_wait instead of replying. Start every independent task first, then wait.`,...TASK_SYSTEM_BLOCK_CLOSING].join(`
3
- `),SERVE_TOOL_DESCRIPTION=`To send this task more input, call this tool again with its taskId; without taskId, each call starts a new task.`,AGENT_SERVE_TOOL_DESCRIPTION=`It does not see this conversation, so put everything it needs in message. To correct or continue an agent task, call this tool again with its taskId; without taskId, each call starts a new agent.`,TASK_ID_INPUT_DESCRIPTION=`The id of a task this tool started, ${TASK_ID_SOURCE}, to send it this input. Omit it to start a new task.`,TASKS_NOTE_LABEL=`[Tasks]`,TASK_RESULT_TAG=`<task_result`,UNREADABLE_TASK_ERROR=`The task's state could not be read.`;function renderTaskReceipt(e){let t=`Started task ${e.id}. Its result will arrive in a <task_result> message.`;return e.resumable?`${t} To send it another message, call ${e.tool} again with taskId ${e.id}.`:t}function renderTaskSentReceipt(e){return`Sent to task ${e}. Its reply will arrive in a <task_result> message.`}function renderUnknownTaskError(e,t){return`No task "${e}" is available to ${t}: it may have ended or belong to another tool. Start a new one by calling ${t} without taskId.`}function renderUnknownCancelTaskError(e){return`No task "${e}" is in this session. Copy an id from a "Started task" receipt or the [Tasks] note.`}function renderTaskCancelResult(e,t){return t.status===`already_finished`?`${e} had no work to stop.`:t.resumable?`Stopped ${e}'s current work; it won't report back. To give it new work, call ${t.tool} again with taskId ${e}.`:`Stopped ${e}; it won't report back.`}function renderTooManyTasksError(e,t){return`${String(e)} tasks are already working (${t.join(`, `)}). Wait with task_wait or stop one with task_cancel, then try again.`}function renderFinalOutputWhileWorkingError(e){return`You can't give your final output while tasks you started are working (${e.join(`, `)}). Wait for their results with task_wait, or stop a task with task_cancel, then call final_output.`}function renderTaskWaitResult(e,t){switch(e.status){case`settled`:return renderSettledWait(e.settled,e.working);case`timeout`:return`Stopped waiting after ${formatDuration(t)}; ${countWorking(e.working)}. ${resultsArriveLater(e.working.length)}`;case`interrupt`:return`A new message arrived, so the wait ended after ${formatDuration(t)}; ${countWorking(e.working)}. Read the message, answer it if it asks you something, and decide whether it changes this work: ${interruptChoices(e.working.length)}`}}function renderSettledWait(e,t){if(e.length===0&&t.length===0)return`No tasks are working.`;let n=[];if(e.length>0){let t=e.map(e=>`${e.id} ${e.status}`),r=e.length===1?`its result follows`:`their results follow`;n.push(`${joinList(t)}; ${r}.`)}return t.length>0&&n.push(`${capitalize(countWorking(t))}: ${t.join(`, `)}.`),n.join(` `)}function countWorking(e){return e.length===1?`1 task is still working`:`${String(e.length)} tasks are still working`}function resultsArriveLater(e){return e===1?`Its result arrives before your turn ends; wait again only if you need it now.`:`Their results arrive before your turn ends; wait again only if you need them now.`}function interruptChoices(e){return`${e===1?`keep the task`:`keep the tasks`}, call an agent again with its taskId to correct it, or stop a task with task_cancel.`}function renderTaskResults(e){let t={bytes:51200,lines:2e3};return e.map(e=>{let n=fitToBudget(escapeTaskResultBody(e.body),t),r=`id="${escapeAttribute(e.taskId)}" tool="${escapeAttribute(e.tool)}" status="${e.status}"`;return`${TASK_RESULT_TAG} ${r}>${n}</task_result>`}).join(`
1
+ import{TASK_CANCEL_TOOL_NAME,TASK_WAIT_TOOL_NAME}from"#protocol/task-tools.js";import{REPLY_TOOL_NAME}from"#protocol/reply-tool.js";import{formatDuration}from"#shared/format-duration.js";const TASK_WAIT_DESCRIPTION=`Call ${TASK_WAIT_TOOL_NAME} sparingly, only when you deliberately want to withhold a message from the user while waiting for a task result. Tasks keep running and their results reach you without calling ${TASK_WAIT_TOOL_NAME}. If the user should hear from you now, reply instead. Wait silently until any of your tasks has a result, a new message arrives, or timeoutSeconds pass. It returns after the first result, which follows in a <task_result> message; wait again only if you still want to withhold a reply until another result arrives. Waiting never stops a task.`,TASK_WAIT_TIMEOUT_DESCRIPTION=`Optional. Seconds to wait before returning without a result. Omit it to wait for a result or a new message, which is almost always right. Don't use short timeouts to check on tasks: results reach you without checking.`,TASK_CANCEL_DESCRIPTION=`Stop a task's current work. That work never reports back; if it already had a result, that result is still delivered. An agent, or any task that accepts more input, stays available: call its tool with its taskId to give it new work.`,TASK_ID_SOURCE=`copied from its "Started task" receipt or the [Tasks] note`,TASK_CANCEL_TASK_ID_DESCRIPTION=`The id of the task to stop, ${TASK_ID_SOURCE}.`,TASK_SYSTEM_BLOCK_OPENING=[`Tasks`,`- A call that returns "Started task <id>" is a task: it keeps working while you continue. Every agent call is a task.`,`- Each result arrives once, in a <task_result> message. Until then you know nothing about it, so don't guess or report its result.`,`- Ending your reply doesn't end your turn. While tasks work, eve holds your turn and calls you again with each result.`],TASK_SYSTEM_BLOCK_CLOSING=[`- Don't redo work you delegated. Never use sleep or shell commands to wait for a task.`,`- To correct or continue an agent, or any task that accepts more input, call its tool again with its taskId. A new message never stops your tasks: answer it if it asks you something, decide whether it changes the work, then keep each task, correct an agent by taskId, or stop a task with ${TASK_CANCEL_TOOL_NAME}.`],TASK_SYSTEM_BLOCK=[...TASK_SYSTEM_BLOCK_OPENING,`- If you have nothing to tell the person until a result arrives, call ${TASK_WAIT_TOOL_NAME}. Start every independent task first, then wait.`,`- If the person should hear from you now, for example to confirm work is underway when they don't need the result yet, reply. When results arrive, report them without repeating yourself.`,...TASK_SYSTEM_BLOCK_CLOSING].join(`
2
+ `),FINAL_REPLY_TASK_SYSTEM_BLOCK=[...TASK_SYSTEM_BLOCK_OPENING,`- Only your final reply reaches your caller. While tasks work, call ${TASK_WAIT_TOOL_NAME} instead of replying. Start every independent task first, then wait.`,...TASK_SYSTEM_BLOCK_CLOSING].join(`
3
+ `),SERVE_TOOL_DESCRIPTION=`To send this task more input, call this tool again with its taskId; without taskId, each call starts a new task.`,AGENT_SERVE_TOOL_DESCRIPTION=`It does not see this conversation, so put everything it needs in message. To correct or continue an agent task, call this tool again with its taskId; without taskId, each call starts a new agent.`,TASK_ID_INPUT_DESCRIPTION=`The id of a task this tool started, ${TASK_ID_SOURCE}, to send it this input. Omit it to start a new task.`,TASKS_NOTE_LABEL=`[Tasks]`,TASK_RESULT_TAG=`<task_result`,UNREADABLE_TASK_ERROR=`The task's state could not be read.`;function renderTaskReceipt(e){let t=`Started task ${e.id}. Its result will arrive in a <task_result> message.`;return e.resumable?`${t} To send it another message, call ${e.tool} again with taskId ${e.id}.`:t}function renderTaskSentReceipt(e){return`Sent to task ${e}. Its reply will arrive in a <task_result> message.`}function renderUnknownTaskError(e,t){return`No task "${e}" is available to ${t}: it may have ended or belong to another tool. Start a new one by calling ${t} without taskId.`}function renderUnknownCancelTaskError(e){return`No task "${e}" is in this session. Copy an id from a "Started task" receipt or the [Tasks] note.`}function renderTaskCancelResult(e,t){return t.status===`already_finished`?`${e} had no work to stop.`:t.resumable?`Stopped ${e}'s current work; it won't report back. To give it new work, call ${t.tool} again with taskId ${e}.`:`Stopped ${e}; it won't report back.`}function renderTooManyTasksError(e,t){return`${String(e)} tasks are already working (${t.join(`, `)}). Wait with ${TASK_WAIT_TOOL_NAME} or stop one with ${TASK_CANCEL_TOOL_NAME}, then try again.`}function renderFinalOutputWhileWorkingError(e){return`You can't give your final reply while tasks you started are working (${e.join(`, `)}). Wait for their results with ${TASK_WAIT_TOOL_NAME}, or stop a task with ${TASK_CANCEL_TOOL_NAME}, then call ${REPLY_TOOL_NAME}.`}function renderTaskWaitResult(e,t){switch(e.status){case`settled`:return renderSettledWait(e.settled,e.working);case`timeout`:return`Stopped waiting after ${formatDuration(t)}; ${countWorking(e.working)}. ${resultsArriveLater(e.working.length)}`;case`interrupt`:return`A new message arrived, so the wait ended after ${formatDuration(t)}; ${countWorking(e.working)}. Read the message, answer it if it asks you something, and decide whether it changes this work: ${interruptChoices(e.working.length)}`}}function renderSettledWait(e,t){if(e.length===0&&t.length===0)return`No tasks are working.`;let n=[];if(e.length>0){let t=e.map(e=>`${e.id} ${e.status}`),r=e.length===1?`its result follows`:`their results follow`;n.push(`${joinList(t)}; ${r}.`)}return t.length>0&&n.push(`${capitalize(countWorking(t))}: ${t.join(`, `)}.`),n.join(` `)}function countWorking(e){return e.length===1?`1 task is still working`:`${String(e.length)} tasks are still working`}function resultsArriveLater(e){return e===1?`Its result arrives before your turn ends; wait again only if you need it now.`:`Their results arrive before your turn ends; wait again only if you need them now.`}function interruptChoices(e){return`${e===1?`keep the task`:`keep the tasks`}, call an agent again with its taskId to correct it, or stop a task with ${TASK_CANCEL_TOOL_NAME}.`}function renderTaskResults(e){let t={bytes:51200,lines:2e3};return e.map(e=>{let n=fitToBudget(escapeTaskResultBody(e.body),t),r=`id="${escapeAttribute(e.taskId)}" tool="${escapeAttribute(e.tool)}" status="${e.status}"`;return`${TASK_RESULT_TAG} ${r}>${n}</task_result>`}).join(`
4
4
  `)}const TASK_RESULT_BLOCK=RegExp(`${TASK_RESULT_TAG} id="([^"]*)" tool="([^"]*)" status="(completed|failed)">([\\s\\S]*?)</task_result>`,`g`);function readTaskResults(e){return[...e.matchAll(TASK_RESULT_BLOCK)].map(([,e,t,n,r])=>({body:r.replaceAll(`<\\/task_result`,`</task_result`),status:n,taskId:e,tool:t}))}function fitToBudget(e,t){let n=new TextEncoder,r=e.split(`
5
5
  `),i=[];for(let e of r){let r=n.encode(e).byteLength+1;if(t.lines===0||r>t.bytes){i.push(`[truncated]`),t.lines=0,t.bytes=0;break}i.push(e),--t.lines,t.bytes-=r}return i.join(`
6
6
  `)}function escapeTaskResultBody(e){return e.replaceAll(`</task_result`,`<\\/task_result`)}function renderModelOutputText(e){if(typeof e==`string`)return e;if(isModelOutput(e))switch(e.type){case`text`:return String(e.value);case`json`:return JSON.stringify(e.value);case`content`:return renderContentParts(e.value)}return JSON.stringify(e??null)}function renderContentParts(e){return Array.isArray(e)?e.map(e=>e.type===`text`?String(e.text):`[file: ${typeof e.filename==`string`?e.filename:String(e.mediaType)}]`).join(`
@@ -4,6 +4,7 @@ import { type TaskRunMessage } from "#execution/tasks/steps.js";
4
4
  import { type TaskTable } from "#execution/tasks/table.js";
5
5
  import type { WorkflowToolRunMessage } from "#execution/tools/workflow/messages.js";
6
6
  import type { TaskCancelReason } from "#protocol/message.js";
7
+ import { TASK_CANCEL_TOOL_NAME } from "#protocol/task-tools.js";
7
8
  import type { RuntimeActionResult } from "#shared/action-types.js";
8
9
  /** Whether a run's message changes a task record. */
9
10
  export declare function isTaskRunMessage(message: WorkflowToolRunMessage): message is TaskRunMessage;
@@ -15,5 +16,5 @@ export declare function sessionTaskTable(cursor: SessionStateCursor): TaskTable;
15
16
  */
16
17
  export declare function cancelWorkingTasks(cursor: SessionStateCursor, reason: Exclude<TaskCancelReason, "task_cancel">): Promise<void>;
17
18
  export declare function answerTaskCancel(cursor: SessionStateCursor, call: Extract<TaskToolCall, {
18
- readonly kind: "task_cancel";
19
+ readonly kind: typeof TASK_CANCEL_TOOL_NAME;
19
20
  }>): Promise<RuntimeActionResult>;
@@ -111,7 +111,7 @@ export declare function taskWaitResult(table: TaskTable, wake: {
111
111
  readonly timedOut: boolean;
112
112
  }): TaskWaitResult | undefined;
113
113
  /**
114
- * What `task_cancel` answers, or `undefined` for a task that doesn't exist.
114
+ * What `eve__task_cancel` answers, or `undefined` for a task that doesn't exist.
115
115
  * `cancelled` means the caller cancels the working task.
116
116
  */
117
117
  export declare function taskCancelResult(table: TaskTable, taskId: string): TaskCancelResult | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { HarnessToolDefinition } from "#harness/execute-tool.js";
2
2
  import type { WorkflowToolEntryPoint } from "#tools/workflow-entry-point.js";
3
3
  /**
4
- * The entry point a deferred tool's calls run through. Every agent tool is a
4
+ * The entry point a workflow tool's calls run through. Every agent tool is a
5
5
  * `serve` tool; tools that dispatch nowhere are called like `execute`.
6
6
  */
7
7
  export declare function entryPointOf(definition: HarnessToolDefinition | undefined): WorkflowToolEntryPoint;
@@ -1 +1 @@
1
- import{buildBaseToolContext}from"#context/build-base-tool-context.js";import{createAuthorizationContext}from"#runtime/authorization-context.js";import{handleAuthorizationError}from"#runtime/connections/scoped-authorization.js";function createToolExecuteWithAuth(e){return(t,n)=>{let r=createAuthorizationContext({scope:e.scope}),i={...buildBaseToolContext({options:n,toolName:e.scope}),messages:n.messages,getToken:r.getToken,requireAuth:r.requireAuth};return r.run(()=>e.execute(t,i))}}function buildApprovalResponseAuth(e){let t=createAuthorizationContext({scope:e.scope,boundResponder:e.responder});return{getToken:(n,r)=>t.getToken(n,namespaceApprovalAuthOptions(e.scope,r)),requireAuth:(n,r)=>t.requireAuth(n,namespaceApprovalAuthOptions(e.scope,r))}}function namespaceApprovalAuthOptions(e,t){return t?.authKey===void 0?t:{...t,authKey:`${e}:${t.authKey}`}}async function handleApprovalResponsePolicyError(e){return await handleAuthorizationError(e)}export{buildApprovalResponseAuth,createToolExecuteWithAuth,handleApprovalResponsePolicyError};
1
+ import{handleAuthorizationError}from"#runtime/connections/scoped-authorization.js";import{buildBaseToolContext}from"#context/build-base-tool-context.js";import{createAuthorizationContext}from"#runtime/authorization-context.js";function createToolExecuteWithAuth(e){return(t,n)=>{let r=createAuthorizationContext({scope:e.scope}),i={...buildBaseToolContext({options:n,toolName:e.scope}),messages:n.messages,getToken:r.getToken,requireAuth:r.requireAuth};return r.run(()=>e.execute(t,i))}}function buildApprovalResponseAuth(e){let t=createAuthorizationContext({scope:e.scope,boundResponder:e.responder});return{getToken:(n,r)=>t.getToken(n,namespaceApprovalAuthOptions(e.scope,r)),requireAuth:(n,r)=>t.requireAuth(n,namespaceApprovalAuthOptions(e.scope,r))}}function namespaceApprovalAuthOptions(e,t){return t?.authKey===void 0?t:{...t,authKey:`${e}:${t.authKey}`}}async function handleApprovalResponsePolicyError(e){return await handleAuthorizationError(e)}export{buildApprovalResponseAuth,createToolExecuteWithAuth,handleApprovalResponsePolicyError};
@@ -1 +1 @@
1
- import{decide}from"#ai/decide.js";async function runAgentRouterTask(e,t){"use workflow";let n=await chooseTarget(e.message,descriptions(t),t.abortSignal),{message:r,status:i}=await(await t.agent(n).send(e.message,{signal:t.abortSignal})).result();if(i===`failed`)throw Error(`Agent "${n}" failed to handle the task.`);return r??null}async function chooseTarget(e,t,n){"use step";let r=Object.keys(t);if(r.length===0)throw Error(`agentRouter requires at least one available agent with a description.`);return r.length===1?r[0]:(await decide({abortSignal:n,state:{message:e},questions:{route:{type:`choice`,instructions:`Which subagent should handle this task?`,criteria:t}}})).answers.route.choice}function descriptions(e){return Object.fromEntries(Object.entries(e.agents).flatMap(([e,t])=>{let n=t.description.trim();return n.length===0?[]:[[e,n]]}))}runAgentRouterTask.workflowId=`workflow//eve@0.75.1//runAgentRouterTask`;export{runAgentRouterTask};
1
+ import{decide}from"#ai/decide.js";async function runAgentRouterTask(e,t){"use workflow";let n=await chooseTarget(e.message,descriptions(t),t.abortSignal),{message:r,status:i}=await(await t.agent(n).send(e.message,{signal:t.abortSignal})).result();if(i===`failed`)throw Error(`Agent "${n}" failed to handle the task.`);return r??null}async function chooseTarget(e,t,n){"use step";let r=Object.keys(t);if(r.length===0)throw Error(`agentRouter requires at least one available agent with a description.`);return r.length===1?r[0]:(await decide({abortSignal:n,state:{message:e},questions:{route:{type:`choice`,instructions:`Which subagent should handle this task?`,criteria:t}}})).answers.route.choice}function descriptions(e){return Object.fromEntries(Object.entries(e.agents).flatMap(([e,t])=>{let n=t.description.trim();return n.length===0?[]:[[e,n]]}))}runAgentRouterTask.workflowId=`workflow//eve@0.76.0//runAgentRouterTask`;export{runAgentRouterTask};
@@ -1 +1 @@
1
- import{UNSPECIFIED_INPUT_SCHEMA,toInputSchema,toOutputSchema}from"#tools/schema.js";import{workflowIdForHandling}from"#runtime/subagents/workflow-reference.js";import{withTaskIdInput}from"#execution/tasks/task-id-input.js";import{entryPointOf}from"#execution/tasks/tool-entry-point.js";function createWorkflowToolHarnessDefinition(e){return{...entryPointOf(e.definition)===`serve`?withTaskIdInput(e.definition):e.definition,execute:void 0,executeInput:e.executeInput,workflowId:e.workflowId}}function createPreparedWorkflowToolHarnessDefinition(e){let t=workflowIdForHandling(e.behavior?.handling);if(t===void 0)throw Error(`Prepared tool "${e.name}" is not backed by a workflow.`);return createWorkflowToolHarnessDefinition({definition:{frameworkTool:e.kind!==`authored-tool`||e.owner.kind===`framework`,behavior:e.behavior,description:e.description,inputSchema:toInputSchema(e.inputSchema)??UNSPECIFIED_INPUT_SCHEMA,name:e.name,outputSchema:toOutputSchema(e.outputSchema),rootOnly:e.rootOnly},workflowId:t})}export{createPreparedWorkflowToolHarnessDefinition,createWorkflowToolHarnessDefinition};
1
+ import{UNSPECIFIED_INPUT_SCHEMA,toInputSchema,toOutputSchema}from"#tools/schema.js";import{workflowIdForHandling}from"#runtime/subagents/workflow-reference.js";import{entryPointOf}from"#execution/tasks/tool-entry-point.js";import{withTaskIdInput}from"#execution/tasks/task-id-input.js";function createWorkflowToolHarnessDefinition(e){return{...entryPointOf(e.definition)===`serve`?withTaskIdInput(e.definition):e.definition,execute:void 0,executeInput:e.executeInput,workflowId:e.workflowId}}function createPreparedWorkflowToolHarnessDefinition(e){let t=workflowIdForHandling(e.behavior?.handling);if(t===void 0)throw Error(`Prepared tool "${e.name}" is not backed by a workflow.`);return createWorkflowToolHarnessDefinition({definition:{frameworkTool:e.kind!==`authored-tool`||e.owner.kind===`framework`,behavior:e.behavior,deferred:e.deferred,description:e.description,inputSchema:toInputSchema(e.inputSchema)??UNSPECIFIED_INPUT_SCHEMA,name:e.name,outputSchema:toOutputSchema(e.outputSchema),rootOnly:e.rootOnly},workflowId:t})}export{createPreparedWorkflowToolHarnessDefinition,createWorkflowToolHarnessDefinition};
@@ -1,28 +1,14 @@
1
1
  import type { SandboxSession } from "eve/sandbox";
2
2
  import { z } from "zod";
3
+ import type { GitHubConfig } from "eve/extensions/git/sandbox";
3
4
  export type CredentialPolicyBroker = (sandbox: SandboxSession, rules: Record<string, Record<string, string>>) => Promise<void>;
4
- export interface GitHubLeaseRule {
5
- readonly match?: {
6
- readonly headers?: readonly {
7
- readonly key?: {
8
- readonly exact: string;
9
- };
10
- readonly value?: {
11
- readonly exact?: string;
12
- readonly regex?: string;
13
- };
14
- }[];
15
- };
16
- readonly transform: readonly {
17
- readonly headers: Readonly<Record<string, string>>;
18
- }[];
19
- }
20
- export type GitHubLeaseBroker = (sandbox: SandboxSession, rules: Readonly<Record<string, readonly GitHubLeaseRule[]>> | null) => Promise<void>;
5
+ export type { GitHubLeaseRule } from "eve/extensions/git/sandbox";
6
+ export type GitHubLeaseBroker = GitHubConfig["broker"];
21
7
  declare const _default: import("eve/extension").ExtensionHandle<z.ZodObject<{
22
8
  github: z.ZodOptional<z.ZodObject<{
23
9
  connector: z.ZodString;
24
10
  org: z.ZodString;
25
- broker: z.ZodCustom<GitHubLeaseBroker, GitHubLeaseBroker>;
11
+ broker: z.ZodCustom<(sandbox: SandboxSession, rules: Readonly<Record<string, readonly import("eve/extensions/git/sandbox").GitHubLeaseRule[]>> | null) => Promise<void>, (sandbox: SandboxSession, rules: Readonly<Record<string, readonly import("eve/extensions/git/sandbox").GitHubLeaseRule[]>> | null) => Promise<void>>;
26
12
  }, z.core.$strip>>;
27
13
  vercel: z.ZodOptional<z.ZodObject<{
28
14
  connector: z.ZodString;
@@ -0,0 +1,3 @@
1
+ /** @deprecated Mount `eve/extensions/git` with `github` config. */
2
+ declare const _default: import("eve/instructions").DynamicSentinel<import("eve/instructions").DynamicInstructionsResult>;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ import{deprecatedGitHubConfigured}from"../lib/github-compat.js";import{githubInstructions}from"eve/extensions/git/sandbox";import{defineDynamic,defineInstructions}from"eve/instructions";var github_default=defineDynamic({events:{"session.started":()=>deprecatedGitHubConfigured()?defineInstructions({content:githubInstructions(!0)}):null}});export{github_default as default};
@@ -49,20 +49,10 @@ Required steps, in order:
49
49
 
50
50
  # Repository work
51
51
 
52
- GitHub credentials are not available to ordinary `bash`. Use the `gh` tool for every authenticated GitHub operation. The full `gh` CLI surface is available. Declare exactly one repository in the configured organization with write-capable access. Authenticated commands run without an approval prompt; describe the intended GitHub-side result accurately in `description`. Connect mints the real token for only the declared repository. The sandbox process receives only a placeholder `GH_TOKEN`, and the firewall exchanges it on matching GitHub requests. GitHub rejects access outside the token's server-side repository scope. Never put credentials in URLs or commands. If access is denied, report it plainly and stop.
53
-
54
- Pass commands as simple argv with ordinary quoting. Do not use environment assignments, pipes, redirects, substitutions, or other shell syntax. Commands without an explicit repository may use normal `gh` context, but their token remains scoped to the declared repository. An explicit `-R`, `--repo`, `--repo=`, or repository argument to `gh repo clone`, `view`, or `fork` must match the declaration.
55
-
56
- Determine the repositories needed to complete the task through source discovery and investigation, even when the requester does not name them. Do not ask the requester to enumerate repositories that can be discovered, and never default to the current agent's repository. The agent may select additional repositories as the work reveals them. Each authenticated command declares exactly one target repository and mints a credential lease for that repository at the moment it is needed, so cross-repository work uses separate scoped commands and leases.
57
-
58
- Clone with `gh repo clone owner/name`. Use authenticated `git fetch`, `git pull`, `git push`, and `git ls-remote` through the `gh` tool too. Local `git status`, `diff`, `add`, `commit`, and `rebase` remain ordinary `bash` commands because they need no GitHub credential. Immediately after entering a checkout and before planning or editing, read its root `AGENTS.md`; use root `CLAUDE.md` only when `AGENTS.md` is absent. Before touching any path, read the nearest nested `AGENTS.md`, falling back to `CLAUDE.md` only when that directory has no `AGENTS.md`.
52
+ Immediately after entering a checkout and before planning or editing, read its root `AGENTS.md`; use root `CLAUDE.md` only when `AGENTS.md` is absent. Before touching any path, read the nearest nested `AGENTS.md`, falling back to `CLAUDE.md` only when that directory has no `AGENTS.md`.
59
53
 
60
54
  Do not rebase before work by default. Rebase only when the requester explicitly asks for it or when an explicitly requested publication or delivery outcome requires a current base. Inspect the worktree first and preserve pre-existing changes.
61
55
 
62
- Use GitHub CLI commands through the `gh` tool for issues, pull requests, reviews, Actions, CI, authentication status, configuration, aliases, extensions, and API requests. Common commands include `gh pr create --draft`, `gh pr checks`, `gh run rerun --failed`, and `gh pr review`, but they are not restrictions.
63
-
64
- Repositories that require verified signatures reject ordinary sandbox commits. Stage the intended changes explicitly, run `gh-signed-commit --repo owner/name --branch <branch> -m <headline>` through the `gh` tool, then create the draft pull request through the same tool.
65
-
66
56
  Use apply_patch for authored edits. Formatters and generators may write their own output. Never rewrite files through shell or Python when a focused patch is sufficient. Write small hunks against current file contents. If a hunk misses, re-read that file and rewrite only the failed hunk.
67
57
 
68
58
  Use `grep` for sandbox content search. Start with `files_with_matches` and a narrow path or glob.
@@ -73,8 +63,6 @@ Make the smallest coherent change. Run focused validation first, then broader ch
73
63
 
74
64
  Be mindful of loading large files into your context window.
75
65
 
76
- Load the pr skill before publishing. Create one pull request per request unless the requester asks otherwise.
77
-
78
66
  ## Destructive actions
79
67
 
80
68
  Before deleting, overwriting, or making data difficult to recover, confirm scope and resolve the exact target with read-only checks. Never use a home directory, repository root, workspace root, unresolved variable, broad glob, or command substitution as a recursive destructive target. Prefer recoverable operations and stop when target or authority is unclear.
@@ -12,7 +12,9 @@ export declare function runPostEditDiagnostics(input: {
12
12
  readonly addedPaths?: readonly string[];
13
13
  readonly changedPaths: readonly string[];
14
14
  readonly deletedPaths: readonly string[];
15
- readonly repoRoot: string;
15
+ readonly patchRoot: string;
16
+ /** Content each written path had before the patch; null or absent for new files. */
17
+ readonly previousContents?: ReadonlyMap<string, string | null>;
16
18
  readonly sandbox: DiagnosticsSandbox;
17
19
  }): Promise<PostEditDiagnostic[]>;
18
20
  /**
@@ -22,7 +24,7 @@ export declare function runPostEditDiagnostics(input: {
22
24
  */
23
25
  export declare function runTypeScriptDiagnostics(input: {
24
26
  readonly paths: readonly string[];
25
- readonly repoRoot: string;
27
+ readonly patchRoot: string;
26
28
  readonly sandbox: DiagnosticsSandbox;
27
29
  }): Promise<PostEditDiagnostic[]>;
28
30
  /** Drop type diagnostics that already existed before the patch, matched by path, code, and message. */
@@ -1,6 +1,6 @@
1
- import{shellQuote}from"./shell.js";import{toolingPaths}from"./tooling.js";import{extname}from"node:path";async function runPostEditDiagnostics(e){let t=[...new Set([...e.changedPaths,...e.deletedPaths])],n=[];if(t.length>0)try{let r=await e.sandbox.run({command:`git -C ${shellQuote(e.repoRoot)} diff --check -- ${t.map(shellQuote).join(` `)}`});r.exitCode!==0&&n.push({check:`git-diff`,message:boundedDiagnostic(r.stderr||r.stdout||`git diff --check failed`)})}catch(e){n.push({check:`git-diff`,message:`Could not run git diff --check: ${errorMessage(e)}`})}for(let t of e.addedPaths??[])try{let r=await e.sandbox.readTextFile({path:`${e.repoRoot}/${t}`});if(r===null)continue;let i=whitespaceIssues(r);i.length>0&&n.push({check:`whitespace`,path:t,message:i.join(`
2
- `)})}catch(e){n.push({check:`whitespace`,path:t,message:`Could not inspect added file: ${errorMessage(e)}`})}for(let t=0;t<e.changedPaths.length;t+=8){let r=await Promise.all(e.changedPaths.slice(t,t+8).map(async t=>{let n=syntaxCommand(e.repoRoot,t);if(n===null)return null;try{let r=await e.sandbox.run({command:n});if(r.exitCode===0)return null;let i=r.stderr||r.stdout||`syntax check failed`;return i.includes(`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`)?null:{check:`syntax`,path:t,message:boundedDiagnostic(i)}}catch(e){return{check:`syntax`,path:t,message:`Could not run syntax check: ${errorMessage(e)}`}}}));for(let e of r)e!==null&&n.push(e)}return n.push(...await runTypeScriptDiagnostics({paths:e.changedPaths,repoRoot:e.repoRoot,sandbox:e.sandbox})),n}async function runTypeScriptDiagnostics(e){let t=e.paths.filter(isTypeScriptPath);if(t.length===0)return[];let n=toolingPaths(e.sandbox);if(await e.sandbox.readTextFile({path:n.worker})===null)return[];let r=[];for(let i=0;i<t.length;i+=4){let a=await Promise.all(t.slice(i,i+4).map(async t=>{let r=Buffer.from(JSON.stringify({filePath:t,repoRoot:e.repoRoot,typescriptPath:n.typescriptModule}),`utf8`).toString(`base64`);try{let i=await e.sandbox.run({command:`node ${shellQuote(n.worker)}`,env:{EVE_CODE_DIAGNOSTICS_REQUEST:r}});return i.exitCode===0?(JSON.parse(i.stdout).diagnostics??[]).map(e=>({check:`typescript`,code:e.code,column:e.column,line:e.line,message:e.message,path:t})):[{check:`typescript`,path:t,message:boundedDiagnostic(i.stderr||i.stdout||`TypeScript diagnostics failed`)}]}catch(e){return[{check:`typescript`,path:t,message:`Could not run TypeScript diagnostics: ${errorMessage(e)}`}]}}));r.push(...a.flat())}return r}function onlyNewTypeDiagnostics(e,t){let n=new Map;for(let e of t){if(e.check!==`typescript`||e.code===void 0)continue;let t=typeDiagnosticKey(e);n.set(t,(n.get(t)??0)+1)}return e.filter(e=>{if(e.check!==`typescript`||e.code===void 0)return!0;let t=typeDiagnosticKey(e),r=n.get(t)??0;return r===0||(n.set(t,r-1),!1)})}function typeDiagnosticKey(e){return`${e.path??``}\0${e.code??``}\0${e.message}`}function isTypeScriptPath(e){return/\.(?:cts|mts|ts|tsx)$/u.test(e)}function syntaxCommand(e,t){let n=shellQuote(`${e}/${t}`);switch(extname(t).toLowerCase()){case`.cjs`:case`.js`:case`.mjs`:return`node --check ${n}`;case`.cts`:case`.mts`:case`.ts`:return`node --experimental-strip-types --check ${n}`;case`.json`:return`node -e ${shellQuote(`JSON.parse(require('node:fs').readFileSync(process.argv[1], 'utf8'))`)} ${n}`;case`.bash`:case`.sh`:return`bash -n ${n}`;case`.py`:return`if command -v python3 >/dev/null 2>&1; then python3 -c ${shellQuote(`import ast,pathlib,sys; ast.parse(pathlib.Path(sys.argv[1]).read_text())`)} ${n}; fi`;default:return null}}function boundedDiagnostic(e){let t=e.trim().split(`
1
+ import{shellQuote}from"./shell.js";import{toolingPaths}from"./tooling.js";import{extname}from"node:path";async function runPostEditDiagnostics(e){let t=[...new Set([...e.changedPaths,...e.deletedPaths])],n=[],r=!1;if(t.length>0)try{let i=shellQuote(e.patchRoot),a=await e.sandbox.run({command:`git -C ${i} rev-parse --is-inside-work-tree`});if(r=a.exitCode===0&&a.stdout.trim()===`true`,r){let r=await e.sandbox.run({command:`git -C ${i} diff --check -- ${t.map(shellQuote).join(` `)}`});r.exitCode!==0&&n.push({check:`git-diff`,message:boundedDiagnostic(r.stderr||r.stdout||`git diff --check failed`)})}}catch(e){n.push({check:`git-diff`,message:`Could not run git diff --check: ${errorMessage(e)}`})}let i=r?e.addedPaths??[]:e.changedPaths;for(let t of i)try{let r=await e.sandbox.readTextFile({path:`${e.patchRoot}/${t}`});if(r===null)continue;let i=whitespaceIssues(r,e.previousContents?.get(t));i.length>0&&n.push({check:`whitespace`,path:t,message:i.join(`
2
+ `)})}catch(e){n.push({check:`whitespace`,path:t,message:`Could not inspect written file: ${errorMessage(e)}`})}for(let t=0;t<e.changedPaths.length;t+=8){let r=await Promise.all(e.changedPaths.slice(t,t+8).map(async t=>{let n=syntaxCommand(e.patchRoot,t);if(n===null)return null;try{let r=await e.sandbox.run({command:n});if(r.exitCode===0)return null;let i=r.stderr||r.stdout||`syntax check failed`;return i.includes(`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`)?null:{check:`syntax`,path:t,message:boundedDiagnostic(i)}}catch(e){return{check:`syntax`,path:t,message:`Could not run syntax check: ${errorMessage(e)}`}}}));for(let e of r)e!==null&&n.push(e)}return n.push(...await runTypeScriptDiagnostics({paths:e.changedPaths,patchRoot:e.patchRoot,sandbox:e.sandbox})),n}async function runTypeScriptDiagnostics(e){let t=e.paths.filter(isTypeScriptPath);if(t.length===0)return[];let n=toolingPaths(e.sandbox);if(await e.sandbox.readTextFile({path:n.worker})===null)return[];let r=[];for(let i=0;i<t.length;i+=4){let a=await Promise.all(t.slice(i,i+4).map(async t=>{let r=Buffer.from(JSON.stringify({filePath:t,patchRoot:e.patchRoot,typescriptPath:n.typescriptModule}),`utf8`).toString(`base64`);try{let i=await e.sandbox.run({command:`node ${shellQuote(n.worker)}`,env:{EVE_CODE_DIAGNOSTICS_REQUEST:r}});return i.exitCode===0?(JSON.parse(i.stdout).diagnostics??[]).map(e=>({check:`typescript`,code:e.code,column:e.column,line:e.line,message:e.message,path:t})):[{check:`typescript`,path:t,message:boundedDiagnostic(i.stderr||i.stdout||`TypeScript diagnostics failed`)}]}catch(e){return[{check:`typescript`,path:t,message:`Could not run TypeScript diagnostics: ${errorMessage(e)}`}]}}));r.push(...a.flat())}return r}function onlyNewTypeDiagnostics(e,t){let n=new Map;for(let e of t){if(e.check!==`typescript`||e.code===void 0)continue;let t=typeDiagnosticKey(e);n.set(t,(n.get(t)??0)+1)}return e.filter(e=>{if(e.check!==`typescript`||e.code===void 0)return!0;let t=typeDiagnosticKey(e),r=n.get(t)??0;return r===0||(n.set(t,r-1),!1)})}function typeDiagnosticKey(e){return`${e.path??``}\0${e.code??``}\0${e.message}`}function isTypeScriptPath(e){return/\.(?:cts|mts|ts|tsx)$/u.test(e)}function syntaxCommand(e,t){let n=shellQuote(`${e}/${t}`);switch(extname(t).toLowerCase()){case`.cjs`:case`.js`:case`.mjs`:return`node --check ${n}`;case`.cts`:case`.mts`:case`.ts`:return`node --experimental-strip-types --check ${n}`;case`.json`:return`node -e ${shellQuote(`JSON.parse(require('node:fs').readFileSync(process.argv[1], 'utf8'))`)} ${n}`;case`.bash`:case`.sh`:return`bash -n ${n}`;case`.py`:return`if command -v python3 >/dev/null 2>&1; then python3 -c ${shellQuote(`import ast,pathlib,sys; ast.parse(pathlib.Path(sys.argv[1]).read_text())`)} ${n}; fi`;default:return null}}function boundedDiagnostic(e){let t=e.trim().split(`
3
3
  `),n=t.slice(-100);for(;n.length>1&&Buffer.byteLength(n.join(`
4
4
  `),`utf8`)>8192;)n=n.slice(1);let r=t.length-n.length;return r>0?`[${r} earlier lines omitted]\n${n.join(`
5
5
  `)}`:n.join(`
6
- `)}function whitespaceIssues(e){let t=[];for(let[n,r]of e.split(/\r?\n/u).entries())if(/^(?:<<<<<<<|=======|>>>>>>>)(?: |$)/u.test(r)?t.push(`line ${n+1}: unresolved conflict marker`):/[\t ]+$/u.test(r)&&t.push(`line ${n+1}: trailing whitespace`),t.length===20)break;return t}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{onlyNewTypeDiagnostics,runPostEditDiagnostics,runTypeScriptDiagnostics};
6
+ `)}function whitespaceIssues(e,t){let n=new Set(t?.split(/\r?\n/u)??[]),r=[];for(let[t,i]of e.split(/\r?\n/u).entries())if(!n.has(i)&&(/^(?:<<<<<<<|=======|>>>>>>>)(?: |$)/u.test(i)?r.push(`line ${t+1}: unresolved conflict marker`):/[\t ]+$/u.test(i)&&r.push(`line ${t+1}: trailing whitespace`),r.length===20))break;return r}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{onlyNewTypeDiagnostics,runPostEditDiagnostics,runTypeScriptDiagnostics};
@@ -0,0 +1,28 @@
1
+ export declare function deprecatedGitHubConfigured(): boolean;
2
+ /** @deprecated Mount `eve/extensions/git` with `github` config, or import `gh` from `eve/extensions/git/tools`. */
3
+ export declare const gh: import("../../../../tools/definition.ts").ToolDefinition<{
4
+ command: string;
5
+ permissions: {
6
+ provider: "github";
7
+ repositories: string[];
8
+ access: "write";
9
+ }[];
10
+ description: string;
11
+ workingDirectory?: string | undefined;
12
+ }, {
13
+ exitCode: number;
14
+ stderr: string;
15
+ stdout: string;
16
+ truncated: boolean;
17
+ }> & {
18
+ execute(input: {
19
+ command: string;
20
+ permissions: {
21
+ provider: "github";
22
+ repositories: string[];
23
+ access: "write";
24
+ }[];
25
+ description: string;
26
+ workingDirectory?: string | undefined;
27
+ }, ctx: import("../../../../tools/definition.ts").ToolContext): Promise<import("eve/extensions/git/sandbox").GitHubShellOutput>;
28
+ };
@@ -0,0 +1 @@
1
+ import extension_default from"../extension.js";import{defineGhTool}from"eve/extensions/git/sandbox";function deprecatedGitHubConfigured(){return extension_default.config.github!==void 0}const gh=defineGhTool(()=>extension_default.config.github);export{deprecatedGitHubConfigured,gh};
@@ -1,3 +1,4 @@
1
+ import { type WorkspaceSandbox } from "./workspace-root.ts";
1
2
  export declare const MAX_GREP_LIMIT = 200;
2
3
  export declare const MAX_GREP_COMMAND_BYTES: number;
3
4
  export declare const MAX_GREP_LINE_BYTES: number;
@@ -21,17 +22,6 @@ export interface GrepSearchResult {
21
22
  readonly path: string;
22
23
  readonly truncated: boolean;
23
24
  }
24
- interface GrepSandbox {
25
- resolvePath(path: string): string;
26
- run(input: {
27
- abortSignal?: AbortSignal;
28
- command: string;
29
- }): PromiseLike<{
30
- exitCode: number;
31
- stderr: string;
32
- stdout: string;
33
- }>;
34
- }
35
25
  interface GrepToolInput {
36
26
  readonly context?: number;
37
27
  readonly glob?: string;
@@ -46,8 +36,8 @@ interface GrepToolInput {
46
36
  export declare function shouldUseFixedStrings(pattern: string, literal: boolean | undefined): boolean;
47
37
  export declare function effectiveOutputMode(outputMode: GrepOutputMode | undefined): GrepOutputMode;
48
38
  export declare function effectiveLimit(limit: number | undefined): number;
49
- export declare function assertWorkspacePath(resolved: string, requested?: string): string;
50
- export declare function executeGrepSearch(input: GrepToolInput, sandbox: GrepSandbox, abortSignal?: AbortSignal): Promise<GrepSearchResult>;
39
+ export declare function assertNoParentSegments(resolved: string, requested?: string): string;
40
+ export declare function executeGrepSearch(input: GrepToolInput, sandbox: WorkspaceSandbox, abortSignal?: AbortSignal): Promise<GrepSearchResult>;
51
41
  export declare function buildSearchCommand(input: GrepCommandInput): string;
52
42
  export declare function buildRipgrepCommand(input: GrepCommandInput): string;
53
43
  export declare function buildPosixGrepCommand(input: GrepCommandInput): string;
@@ -1,6 +1,6 @@
1
- import{shellQuote}from"./shell.js";const MAX_GREP_LIMIT=200,MAX_GREP_COMMAND_BYTES=262144,MAX_GREP_LINE_BYTES=8192,MAX_GREP_RETURN_BYTES=65536,REGEX_META=/[\\^$.*+?()[\]{}|]/u,GREP_OUTPUT_MODES=[`files_with_matches`,`content`,`count`];function shouldUseFixedStrings(e,t){return t===!0||t!==!1&&!REGEX_META.test(e)}function effectiveOutputMode(e){return e??`files_with_matches`}function effectiveLimit(e){return Math.min(Math.max(1,e??50),200)}function assertWorkspacePath(e,t){if(t!==void 0&&t.split(/[\\/]/u).includes(`..`))throw Error(`grep path must not contain '..'`);if(e!==`/workspace`&&!e.startsWith(`/workspace/`))throw Error(`grep path must stay under /workspace: ${e}`);if(e.split(`/`).includes(`..`))throw Error(`grep path must not contain '..'`);return e}async function executeGrepSearch(e,t,n){let r=assertWorkspacePath(t.resolvePath(e.path??`/workspace`),e.path),i=await sandboxRealPath(t,t.resolvePath(``),`sandbox workspace`,n),a=await sandboxRealPath(t,r,`grep path`,n);assertRealPathWithinWorkspace(a,i);let o=effectiveOutputMode(e.outputMode),s=effectiveLimit(e.limit),c=buildSearchCommand({contextLines:e.context??0,glob:e.glob,ignoreCase:e.ignoreCase===!0,limit:s,literal:shouldUseFixedStrings(e.pattern,e.literal),outputMode:o,path:a,pattern:e.pattern}),l=await t.run({abortSignal:n,command:c}),u=truncateUtf8(l.stdout,MAX_GREP_COMMAND_BYTES),d=u.truncated;if(l.exitCode!==0&&l.exitCode!==1||l.exitCode===1&&l.stderr.trim().length>0){let e=l.stderr.trim()||u.value.trim()||`no command output`;throw Error(`grep failed (exit ${l.exitCode}): ${truncateUtf8(e,MAX_GREP_LINE_BYTES).value}`)}return processGrepOutput({commandTruncated:d,limit:s,outputMode:o,path:r,stdout:u.value})}async function sandboxRealPath(e,t,n,r){let i=await e.run({abortSignal:r,command:`realpath -z -- ${shellQuote(t)}`});if(i.exitCode!==0){let e=i.stderr.trim()||i.stdout.trim()||`no command output`;throw Error(`${n} could not be resolved: ${truncateUtf8(e,MAX_GREP_LINE_BYTES).value}`)}let a=i.stdout.endsWith(`\0`)?i.stdout.slice(0,-1):i.stdout;if(a.length===0||a.includes(`\0`))throw Error(`${n} returned an invalid realpath`);return a}function assertRealPathWithinWorkspace(e,t){if(e!==t&&!e.startsWith(`${t}/`))throw Error(`grep path resolves outside /workspace: ${e}`)}function buildSearchCommand(e){return[`set -o pipefail`,`{`,` if command -v rg >/dev/null 2>&1; then`,` ${buildRipgrepCommand(e)}`,` else`,` ${buildPosixGrepCommand(e)}`,` fi`,`} 2>&1 | head -c 262145`,"search_status=${PIPESTATUS[0]}",`if [ "$search_status" -eq 141 ]; then exit 0; fi`,`exit "$search_status"`].join(`
1
+ import{shellQuote}from"./shell.js";import{resolveInWorkspace}from"./workspace-root.js";const MAX_GREP_LIMIT=200,MAX_GREP_COMMAND_BYTES=262144,MAX_GREP_LINE_BYTES=8192,MAX_GREP_RETURN_BYTES=65536,REGEX_META=/[\\^$.*+?()[\]{}|]/u,GREP_OUTPUT_MODES=[`files_with_matches`,`content`,`count`];function shouldUseFixedStrings(e,t){return t===!0||t!==!1&&!REGEX_META.test(e)}function effectiveOutputMode(e){return e??`files_with_matches`}function effectiveLimit(e){return Math.min(Math.max(1,e??50),200)}function assertNoParentSegments(e,t){if(t!==void 0&&t.split(/[\\/]/u).includes(`..`)||e.split(`/`).includes(`..`))throw Error(`grep path must not contain '..'`);return e}async function executeGrepSearch(e,t,n){let r=assertNoParentSegments(t.resolvePath(e.path??``),e.path),{path:i}=await resolveInWorkspace(t,r,`grep path`,n),a=effectiveOutputMode(e.outputMode),o=effectiveLimit(e.limit),s=buildSearchCommand({contextLines:e.context??0,glob:e.glob,ignoreCase:e.ignoreCase===!0,limit:o,literal:shouldUseFixedStrings(e.pattern,e.literal),outputMode:a,path:i,pattern:e.pattern}),c=await t.run({abortSignal:n,command:s}),l=truncateUtf8(c.stdout,MAX_GREP_COMMAND_BYTES),u=l.truncated;if(c.exitCode!==0&&c.exitCode!==1||c.exitCode===1&&c.stderr.trim().length>0){let e=c.stderr.trim()||l.value.trim()||`no command output`;throw Error(`grep failed (exit ${c.exitCode}): ${truncateUtf8(e,MAX_GREP_LINE_BYTES).value}`)}return processGrepOutput({commandTruncated:u,limit:o,outputMode:a,path:r,stdout:l.value})}function buildSearchCommand(e){return[`set -o pipefail`,`{`,` if command -v rg >/dev/null 2>&1; then`,` ${buildRipgrepCommand(e)}`,` else`,` ${buildPosixGrepCommand(e)}`,` fi`,`} 2>&1 | head -c 262145`,"search_status=${PIPESTATUS[0]}",`if [ "$search_status" -eq 141 ]; then exit 0; fi`,`exit "$search_status"`].join(`
2
2
  `)}function buildRipgrepCommand(e){let t=[`rg`,`--color=never`,`--hidden`,`--glob`,shellQuote(`!.git/*`)];switch(e.ignoreCase&&t.push(`--ignore-case`),e.literal&&t.push(`--fixed-strings`),e.glob!==void 0&&t.push(`--glob`,shellQuote(e.glob)),e.outputMode){case`files_with_matches`:t.push(`--files-with-matches`,`--max-count`,`1`);break;case`count`:t.push(`--count`);break;case`content`:t.push(`--line-number`,`--with-filename`,`--null`),e.contextLines>0&&t.push(`--context`,String(e.contextLines)),t.push(`--max-count`,String(e.limit))}return t.push(`--`,shellQuote(e.pattern),shellQuote(e.path)),t.join(` `)}function buildPosixGrepCommand(e){let t=[`grep`,`-r`,`--exclude-dir=.git`];switch(e.ignoreCase&&t.push(`-i`),e.literal?t.push(`-F`):t.push(`-E`),e.glob!==void 0&&t.push(`--include=${shellQuote(e.glob)}`),e.outputMode){case`files_with_matches`:t.push(`-l`);break;case`count`:t.push(`-c`);break;case`content`:t.push(`-n`,`-H`,`-Z`),e.contextLines>0&&t.push(`-C`,String(e.contextLines)),t.push(`-m`,String(e.limit))}return t.push(`-e`,shellQuote(e.pattern),shellQuote(e.path)),t.join(` `)}function processGrepOutput(e){let t=e.stdout.split(`
3
3
  `),n=[],r=`
4
4
 
5
5
  [Output truncated. Narrow path or glob, or lower context.]`,i=MAX_GREP_RETURN_BYTES-Buffer.byteLength(r),a=0,o=0,s=0,c=e.commandTruncated===!0,appendLine=e=>{let t=Buffer.byteLength(e)+(n.length===0?0:1);return a+t>i?!1:(n.push(e),a+=t,!0)};for(let r=0;r<t.length;r+=1){let i=t[r]??``;if(i.length===0&&r===t.length-1)continue;if(i===`--`){if(n.length>0&&!appendLine(i)){c=!0;break}continue}let a=i,l=e.outputMode!==`content`;if(e.outputMode===`content`){let e=normalizeContentLine(i);a=e.line,l=e.isMatch}let u=0;if(e.outputMode===`count`&&(u=parseCountLine(a),u===0))continue;if(s>=e.limit){c=!0;break}let d=truncateUtf8(a,MAX_GREP_LINE_BYTES);if(d.truncated&&(c=!0),!appendLine(d.value)){c=!0;break}s+=1,e.outputMode===`count`?o+=u:l&&(o+=1)}if(n.length===0)return{content:c?`[Output truncated. Narrow path or glob, or lower context.]`:`No matches found`,matchCount:0,outputMode:e.outputMode,path:e.path,truncated:c};let l=n.join(`
6
- `);return c&&(l+=r),{content:l,matchCount:o,outputMode:e.outputMode,path:e.path,truncated:c}}function normalizeContentLine(e){let t=e.lastIndexOf(`\0`);if(t===-1)return{isMatch:!1,line:e};let n=e.slice(0,t),r=e.slice(t+1),i=/^(\d+)([:-])(.*)$/u.exec(r);if(i===null)return{isMatch:!1,line:`${n}:${r}`};let[,a,o,s]=i;return{isMatch:o===`:`,line:`${n}${o}${a}${o}${s}`}}function parseCountLine(e){let t=e.lastIndexOf(`:`);if(t===-1)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)&&n>0?n:0}function truncateUtf8(e,t){if(Buffer.byteLength(e)<=t)return{truncated:!1,value:e};let n=0,r=``;for(let i of e){let e=Buffer.byteLength(i);if(n+e>t)break;r+=i,n+=e}return{truncated:!0,value:r}}export{GREP_OUTPUT_MODES,MAX_GREP_COMMAND_BYTES,MAX_GREP_LIMIT,MAX_GREP_LINE_BYTES,MAX_GREP_RETURN_BYTES,assertWorkspacePath,buildPosixGrepCommand,buildRipgrepCommand,buildSearchCommand,effectiveLimit,effectiveOutputMode,executeGrepSearch,processGrepOutput,shouldUseFixedStrings};
6
+ `);return c&&(l+=r),{content:l,matchCount:o,outputMode:e.outputMode,path:e.path,truncated:c}}function normalizeContentLine(e){let t=e.lastIndexOf(`\0`);if(t===-1)return{isMatch:!1,line:e};let n=e.slice(0,t),r=e.slice(t+1),i=/^(\d+)([:-])(.*)$/u.exec(r);if(i===null)return{isMatch:!1,line:`${n}:${r}`};let[,a,o,s]=i;return{isMatch:o===`:`,line:`${n}${o}${a}${o}${s}`}}function parseCountLine(e){let t=e.lastIndexOf(`:`);if(t===-1)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)&&n>0?n:0}function truncateUtf8(e,t){if(Buffer.byteLength(e)<=t)return{truncated:!1,value:e};let n=0,r=``;for(let i of e){let e=Buffer.byteLength(i);if(n+e>t)break;r+=i,n+=e}return{truncated:!0,value:r}}export{GREP_OUTPUT_MODES,MAX_GREP_COMMAND_BYTES,MAX_GREP_LIMIT,MAX_GREP_LINE_BYTES,MAX_GREP_RETURN_BYTES,assertNoParentSegments,buildPosixGrepCommand,buildRipgrepCommand,buildSearchCommand,effectiveLimit,effectiveOutputMode,executeGrepSearch,processGrepOutput,shouldUseFixedStrings};
@@ -16,6 +16,8 @@ interface UpdateChunk {
16
16
  readonly oldLines: readonly string[];
17
17
  readonly newLines: readonly string[];
18
18
  readonly changeContext?: string;
19
+ /** Function context from a unified-diff range header; git may have truncated it. */
20
+ readonly contextHint?: string;
19
21
  readonly endOfFile?: boolean;
20
22
  }
21
23
  export interface AppliedPatchFile {
@@ -23,10 +25,14 @@ export interface AppliedPatchFile {
23
25
  readonly path: string;
24
26
  readonly previousPath?: string;
25
27
  }
28
+ /** A verified change about to be written, with the content it replaces. */
29
+ export interface PlannedPatchFile extends AppliedPatchFile {
30
+ readonly previousContent: string | null;
31
+ }
26
32
  export declare function applyPatchToSandbox(input: {
27
- readonly beforeCommit?: (files: readonly AppliedPatchFile[]) => Promise<void>;
33
+ readonly beforeCommit?: (files: readonly PlannedPatchFile[]) => Promise<void>;
28
34
  readonly patchText: string;
29
- readonly repoRoot: string;
35
+ readonly patchRoot: string;
30
36
  readonly sandbox: SandboxSession;
31
37
  /** Serializes patches per eve session; every `ctx.getSandbox()` call returns a new handle. */
32
38
  readonly sessionId: string;
@@ -1,4 +1,4 @@
1
- import{shellQuote}from"./shell.js";import{posix}from"node:path";const patchLocks=new Map;async function applyPatchToSandbox(e){return withPatchLock(`${e.sessionId}:${e.repoRoot}`,()=>applyPatchUnlocked(e))}async function applyPatchUnlocked(e){let t=parsePatch(e.patchText);if(t.length===0)throw Error(`patch rejected: empty patch`);if(t.length>100)throw Error(`patch rejected: at most 100 file operations are allowed`);let n=await planChanges(e.sandbox,e.repoRoot,t);await e.beforeCommit?.(n.map(({operation:e,path:t,previousPath:n})=>{let r={operation:e,path:t};return n!==void 0&&(r.previousPath=n),r}));let r=[];try{for(let t of n)await revalidateChange(e.sandbox,e.repoRoot,t),r.push(t),await commitChange(e.sandbox,t)}catch(t){let n=await rollbackChanges(e.sandbox,r),i=t instanceof Error?t.message:String(t),a=n.length===0?``:` Rollback also failed: ${n.join(`; `)}`;throw Error(`apply_patch failed after validation: ${i}.${a}`,{cause:t})}return n.map(({operation:e,path:t,previousPath:n})=>{let r={operation:e,path:t};return n!==void 0&&(r.previousPath=n),r})}async function withPatchLock(e,t){let n=patchLocks.get(e)??Promise.resolve(),r,i=new Promise(e=>{r=e}),a=n.then(()=>i);patchLocks.set(e,a),await n;try{return await t()}finally{r(),patchLocks.get(e)===a&&patchLocks.delete(e)}}function parsePatch(e){let t=stripHeredoc(normalizeLineEndings(e).trim()).split(`
1
+ import{shellQuote}from"./shell.js";import{posix}from"node:path";const patchLocks=new Map;async function applyPatchToSandbox(e){return withPatchLock(`${e.sessionId}:${e.patchRoot}`,()=>applyPatchUnlocked(e))}async function applyPatchUnlocked(e){let t=parsePatch(e.patchText);if(t.length===0)throw Error(`patch rejected: empty patch`);if(t.length>100)throw Error(`patch rejected: at most 100 file operations are allowed`);let n=await planChanges(e.sandbox,e.patchRoot,t);await e.beforeCommit?.(n.map(({operation:e,path:t,previousPath:n,oldContent:r})=>{let i={operation:e,path:t,previousContent:r};return n!==void 0&&(i.previousPath=n),i}));let r=[];try{for(let t of n)await revalidateChange(e.sandbox,e.patchRoot,t),r.push(t),await commitChange(e.sandbox,t)}catch(t){let n=await rollbackChanges(e.sandbox,r),i=t instanceof Error?t.message:String(t),a=n.length===0?``:` Rollback also failed: ${n.join(`; `)}`;throw Error(`apply_patch failed after validation: ${i}.${a}`,{cause:t})}return n.map(({operation:e,path:t,previousPath:n})=>{let r={operation:e,path:t};return n!==void 0&&(r.previousPath=n),r})}async function withPatchLock(e,t){let n=patchLocks.get(e)??Promise.resolve(),r,i=new Promise(e=>{r=e}),a=n.then(()=>i);patchLocks.set(e,a),await n;try{return await t()}finally{r(),patchLocks.get(e)===a&&patchLocks.delete(e)}}function parsePatch(e){let t=stripHeredoc(normalizeLineEndings(e).trim()).split(`
2
2
  `),n=t.findIndex(e=>e.trim()===`*** Begin Patch`),r=t.findIndex((e,t)=>t>n&&e.trim()===`*** End Patch`);if(n===-1||r===-1||n>=r)throw Error(`invalid patch format: missing Begin/End markers`);if(t.slice(0,n).some(e=>e.trim().length>0&&!e.trimStart().startsWith(`*** Environment ID:`)))throw Error(`invalid patch format: unexpected content before Begin Patch`);if(t.slice(r+1).some(e=>e.trim().length>0))throw Error(`invalid patch format: unexpected content after End Patch`);let i=[],a=n+1;for(;a<r;){let e=t[a]??``;if(e.startsWith(`*** Environment ID:`)){a+=1;continue}if(e.startsWith(`*** Add File:`)){let n=requirePath(e.slice(13),`add`),o=parseAdd(t,a+1,r);i.push({type:`add`,path:n,contents:o.content}),a=o.next;continue}if(e.startsWith(`*** Delete File:`)){i.push({type:`delete`,path:requirePath(e.slice(16),`delete`)}),a+=1;continue}if(e.startsWith(`*** Update File:`)){let n=requirePath(e.slice(16),`update`),o=a+1,s;t[o]?.startsWith(`*** Move to:`)&&(s=requirePath(t[o].slice(12),`move`),o+=1);let c=parseUpdate(t,o,r);if(c.chunks.length===0&&s===void 0)throw Error(`invalid update hunk for ${n}: expected at least one @@ chunk`);i.push({type:`update`,path:n,movePath:s,chunks:c.chunks}),a=c.next;continue}throw Error(`invalid patch line: ${e}`)}return i}function deriveUpdatedContent(e,t,n){let r=n.includes(`\r
3
3
  `)?`\r
4
4
  `:`
@@ -6,15 +6,15 @@ import{shellQuote}from"./shell.js";import{posix}from"node:path";const patchLocks
6
6
  `);a.at(-1)===``&&a.pop();let o=computeReplacements(a,e,t),s=[...a];for(let[e,t,n]of o.toReversed())s.splice(e,t,...n);s.at(-1)!==``&&s.push(``);let c=s.join(`
7
7
  `).replaceAll(`
8
8
  `,r);return i.bom?`\uFEFF${c}`:c}function parseAdd(e,t,n){let r=[],i=t;for(;i<n&&!e[i].startsWith(`***`);){let t=e[i];if(!t.startsWith(`+`))throw Error(`invalid add file line: ${t}`);r.push(t.slice(1)),i+=1}return{content:r.join(`
9
- `),next:i}}function parseUpdate(e,t,n){let r=[],i=t;for(;i<n&&!e[i].startsWith(`***`);){let t=e[i],a=t.startsWith(`@@`);if(!a&&r.length>0)throw Error(`invalid update file line: ${e[i]}`);let o=a&&t.slice(2).trim()||void 0,s=[],c=[],l=!1;for(a&&(i+=1);i<n&&!e[i].startsWith(`@@`);){let t=e[i];if(t===`*** End of File`){for(l=!0,i+=1;i<n&&e[i]===``;)i+=1;break}if(t.startsWith(`***`))break;if(t===``)s.push(``),c.push(``);else if(t.startsWith(` `))s.push(t.slice(1)),c.push(t.slice(1));else if(t.startsWith(`-`))s.push(t.slice(1));else if(t.startsWith(`+`))c.push(t.slice(1));else throw Error(`invalid update chunk line: ${t}`);i+=1}r.push({oldLines:s,newLines:c,changeContext:o,endOfFile:l||void 0})}return{chunks:r,next:i}}async function planChanges(e,t,n){if(await realPath(e,t)!==t)throw Error(`apply_patch verification failed: repository root resolves outside itself: ${t}`);let r=new Set,i=[],a=[];for(let o of n)try{i.push(await planHunk(e,t,r,o))}catch(e){a.push(e instanceof Error?e.message:String(e))}if(a.length>0)throw Error(a.join(`
9
+ `),next:i}}const UNIFIED_RANGE_HEADER=/^-\d+(?:,\d+)? \+\d+(?:,\d+)? @@\s*(.*)$/u;function chunkHeader(e){let t=e.slice(2).trim();if(t.length===0)return{changeContext:void 0};let n=UNIFIED_RANGE_HEADER.exec(t);if(!n)return{changeContext:t};let r=n[1].trim();return r.length===0?{changeContext:void 0}:{changeContext:void 0,contextHint:r}}function parseUpdate(e,t,n){let r=[],i=t;for(;i<n&&!e[i].startsWith(`***`);){let t=e[i],a=t.startsWith(`@@`);if(!a&&r.length>0)throw Error(`invalid update file line: ${e[i]}`);let o=a?chunkHeader(t):{changeContext:void 0},s=[],c=[],l=!1;for(a&&(i+=1);i<n&&!e[i].startsWith(`@@`);){let t=e[i];if(t===`*** End of File`){for(l=!0,i+=1;i<n&&e[i]===``;)i+=1;break}if(t.startsWith(`***`))break;if(t===``)s.push(``),c.push(``);else if(t.startsWith(` `))s.push(t.slice(1)),c.push(t.slice(1));else if(t.startsWith(`-`))s.push(t.slice(1));else if(t.startsWith(`+`))c.push(t.slice(1));else throw Error(`invalid update chunk line: ${t}`);i+=1}r.push({oldLines:s,newLines:c,...o,endOfFile:l||void 0})}return{chunks:r,next:i}}async function planChanges(e,t,n){if(await realPath(e,t)!==t)throw Error(`apply_patch verification failed: patch root resolves outside itself: ${t}`);let r=new Set,i=[],a=[];for(let o of n)try{i.push(await planHunk(e,t,r,o))}catch(e){a.push(e instanceof Error?e.message:String(e))}if(a.length>0)throw Error(a.join(`
10
10
 
11
11
  `));return i}async function planHunk(e,t,n,r){let i=resolvePatchPath(t,r.path);if(await assertRealPath(e,t,i.absolutePath),claimPath(n,i.absolutePath),r.type===`add`){if(await e.readTextFile({path:i.absolutePath})!==null)throw Error(`apply_patch verification failed: file already exists: ${i.path}`);return{absolutePath:i.absolutePath,newContent:r.contents.length===0||r.contents.endsWith(`
12
- `)?r.contents:`${r.contents}\n`,oldContent:null,operation:`add`,path:i.path}}let a=await e.readTextFile({path:i.absolutePath});if(a===null)throw Error(`apply_patch verification failed: file not found: ${i.path}`);let o=await fileMode(e,i.absolutePath);if(r.type===`delete`)return{absolutePath:i.absolutePath,newContent:null,oldContent:a,oldMode:o,operation:`delete`,path:i.path};let s=r.movePath===void 0?i:resolvePatchPath(t,r.movePath);if(s.absolutePath!==i.absolutePath&&(await assertRealPath(e,t,s.absolutePath),claimPath(n,s.absolutePath),await e.readTextFile({path:s.absolutePath})!==null))throw Error(`apply_patch verification failed: move target already exists: ${s.path}`);let c=r.chunks.length===0?a:deriveUpdatedContent(i.path,r.chunks,a);if(c===a&&s.absolutePath===i.absolutePath)throw Error(`apply_patch verification failed: update makes no changes: ${i.path}`);let l={absolutePath:s.absolutePath,newContent:c,oldContent:a,oldMode:o,operation:s.absolutePath===i.absolutePath?`update`:`move`,path:s.path};return s.absolutePath!==i.absolutePath&&(l.previousAbsolutePath=i.absolutePath,l.previousPath=i.path),l}async function commitChange(e,t){if(t.operation===`delete`){await e.removePath({path:t.absolutePath});return}if(t.operation===`move`&&t.previousAbsolutePath!==void 0){await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:!1,path:t.absolutePath}),await e.removePath({path:t.previousAbsolutePath});return}await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:t.operation!==`add`,path:t.absolutePath})}async function revalidateChange(e,t,n){if(await assertRealPath(e,t,n.absolutePath),n.operation===`add`){if(await e.readTextFile({path:n.absolutePath})!==null)throw Error(`apply_patch stale write: add target now exists: ${n.path}`);return}if(n.operation===`move`&&n.previousAbsolutePath!==void 0){await assertRealPath(e,t,n.previousAbsolutePath);let[r,i]=await Promise.all([e.readTextFile({path:n.previousAbsolutePath}),e.readTextFile({path:n.absolutePath})]);if(r!==n.oldContent||i!==null)throw Error(`apply_patch stale write: move inputs changed: ${n.previousPath}`);return}if(await e.readTextFile({path:n.absolutePath})!==n.oldContent)throw Error(`apply_patch stale write: file changed after validation: ${n.path}`)}async function rollbackChanges(e,t){let n=[];for(let r of t.toReversed())try{let t=await e.readTextFile({path:r.absolutePath});if(r.operation===`add`){if(t===null)continue;if(t!==r.newContent)throw Error(`refusing to remove concurrently changed file ${r.path}`);await e.removePath({path:r.absolutePath})}else if(r.operation===`move`&&r.previousAbsolutePath!==void 0){let n=await e.readTextFile({path:r.previousAbsolutePath});if(t===r.newContent&&n===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.previousAbsolutePath}),await e.removePath({path:r.absolutePath});else if(t===r.newContent&&n===r.oldContent)await e.removePath({path:r.absolutePath});else if(t===null&&n===r.newContent)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.previousAbsolutePath});else if(t!==null||n!==r.oldContent)throw Error(`refusing to roll back concurrently changed move ${r.path}`)}else if(r.operation===`delete`){if(t===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.absolutePath});else if(t!==r.oldContent)throw Error(`refusing to overwrite concurrently recreated file ${r.path}`)}else{if(t===r.oldContent)continue;if(t!==r.newContent)throw Error(`refusing to overwrite concurrently changed file ${r.path}`);await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.absolutePath})}}catch(e){n.push(e instanceof Error?e.message:String(e))}return n}async function assertRealPath(e,t,n){let r=await realPath(e,n);if(r!==n||!r.startsWith(`${t}/`))throw Error(`apply_patch verification failed: path crosses a symlink or repository boundary: ${n}`)}async function realPath(e,t){let n=await e.run({command:`realpath -m -- ${shellQuote(t)}`});if(n.exitCode!==0)throw Error(`apply_patch verification failed: could not resolve ${t}: ${n.stderr}`);return n.stdout.trim()}async function ensureParentDirectory(e,t){let n=await e.run({command:`mkdir -p -- ${shellQuote(posix.dirname(t))}`});if(n.exitCode!==0)throw Error(`failed to create parent directory for ${t}: ${n.stderr}`)}async function atomicWrite(e,t){await ensureParentDirectory(e,t.path);let n=posix.join(posix.dirname(t.path),`.${posix.basename(t.path)}.eve-code-${crypto.randomUUID()}.tmp`),r=!1;try{await e.writeTextFile({path:n,content:t.content}),await restoreMode(e,n,t.mode);let i=await e.run({command:`mv ${t.overwrite?``:`-n `}-- ${shellQuote(n)} ${shellQuote(t.path)}`});if(i.exitCode!==0)throw Error(`failed to install ${t.path}: ${i.stderr||i.stdout}`);if(!t.overwrite&&await e.readTextFile({path:n})!==null)throw Error(`apply_patch stale write: target now exists: ${t.path}`);r=!0}finally{r||await e.removePath({path:n,force:!0}).catch(()=>{})}}async function fileMode(e,t){let n=await e.run({command:`stat -c %a -- ${shellQuote(t)}`}),r=n.stdout.trim();if(n.exitCode!==0||!/^[0-7]{3,4}$/u.test(r))throw Error(`apply_patch verification failed: could not read file mode for ${t}`);return r}async function restoreMode(e,t,n){if(n!==void 0&&(await e.run({command:`chmod ${n} -- ${shellQuote(t)}`})).exitCode!==0)throw Error(`failed to restore file mode for ${t}`)}function resolvePatchPath(e,t){let n=t.replaceAll(`\\`,`/`).trim();if(n.length===0||n.includes(`\0`)||posix.isAbsolute(n)||n.split(`/`).some(e=>e===``||e===`.`||e===`..`))throw Error(`invalid patch path: ${t}`);return{absolutePath:posix.join(e,n),path:n}}function claimPath(e,t){if(e.has(t))throw Error(`patch contains overlapping file operations: ${t}`);e.add(t)}function requirePath(e,t){let n=e.trim();if(n.length===0)throw Error(`invalid ${t} file path`);return n}function computeReplacements(e,t,n){let r=[],i=0;for(let a of n){if(a.changeContext!==void 0){let n=seek(e,[a.changeContext],i);if(n===-1)throw Error(formatMissingContextError(t,a.changeContext,e,i));i=n+1}if(a.oldLines.length===0){r.push([e.length,0,a.newLines]);continue}let n=a.oldLines,o=a.newLines,s=seek(e,n,i,a.endOfFile);if(s===-1&&n.at(-1)===``&&(n=n.slice(0,-1),o.at(-1)===``&&(o=o.slice(0,-1)),s=seek(e,n,i,a.endOfFile)),s===-1)throw Error(formatMissingLinesError(t,a.oldLines,e,i));r.push([s,n.length,o]),i=s+n.length}return r.toSorted((e,t)=>e[0]-t[0])}function formatMissingLinesError(e,t,n,r){return[`failed to find expected lines in ${e}.`,``,`Expected:`,boundLines(t,20),``,currentExcerpt(n,t,r),``,`Re-read ${e} and rewrite this hunk against the current contents.`].join(`
12
+ `)?r.contents:`${r.contents}\n`,oldContent:null,operation:`add`,path:i.path}}let a=await e.readTextFile({path:i.absolutePath});if(a===null)throw Error(`apply_patch verification failed: file not found: ${i.path}`);let o=await fileMode(e,i.absolutePath);if(r.type===`delete`)return{absolutePath:i.absolutePath,newContent:null,oldContent:a,oldMode:o,operation:`delete`,path:i.path};let s=r.movePath===void 0?i:resolvePatchPath(t,r.movePath);if(s.absolutePath!==i.absolutePath&&(await assertRealPath(e,t,s.absolutePath),claimPath(n,s.absolutePath),await e.readTextFile({path:s.absolutePath})!==null))throw Error(`apply_patch verification failed: move target already exists: ${s.path}`);let c=r.chunks.length===0?a:deriveUpdatedContent(i.path,r.chunks,a);if(c===a&&s.absolutePath===i.absolutePath)throw Error(`apply_patch verification failed: update makes no changes: ${i.path}`);let l={absolutePath:s.absolutePath,newContent:c,oldContent:a,oldMode:o,operation:s.absolutePath===i.absolutePath?`update`:`move`,path:s.path};return s.absolutePath!==i.absolutePath&&(l.previousAbsolutePath=i.absolutePath,l.previousPath=i.path),l}async function commitChange(e,t){if(t.operation===`delete`){await e.removePath({path:t.absolutePath});return}if(t.operation===`move`&&t.previousAbsolutePath!==void 0){await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:!1,path:t.absolutePath}),await e.removePath({path:t.previousAbsolutePath});return}await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:t.operation!==`add`,path:t.absolutePath})}async function revalidateChange(e,t,n){if(await assertRealPath(e,t,n.absolutePath),n.operation===`add`){if(await e.readTextFile({path:n.absolutePath})!==null)throw Error(`apply_patch stale write: add target now exists: ${n.path}`);return}if(n.operation===`move`&&n.previousAbsolutePath!==void 0){await assertRealPath(e,t,n.previousAbsolutePath);let[r,i]=await Promise.all([e.readTextFile({path:n.previousAbsolutePath}),e.readTextFile({path:n.absolutePath})]);if(r!==n.oldContent||i!==null)throw Error(`apply_patch stale write: move inputs changed: ${n.previousPath}`);return}if(await e.readTextFile({path:n.absolutePath})!==n.oldContent)throw Error(`apply_patch stale write: file changed after validation: ${n.path}`)}async function rollbackChanges(e,t){let n=[];for(let r of t.toReversed())try{let t=await e.readTextFile({path:r.absolutePath});if(r.operation===`add`){if(t===null)continue;if(t!==r.newContent)throw Error(`refusing to remove concurrently changed file ${r.path}`);await e.removePath({path:r.absolutePath})}else if(r.operation===`move`&&r.previousAbsolutePath!==void 0){let n=await e.readTextFile({path:r.previousAbsolutePath});if(t===r.newContent&&n===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.previousAbsolutePath}),await e.removePath({path:r.absolutePath});else if(t===r.newContent&&n===r.oldContent)await e.removePath({path:r.absolutePath});else if(t===null&&n===r.newContent)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.previousAbsolutePath});else if(t!==null||n!==r.oldContent)throw Error(`refusing to roll back concurrently changed move ${r.path}`)}else if(r.operation===`delete`){if(t===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.absolutePath});else if(t!==r.oldContent)throw Error(`refusing to overwrite concurrently recreated file ${r.path}`)}else{if(t===r.oldContent)continue;if(t!==r.newContent)throw Error(`refusing to overwrite concurrently changed file ${r.path}`);await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.absolutePath})}}catch(e){n.push(e instanceof Error?e.message:String(e))}return n}async function assertRealPath(e,t,n){let r=await realPath(e,n);if(r!==n||!r.startsWith(`${t}/`))throw Error(`apply_patch verification failed: path crosses a symlink or repository boundary: ${n}`)}async function realPath(e,t){let n=await e.run({command:`realpath -m -- ${shellQuote(t)}`});if(n.exitCode!==0)throw Error(`apply_patch verification failed: could not resolve ${t}: ${n.stderr}`);return n.stdout.trim()}async function ensureParentDirectory(e,t){let n=await e.run({command:`mkdir -p -- ${shellQuote(posix.dirname(t))}`});if(n.exitCode!==0)throw Error(`failed to create parent directory for ${t}: ${n.stderr}`)}async function atomicWrite(e,t){await ensureParentDirectory(e,t.path);let n=posix.join(posix.dirname(t.path),`.${posix.basename(t.path)}.eve-code-${crypto.randomUUID()}.tmp`),r=!1;try{await e.writeTextFile({path:n,content:t.content}),await restoreMode(e,n,t.mode);let i=await e.run({command:`mv ${t.overwrite?``:`-n `}-- ${shellQuote(n)} ${shellQuote(t.path)}`});if(i.exitCode!==0)throw Error(`failed to install ${t.path}: ${i.stderr||i.stdout}`);if(!t.overwrite&&await e.readTextFile({path:n})!==null)throw Error(`apply_patch stale write: target now exists: ${t.path}`);r=!0}finally{r||await e.removePath({path:n,force:!0}).catch(()=>{})}}async function fileMode(e,t){let n=await e.run({command:`stat -c %a -- ${shellQuote(t)}`}),r=n.stdout.trim();if(n.exitCode!==0||!/^[0-7]{3,4}$/u.test(r))throw Error(`apply_patch verification failed: could not read file mode for ${t}`);return r}async function restoreMode(e,t,n){if(n!==void 0&&(await e.run({command:`chmod ${n} -- ${shellQuote(t)}`})).exitCode!==0)throw Error(`failed to restore file mode for ${t}`)}function resolvePatchPath(e,t){let n=t.replaceAll(`\\`,`/`).trim();if(n.length===0||n.includes(`\0`)||posix.isAbsolute(n)||n.split(`/`).some(e=>e===``||e===`.`||e===`..`))throw Error(`invalid patch path: ${t}`);return{absolutePath:posix.join(e,n),path:n}}function claimPath(e,t){if(e.has(t))throw Error(`patch contains overlapping file operations: ${t}`);e.add(t)}function requirePath(e,t){let n=e.trim();if(n.length===0)throw Error(`invalid ${t} file path`);return n}function computeReplacements(e,t,n){let r=[],i=0;for(let a of n){if(a.changeContext!==void 0){let n=seek(e,[a.changeContext],i);if(n===-1)throw Error(formatMissingContextError(t,a.changeContext,e,i));i=n+1}if(a.contextHint!==void 0){let n=seekPrefix(e,a.contextHint,i);if(n!==-1)i=n+1;else if(occurrences(e,a,i)!==1)throw Error(formatMissingContextError(t,a.contextHint,e,i))}if(a.oldLines.length===0){r.push([e.length,0,a.newLines]);continue}let n=a.oldLines,o=a.newLines,s=seek(e,n,i,a.endOfFile);if(s===-1&&n.at(-1)===``&&(n=n.slice(0,-1),o.at(-1)===``&&(o=o.slice(0,-1)),s=seek(e,n,i,a.endOfFile)),s===-1)throw Error(formatMissingLinesError(t,a.oldLines,e,i));r.push([s,n.length,o]),i=s+n.length}return r.toSorted((e,t)=>e[0]-t[0])}function formatMissingLinesError(e,t,n,r){return[`failed to find expected lines in ${e}.`,``,`Expected:`,boundLines(t,20),``,currentExcerpt(n,t,r),``,`Re-read ${e} and rewrite this hunk against the current contents.`].join(`
13
13
  `)}function formatMissingContextError(e,t,n,r){return[`failed to find context '${t}' in ${e}.`,``,currentExcerpt(n,[t],r),``,`Re-read ${e} and rewrite this hunk against the current contents.`].join(`
14
14
  `)}function currentExcerpt(e,t,n){if(e.length===0)return`Current file is empty.`;let r=closestMatchIndex(e,t,n),i=r===-1?Math.min(n,Math.max(0,e.length-1)):r,a=Math.max(0,i-4),o=Math.min(e.length,a+16);return`${r===-1?`Current contents from line ${a+1}:`:`Closest current content:`}\n${numberedLines(e,a,o)}`}function closestMatchIndex(e,t,n){let r=t.map(e=>e.trim()).filter(e=>e.length>0).toSorted((e,t)=>t.length-e.length).slice(0,3);for(let t of r){let r=seek(e,[t],n);if(r!==-1)return r;let i=seek(e,[t],0);if(i!==-1)return i}return closestScoredLine(e,t)}function closestScoredLine(e,t){let n=new Set(t.join(` `).toLowerCase().split(/\W+/u).filter(e=>e.length>2));if(n.size===0)return-1;let r=-1,i=0;for(let t=0;t<e.length;t+=1){let a=0;for(let r of e[t].toLowerCase().split(/\W+/u))n.has(r)&&(a+=1);a>i&&(i=a,r=t)}return i>=2?r:-1}function boundLines(e,t){return e.length<=t?e.join(`
15
15
  `):`${e.slice(0,t).join(`
16
16
  `)}\n[${e.length-t} more expected lines omitted]`}function numberedLines(e,t,n){let r=String(n).length;return e.slice(t,n).map((e,n)=>`${String(t+n+1).padStart(r,` `)} | ${e}`).join(`
17
- `)}function seek(e,t,n,r=!1){if(t.length===0)return-1;for(let i of[exact,trimEnd,trim,normalized]){if(r){let r=e.length-t.length;if(r>=n&&matches(e,t,r,i))return r}for(let r=n;r<=e.length-t.length;r+=1)if(matches(e,t,r,i))return r}return-1}function matches(e,t,n,r){return t.every((t,i)=>r(e[n+i],t))}const exact=(e,t)=>e===t,trimEnd=(e,t)=>e.trimEnd()===t.trimEnd(),trim=(e,t)=>e.trim()===t.trim(),normalized=(e,t)=>normalizeTypography(e.trim())===normalizeTypography(t.trim());function normalizeTypography(e){return e.replace(/[‘’‚‛]/gu,`'`).replace(/[“”„‟]/gu,`"`).replace(/[‐‑‒–—―]/gu,`-`).replace(/…/gu,`...`).replace(/ /gu,` `)}function normalizeLineEndings(e){return e.replaceAll(`\r
17
+ `)}function seek(e,t,n,r=!1){if(t.length===0)return-1;for(let i of[exact,trimEnd,trim,normalized]){if(r){let r=e.length-t.length;if(r>=n&&matches(e,t,r,i))return r}for(let r=n;r<=e.length-t.length;r+=1)if(matches(e,t,r,i))return r}return-1}function occurrences(e,t,n){let r=seekAll(e,t.oldLines,n,t.endOfFile);return r.length>0||t.oldLines.at(-1)!==``?r.length:seekAll(e,t.oldLines.slice(0,-1),n,t.endOfFile).length}function seekAll(e,t,n,r=!1){if(t.length===0)return[];for(let i of[exact,trimEnd,trim,normalized]){let a=e.length-t.length;if(r&&a>=n&&matches(e,t,a,i))return[a];let o=[];for(let r=n;r<=a;r+=1)matches(e,t,r,i)&&o.push(r);if(o.length>0)return o}return[]}function seekPrefix(e,t,n){let r=normalizeTypography(t.trim());for(let t=n;t<e.length;t+=1)if(normalizeTypography(e[t].trim()).startsWith(r))return t;return-1}function matches(e,t,n,r){return t.every((t,i)=>r(e[n+i],t))}const exact=(e,t)=>e===t,trimEnd=(e,t)=>e.trimEnd()===t.trimEnd(),trim=(e,t)=>e.trim()===t.trim(),normalized=(e,t)=>normalizeTypography(e.trim())===normalizeTypography(t.trim());function normalizeTypography(e){return e.replace(/[‘’‚‛]/gu,`'`).replace(/[“”„‟]/gu,`"`).replace(/[‐‑‒–—―]/gu,`-`).replace(/…/gu,`...`).replace(/ /gu,` `)}function normalizeLineEndings(e){return e.replaceAll(`\r
18
18
  `,`
19
19
  `).replaceAll(`\r`,`
20
20
  `)}function splitBom(e){return e.startsWith(``)?{bom:!0,text:e.slice(1)}:{bom:!1,text:e}}function stripHeredoc(e){return e.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/u)?.[2]??e}export{applyPatchToSandbox,deriveUpdatedContent,parsePatch};
@@ -1,4 +1,3 @@
1
- import type { SandboxSession } from "eve/sandbox";
2
- type RootSandbox = Pick<SandboxSession, "resolvePath" | "run">;
3
- export declare function validateRepositoryRoot(sandbox: RootSandbox, root: string): Promise<string>;
4
- export {};
1
+ import { type WorkspaceSandbox } from "./workspace-root.ts";
2
+ /** A workspace directory that must also be the top of a git work tree. */
3
+ export declare function validateRepositoryRoot(sandbox: WorkspaceSandbox, root: string): Promise<string>;
@@ -1 +1 @@
1
- import{shellQuote}from"./shell.js";async function validateRepositoryRoot(e,t){if(!t.startsWith(`/`))throw Error(`root must be an absolute sandbox path`);let n=await realPath(e,e.resolvePath(``),`sandbox workspace`),r=await realPath(e,t,`root`);if(r!==n&&!r.startsWith(`${n}/`))throw Error(`root must be inside the sandbox workspace: ${t}`);let i=await e.run({command:`git -C ${shellQuote(r)} rev-parse --show-toplevel`});if(i.exitCode!==0||i.stdout.trim()!==r)throw Error(`root is not a git work tree root: ${t}`);return r}async function realPath(e,t,n){let r=await e.run({command:`realpath -e -- ${shellQuote(t)}`});if(r.exitCode!==0)throw Error(`Could not resolve ${n} ${t}: ${r.stderr}`);return r.stdout.trim()}export{validateRepositoryRoot};
1
+ import{shellQuote}from"./shell.js";import{resolveWorkspaceDirectory}from"./workspace-root.js";async function validateRepositoryRoot(e,t){let n=await resolveWorkspaceDirectory(e,t),r=await e.run({command:`git -C ${shellQuote(n)} rev-parse --show-toplevel`});if(r.exitCode!==0||r.stdout.trim()!==n)throw Error(`root is not a git work tree root: ${t}`);return n}export{validateRepositoryRoot};
@@ -10,4 +10,5 @@ export declare function installCodeTooling(sandbox: ToolingSandbox, options?: {
10
10
  export { authenticateGitHub, authenticateVercel, type BrokeredCredentialOptions, } from "./credentials.ts";
11
11
  /** @deprecated Import from `eve/computer-use/sandbox` and mount `eve/computer-use`. */
12
12
  export { COMPUTER_USE_REVALIDATION_KEY, installComputerUse, startComputerUse, } from "eve/computer-use/sandbox";
13
- export { executeGitHubShell, githubShellApproval, type GitHubLeaseRule, type GitHubShellInput, type GitHubShellOutput, } from "./github-shell.ts";
13
+ /** @deprecated Import from `eve/extensions/git/sandbox`. */
14
+ export { executeGitHubShell, githubShellApproval, type GitHubLeaseRule, type GitHubShellInput, type GitHubShellOutput, } from "eve/extensions/git/sandbox";
@@ -1,2 +1,2 @@
1
- import{GH_SIGNED_COMMIT_SOURCE}from"./signed-commit.js";import{DIAGNOSTICS_WORKER_SOURCE,TYPESCRIPT_VERSION,ghWrapperSource,toolingPaths,typescriptInstallCommand,vercelWrapperSource}from"./tooling.js";import{authenticateGitHub,authenticateVercel}from"./credentials.js";import{commandFailureDetail}from"./command-failure.js";import{executeGitHubShell,githubShellApproval}from"./github-shell.js";import{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse}from"eve/computer-use/sandbox";const CODE_TOOLING_REVALIDATION_KEY=`eve-code-tooling:3:3:${TYPESCRIPT_VERSION}`;async function installCodeTooling(e,t={}){let n=toolingPaths(e);await Promise.all([e.writeTextFile({path:n.ghWrapper,content:ghWrapperSource(e)}),e.writeTextFile({path:n.signedCommit,content:GH_SIGNED_COMMIT_SOURCE}),e.writeTextFile({path:n.workerSource,content:DIAGNOSTICS_WORKER_SOURCE}),...t.vercel===!0?[e.writeTextFile({path:n.vercelWrapper,content:vercelWrapperSource(e)})]:[]]);let r=await e.run({command:toolingInstallCommand(e,t.vercel===!0)});if(r.exitCode!==0)throw Error(`eve-code tooling installation failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}function toolingInstallCommand(e,t){let n=toolingPaths(e),quote=e=>`'${e.replaceAll(`'`,`'"'"'`)}'`;return[`set -e`,`mkdir -p ${quote(n.root)}`,`if ! command -v gh >/dev/null 2>&1; then`,` command -v apt-get >/dev/null 2>&1 || { echo 'eve-code requires gh or apt-get' >&2; exit 1; }`,` if [ "$(id -u)" = 0 ]; then APT=apt-get; else command -v sudo >/dev/null 2>&1 || { echo 'eve-code needs root or sudo to install gh' >&2; exit 1; }; APT='sudo -n apt-get'; fi`,` $APT update && $APT install -y gh`,`fi`,`chmod 755 ${quote(n.ghWrapper)} ${quote(n.signedCommit)}`,`if [ "$(id -u)" = 0 ]; then INSTALL=install; else INSTALL='sudo -n install'; fi`,`$INSTALL -d -o root -g root -m 755 ${quote(n.trustedRoot)} ${quote(n.typescriptRoot)}`,`[ -x /usr/bin/gh ] || { echo 'eve-code requires gh at /usr/bin/gh' >&2; exit 1; }`,`$INSTALL -m 755 /usr/bin/gh ${quote(n.ghReal)}`,`$INSTALL -m 755 ${quote(n.signedCommit)} ${quote(n.trustedSignedCommit)}`,`$INSTALL -m 644 ${quote(n.workerSource)} ${quote(n.worker)}`,`$INSTALL -m 755 ${quote(n.ghWrapper)} /usr/local/bin/gh`,`$INSTALL -m 755 ${quote(n.trustedSignedCommit)} /usr/local/bin/gh-signed-commit`,typescriptInstallCommand(e),...t?[`if [ "$(id -u)" = 0 ]; then npm install -g vercel@latest; else sudo -n npm install -g vercel@latest; fi`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vercel`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vc`]:[]].join(`
1
+ import{DIAGNOSTICS_WORKER_SOURCE,GH_SIGNED_COMMIT_SOURCE,GH_SIGNED_COMMIT_VERSION,TYPESCRIPT_VERSION,ghWrapperSource,toolingPaths,typescriptInstallCommand,vercelWrapperSource}from"./tooling.js";import{authenticateGitHub,authenticateVercel}from"./credentials.js";import{commandFailureDetail}from"./command-failure.js";import{executeGitHubShell,githubShellApproval}from"eve/extensions/git/sandbox";import{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse}from"eve/computer-use/sandbox";const CODE_TOOLING_REVALIDATION_KEY=`eve-code-tooling:3:${GH_SIGNED_COMMIT_VERSION}:${TYPESCRIPT_VERSION}`;async function installCodeTooling(e,t={}){let n=toolingPaths(e);await Promise.all([e.writeTextFile({path:n.ghWrapper,content:ghWrapperSource(e)}),e.writeTextFile({path:n.signedCommit,content:GH_SIGNED_COMMIT_SOURCE}),e.writeTextFile({path:n.workerSource,content:DIAGNOSTICS_WORKER_SOURCE}),...t.vercel===!0?[e.writeTextFile({path:n.vercelWrapper,content:vercelWrapperSource(e)})]:[]]);let r=await e.run({command:toolingInstallCommand(e,t.vercel===!0)});if(r.exitCode!==0)throw Error(`eve-code tooling installation failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}function toolingInstallCommand(e,t){let n=toolingPaths(e),quote=e=>`'${e.replaceAll(`'`,`'"'"'`)}'`;return[`set -e`,`mkdir -p ${quote(n.root)}`,`if ! command -v gh >/dev/null 2>&1; then`,` command -v apt-get >/dev/null 2>&1 || { echo 'eve-code requires gh or apt-get' >&2; exit 1; }`,` if [ "$(id -u)" = 0 ]; then APT=apt-get; else command -v sudo >/dev/null 2>&1 || { echo 'eve-code needs root or sudo to install gh' >&2; exit 1; }; APT='sudo -n apt-get'; fi`,` $APT update && $APT install -y gh`,`fi`,`chmod 755 ${quote(n.ghWrapper)} ${quote(n.signedCommit)}`,`if [ "$(id -u)" = 0 ]; then INSTALL=install; else INSTALL='sudo -n install'; fi`,`$INSTALL -d -o root -g root -m 755 ${quote(n.trustedRoot)} ${quote(n.typescriptRoot)}`,`[ -x /usr/bin/gh ] || { echo 'eve-code requires gh at /usr/bin/gh' >&2; exit 1; }`,`$INSTALL -m 755 /usr/bin/gh ${quote(n.ghReal)}`,`$INSTALL -m 755 ${quote(n.signedCommit)} ${quote(n.trustedSignedCommit)}`,`$INSTALL -m 644 ${quote(n.workerSource)} ${quote(n.worker)}`,`$INSTALL -m 755 ${quote(n.ghWrapper)} /usr/local/bin/gh`,`$INSTALL -m 755 ${quote(n.trustedSignedCommit)} /usr/local/bin/gh-signed-commit`,typescriptInstallCommand(e),...t?[`if [ "$(id -u)" = 0 ]; then npm install -g vercel@latest; else sudo -n npm install -g vercel@latest; fi`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vercel`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vc`]:[]].join(`
2
2
  `)}export{CODE_TOOLING_REVALIDATION_KEY,COMPUTER_USE_REVALIDATION_KEY,authenticateGitHub,authenticateVercel,executeGitHubShell,githubShellApproval,installCodeTooling,installComputerUse,startComputerUse};
@@ -1,16 +1,16 @@
1
1
  import type { SandboxSession } from "eve/sandbox";
2
- import { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION } from "./signed-commit.ts";
2
+ import { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION } from "eve/extensions/git/sandbox";
3
3
  export { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION };
4
4
  export declare const TYPESCRIPT_VERSION = "6.0.3";
5
5
  export declare function toolingPaths(sandbox: Pick<SandboxSession, "resolvePath">): {
6
6
  root: string;
7
7
  trustedRoot: string;
8
8
  env: string;
9
- ghReal: string;
9
+ ghReal: "/usr/local/lib/eve-code/gh";
10
10
  ghWrapper: string;
11
11
  vercelWrapper: string;
12
12
  signedCommit: string;
13
- trustedSignedCommit: string;
13
+ trustedSignedCommit: "/usr/local/lib/eve-code/gh-signed-commit";
14
14
  typescriptRoot: string;
15
15
  typescriptModule: string;
16
16
  workerSource: string;
@@ -21,7 +21,7 @@ export declare function vercelWrapperSource(sandbox: Pick<SandboxSession, "resol
21
21
  export declare function typescriptInstallCommand(sandbox: Pick<SandboxSession, "resolvePath">): string;
22
22
  /**
23
23
  * Runs inside the sandbox with `node`. Reads one base64 JSON request from
24
- * `EVE_CODE_DIAGNOSTICS_REQUEST` (`{ repoRoot, filePath }`), loads only the
24
+ * `EVE_CODE_DIAGNOSTICS_REQUEST` (`{ patchRoot, filePath }`), loads only the
25
25
  * bootstrap-installed compiler, and prints `{ diagnostics }`.
26
26
  */
27
27
  export declare const DIAGNOSTICS_WORKER_SOURCE: string;