eve 0.72.1 → 0.74.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 (575) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/src/channel/agent-description.d.ts +49 -9
  4. package/dist/src/channel/agent-description.js +1 -1
  5. package/dist/src/channel/invoke-tool.d.ts +26 -4
  6. package/dist/src/channel/invoke-tool.js +1 -1
  7. package/dist/src/channel/principal-identity.d.ts +9 -0
  8. package/dist/src/channel/principal-identity.js +1 -0
  9. package/dist/src/channel/prompt-queue.d.ts +31 -0
  10. package/dist/src/channel/prompt-queue.js +1 -0
  11. package/dist/src/channel/routes.d.ts +19 -4
  12. package/dist/src/channel/schedule.d.ts +20 -6
  13. package/dist/src/channel/schedule.js +1 -1
  14. package/dist/src/channel/skill-files.d.ts +114 -0
  15. package/dist/src/channel/skill-files.js +1 -0
  16. package/dist/src/channel/types.d.ts +4 -0
  17. package/dist/src/chunks/{use-eve-agent-C1GYGCtb.js → use-eve-agent-DOOXadF0.js} +13 -3
  18. package/dist/src/chunks/{use-eve-agent-hZJ7CB8t.js → use-eve-agent-mP0M7SrL.js} +13 -3
  19. package/dist/src/cli/commands/agent-instructions.js +1 -1
  20. package/dist/src/cli/commands/extension-init.js +1 -1
  21. package/dist/src/cli/commands/init-agent-workspace.js +1 -1
  22. package/dist/src/cli/commands/init-project.js +1 -1
  23. package/dist/src/cli/commands/init.js +1 -1
  24. package/dist/src/cli/dev/diagnostic-dump.js +1 -1
  25. package/dist/src/cli/dev/tui/blocks.d.ts +6 -0
  26. package/dist/src/cli/dev/tui/blocks.js +2 -2
  27. package/dist/src/cli/dev/tui/markdown.d.ts +5 -0
  28. package/dist/src/cli/dev/tui/markdown.js +2 -2
  29. package/dist/src/cli/dev/tui/stream-format.js +2 -2
  30. package/dist/src/cli/dev/tui/transcript-parts.d.ts +4 -1
  31. package/dist/src/cli/dev/tui/transcript-parts.js +2 -2
  32. package/dist/src/cli/dev/tui/transcript.js +1 -1
  33. package/dist/src/client/message-reducer.js +1 -1
  34. package/dist/src/compiled/.vendor-stamp.json +9 -8
  35. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  36. package/dist/src/compiled/@modelcontextprotocol/server/index.d.ts +68 -7
  37. package/dist/src/compiled/@vercel/schedules/index.d.ts +158 -0
  38. package/dist/src/compiled/@vercel/schedules/index.js +17 -0
  39. package/dist/src/compiled/@workflow/core/capabilities.d.ts +33 -6
  40. package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +2 -0
  41. package/dist/src/compiled/@workflow/core/index.d.ts +1 -0
  42. package/dist/src/compiled/@workflow/core/index.js +2 -2
  43. package/dist/src/compiled/@workflow/core/private.js +1 -1
  44. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +6 -0
  45. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  46. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  47. package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +8 -8
  48. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +13 -5
  49. package/dist/src/compiled/@workflow/core/serialization.d.ts +9 -9
  50. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  51. package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -0
  52. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +2 -2
  53. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  54. package/dist/src/compiled/@workflow/core/workflow/index.d.ts +1 -0
  55. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  56. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  57. package/dist/src/compiled/@workflow/world/events.d.ts +11 -0
  58. package/dist/src/compiled/@workflow/world/hooks.d.ts +2 -0
  59. package/dist/src/compiled/@workflow/world/interfaces.d.ts +6 -0
  60. package/dist/src/compiled/@workflow/world-local/index.js +3 -3
  61. package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
  62. package/dist/src/compiled/_chunks/workflow/{attribute-changes-VaTKT4K8.js → attribute-changes-CSqvJx6j.js} +2 -2
  63. package/dist/src/compiled/_chunks/workflow/{dist-B7NC1c9-.js → dist-DmXynLVH.js} +1 -1
  64. package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +3 -0
  65. package/dist/src/compiled/_chunks/workflow/helpers-BXCuoPUb.js +1 -0
  66. package/dist/src/compiled/_chunks/workflow/private-Dlf90Zvn.js +1 -0
  67. package/dist/src/compiled/_chunks/workflow/resume-hook-CvENCrxc.js +1 -0
  68. package/dist/src/compiled/_chunks/workflow/{run-DYKeqbob.js → run-8pLWuR2U.js} +6 -6
  69. package/dist/src/compiled/_chunks/workflow/serialization-vDozzDhh.js +16 -0
  70. package/dist/src/compiled/_chunks/workflow/sleep-BMqbraZM.js +1 -0
  71. package/dist/src/compiled/_chunks/workflow/wait-until-A344L2AG.js +1 -0
  72. package/dist/src/compiled/shadcn-registry/index.js +3408 -35163
  73. package/dist/src/compiler/artifacts.js +1 -1
  74. package/dist/src/compiler/compile-agent.js +1 -1
  75. package/dist/src/compiler/development-extensions.js +1 -1
  76. package/dist/src/compiler/extension-compatibility.d.ts +18 -18
  77. package/dist/src/compiler/extension-compatibility.js +1 -1
  78. package/dist/src/compiler/load-binding-namespace.d.ts +5 -0
  79. package/dist/src/compiler/load-binding-namespace.js +1 -1
  80. package/dist/src/compiler/manifest.d.ts +39 -0
  81. package/dist/src/compiler/manifest.js +1 -1
  82. package/dist/src/compiler/memory-wrapper-candidates.d.ts +2 -0
  83. package/dist/src/compiler/memory-wrapper-candidates.js +1 -0
  84. package/dist/src/compiler/module-lifecycle.d.ts +1 -1
  85. package/dist/src/compiler/module-lifecycle.js +1 -1
  86. package/dist/src/compiler/module-map.js +1 -1
  87. package/dist/src/compiler/normalize-agent-config.js +1 -1
  88. package/dist/src/compiler/normalize-manifest.js +1 -1
  89. package/dist/src/compiler/normalize-schedule-collection.d.ts +3 -0
  90. package/dist/src/compiler/normalize-schedule-collection.js +1 -0
  91. package/dist/src/compiler/normalize-schedule.d.ts +2 -2
  92. package/dist/src/compiler/normalize-schedule.js +1 -1
  93. package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
  94. package/dist/src/compiler/schedule-collection-wrapper-candidates.d.ts +2 -0
  95. package/dist/src/compiler/schedule-collection-wrapper-candidates.js +1 -0
  96. package/dist/src/compiler/validate-artifact.js +1 -1
  97. package/dist/src/context/build-callback-context.js +1 -1
  98. package/dist/src/context/dynamic-resolve-context.js +1 -1
  99. package/dist/src/context/key-names.d.ts +1 -0
  100. package/dist/src/context/key-names.js +1 -1
  101. package/dist/src/context/keys.d.ts +2 -0
  102. package/dist/src/context/keys.js +1 -1
  103. package/dist/src/context/providers/session.js +1 -1
  104. package/dist/src/context/schedule-collection-tools.d.ts +9 -0
  105. package/dist/src/context/schedule-collection-tools.js +1 -0
  106. package/dist/src/context/session-context.d.ts +4 -1
  107. package/dist/src/context/session-schedule.d.ts +9 -0
  108. package/dist/src/context/session-schedule.js +1 -0
  109. package/dist/src/context/turn-principals.d.ts +12 -0
  110. package/dist/src/context/turn-principals.js +1 -0
  111. package/dist/src/dynamic/definition.d.ts +1 -0
  112. package/dist/src/evals/cli/eval-client.js +1 -1
  113. package/dist/src/evals/cli/eval.js +1 -1
  114. package/dist/src/execution/agent-sessions/context.d.ts +2 -0
  115. package/dist/src/execution/agent-sessions/context.js +1 -1
  116. package/dist/src/execution/agent-sessions/steps.js +1 -1
  117. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  118. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  119. package/dist/src/execution/invoke-tool.d.ts +6 -2
  120. package/dist/src/execution/invoke-tool.js +1 -1
  121. package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
  122. package/dist/src/execution/node-step.d.ts +1 -0
  123. package/dist/src/execution/node-step.js +1 -1
  124. package/dist/src/execution/publish-session-events.js +1 -1
  125. package/dist/src/execution/runtime-context.js +1 -1
  126. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  127. package/dist/src/execution/sandbox/bindings/vercel-errors.d.ts +11 -0
  128. package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -1
  129. package/dist/src/execution/sandbox/bindings/vercel-tool-sessions.d.ts +7 -0
  130. package/dist/src/execution/sandbox/bindings/vercel-tool-sessions.js +1 -0
  131. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  132. package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
  133. package/dist/src/execution/sandbox/ensure.d.ts +14 -1
  134. package/dist/src/execution/sandbox/ensure.js +1 -1
  135. package/dist/src/execution/sandbox/prewarm.js +1 -1
  136. package/dist/src/execution/session/active-turn.d.ts +2 -1
  137. package/dist/src/execution/session/active-turn.js +1 -1
  138. package/dist/src/execution/session/entry.d.ts +10 -1
  139. package/dist/src/execution/session/entry.js +1 -1
  140. package/dist/src/execution/session/program.d.ts +4 -0
  141. package/dist/src/execution/session/program.js +1 -1
  142. package/dist/src/execution/session/timeout-control.d.ts +1 -2
  143. package/dist/src/execution/session/timeout-control.js +1 -1
  144. package/dist/src/execution/session/turn-control.d.ts +7 -0
  145. package/dist/src/execution/session/turn-control.js +1 -0
  146. package/dist/src/execution/session/turn-step.js +1 -1
  147. package/dist/src/execution/session/turn.d.ts +2 -0
  148. package/dist/src/execution/session/turn.js +1 -1
  149. package/dist/src/execution/session-inbox/protocol.js +1 -1
  150. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  151. package/dist/src/execution/tool-session/id.d.ts +22 -0
  152. package/dist/src/execution/tool-session/id.js +1 -0
  153. package/dist/src/execution/tool-session/sandbox.d.ts +22 -0
  154. package/dist/src/execution/tool-session/sandbox.js +1 -0
  155. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  156. package/dist/src/execution/tools/connection-tools.js +1 -1
  157. package/dist/src/framework/sources/modules/schedule-collection-wrapper.d.ts +2 -0
  158. package/dist/src/framework/sources/modules/schedule-collection-wrapper.js +1 -0
  159. package/dist/src/framework/sources/registry.d.ts +1 -0
  160. package/dist/src/framework/sources/registry.js +1 -1
  161. package/dist/src/harness/compaction/step.js +1 -1
  162. package/dist/src/harness/emission.d.ts +1 -0
  163. package/dist/src/harness/emission.js +1 -1
  164. package/dist/src/harness/hitl/approvals.d.ts +1 -1
  165. package/dist/src/harness/hitl/approvals.js +1 -1
  166. package/dist/src/harness/hitl/delivery.d.ts +9 -2
  167. package/dist/src/harness/hitl/delivery.js +1 -1
  168. package/dist/src/harness/hitl/intake.js +1 -1
  169. package/dist/src/harness/model-call/call.d.ts +5 -0
  170. package/dist/src/harness/model-call/call.js +1 -1
  171. package/dist/src/harness/model-call/usage.js +1 -1
  172. package/dist/src/harness/open-input-request.d.ts +8 -0
  173. package/dist/src/harness/open-input-request.js +1 -0
  174. package/dist/src/harness/session-machine/current.js +1 -1
  175. package/dist/src/harness/session-machine/transitions.d.ts +13 -0
  176. package/dist/src/harness/session-machine/transitions.js +1 -1
  177. package/dist/src/harness/stream-actions.d.ts +6 -1
  178. package/dist/src/harness/stream-actions.js +1 -1
  179. package/dist/src/harness/tool-loop.js +1 -1
  180. package/dist/src/harness/tools.js +1 -1
  181. package/dist/src/harness/types.d.ts +2 -0
  182. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  183. package/dist/src/instrumentation/lifecycle.d.ts +1 -0
  184. package/dist/src/internal/application/cache-metadata.js +1 -1
  185. package/dist/src/internal/application/compiled-artifacts.js +1 -1
  186. package/dist/src/internal/application/package.js +1 -1
  187. package/dist/src/internal/application/paths.js +1 -1
  188. package/dist/src/internal/application/runtime-compiled-artifacts-source.js +1 -1
  189. package/dist/src/internal/authored-definition/connection.js +1 -1
  190. package/dist/src/internal/authored-definition/schedule-collection.d.ts +2 -0
  191. package/dist/src/internal/authored-definition/schedule-collection.js +1 -0
  192. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  193. package/dist/src/internal/authored-module-loader.d.ts +7 -0
  194. package/dist/src/internal/authored-module-loader.js +2 -2
  195. package/dist/src/internal/authored-module-map-loader.js +1 -1
  196. package/dist/src/internal/authored-package-boundary.js +1 -1
  197. package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
  198. package/dist/src/internal/authored-runtime-modules.js +1 -1
  199. package/dist/src/internal/invocation/metadata.js +1 -1
  200. package/dist/src/internal/mcp/forwarded-principal-header.d.ts +31 -0
  201. package/dist/src/internal/mcp/forwarded-principal-header.js +1 -0
  202. package/dist/src/internal/mcp/published-tools.d.ts +9 -2
  203. package/dist/src/internal/mcp/published-tools.js +1 -1
  204. package/dist/src/internal/mcp/skills.d.ts +57 -0
  205. package/dist/src/internal/mcp/skills.js +1 -0
  206. package/dist/src/internal/mcp/streamable-http-server.d.ts +38 -6
  207. package/dist/src/internal/mcp/streamable-http-server.js +1 -1
  208. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  209. package/dist/src/internal/nitro/development-generation.js +1 -1
  210. package/dist/src/internal/nitro/host/artifacts-config.js +1 -1
  211. package/dist/src/internal/nitro/host/build-application.js +1 -1
  212. package/dist/src/internal/nitro/host/build-extension.js +1 -1
  213. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  214. package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
  215. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  216. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  217. package/dist/src/internal/nitro/host/dev-runner.js +1 -1
  218. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  219. package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.js +1 -1
  220. package/dist/src/internal/nitro/host/skill-server-assets.d.ts +29 -0
  221. package/dist/src/internal/nitro/host/skill-server-assets.js +1 -0
  222. package/dist/src/internal/nitro/host/start-production-server.js +1 -1
  223. package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +12 -0
  224. package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
  225. package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
  226. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  227. package/dist/src/internal/nitro/routes/channel-route-context.d.ts +4 -0
  228. package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
  229. package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +3 -0
  230. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -0
  231. package/dist/src/internal/schedules/consumer-route.d.ts +17 -0
  232. package/dist/src/internal/schedules/consumer-route.js +1 -0
  233. package/dist/src/internal/schedules/verify-delivery.d.ts +25 -0
  234. package/dist/src/internal/schedules/verify-delivery.js +1 -0
  235. package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
  236. package/dist/src/internal/workflow/development-world-client.js +1 -1
  237. package/dist/src/internal/workflow/validate-world.js +1 -1
  238. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
  239. package/dist/src/internal/workflow-bundle/builder-support.js +1 -1
  240. package/dist/src/internal/workflow-bundle/builder.js +1 -1
  241. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  242. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +1 -0
  243. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +1 -0
  244. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +1 -0
  245. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +1 -0
  246. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +1 -0
  247. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +1 -0
  248. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +1 -0
  249. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +2 -0
  250. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +1 -0
  251. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +1 -0
  252. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +1 -0
  253. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +1 -0
  254. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +1 -0
  255. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +1 -0
  256. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +1 -0
  257. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +1 -0
  258. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +1 -0
  259. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +1 -0
  260. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +2 -0
  261. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +1 -0
  262. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +1 -0
  263. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +1 -0
  264. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +1 -0
  265. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +2 -0
  266. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +1 -0
  267. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +1 -0
  268. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +1 -0
  269. package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +36 -0
  270. package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +1 -0
  271. package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +1 -0
  272. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +1 -0
  273. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +1 -0
  274. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +1 -0
  275. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +1 -0
  276. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +1 -0
  277. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +1 -0
  278. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +1 -0
  279. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +1 -0
  280. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +2 -0
  281. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +1 -0
  282. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +1 -0
  283. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +1 -0
  284. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +1 -0
  285. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +1 -0
  286. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +1 -0
  287. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +1 -0
  288. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +1 -0
  289. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +1 -0
  290. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +1 -0
  291. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +1 -0
  292. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +1 -0
  293. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +1 -0
  294. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +1 -0
  295. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +1 -0
  296. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +1 -0
  297. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +1 -0
  298. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +1 -0
  299. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +1 -0
  300. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +1 -0
  301. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +1 -0
  302. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +1 -0
  303. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +1 -0
  304. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +1 -0
  305. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +1 -0
  306. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +1 -0
  307. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +1 -0
  308. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +1 -0
  309. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +1 -0
  310. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +1 -0
  311. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +1 -0
  312. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +1 -0
  313. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +1 -0
  314. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +1 -0
  315. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +1 -0
  316. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +1 -0
  317. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +1 -0
  318. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +1 -0
  319. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +1 -0
  320. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +1 -0
  321. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +1 -0
  322. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +1 -0
  323. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +1 -0
  324. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +1 -0
  325. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +1 -0
  326. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +1 -0
  327. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +1 -0
  328. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +1 -0
  329. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +1 -0
  330. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +1 -0
  331. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +1 -0
  332. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +1 -0
  333. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +1 -0
  334. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +1 -0
  335. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +1 -0
  336. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +1 -0
  337. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +1 -0
  338. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +1 -0
  339. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +1 -0
  340. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +1 -0
  341. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +1 -0
  342. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +1 -0
  343. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +1 -0
  344. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +1 -0
  345. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +1 -0
  346. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +1 -0
  347. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +1 -0
  348. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +1 -0
  349. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +1 -0
  350. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +1 -0
  351. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +1 -0
  352. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +1 -0
  353. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +1 -0
  354. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +1 -0
  355. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +1 -0
  356. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +1 -0
  357. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +1 -0
  358. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +1 -0
  359. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +1 -0
  360. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +1 -0
  361. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +1 -0
  362. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +1 -0
  363. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +1 -0
  364. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +1 -0
  365. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +1 -0
  366. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +1 -0
  367. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +1 -0
  368. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +1 -0
  369. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +1 -0
  370. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +1 -0
  371. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +1 -0
  372. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +1 -0
  373. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +1 -0
  374. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +1 -0
  375. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +1 -0
  376. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +1 -0
  377. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +1 -0
  378. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +1 -0
  379. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +1 -0
  380. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +1 -0
  381. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +1 -0
  382. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +1 -0
  383. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +1 -0
  384. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +1 -0
  385. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +1 -0
  386. package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +7 -0
  387. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +1 -0
  388. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +1 -0
  389. package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +1 -0
  390. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +1 -0
  391. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +1 -0
  392. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +1 -0
  393. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +1 -0
  394. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +1 -0
  395. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +1 -0
  396. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +2 -0
  397. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +1 -0
  398. package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +1 -0
  399. package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +1 -0
  400. package/dist/src/public/channels/chat-sdk/authorization.js +1 -1
  401. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +7 -1
  402. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  403. package/dist/src/public/channels/discord/defaults.d.ts +8 -7
  404. package/dist/src/public/channels/discord/discordChannel.d.ts +21 -1
  405. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  406. package/dist/src/public/channels/discord/index.d.ts +1 -1
  407. package/dist/src/public/channels/github/defaults.js +3 -3
  408. package/dist/src/public/channels/github/githubChannel.d.ts +4 -1
  409. package/dist/src/public/channels/github/state.d.ts +2 -1
  410. package/dist/src/public/channels/index.d.ts +1 -1
  411. package/dist/src/public/channels/linear/defaults.js +1 -1
  412. package/dist/src/public/channels/linear/linearChannel.d.ts +4 -1
  413. package/dist/src/public/channels/mcp.d.ts +26 -5
  414. package/dist/src/public/channels/mcp.js +1 -1
  415. package/dist/src/public/channels/slack/index.d.ts +1 -0
  416. package/dist/src/public/channels/slack/index.js +1 -1
  417. package/dist/src/public/channels/slack/interactions.js +1 -1
  418. package/dist/src/public/channels/slack/slackChannel.d.ts +6 -0
  419. package/dist/src/public/channels/twilio/defaults.js +2 -4
  420. package/dist/src/public/channels/twilio/twilioChannel.d.ts +4 -1
  421. package/dist/src/public/definitions/channel.d.ts +1 -1
  422. package/dist/src/public/definitions/connections/mcp.d.ts +11 -0
  423. package/dist/src/public/experimental/schedules/client.d.ts +7 -0
  424. package/dist/src/public/experimental/schedules/client.js +1 -0
  425. package/dist/src/public/experimental/schedules/index.d.ts +5 -0
  426. package/dist/src/public/experimental/schedules/index.js +1 -0
  427. package/dist/src/public/experimental/schedules/testing.d.ts +2 -0
  428. package/dist/src/public/experimental/schedules/testing.js +1 -0
  429. package/dist/src/public/experimental/schedules/vercel.d.ts +2 -0
  430. package/dist/src/public/experimental/schedules/vercel.js +1 -0
  431. package/dist/src/public/memory/scope.js +1 -1
  432. package/dist/src/public/schedules/provider-types.d.ts +16 -0
  433. package/dist/src/public/schedules/provider-types.js +1 -0
  434. package/dist/src/public/schedules/providers/in-memory.d.ts +5 -0
  435. package/dist/src/public/schedules/providers/in-memory.js +1 -0
  436. package/dist/src/public/schedules/providers/vercel.d.ts +10 -0
  437. package/dist/src/public/schedules/providers/vercel.js +1 -0
  438. package/dist/src/public/schedules/scope.d.ts +2 -0
  439. package/dist/src/public/schedules/scope.js +1 -0
  440. package/dist/src/public/schedules/subscription.d.ts +259 -0
  441. package/dist/src/public/schedules/subscription.js +1 -0
  442. package/dist/src/public/schedules/testing.d.ts +1 -0
  443. package/dist/src/public/schedules/testing.js +1 -0
  444. package/dist/src/public/sveltekit/dev-server.js +1 -1
  445. package/dist/src/runtime/cache-key.js +1 -1
  446. package/dist/src/runtime/connections/mcp-client.js +1 -1
  447. package/dist/src/runtime/loaders/compile-metadata.js +1 -1
  448. package/dist/src/runtime/loaders/manifest.js +1 -1
  449. package/dist/src/runtime/loaders/module-map.js +1 -1
  450. package/dist/src/runtime/resolve-connection.js +1 -1
  451. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
  452. package/dist/src/runtime/schedules/collection-client.d.ts +20 -0
  453. package/dist/src/runtime/schedules/collection-client.js +1 -0
  454. package/dist/src/runtime/schedules/dispatch-occurrence.d.ts +12 -0
  455. package/dist/src/runtime/schedules/dispatch-occurrence.js +1 -0
  456. package/dist/src/runtime/schedules/load-collection.d.ts +14 -0
  457. package/dist/src/runtime/schedules/load-collection.js +1 -0
  458. package/dist/src/runtime/schedules/payload.d.ts +24 -0
  459. package/dist/src/runtime/schedules/payload.js +1 -0
  460. package/dist/src/runtime/schedules/provider-types.d.ts +1 -0
  461. package/dist/src/runtime/schedules/provider-types.js +1 -0
  462. package/dist/src/runtime/schedules/queue-namespace.d.ts +2 -0
  463. package/dist/src/runtime/schedules/queue-namespace.js +1 -0
  464. package/dist/src/runtime/schedules/record.d.ts +4 -0
  465. package/dist/src/runtime/schedules/record.js +1 -0
  466. package/dist/src/runtime/schedules/validation.d.ts +6 -0
  467. package/dist/src/runtime/schedules/validation.js +1 -0
  468. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  469. package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
  470. package/dist/src/runtime/sessions/runtime-session.d.ts +10 -0
  471. package/dist/src/runtime/sessions/runtime-session.js +1 -1
  472. package/dist/src/runtime/types.d.ts +2 -0
  473. package/dist/src/self-modification/config.d.ts +4 -63
  474. package/dist/src/self-modification/config.js +1 -1
  475. package/dist/src/self-modification/credentials.d.ts +1 -1
  476. package/dist/src/self-modification/deployed-sandbox.d.ts +14 -0
  477. package/dist/src/self-modification/deployed-sandbox.js +1 -0
  478. package/dist/src/self-modification/extension/config-schema.d.ts +2 -17
  479. package/dist/src/self-modification/extension/config-schema.js +1 -1
  480. package/dist/src/self-modification/extension/local-only.d.ts +1 -1
  481. package/dist/src/self-modification/extension/local-only.js +1 -1
  482. package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
  483. package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
  484. package/dist/src/self-modification/extension/subagents/agent/instructions.js +3 -35
  485. package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.d.ts +3 -31
  486. package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
  487. package/dist/src/self-modification/git-workspace.d.ts +1 -2
  488. package/dist/src/self-modification/git-workspace.js +1 -1
  489. package/dist/src/self-modification/github-publisher.d.ts +1 -1
  490. package/dist/src/self-modification/mode.d.ts +4 -4
  491. package/dist/src/self-modification/mode.js +1 -1
  492. package/dist/src/self-modification/proposal.js +1 -1
  493. package/dist/src/self-modification/remote/config-schema.d.ts +20 -0
  494. package/dist/src/self-modification/remote/config-schema.js +1 -0
  495. package/dist/src/self-modification/remote/config.d.ts +66 -0
  496. package/dist/src/self-modification/remote/config.js +1 -0
  497. package/dist/src/self-modification/remote/extension.d.ts +5 -0
  498. package/dist/src/self-modification/remote/extension.js +1 -0
  499. package/dist/src/self-modification/remote/production-registry-add.js +1 -0
  500. package/dist/src/self-modification/remote/subagents/agent/agent.d.ts +4 -0
  501. package/dist/src/self-modification/remote/subagents/agent/agent.js +1 -0
  502. package/dist/src/self-modification/remote/subagents/agent/instructions.d.ts +2 -0
  503. package/dist/src/self-modification/remote/subagents/agent/instructions.js +5 -0
  504. package/dist/src/self-modification/remote/subagents/agent/sandbox.d.ts +2 -0
  505. package/dist/src/self-modification/remote/subagents/agent/sandbox.js +1 -0
  506. package/dist/src/self-modification/remote/subagents/agent/tools/edit_file.d.ts +1 -0
  507. package/dist/src/self-modification/remote/subagents/agent/tools/edit_file.js +1 -0
  508. package/dist/src/self-modification/remote/subagents/agent/tools/publish.js +1 -0
  509. package/dist/src/self-modification/remote/subagents/agent/tools/registry_add.d.ts +32 -0
  510. package/dist/src/self-modification/remote/subagents/agent/tools/registry_add.js +1 -0
  511. package/dist/src/self-modification/remote/subagents/agent/tools/search_models.d.ts +1 -0
  512. package/dist/src/self-modification/remote/subagents/agent/tools/search_models.js +1 -0
  513. package/dist/src/self-modification/remote/subagents/agent/tools/search_registry.d.ts +1 -0
  514. package/dist/src/self-modification/remote/subagents/agent/tools/search_registry.js +1 -0
  515. package/dist/src/self-modification/sandbox.d.ts +1 -6
  516. package/dist/src/self-modification/sandbox.js +1 -1
  517. package/dist/src/self-modification/scaffold.js +1 -1
  518. package/dist/src/self-modification/setup.d.ts +6 -0
  519. package/dist/src/self-modification/setup.js +46 -48
  520. package/dist/src/self-modification/subagent-guidance.d.ts +15 -0
  521. package/dist/src/self-modification/subagent-guidance.js +29 -0
  522. package/dist/src/services/dev-client/request-headers.js +1 -1
  523. package/dist/src/setup/flows/model-source-change.js +1 -1
  524. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  525. package/dist/src/setup/project-resolution.js +1 -1
  526. package/dist/src/setup/scaffold/create/project.js +1 -1
  527. package/dist/src/setup/verified-remote-client.d.ts +3 -0
  528. package/dist/src/setup/verified-remote-client.js +1 -1
  529. package/dist/src/shared/framework-eve-server.js +1 -1
  530. package/dist/src/shared/principal-scope.d.ts +2 -0
  531. package/dist/src/shared/principal-scope.js +1 -0
  532. package/dist/src/shared/schedule-collection-definition.d.ts +11 -0
  533. package/dist/src/shared/schedule-collection-definition.js +1 -0
  534. package/dist/src/shared/schedule-collection-tools.d.ts +1 -0
  535. package/dist/src/shared/schedule-collection-tools.js +1 -0
  536. package/dist/src/subagents/hitl-proxy.js +1 -1
  537. package/dist/src/subagents/tool.d.ts +1 -0
  538. package/dist/src/subagents/tool.js +1 -1
  539. package/dist/src/svelte/index.js +1 -1
  540. package/dist/src/svelte/use-eve-agent.js +1 -1
  541. package/dist/src/tools/framework/agent.js +1 -1
  542. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  543. package/dist/src/tools/provided/read-file.js +1 -1
  544. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  545. package/dist/src/tracing/agent-otel-content.d.ts +2 -0
  546. package/dist/src/tracing/agent-otel-content.js +2 -2
  547. package/dist/src/tracing/agent-otel-provider.js +1 -1
  548. package/dist/src/tracing/invoke-tool-span.d.ts +1 -0
  549. package/dist/src/vue/index.js +1 -1
  550. package/dist/src/vue/use-eve-agent.js +1 -1
  551. package/docs/channels/chat-sdk.mdx +27 -0
  552. package/docs/channels/custom.mdx +5 -2
  553. package/docs/channels/discord.mdx +22 -0
  554. package/docs/channels/mcp.mdx +102 -4
  555. package/docs/channels/slack.mdx +1 -1
  556. package/docs/connections/mcp.mdx +19 -0
  557. package/docs/evals/targets.mdx +5 -1
  558. package/docs/guides/self-modification.md +50 -3
  559. package/docs/tools/human-in-the-loop.md +14 -2
  560. package/docs/tools/workflows.mdx +6 -4
  561. package/docs/tutorial/guard-the-spend.mdx +1 -1
  562. package/package.json +46 -8
  563. package/dist/src/compiled/@workflow/core/runtime/vm-serde-bundle.generated.d.ts +0 -14
  564. package/dist/src/compiled/_chunks/workflow/dist-CaNNONeg.js +0 -3
  565. package/dist/src/compiled/_chunks/workflow/global-DKbOgrts.js +0 -1
  566. package/dist/src/compiled/_chunks/workflow/helpers-CP9TjeO8.js +0 -1
  567. package/dist/src/compiled/_chunks/workflow/logger-oqfblE3p.js +0 -14
  568. package/dist/src/compiled/_chunks/workflow/resume-hook-yq-NAdBu.js +0 -1
  569. package/dist/src/compiled/_chunks/workflow/serialization-APSKphN5.js +0 -3
  570. package/dist/src/compiled/_chunks/workflow/sleep-Ba8SExMt.js +0 -1
  571. package/dist/src/compiled/_chunks/workflow/wait-until-Dc9s3yyP.js +0 -1
  572. package/dist/src/self-modification/extension/production-registry-add.js +0 -1
  573. package/dist/src/self-modification/extension/subagents/agent/tools/publish.js +0 -1
  574. /package/dist/src/self-modification/{extension → remote}/production-registry-add.d.ts +0 -0
  575. /package/dist/src/self-modification/{extension → remote}/subagents/agent/tools/publish.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- import{assertFullSha}from"./identifiers.js";import{gitOutput,runGitCommand}from"./git.js";import{createHash}from"node:crypto";import{shellQuote}from"#shared/shell-quote.js";const MAX_PROPOSAL_CHANGED_BYTES=1e6;async function captureSelfModificationProposal(e){let t=quote(e.workspace.repositoryPath);assertFullSha(e.workspace.baseSha,`proposal base revision`),await runGitCommand(e.sandbox,`git -C ${t} add -A -- .`);let n=await gitOutput(e.sandbox,`git -C ${t} write-tree`),r=await gitOutput(e.sandbox,`git -C ${t} rev-parse ${quote(`${e.workspace.baseSha}^{tree}`)}`);assertFullSha(n,`proposal tree`),assertFullSha(r,`proposal base tree`);let i=parseRawDiff(await gitOutput(e.sandbox,`git -C ${t} diff-tree -r --no-commit-id --raw -z --no-renames ${quote(e.workspace.baseSha)} ${quote(n)}`,!1));if(i.length===0)throw Error(`Self-modification proposal contains no changes.`);if(i.length>100)throw Error(`Self-modification proposal changes ${i.length} files; limit is 100.`);let a=await selfModificationMountPaths({directory:e.workspace.directory,repositoryPath:e.workspace.repositoryPath,sandbox:e.sandbox,tree:e.workspace.baseSha}),o=await selfModificationMountPaths({directory:e.workspace.directory,repositoryPath:e.workspace.repositoryPath,sandbox:e.sandbox,tree:n}),s=[...new Set([...a,...o])],c=[],l=0;for(let t of i){let n=t.status===`D`?null:proposalMode(t.newMode,t.path),r=t.status===`D`?null:t.newObjectId;assertAllowedChange({mode:n,objectId:r,path:t.path},e.workspace.directory,s);let i=r===null?0:await blobSize(e.sandbox,e.workspace.repositoryPath,r);if(l+=i,l>MAX_PROPOSAL_CHANGED_BYTES)throw Error(`Self-modification proposal changes more than ${MAX_PROPOSAL_CHANGED_BYTES} bytes.`);c.push({bytes:i,kind:t.status===`A`?`add`:t.status===`D`?`delete`:`modify`,mode:n,objectId:r,path:t.path})}return{baseSha:e.workspace.baseSha,baseTreeSha:r,changedBytes:l,changes:c,proposedTreeSha:n}}async function readProposalBlob(e){if(e.change.objectId===null)throw Error(`Cannot read a deleted proposal blob.`);let t=await gitOutput(e.sandbox,`git -C ${quote(e.workspace.repositoryPath)} cat-file blob ${quote(e.change.objectId)} | base64 | tr -d '\\n'`),n=Buffer.from(t,`base64`),r=createHash(`sha1`).update(`blob ${n.byteLength}\0`).update(n).digest(`hex`);if(n.byteLength!==e.change.bytes||r!==e.change.objectId.toLowerCase())throw Error(`Self-modification proposal blob changed after validation: ${JSON.stringify(e.change.path)}.`);return t}function parseRawDiff(e){if(e.length===0)return[];let t=e.split(`\0`);if(t.at(-1)===``&&t.pop(),t.length%2!=0)throw Error(`Git returned malformed raw diff output.`);let n=[];for(let e=0;e<t.length;e+=2){let r=t[e],i=t[e+1],a=r===void 0?null:/^:[0-7]{6} ([0-7]{6}) [a-f0-9]{40} ([a-f0-9]{40}) ([ADM])$/u.exec(r);if(a===null||i===void 0||!isSafePath(i))throw Error(`Git returned malformed raw diff output.`);n.push({newMode:a[1],newObjectId:a[2],path:i,status:a[3]})}return n}function assertAllowedChange(e,t,n=[]){let r=e.path,i=t===`.`?``:`${t}/`,a=`${i}agent/`,o=r.split(`/`),s=o.at(-1)??``;if(!isSafePath(r)||o.includes(`.git`)||s===`.env`||s===`.envrc`||s.startsWith(`.env.`)||o.some(e=>[`node_modules`,`dist`,`build`,`.next`,`.output`,`.turbo`,`.vercel`,`coverage`,`out`].includes(e))||r.startsWith(`.github/workflows/`)||r.startsWith(`${a}subagents/self-modification/`)||r.startsWith(`${a}extensions/self-modification/`)||r===`${i}agent/extensions/self-modification.ts`||n.some(e=>r===e||r.startsWith(`${e}/`))||r===`${i}agent/extensions/selfmod.ts`||r===`${i}agent/self-modification.config.ts`)throw Error(`Self-modification proposal changes a protected path: ${JSON.stringify(r)}.`)}async function selfModificationMountPaths(e){let t=`${e.directory===`.`?``:`${e.directory}/`}agent/extensions`,n=await gitOutput(e.sandbox,`git -C ${quote(e.repositoryPath)} grep -l -z -F -- "eve/self-modification" ${quote(e.tree)} -- ${quote(t)}`,!1).catch(e=>{if(e instanceof Error&&e.message.includes(`failed with exit 1:`))return``;throw e});return[...new Set(n.split(`\0`).filter(Boolean).flatMap(e=>{let n=e.slice(e.indexOf(`:`)+1);if(!n.startsWith(`${t}/`))return[];let r=n.slice(t.length+1);return r.endsWith(`/extension.ts`)?[`${t}/${r.slice(0,-13)}`]:r.includes(`/`)?[`${t}/${r.split(`/`)[0]}`]:[n]}))]}function isSafePath(e){return e.length>0&&!e.startsWith(`/`)&&!e.includes(`\\`)&&!e.includes(`
1
+ import{gitOutput,runGitCommand}from"./git.js";import{assertFullSha}from"./identifiers.js";import{createHash}from"node:crypto";import{shellQuote}from"#shared/shell-quote.js";const MAX_PROPOSAL_CHANGED_BYTES=1e6;async function captureSelfModificationProposal(e){let t=quote(e.workspace.repositoryPath);assertFullSha(e.workspace.baseSha,`proposal base revision`),await runGitCommand(e.sandbox,`git -C ${t} add -A -- .`);let n=await gitOutput(e.sandbox,`git -C ${t} write-tree`),r=await gitOutput(e.sandbox,`git -C ${t} rev-parse ${quote(`${e.workspace.baseSha}^{tree}`)}`);assertFullSha(n,`proposal tree`),assertFullSha(r,`proposal base tree`);let i=parseRawDiff(await gitOutput(e.sandbox,`git -C ${t} diff-tree -r --no-commit-id --raw -z --no-renames ${quote(e.workspace.baseSha)} ${quote(n)}`,!1));if(i.length===0)throw Error(`Self-modification proposal contains no changes.`);if(i.length>100)throw Error(`Self-modification proposal changes ${i.length} files; limit is 100.`);let a=await selfModificationMountPaths({directory:e.workspace.directory,repositoryPath:e.workspace.repositoryPath,sandbox:e.sandbox,tree:e.workspace.baseSha}),o=await selfModificationMountPaths({directory:e.workspace.directory,repositoryPath:e.workspace.repositoryPath,sandbox:e.sandbox,tree:n}),s=[...new Set([...a,...o])],c=[],l=0;for(let t of i){let n=t.status===`D`?null:proposalMode(t.newMode,t.path),r=t.status===`D`?null:t.newObjectId;assertAllowedChange({mode:n,objectId:r,path:t.path},e.workspace.directory,s);let i=r===null?0:await blobSize(e.sandbox,e.workspace.repositoryPath,r);if(l+=i,l>MAX_PROPOSAL_CHANGED_BYTES)throw Error(`Self-modification proposal changes more than ${MAX_PROPOSAL_CHANGED_BYTES} bytes.`);c.push({bytes:i,kind:t.status===`A`?`add`:t.status===`D`?`delete`:`modify`,mode:n,objectId:r,path:t.path})}return{baseSha:e.workspace.baseSha,baseTreeSha:r,changedBytes:l,changes:c,proposedTreeSha:n}}async function readProposalBlob(e){if(e.change.objectId===null)throw Error(`Cannot read a deleted proposal blob.`);let t=await gitOutput(e.sandbox,`git -C ${quote(e.workspace.repositoryPath)} cat-file blob ${quote(e.change.objectId)} | base64 | tr -d '\\n'`),n=Buffer.from(t,`base64`),r=createHash(`sha1`).update(`blob ${n.byteLength}\0`).update(n).digest(`hex`);if(n.byteLength!==e.change.bytes||r!==e.change.objectId.toLowerCase())throw Error(`Self-modification proposal blob changed after validation: ${JSON.stringify(e.change.path)}.`);return t}function parseRawDiff(e){if(e.length===0)return[];let t=e.split(`\0`);if(t.at(-1)===``&&t.pop(),t.length%2!=0)throw Error(`Git returned malformed raw diff output.`);let n=[];for(let e=0;e<t.length;e+=2){let r=t[e],i=t[e+1],a=r===void 0?null:/^:[0-7]{6} ([0-7]{6}) [a-f0-9]{40} ([a-f0-9]{40}) ([ADM])$/u.exec(r);if(a===null||i===void 0||!isSafePath(i))throw Error(`Git returned malformed raw diff output.`);n.push({newMode:a[1],newObjectId:a[2],path:i,status:a[3]})}return n}function assertAllowedChange(e,t,n=[]){let r=e.path,i=t===`.`?``:`${t}/`,a=`${i}agent/`,o=r.split(`/`),s=o.at(-1)??``;if(!isSafePath(r)||o.includes(`.git`)||s===`.env`||s===`.envrc`||s.startsWith(`.env.`)||o.some(e=>[`node_modules`,`dist`,`build`,`.next`,`.output`,`.turbo`,`.vercel`,`coverage`,`out`].includes(e))||r.startsWith(`.github/workflows/`)||r.startsWith(`${a}subagents/self-modification/`)||r.startsWith(`${a}extensions/self-modification/`)||r===`${i}agent/extensions/self-modification.ts`||n.some(e=>r===e||r.startsWith(`${e}/`))||r===`${i}agent/extensions/selfmod.ts`||r===`${i}agent/self-modification.config.ts`)throw Error(`Self-modification proposal changes a protected path: ${JSON.stringify(r)}.`)}async function selfModificationMountPaths(e){let t=`${e.directory===`.`?``:`${e.directory}/`}agent/extensions`,n=await gitOutput(e.sandbox,`git -C ${quote(e.repositoryPath)} grep -l -z -F -- "eve/self-modification" ${quote(e.tree)} -- ${quote(t)}`,!1).catch(e=>{if(e instanceof Error&&e.message.includes(`failed with exit 1:`))return``;throw e});return[...new Set(n.split(`\0`).filter(Boolean).flatMap(e=>{let n=e.slice(e.indexOf(`:`)+1);if(!n.startsWith(`${t}/`))return[];let r=n.slice(t.length+1);return r.endsWith(`/extension.ts`)?[`${t}/${r.slice(0,-13)}`]:r.includes(`/`)?[`${t}/${r.split(`/`)[0]}`]:[n]}))]}function isSafePath(e){return e.length>0&&!e.startsWith(`/`)&&!e.includes(`\\`)&&!e.includes(`
2
2
  `)&&!e.includes(`\r`)&&!e.split(`/`).some(e=>e===``||e===`.`||e===`..`)}function proposalMode(e,t){if(e===`100644`||e===`100755`)return e;throw Error(`Self-modification proposal uses unsafe Git mode ${e}: ${JSON.stringify(t)}.`)}async function blobSize(e,t,n){assertFullSha(n,`proposal blob`);let r=await gitOutput(e,`git -C ${quote(t)} cat-file -s ${quote(n)}`);if(!/^\d+$/u.test(r)||!Number.isSafeInteger(Number(r)))throw Error(`Git returned an invalid blob size.`);return Number(r)}function quote(e){return shellQuote(e)}export{assertAllowedChange,captureSelfModificationProposal,parseRawDiff,readProposalBlob};
@@ -0,0 +1,20 @@
1
+ import { z } from "#compiled/zod/index.js";
2
+ import type { AgentReasoningDefinition, AgentStaticModelDefinition } from "#public/index.js";
3
+ import type { GitHubCredentialProvider, SelfModificationAuthorization } from "./config.js";
4
+ export declare const deployedSelfModificationConfigSchema: z.ZodObject<{
5
+ model: z.ZodOptional<z.ZodCustom<AgentStaticModelDefinition, AgentStaticModelDefinition>>;
6
+ reasoning: z.ZodOptional<z.ZodCustom<AgentReasoningDefinition, AgentReasoningDefinition>>;
7
+ credentials: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
8
+ pat: z.ZodLiteral<true>;
9
+ }, z.core.$strip>, z.ZodCustom<GitHubCredentialProvider, GitHubCredentialProvider>]>>;
10
+ source: z.ZodObject<{
11
+ git: z.ZodObject<{
12
+ directory: z.ZodString;
13
+ repository: z.ZodString;
14
+ }, z.core.$strip>;
15
+ }, z.core.$strip>;
16
+ target: z.ZodObject<{
17
+ branch: z.ZodString;
18
+ }, z.core.$strip>;
19
+ authorize: z.ZodCustom<SelfModificationAuthorization, SelfModificationAuthorization>;
20
+ }, z.core.$strict>;
@@ -0,0 +1 @@
1
+ import{z}from"#compiled/zod/index.js";import{isAgentReasoningDefinition,isRuntimeLanguageModel}from"#internal/runtime-model.js";const deployedSelfModificationConfigSchema=z.object({model:z.custom(e=>typeof e==`string`||isRuntimeLanguageModel(e)).optional(),reasoning:z.custom(isAgentReasoningDefinition).optional(),credentials:z.union([z.object({pat:z.literal(!0)}),z.custom(e=>typeof e==`object`&&!!e&&`resolve`in e&&typeof e.resolve==`function`)]).optional(),source:z.object({git:z.object({directory:z.string(),repository:z.string()})}),target:z.object({branch:z.string()}),authorize:z.custom(e=>typeof e==`function`)}).strict();export{deployedSelfModificationConfigSchema};
@@ -0,0 +1,66 @@
1
+ import type { SessionAuthContext } from "#channel/types.js";
2
+ import type { AgentReasoningDefinition, AgentStaticModelDefinition } from "#public/index.js";
3
+ /** Principal and channel that requested a deployed source modification. */
4
+ export interface SelfModificationAuthorizationContext {
5
+ readonly channel: {
6
+ /** Channel adapter family, such as `"slack"` or `"http"`. */
7
+ readonly kind?: string;
8
+ readonly metadata?: Readonly<Record<string, unknown>>;
9
+ };
10
+ readonly principal: SessionAuthContext | null;
11
+ }
12
+ /** Decides whether a principal may use deployed self-modification. */
13
+ export type SelfModificationAuthorization = (context: SelfModificationAuthorizationContext) => boolean | Promise<boolean>;
14
+ export interface GitHubRepository {
15
+ readonly owner: string;
16
+ readonly repo: string;
17
+ }
18
+ export type GitHubCredentialCapability = "checkout" | "publish";
19
+ export interface GitHubCredentialRequest {
20
+ readonly capability: GitHubCredentialCapability;
21
+ readonly repository: GitHubRepository;
22
+ }
23
+ /** Application-supplied GitHub credentials for deployed self-modification. */
24
+ export interface GitHubCredentialProvider {
25
+ resolve(request: GitHubCredentialRequest): Promise<string>;
26
+ }
27
+ /** Values accepted by the `eve/self-modification/remote` extension mount. */
28
+ export interface DeployedSelfModificationConfig {
29
+ readonly source: {
30
+ readonly git: {
31
+ /** GitHub repository in github.com/owner/repository form. */
32
+ readonly repository: string;
33
+ /** Application directory relative to the repository root. */
34
+ readonly directory: string;
35
+ };
36
+ };
37
+ readonly target: {
38
+ readonly branch: string;
39
+ };
40
+ /** Fail-closed policy for principals that may create draft proposals. */
41
+ readonly authorize: SelfModificationAuthorization;
42
+ readonly credentials?: GitHubCredentialProvider | {
43
+ /**
44
+ * Self-hosted exception. Reads `EVE_SELF_MODIFICATION_GITHUB_TOKEN` from
45
+ * the trusted deployment environment; never injects it into the sandbox.
46
+ */
47
+ readonly pat: true;
48
+ };
49
+ /** Model used by the deployed self-modification subagent; defaults to the parent model. */
50
+ readonly model?: AgentStaticModelDefinition;
51
+ readonly reasoning?: AgentReasoningDefinition;
52
+ }
53
+ export interface ResolvedDeployedSelfModificationConfig {
54
+ readonly authorize: SelfModificationAuthorization;
55
+ readonly credentials: ResolvedGitHubCredentials;
56
+ readonly directory: string;
57
+ readonly repository: GitHubRepository;
58
+ readonly targetBranch: string;
59
+ }
60
+ export type ResolvedGitHubCredentials = {
61
+ readonly kind: "pat";
62
+ } | {
63
+ readonly kind: "provider";
64
+ readonly provider: GitHubCredentialProvider;
65
+ };
66
+ export declare function resolveDeployedSelfModificationConfig(config: DeployedSelfModificationConfig): ResolvedDeployedSelfModificationConfig;
@@ -0,0 +1 @@
1
+ import{assertGitRef,assertRepositoryPart}from"../identifiers.js";function resolveDeployedSelfModificationConfig(e){if(!isRecord(e))throw Error(`Deployed self-modification configuration must be an object.`);let{source:t,target:n,authorize:r,credentials:i}=e;if(t===void 0||n===void 0||r===void 0)throw Error(`Deployed self-modification requires source, target, and authorization configuration.`);if(!isRecord(t))throw Error(`Deployed self-modification source must be an object.`);if(!isRecord(t.git))throw Error(`Deployed self-modification source.git must be an object.`);if(!isRecord(n))throw Error(`Deployed self-modification target must be an object.`);if(typeof r!=`function`)throw Error(`Deployed self-modification authorize must be a function.`);let{git:a}=t;if(typeof a.repository!=`string`||typeof a.directory!=`string`)throw Error(`Deployed self-modification source.git.repository and source.git.directory must be strings.`);if(typeof n.branch!=`string`)throw Error(`Deployed self-modification target.branch must be a string.`);return{authorize:r,credentials:parseCredentials(i),directory:parseDirectory(a.directory),repository:parseGitHubRepository(a.repository),targetBranch:parseBranch(n.branch)}}function parseCredentials(e){if(!isRecord(e))throw Error(`Deployed self-modification credentials must explicitly configure a credential provider or the self-hosted PAT exception.`);let t=e.resolve!==void 0,n=e.pat!==void 0;if(t&&n)throw Error(`Deployed self-modification credentials must configure either a credential provider or pat, not both.`);if(n){if(e.pat!==!0)throw Error(`Deployed self-modification credentials.pat must be true.`);return{kind:`pat`}}if(!isGitHubCredentialProvider(e))throw Error(`Deployed self-modification credentials must be an object with a resolve function.`);return{kind:`provider`,provider:e}}function isGitHubCredentialProvider(e){return isRecord(e)&&typeof e.resolve==`function`}function parseGitHubRepository(e){let t=/^github\.com\/([^/]+)\/([^/]+)$/u.exec(e);if(t?.[1]===void 0||t[2]===void 0)throw Error(`Deployed self-modification source.git.repository must use github.com/owner/repo form.`);return assertRepositoryPart(t[1],`repository owner`),assertRepositoryPart(t[2],`repository name`),{owner:t[1],repo:t[2]}}function parseDirectory(e){if(e!==`.`&&(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||e.split(`/`).some(e=>e===``||e===`.`||e===`..`)))throw Error(`Deployed self-modification source.git.directory must be a safe repository-relative path.`);return e}function parseBranch(e){if(assertGitRef(e,`target branch`),e.startsWith(`refs/`))throw Error(`Deployed self-modification target.branch must be a branch name, not a full Git ref.`);return e}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{resolveDeployedSelfModificationConfig};
@@ -0,0 +1,5 @@
1
+ import type { StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
2
+ import type { DeployedSelfModificationConfig } from "./config.js";
3
+ /** Deployed self-modification mount; independent of the local development extension. */
4
+ declare const _default: import("eve/extension").ExtensionHandle<StandardSchemaV1<DeployedSelfModificationConfig, DeployedSelfModificationConfig>>;
5
+ export default _default;
@@ -0,0 +1 @@
1
+ import{deployedSelfModificationConfigSchema}from"./config-schema.js";import{defineExtension}from"eve/extension";var extension_default=defineExtension({config:deployedSelfModificationConfigSchema});export{extension_default as default};
@@ -0,0 +1 @@
1
+ import{gitOutput,runGitCommand}from"../git.js";import{assertFullSha}from"../identifiers.js";import{readTerminalHeadlessEvent}from"../extension/eve-add.js";import{shellQuote}from"#shared/shell-quote.js";const OFFICIAL_ADDRESS=/^(?:(?:channel|connection|extension|instrumentation)\/)?[a-z0-9][a-z0-9._-]*$/u;function assertOfficialRegistryAddress(e){if(!OFFICIAL_ADDRESS.test(e))throw Error(`Production registry installation requires an exact official eve registry address.`)}async function installProductionRegistryItem(e){assertOfficialRegistryAddress(e.address);let t=e.workspace.directory===`.`?e.workspace.repositoryPath:`${e.workspace.repositoryPath}/${e.workspace.directory}`,n=await locatePackageManagerRoot(e.sandbox,t,e.workspace.repositoryPath,e.signal);if(n===void 0)return{kind:`failed`,message:`The proposal checkout has no supported lockfile.`};if(!await runChecked(e.sandbox,`mkdir -p ${quote(`${e.workspace.repositoryPath}/.git/info`)} && printf '\\nnode_modules/\\n**/node_modules/\\n' >> ${quote(`${e.workspace.repositoryPath}/.git/info/exclude`)}`,e.signal)||!await runChecked(e.sandbox,bootstrapCommand(n),e.signal))return{kind:`failed`,message:`Could not prepare the proposal checkout's locked dependencies.`};let r=await locateEveExecutable(e.sandbox,t,n.root,e.signal);if(r===void 0)return{kind:`failed`,message:`The proposal checkout's locked dependencies do not provide the eve CLI.`};let i=await captureTree(e.sandbox,e.workspace.repositoryPath);if(e.answers!==void 0){if(e.installed!==!0)return{kind:`failed`,message:`Setup answers require a prior installed input-required result.`};let n;try{n=await e.sandbox.run({abortSignal:e.signal,command:isolatedCommand(t,`${quote(r)} add ${quote(e.address)} --non-interactive --skip-install`)})}finally{await restoreTree(e.sandbox,e.workspace.repositoryPath,i)}let a=readTerminalHeadlessEvent(`${String(n.stdout??``)}\n${String(n.stderr??``)}`);if(a?.type!==`blocked`||a.item!==e.address)return{kind:`failed`,message:`Setup continuation is no longer waiting for a validated question.`};let o=setupQuestion(a.question);if(o===void 0)return{kind:`failed`,message:`Registry setup returned an invalid continuation question.`};if(o.kind===`environment`)return{kind:`input-required`,installed:!0,question:a.question};if(!acceptsNonSecretSetupAnswers(o,e.answers))return{kind:`failed`,message:`Setup answers must contain only the current non-secret question.`}}let a=Object.entries(e.answers??{}).flatMap(([e,t])=>[`--answer`,`${e}=${JSON.stringify(t)}`]);try{let n=`${quote(r)} add ${quote(e.address)} --non-interactive ${e.installed===!0?`--skip-install `:``}${a.map(quote).join(` `)}`,o=await e.sandbox.run({abortSignal:e.signal,command:isolatedCommand(t,n)}),s=readTerminalHeadlessEvent(`${String(o.stdout??``)}\n${String(o.stderr??``)}`);if(s?.type===`completed`&&s.item===e.address&&o.exitCode===0){let t=await captureTree(e.sandbox,e.workspace.repositoryPath);return{kind:`completed`,changedPaths:await changedPaths(e.sandbox,e.workspace.repositoryPath,i,t),completedItems:s.completedItems?.filter(e=>OFFICIAL_ADDRESS.test(e))??[],deploymentRequired:s.deploymentRequired===!0}}if(s?.type===`blocked`&&s.item===e.address)return{kind:`input-required`,installed:s.installed===!0,question:s.question??s};if(s?.type===`external_action`&&typeof s.url==`string`&&typeof s.message==`string`){let t={kind:`external-action-required`,installed:e.installed===!0,message:s.message,url:s.url};return typeof s.userCode==`string`&&(t.userCode=s.userCode),t}return await restoreTree(e.sandbox,e.workspace.repositoryPath,i),s?.type===`cancelled`||e.signal?.aborted===!0?{kind:`cancelled`,message:`Installing ${e.address} was cancelled.`}:{kind:`failed`,message:`Installing ${e.address} failed.`}}catch(t){throw await restoreTree(e.sandbox,e.workspace.repositoryPath,i),t}}function acceptsNonSecretSetupAnswers(e,t){return e.kind!==`environment`&&Object.keys(t).length===1&&t[e.key]!==void 0}function setupQuestion(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e;if(typeof t.key==`string`&&t.key.length!==0&&typeof t.kind==`string`)return{key:t.key,kind:t.sensitive===!0?`environment`:t.kind}}async function locatePackageManagerRoot(e,t,n,r){let i=await e.run({abortSignal:r,command:`root=${quote(t)}; repository=${quote(n)}; while :; do if test -f "$root/pnpm-lock.yaml"; then printf 'pnpm\\t%s' "$root"; exit 0; fi; if test -f "$root/package-lock.json"; then printf 'npm\\t%s' "$root"; exit 0; fi; test "$root" = "$repository" && exit 0; root=\${root%/*}; done`});if(i.exitCode!==0)throw Error(`Could not inspect the proposal package workspace.`);let a=/^(pnpm|npm)\t([^\n]+)$/u.exec(String(i.stdout??``));if(a===null)return;let o=a[2];if(o!==n&&!o.startsWith(`${n}/`))throw Error(`Package manager root escaped the proposal repository.`);return{kind:a[1],root:o}}function bootstrapCommand(e){return isolatedCommand(e.root,e.kind===`pnpm`?`corepack pnpm --dir ${quote(e.root)} install --frozen-lockfile --ignore-scripts`:`npm ci --prefix ${quote(e.root)} --ignore-scripts`)}async function locateEveExecutable(e,t,n,r){let i=[`${t}/node_modules/.bin/eve`,`${n}/node_modules/.bin/eve`],a=await e.run({abortSignal:r,command:`for executable in ${i.map(quote).join(` `)}; do if test -x "$executable"; then printf '%s' "$executable"; exit 0; fi; done`});if(a.exitCode!==0)throw Error(`Could not inspect the checkout's eve executable.`);return i.includes(String(a.stdout??``))?String(a.stdout):void 0}async function captureTree(e,t){await runGitCommand(e,`git -C ${quote(t)} add -A -- .`);let n=await gitOutput(e,`git -C ${quote(t)} write-tree`);return assertFullSha(n,`registry tree`),n}async function restoreTree(e,t,n){await runGitCommand(e,`git -C ${quote(t)} read-tree --reset -u ${quote(n)}`),await runGitCommand(e,`git -C ${quote(t)} clean -fd -- .`)}async function changedPaths(e,t,n,r){return(await gitOutput(e,`git -C ${quote(t)} diff-tree -r --no-commit-id --name-only -z ${quote(n)} ${quote(r)}`,!1)).split(`\0`).filter(e=>e.length>0)}async function runChecked(e,t,n){return(await e.run({abortSignal:n,command:t})).exitCode===0}function isolatedCommand(e,t){return`env -i HOME=/tmp/eve-selfmod-home PATH=/usr/local/bin:/usr/bin:/bin CI=1 npm_config_ignore_scripts=true sh -c ${quote(`cd ${quote(e)} && ${t}`)}`}function quote(e){return shellQuote(e)}export{acceptsNonSecretSetupAnswers,assertOfficialRegistryAddress,bootstrapCommand,installProductionRegistryItem,locatePackageManagerRoot};
@@ -0,0 +1,4 @@
1
+ import { type DynamicSentinel, type DynamicSubagentDefinition } from "eve";
2
+ /** Offers the deployed self-modification child only to authorized principals outside `eve dev`. */
3
+ declare const deployedSelfModificationAgent: DynamicSentinel<DynamicSubagentDefinition | null>;
4
+ export default deployedSelfModificationAgent;
@@ -0,0 +1 @@
1
+ import{hasGitHubCredential}from"../../../credentials.js";import{isDeployedRuntime}from"../../../mode.js";import{resolveDeployedSelfModificationConfig}from"../../config.js";import{followUpDelegation,namedInstallationDelegation,persistenceDelegation,renderDescription,repairDelegation,sourceDelegation}from"../../../subagent-guidance.js";import extension_default from"../../extension.js";import{DEFAULT_AGENT_MODEL_ID,DEFAULT_AGENT_REASONING}from"#shared/default-agent-model.js";import{defineAgent,defineDynamic}from"eve";const description=renderDescription([`Delegate here immediately when the user asks to change this eve agent or its authored source.`,sourceDelegation,persistenceDelegation,namedInstallationDelegation,`Delegate requests to add integrations, channels, connections, or capabilities: the subagent searches the official eve registry and can install source changes into the draft proposal. Setup may require non-secret answers or an external action, and secret binding remains separate.`,followUpDelegation,repairDelegation,`Source edits do not affect the caller’s current turn. The subagent can publish only a draft pull request, and changes become effective only after review, merge, and redeployment.`]),resolve=async(e,t)=>{if(!isDeployedRuntime())return null;let n=extension_default.config,r=resolveDeployedSelfModificationConfig(n);if(r.credentials.kind===`pat`&&!hasGitHubCredential())return null;try{if(!await r.authorize({channel:t.channel,principal:t.session.auth.current}))return null}catch{return null}let i=n.model??t.model?.id;return defineAgent({description,model:i??DEFAULT_AGENT_MODEL_ID,reasoning:n.reasoning??(i===void 0?DEFAULT_AGENT_REASONING:void 0)})},deployedSelfModificationAgent=defineDynamic({events:{"session.started":resolve,"turn.started":resolve}});export{deployedSelfModificationAgent as default};
@@ -0,0 +1,2 @@
1
+ declare const _default: import("eve/instructions").DynamicSentinel<import("eve/instructions").DynamicInstructionsResult>;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import{isDeployedRuntime}from"../../../mode.js";import{documentationInstructions,registryWorkflowInstructions,renderInstructions,roleInstructions,sourceEditingInstructions,sourceWorkspaceInstructions,toolAuthoringInstructions,workingInstructions}from"../../../subagent-guidance.js";import{defineDynamic,defineInstructions}from"eve/instructions";var instructions_default=defineDynamic({events:{"session.started":()=>isDeployedRuntime()?defineInstructions({markdown:renderInstructions([roleInstructions,sourceWorkspaceInstructions,sourceEditingInstructions,toolAuthoringInstructions,registryWorkflowInstructions,documentationInstructions,"## Deployed environment\n\nThe registry_add tool may return `completed`, `input-required`, `external-action-required`, `cancelled`, or `failed`. Supply only non-secret structured answers when continuing an `input-required` setup; set `installed: true` so the continuation does not reinstall source. Never request, accept, or repeat secret values. External authorization and secret binding are incomplete follow-up boundaries, not evidence that an integration is active.\n\nThe configured target branch is checked out as a disposable workspace under /workspace/repository. Make ordinary changes through /source, which is the writable view of the configured application's agent/ directory. Publication validates the final repository snapshot, including registry, manifest, and lockfile changes. Never modify Git refs, access GitHub directly, or use shell commands to write files. The sandbox has no reusable GitHub credential after checkout.\n\nComplete all edits and registry installations before publication, and call publish by itself. Before publication, review and summarize the complete intended scope. Call publish once with a concise title and summary. A successful result is only a draft pull request. Return its URL and changed paths, and state that merge and deployment have not occurred.",workingInstructions,`## Report results
2
+
3
+ For source-modification tasks, return a concise handoff to the caller. Use at most four short bullets covering changed paths and behavior, and any required setup or unresolved issues. Include the draft pull request URL if one was published.
4
+
5
+ For investigation tasks, report the findings and supporting evidence requested by the caller.`])}):null}});export{instructions_default as default};
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../../../shared/sandbox-environment.ts").SandboxSelector;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineDeployedSelfModificationSandbox}from"../../../deployed-sandbox.js";import extension_default from"../../extension.js";var sandbox_default=defineDeployedSelfModificationSandbox(extension_default.config);export{sandbox_default as default};
@@ -0,0 +1 @@
1
+ export { default } from "../../../../extension/subagents/agent/tools/edit_file.js";
@@ -0,0 +1 @@
1
+ import edit_file_default from"../../../../extension/subagents/agent/tools/edit_file.js";export{edit_file_default as default};
@@ -0,0 +1 @@
1
+ import{createGitHubCredentialProvider}from"../../../../credentials.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{isDeployedRuntime}from"../../../../mode.js";import{resolveDeployedSelfModificationConfig}from"../../../config.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{publishGitHubDraftPullRequest}from"../../../../github-publisher.js";import extension_default from"../../../extension.js";import{defineDynamic,defineTool}from"eve/tools";const inputSchema={type:`object`,additionalProperties:!1,properties:{summary:{type:`string`,minLength:1,maxLength:1e4,description:`Concise description of the proposed agent source change.`},title:{type:`string`,minLength:1,maxLength:256,description:`Concise draft pull request title.`}},required:[`summary`,`title`]},outputSchema={type:`object`,additionalProperties:!1,properties:{branch:{type:`string`},changedPaths:{type:`array`,items:{type:`string`}},commitSha:{type:`string`},deployed:{type:`boolean`,const:!1},draft:{type:`boolean`,const:!0},merged:{type:`boolean`,const:!1},pullRequestUrl:{type:`string`},repository:{type:`string`},targetBranch:{type:`string`}},required:[`branch`,`changedPaths`,`commitSha`,`deployed`,`draft`,`merged`,`pullRequestUrl`,`repository`,`targetBranch`]};function resolveTool(){return isDeployedRuntime()?defineTool({description:`Publish the complete validated agent source change as one draft pull request. Merge and deployment do not occur.`,inputSchema,outputSchema,execute:publish}):null}async function publish(e,t){if(typeof e!=`object`||!e||!(`summary`in e)||typeof e.summary!=`string`||e.summary.trim().length===0||!(`title`in e)||typeof e.title!=`string`||e.title.trim().length===0)throw Error(`Production publication requires a valid title and summary.`);if(!isDeployedRuntime())throw Error(`Production publication is unavailable during eve dev.`);let n=resolveDeployedSelfModificationConfig(extension_default.config),r=e.summary,i=e.title,a=publicationOperationId(t),o=await t.getSandbox();return await withSelfModificationWorkspaceLock(`sandbox:${t.session.id}`,async()=>{let e=await readPreparedSelfModificationWorkspace({...n,sandbox:o});return await publishGitHubDraftPullRequest({credentialProvider:createGitHubCredentialProvider(n.credentials),description:r,operationId:a,sandbox:o,title:i,workspace:e})})}function publicationOperationId(e){let t=e.session.parent;if(t===void 0)throw Error(`Production publication requires a delegated child session.`);return`${t.rootSessionId}:${t.sessionId}:${t.turn.id}:${t.callId}:${e.session.id}`}var publish_default=defineDynamic({events:{"session.started":resolveTool}});export{publish_default as default,publicationOperationId};
@@ -0,0 +1,32 @@
1
+ import { type ToolContext } from "eve/tools";
2
+ import { type ResolvedDeployedSelfModificationConfig } from "../../../config.js";
3
+ type ProductionRegistryAddResult = {
4
+ readonly address: string;
5
+ readonly status: "completed";
6
+ readonly completedItems: readonly string[];
7
+ readonly changedPaths: readonly string[];
8
+ readonly deploymentRequired: boolean;
9
+ } | {
10
+ readonly address: string;
11
+ readonly status: "input-required";
12
+ readonly installed: boolean;
13
+ readonly question: unknown;
14
+ } | {
15
+ readonly address: string;
16
+ readonly status: "external-action-required";
17
+ readonly installed: boolean;
18
+ readonly message: string;
19
+ readonly url: string;
20
+ readonly userCode?: string;
21
+ } | {
22
+ readonly address: string;
23
+ readonly status: "failed" | "cancelled";
24
+ readonly message: string;
25
+ };
26
+ export declare function productionRegistryAddTool(deployed: ResolvedDeployedSelfModificationConfig): import("eve/tools").ToolDefinition<Record<string, unknown>, ProductionRegistryAddResult> & {
27
+ execute(input: Record<string, unknown>, ctx: ToolContext): Promise<ProductionRegistryAddResult>;
28
+ };
29
+ declare const _default: import("eve/tools").DynamicSentinel<(import("eve/tools").ToolDefinition<Record<string, unknown>, ProductionRegistryAddResult> & {
30
+ execute(input: Record<string, unknown>, ctx: ToolContext): Promise<ProductionRegistryAddResult>;
31
+ }) | null>;
32
+ export default _default;
@@ -0,0 +1 @@
1
+ import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{isDeployedRuntime}from"../../../../mode.js";import{resolveDeployedSelfModificationConfig}from"../../../config.js";import{classifyCatalogEntry}from"../../../../extension/classify-registry-item.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,officialRegistryIndexUrl}from"../../../../extension/subagents/agent/tools/search_registry.js";import extension_default from"../../../extension.js";import{assertOfficialRegistryAddress,installProductionRegistryItem}from"../../../production-registry-add.js";import{defineDynamic,defineTool}from"eve/tools";const productionInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact official eve registry address, for example `channel/slack` or `extension/browserbase`."},answers:{type:`object`,additionalProperties:!0,description:`Non-secret answers to the setup question returned by the previous call.`},installed:{type:`boolean`,description:`Set to true with answers when the previous input-required result installed the source.`}},required:[`address`]},productionOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`completed`,`input-required`,`external-action-required`,`failed`,`cancelled`]},address:{type:`string`},changedPaths:{type:`array`,items:{type:`string`},description:`Repository-relative paths installed into the proposal.`},completedItems:{type:`array`,items:{type:`string`}},deploymentRequired:{type:`boolean`},installed:{type:`boolean`,description:`Whether source installation completed before setup paused.`},question:{type:`object`,additionalProperties:!0,description:`The current setup question. Supply only its non-secret answer on the next call.`},message:{type:`string`},url:{type:`string`,description:`External authorization URL the developer must open.`},userCode:{type:`string`}},required:[`status`,`address`]};async function addProductionRegistryItem(e,t,n,r){assertOfficialRegistryAddress(e);let i=(await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:officialRegistryIndexUrl()})).find(t=>t.address===e);if(i===void 0)throw Error(`No official eve registry item is published at "${e}".`);let a=classifyCatalogEntry(i);if(a.kind===`self-modification-mount`)throw Error(a.reason);let o=await t.getSandbox(),s=await withSelfModificationWorkspaceLock(`sandbox:${t.session.id}`,async()=>{let i=await readPreparedSelfModificationWorkspace({...n,sandbox:o});return await installProductionRegistryItem({address:e,answers:r.answers,installed:r.installed,sandbox:o,signal:t.abortSignal,workspace:i})});return s.kind===`completed`?{address:e,...s,status:`completed`}:s.kind===`input-required`?{address:e,...s,status:`input-required`}:s.kind===`external-action-required`?{address:e,...s,status:`external-action-required`}:{address:e,...s,status:s.kind}}function productionRegistryAddTool(e){return defineTool({description:`Install an exact item from the official eve registry into the current production change proposal. If setup pauses, call this tool again with the non-secret answers and the installed state from its result. External authorization and secret binding must be completed by the developer.`,inputSchema:productionInputSchema,outputSchema:productionOutputSchema,async execute(t,n){let{address:r}=t;if(typeof r!=`string`||r.length===0)throw Error(`address must be an exact item address from the official eve registry.`);return await addProductionRegistryItem(r,n,e,{answers:`answers`in t&&typeof t.answers==`object`&&t.answers!==null&&!Array.isArray(t.answers)?t.answers:void 0,installed:`installed`in t&&t.installed===!0})}})}var registry_add_default=defineDynamic({events:{"session.started":()=>isDeployedRuntime()?productionRegistryAddTool(resolveDeployedSelfModificationConfig(extension_default.config)):null}});export{registry_add_default as default,productionRegistryAddTool};
@@ -0,0 +1 @@
1
+ export { default } from "../../../../extension/subagents/agent/tools/search_models.js";
@@ -0,0 +1 @@
1
+ import search_models_default from"../../../../extension/subagents/agent/tools/search_models.js";export{search_models_default as default};
@@ -0,0 +1 @@
1
+ export { default } from "../../../../extension/subagents/agent/tools/search_registry.js";
@@ -0,0 +1 @@
1
+ import search_registry_default from"../../../../extension/subagents/agent/tools/search_registry.js";export{search_registry_default as default};
@@ -1,7 +1,4 @@
1
1
  import { type RuntimeSandboxSession, type SandboxSelectorContext } from "#public/definitions/sandbox.js";
2
- import { MicrosandboxSandbox } from "#sandbox/providers/microsandbox.js";
3
- import { type DefaultSandboxProbes } from "#sandbox/providers/default.js";
4
- import { VercelSandbox } from "#sandbox/providers/vercel.js";
5
2
  import { type SelfModificationConfig } from "./config.js";
6
3
  export interface SelfModificationSandboxOptions {
7
4
  readonly config?: SelfModificationConfig;
@@ -9,9 +6,7 @@ export interface SelfModificationSandboxOptions {
9
6
  export interface SelfModificationSandbox {
10
7
  (context: SandboxSelectorContext): Promise<RuntimeSandboxSession> | RuntimeSandboxSession;
11
8
  }
12
- type Probes = Pick<DefaultSandboxProbes, "isDeployedOnVercel" | "isMicrosandboxSupported">;
13
- type DeployedSelfModificationEnvironment = ReturnType<typeof MicrosandboxSandbox.environment> | ReturnType<typeof VercelSandbox.environment>;
9
+ /** Defines the local self-modification sandbox; source mounts exist only during development. */
14
10
  export declare function defineSelfModificationSandbox(options?: SelfModificationSandboxOptions): SelfModificationSandbox;
15
- export declare function selectDeployedSelfModificationEnvironment(probes: Probes): DeployedSelfModificationEnvironment;
16
11
  declare const _default: SelfModificationSandbox;
17
12
  export default _default;
@@ -1 +1 @@
1
- import{resolveSelfModificationConfig}from"./config.js";import{createGitHubCredentialProvider}from"./credentials.js";import{resolveSelfModificationMode}from"./mode.js";import{SELF_MODIFICATION_BASELINE_NETWORK_POLICY}from"./network-policy.js";import{REPOSITORY_PATH,prepareSelfModificationWorkspace}from"./git-workspace.js";import{createSelfModificationFilesystem}from"./filesystem.js";import{bindSandboxEnvironment}from"#shared/sandbox-environment.js";import{shellQuote}from"#shared/shell-quote.js";import{defineSandbox}from"#public/definitions/sandbox.js";import{SANDBOX_PROVIDER_PROBES}from"#sandbox/providers/default.js";import{JustBashSandbox}from"#sandbox/providers/just-bash.js";import{MicrosandboxSandbox}from"#sandbox/providers/microsandbox.js";import{VercelSandbox}from"#sandbox/providers/vercel.js";function defineSelfModificationSandbox(e={}){let t=resolveSelfModificationConfig(e.config),n=resolveSelfModificationMode(t);if(n!==`deployed`){let e=n===`local`?JustBashSandbox.environment({filesystem:createSelfModificationFilesystem}):JustBashSandbox.environment();return bindSandboxEnvironment(defineSandbox(()=>e.open()),e)}let r=selectDeployedSelfModificationEnvironment(SANDBOX_PROVIDER_PROBES);return bindSandboxEnvironment(defineSandbox(async({session:e})=>{let n=await r.open({networkPolicy:SELF_MODIFICATION_BASELINE_NETWORK_POLICY});if(t.deployed===void 0)return n;if(e.parent===void 0)throw Error(`Production self-modification requires a child session.`);if(n.setNetworkPolicy===void 0)throw Error(`Production self-modification requires mutable sandbox network policy.`);let i={...n,setNetworkPolicy:n.setNetworkPolicy},a=t.deployed,o=await createGitHubCredentialProvider(a.credentials).resolve({capability:`checkout`,repository:a.repository});await prepareSelfModificationWorkspace({directory:a.directory,repository:a.repository,sandbox:i,targetBranch:a.targetBranch,token:o});let s=a.directory===`.`?REPOSITORY_PATH:`${REPOSITORY_PATH}/${a.directory}`;if((await n.run({command:`rm -rf /source && ln -s ${shellQuote(`${s}/agent`)} /source`})).exitCode!==0)throw Error(`Self-modification could not mount the agent source.`);return n}),r)}function selectDeployedSelfModificationEnvironment(e){if(e.isDeployedOnVercel())return VercelSandbox.environment();if(e.isMicrosandboxSupported())return MicrosandboxSandbox.environment();throw Error(`Deployed self-modification requires runtime credential transforms. No supported provider is available. Use Vercel Sandbox or microsandbox on a supported self-hosted system.`)}var sandbox_default=defineSelfModificationSandbox();export{sandbox_default as default,defineSelfModificationSandbox,selectDeployedSelfModificationEnvironment};
1
+ import{resolveSelfModificationConfig}from"./config.js";import{isLocalSelfModificationEnabled}from"./mode.js";import{createSelfModificationFilesystem}from"./filesystem.js";import{bindSandboxEnvironment}from"#shared/sandbox-environment.js";import{defineSandbox}from"#public/definitions/sandbox.js";import{JustBashSandbox}from"#sandbox/providers/just-bash.js";function defineSelfModificationSandbox(e={}){let t=isLocalSelfModificationEnabled(resolveSelfModificationConfig(e.config))?JustBashSandbox.environment({filesystem:createSelfModificationFilesystem}):JustBashSandbox.environment();return bindSandboxEnvironment(defineSandbox(()=>t.open()),t)}var sandbox_default=defineSelfModificationSandbox();export{sandbox_default as default,defineSelfModificationSandbox};
@@ -1,4 +1,4 @@
1
- function renderLocalSelfModificationExtension(){return`import selfModification from "eve/self-modification";
1
+ function renderLocalSelfModificationExtension(){return`import selfModification from "eve/self-modification/local";
2
2
 
3
3
  export default selfModification({
4
4
  // model: "provider/model",
@@ -1,6 +1,8 @@
1
1
  import { relative } from "node:path";
2
2
  import { captureVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";
3
3
  import type { VercelProjectReference } from "#setup/project-resolution.js";
4
+ export declare const SELF_MODIFICATION_CONFIG_PATH = "agent/extensions/self-modification/extension.ts";
5
+ export declare const DEPLOYED_SELF_MODIFICATION_CONFIG_PATH = "agent/extensions/self-modification-remote/extension.ts";
4
6
  export interface SelfModificationSetupValues {
5
7
  readonly branch: string;
6
8
  readonly channelNames: readonly string[];
@@ -21,7 +23,11 @@ export interface SelfModificationSetupOperations {
21
23
  detectChannelNames(): Promise<readonly string[]>;
22
24
  detectGitRepository(): Promise<DetectedGitRepository>;
23
25
  findOrCreateConnector(name: string, project: VercelProjectReference): Promise<string>;
26
+ /** Reads the deployed mount at {@link DEPLOYED_SELF_MODIFICATION_CONFIG_PATH}. */
24
27
  readConfig(): Promise<string | undefined>;
28
+ /** Reads the local mount at {@link SELF_MODIFICATION_CONFIG_PATH}. */
29
+ readLocalConfig(): Promise<string | undefined>;
30
+ /** Writes the deployed mount at {@link DEPLOYED_SELF_MODIFICATION_CONFIG_PATH}. */
25
31
  writeConfig(source: string): Promise<void>;
26
32
  }
27
33
  export interface SelfModificationSetupDependencies {
@@ -1,62 +1,60 @@
1
- import{renderLocalSelfModificationExtension}from"./scaffold.js";import{SELF_MODIFICATION_CONFIG_PATH}from"./git-workspace.js";import{createHash}from"node:crypto";import{mkdir,readFile,writeFile}from"node:fs/promises";import{join,relative}from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{captureVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{discoverAgent}from"#discover/discover-agent.js";const runFile=promisify(execFile),DEFAULT_EXTENSION=renderLocalSelfModificationExtension(),defaultDependencies={captureVercel,runVercelCaptureStdout};function connectorName(e,t){return`selfmod-${e}-${t}`.toLowerCase().replaceAll(/[^a-z0-9-]/gu,`-`)}function renderSelfModificationConfig(e){if(e===void 0)return DEFAULT_EXTENSION;let t=[...new Set(e.channelNames)].filter(e=>e!==`eve`).sort(),n=(e.vercelBackend?t:[]).map(e=>` case ${JSON.stringify(`channel:${e}`)}:
1
+ import{renderLocalSelfModificationExtension}from"./scaffold.js";import{createHash}from"node:crypto";import{mkdir,readFile,writeFile}from"node:fs/promises";import{join,relative}from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{captureVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{discoverAgent}from"#discover/discover-agent.js";const SELF_MODIFICATION_CONFIG_PATH=`agent/extensions/self-modification/extension.ts`,DEPLOYED_SELF_MODIFICATION_CONFIG_PATH=`agent/extensions/self-modification-remote/extension.ts`,runFile=promisify(execFile),DEFAULT_EXTENSION=renderLocalSelfModificationExtension(),LEGACY_DEFAULT_EXTENSION=DEFAULT_EXTENSION.replace(`"eve/self-modification/local"`,`"eve/self-modification"`),defaultDependencies={captureVercel,runVercelCaptureStdout};function connectorName(e,t){return`selfmod-${e}-${t}`.toLowerCase().replaceAll(/[^a-z0-9-]/gu,`-`)}function renderSelfModificationConfig(e){if(e===void 0)return DEFAULT_EXTENSION;let t=[...new Set(e.channelNames)].filter(e=>e!==`eve`).sort(),n=(e.vercelBackend?t:[]).map(e=>` case ${JSON.stringify(`channel:${e}`)}:
2
2
  // Authorize trusted principals for this channel before returning true.
3
3
  return false;`).join(`
4
- `),r=`${e.vercelBackend?` case "http": {
5
- const projectId = process.env.VERCEL_PROJECT_ID;
6
- return (
7
- projectId !== undefined &&
8
- projectId.length > 0 &&
9
- principal?.authenticator === "oidc" &&
10
- (principal.issuer === "https://oidc.vercel.com" ||
11
- principal.issuer?.startsWith("https://oidc.vercel.com/") === true) &&
12
- principal.attributes.project_id === projectId
13
- );
14
- }
4
+ `),r=`${e.vercelBackend?` case "http": {
5
+ const projectId = process.env.VERCEL_PROJECT_ID;
6
+ return (
7
+ projectId !== undefined &&
8
+ projectId.length > 0 &&
9
+ principal?.authenticator === "oidc" &&
10
+ (principal.issuer === "https://oidc.vercel.com" ||
11
+ principal.issuer?.startsWith("https://oidc.vercel.com/") === true) &&
12
+ principal.attributes.project_id === projectId
13
+ );
14
+ }
15
15
  `:``}${n}`,i=`Self-modification could not obtain a GitHub credential from Vercel Connect for ${e.connector}. Install and attach the configured GitHub connector to this Vercel project, install the managed GitHub App for the configured repository, then retry.`,a=`import { getToken } from "@vercel/connect";
16
- import selfModification from "eve/self-modification";
16
+ import selfModification from "eve/self-modification/remote";
17
17
 
18
18
  export default selfModification({
19
- deployed: {
20
- source: {
21
- git: {
22
- repository: ${JSON.stringify(e.repository)},
23
- directory: ${JSON.stringify(e.directory)},
24
- },
25
- },
26
- target: { branch: ${JSON.stringify(e.branch)} },
27
- credentials: {
28
- async resolve({ capability, repository }) {
29
- try {
30
- return await getToken(${JSON.stringify(e.connector)}, {
31
- authorizationDetails: [
32
- {
33
- type: "github_app_installation",
34
- repositories: [repository.owner + "/" + repository.repo],
35
- },
36
- ],
37
- scopes:
38
- capability === "checkout"
39
- ? ["contents:read", "metadata:read"]
40
- : ["contents:write", "pull_requests:write", "metadata:read"],
41
- subject: { type: "app" },
42
- });
43
- } catch (error) {
44
- throw new Error(${JSON.stringify(i)}, { cause: error });
45
- }
46
- },
19
+ source: {
20
+ git: {
21
+ repository: ${JSON.stringify(e.repository)},
22
+ directory: ${JSON.stringify(e.directory)},
47
23
  },
48
- authorize: ({ channel, principal }) => {
49
- switch (channel.kind) {
50
- ${r} default:
51
- // Add another branch when you add a trusted channel.
52
- return false;
24
+ },
25
+ target: { branch: ${JSON.stringify(e.branch)} },
26
+ credentials: {
27
+ async resolve({ capability, repository }) {
28
+ try {
29
+ return await getToken(${JSON.stringify(e.connector)}, {
30
+ authorizationDetails: [
31
+ {
32
+ type: "github_app_installation",
33
+ repositories: [repository.owner + "/" + repository.repo],
34
+ },
35
+ ],
36
+ scopes:
37
+ capability === "checkout"
38
+ ? ["contents:read", "metadata:read"]
39
+ : ["contents:write", "pull_requests:write", "metadata:read"],
40
+ subject: { type: "app" },
41
+ });
42
+ } catch (error) {
43
+ throw new Error(${JSON.stringify(i)}, { cause: error });
53
44
  }
54
45
  },
55
46
  },
47
+ authorize: ({ channel, principal }) => {
48
+ switch (channel.kind) {
49
+ ${r} default:
50
+ // Add another branch when you add a trusted channel.
51
+ return false;
52
+ }
53
+ },
56
54
  });
57
- `;return`// eve-self-modification: generated-v1 digest:${createHash(`sha256`).update(a).digest(`hex`)}\n${a}`}function classifySelfModificationConfig(e){if(e===void 0)return`missing`;if(e===renderSelfModificationConfig()||e===`import { defineSelfModificationConfig } from "eve/self-modification/config";
55
+ `;return`// eve-self-modification: generated-v1 digest:${createHash(`sha256`).update(a).digest(`hex`)}\n${a}`}function classifySelfModificationConfig(e){if(e===void 0)return`missing`;if(e===DEFAULT_EXTENSION||e===LEGACY_DEFAULT_EXTENSION||e===`import { defineSelfModificationConfig } from "eve/self-modification/config";
58
56
 
59
57
  export default defineSelfModificationConfig({});
60
58
  `)return`local`;let[t,...n]=e.split(`
61
59
  `);return/^\/\/ eve-self-modification: generated-v1 digest:([a-f0-9]{64})$/u.exec(t??``)?.[1]===createHash(`sha256`).update(n.join(`
62
- `)).digest(`hex`)?`generated`:`authored`}function parseGitHubRemote(e){let t=e.trim().match(/^(?:https?:\/\/github\.com\/|git@github\.com:|ssh:\/\/git@github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?$/u);return t?.[1]===void 0||t[2]===void 0?void 0:{owner:t[1],repo:t[2]}}function defaultSelfModificationSetupOperations(e,t=defaultDependencies,n=e){let r=join(e,SELF_MODIFICATION_CONFIG_PATH);return{async detectChannelNames(){return(await discoverAgent({appRoot:e,agentRoot:join(e,`agent`)})).manifest.channels.map(e=>stripLogicalPathExtension(e.logicalPath).replace(/^channels\//,``))},async detectGitRepository(){let t=await gitOutput(e,[`config`,`--get`,`remote.origin.url`]),n=t===void 0?void 0:parseGitHubRemote(t),r=await gitOutput(e,[`symbolic-ref`,`--quiet`,`--short`,`refs/remotes/origin/HEAD`]),i=await gitOutput(e,[`rev-parse`,`--show-toplevel`]);return{...n,branch:r?.replace(/^origin\//u,``),directory:i===void 0?void 0:repositoryRelativeDirectory(i,e),remoteKind:t===void 0?`missing`:n===void 0?`other`:`github`}},async readConfig(){try{return await readFile(r,`utf8`)}catch(e){if(e.code===`ENOENT`)return;throw e}},async writeConfig(e){await mkdir(join(r,`..`),{recursive:!0}),await writeFile(r,e,`utf8`)},async findOrCreateConnector(e,r){let i=await listGitHubConnectors(n,r,t.captureVercel),a=`github/${e}`,o=i.find(e=>e.uid===a);if(o!==void 0){if(o.type!==`github`)throw Error(`The existing connector ${a} is not a GitHub connector.`);return o.uid}let s=await t.runVercelCaptureStdout([`connect`,`create`,`github`,`--name`,e,`-F`,`json`,`--scope`,r.orgId],{cwd:n}),c=s.ok?parseCreatedConnector(s.stdout):void 0;if(c===void 0||!c.startsWith(`github/`))throw Error(`Could not create a GitHub Vercel Connect connector.`);return c},async attachConnector(e,r){if(!(await t.runVercelCaptureStdout([`connect`,`attach`,e,`--project`,r.projectId,`--environment`,`production`,`--yes`,`--scope`,r.orgId],{cwd:n})).ok)throw Error(`Could not attach ${e} to the selected Vercel project for Production.`)}}}function parseCreatedConnector(e){try{let t=JSON.parse(e);return typeof t.uid==`string`?t.uid:void 0}catch{return}}function parseConnectorListPage(e){try{let t=JSON.parse(e);if(!Array.isArray(t.connectors))return;let n=t.connectors.flatMap(e=>typeof e==`object`&&e&&typeof e.uid==`string`&&typeof e.type==`string`?[{uid:e.uid,type:e.type}]:[]);return typeof t.cursor==`string`?{connectors:n,cursor:t.cursor}:{connectors:n}}catch{return}}async function listGitHubConnectors(e,t,n){let r=[],i=new Set,a;do{let o=[`connect`,`list`,`--all-projects`,`--service`,`github`,`-F`,`json`,`--scope`,t.orgId];a!==void 0&&o.push(`--next`,a);let s=await n(o,{cwd:e});if(!s.ok)throw Error(`Could not list GitHub connectors for the selected Vercel project. ${s.failure.message}`);let c=parseConnectorListPage(s.stdout);if(c===void 0)throw Error(`Vercel returned an invalid GitHub connector list for the selected project.`);if(r.push(...c.connectors),c.cursor!==void 0&&i.has(c.cursor))throw Error(`The GitHub connector list repeated cursor ${c.cursor}.`);c.cursor!==void 0&&i.add(c.cursor),a=c.cursor}while(a!==void 0);return r}function repositoryRelativeDirectory(e,t,n=relative){return n(e,t).replaceAll(`\\`,`/`)||`.`}function repositoryPartError(e){return/^[A-Za-z0-9_.-]+$/u.test(e)?void 0:`Enter a valid GitHub owner or repository name.`}function directoryError(e){return e===`.`||e.length>0&&!e.startsWith(`/`)&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)?void 0:`Enter a safe repository-relative directory or ".".`}function gitRefError(e){return/^[A-Za-z0-9][A-Za-z0-9._/-]*$/u.test(e)&&!e.endsWith(`.`)&&!e.endsWith(`/`)&&!e.includes(`..`)&&!e.includes(`//`)&&!e.includes(`@{`)?void 0:`Enter a valid branch name.`}async function gitOutput(e,t){try{return(await runFile(`git`,t,{cwd:e})).stdout.trim()||void 0}catch{return}}export{classifySelfModificationConfig,connectorName,defaultSelfModificationSetupOperations,directoryError,gitRefError,parseGitHubRemote,renderSelfModificationConfig,repositoryPartError,repositoryRelativeDirectory};
60
+ `)).digest(`hex`)?`generated`:`authored`}function parseGitHubRemote(e){let t=e.trim().match(/^(?:https?:\/\/github\.com\/|git@github\.com:|ssh:\/\/git@github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?$/u);return t?.[1]===void 0||t[2]===void 0?void 0:{owner:t[1],repo:t[2]}}function defaultSelfModificationSetupOperations(e,t=defaultDependencies,n=e){let r=join(e,DEPLOYED_SELF_MODIFICATION_CONFIG_PATH);return{async detectChannelNames(){return(await discoverAgent({appRoot:e,agentRoot:join(e,`agent`)})).manifest.channels.map(e=>stripLogicalPathExtension(e.logicalPath).replace(/^channels\//,``))},async detectGitRepository(){let t=await gitOutput(e,[`config`,`--get`,`remote.origin.url`]),n=t===void 0?void 0:parseGitHubRemote(t),r=await gitOutput(e,[`symbolic-ref`,`--quiet`,`--short`,`refs/remotes/origin/HEAD`]),i=await gitOutput(e,[`rev-parse`,`--show-toplevel`]);return{...n,branch:r?.replace(/^origin\//u,``),directory:i===void 0?void 0:repositoryRelativeDirectory(i,e),remoteKind:t===void 0?`missing`:n===void 0?`other`:`github`}},readConfig:()=>readOptionalFile(r),readLocalConfig:()=>readOptionalFile(join(e,SELF_MODIFICATION_CONFIG_PATH)),async writeConfig(e){await mkdir(join(r,`..`),{recursive:!0}),await writeFile(r,e,`utf8`)},async findOrCreateConnector(e,r){let i=await listGitHubConnectors(n,r,t.captureVercel),a=`github/${e}`,o=i.find(e=>e.uid===a);if(o!==void 0){if(o.type!==`github`)throw Error(`The existing connector ${a} is not a GitHub connector.`);return o.uid}let s=await t.runVercelCaptureStdout([`connect`,`create`,`github`,`--name`,e,`-F`,`json`,`--scope`,r.orgId],{cwd:n}),c=s.ok?parseCreatedConnector(s.stdout):void 0;if(c===void 0||!c.startsWith(`github/`))throw Error(`Could not create a GitHub Vercel Connect connector.`);return c},async attachConnector(e,r){if(!(await t.runVercelCaptureStdout([`connect`,`attach`,e,`--project`,r.projectId,`--environment`,`production`,`--yes`,`--scope`,r.orgId],{cwd:n})).ok)throw Error(`Could not attach ${e} to the selected Vercel project for Production.`)}}}async function readOptionalFile(e){try{return await readFile(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return;throw e}}function parseCreatedConnector(e){try{let t=JSON.parse(e);return typeof t.uid==`string`?t.uid:void 0}catch{return}}function parseConnectorListPage(e){try{let t=JSON.parse(e);if(!Array.isArray(t.connectors))return;let n=t.connectors.flatMap(e=>typeof e==`object`&&e&&typeof e.uid==`string`&&typeof e.type==`string`?[{uid:e.uid,type:e.type}]:[]);return typeof t.cursor==`string`?{connectors:n,cursor:t.cursor}:{connectors:n}}catch{return}}async function listGitHubConnectors(e,t,n){let r=[],i=new Set,a;do{let o=[`connect`,`list`,`--all-projects`,`--service`,`github`,`-F`,`json`,`--scope`,t.orgId];a!==void 0&&o.push(`--next`,a);let s=await n(o,{cwd:e});if(!s.ok)throw Error(`Could not list GitHub connectors for the selected Vercel project. ${s.failure.message}`);let c=parseConnectorListPage(s.stdout);if(c===void 0)throw Error(`Vercel returned an invalid GitHub connector list for the selected project.`);if(r.push(...c.connectors),c.cursor!==void 0&&i.has(c.cursor))throw Error(`The GitHub connector list repeated cursor ${c.cursor}.`);c.cursor!==void 0&&i.add(c.cursor),a=c.cursor}while(a!==void 0);return r}function repositoryRelativeDirectory(e,t,n=relative){return n(e,t).replaceAll(`\\`,`/`)||`.`}function repositoryPartError(e){return/^[A-Za-z0-9_.-]+$/u.test(e)?void 0:`Enter a valid GitHub owner or repository name.`}function directoryError(e){return e===`.`||e.length>0&&!e.startsWith(`/`)&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)?void 0:`Enter a safe repository-relative directory or ".".`}function gitRefError(e){return/^[A-Za-z0-9][A-Za-z0-9._/-]*$/u.test(e)&&!e.endsWith(`.`)&&!e.endsWith(`/`)&&!e.includes(`..`)&&!e.includes(`//`)&&!e.includes(`@{`)?void 0:`Enter a valid branch name.`}async function gitOutput(e,t){try{return(await runFile(`git`,t,{cwd:e})).stdout.trim()||void 0}catch{return}}export{DEPLOYED_SELF_MODIFICATION_CONFIG_PATH,SELF_MODIFICATION_CONFIG_PATH,classifySelfModificationConfig,connectorName,defaultSelfModificationSetupOperations,directoryError,gitRefError,parseGitHubRemote,renderSelfModificationConfig,repositoryPartError,repositoryRelativeDirectory};
@@ -0,0 +1,15 @@
1
+ /** Delegation and instruction text shared by the local and deployed self-modification children. */
2
+ export declare function renderDescription(sections: readonly string[]): string;
3
+ export declare function renderInstructions(sections: readonly string[]): string;
4
+ export declare const sourceDelegation: string;
5
+ export declare const persistenceDelegation: string;
6
+ export declare const namedInstallationDelegation = "Treat questions phrased as whether you can install, add, enable, or connect to a named product or service as requests to extend this eve agent and delegate immediately. Do not assume they refer to device software, ask what kind of installation they mean, or deny them because you lack access to the user's device. The subagent determines whether the request maps to an integration, channel, connection, or other capability, then checks registry availability and any required setup.";
7
+ export declare const followUpDelegation: string;
8
+ export declare const repairDelegation: string;
9
+ export declare const roleInstructions = "## Role\n\nYou are an expert coding assistant operating inside of an eve agent. You help users by reading files, editing code, and writing new files that shape the behavior of the agent itself.";
10
+ export declare const sourceWorkspaceInstructions = "## Source workspace\n\nThe source code of the eve agent is mounted read-write at /source. /source is the authored agent directory. Locate source files with bash. Read source contents with read_file, not shell commands. Before generating an overwrite, ensure read_file has succeeded for that path. Shell reads do not satisfy write_file's read-before-write requirement. edit_file instead validates exact matches against current contents. Never modify source files with bash, sed, awk, redirection, or scripting.\n\nResolve named tools by filename under /source/tools before searching contents. Tool identifiers derive from filenames and may not occur in the implementation.";
11
+ export declare const sourceEditingInstructions = "## Implement changes\n\nUse edit_file for localized changes; include only the unique matching text. For a complete rewrite, use read_file then write_file; do not encode the whole old file as one replacement. If tool arguments fail argument parsing, retry the same tool with corrected encoding.\n\nOnce paths are known, batch independent file reads and edits to different files. Never edit the same file concurrently.";
12
+ export declare const toolAuthoringInstructions = "## Add model-callable actions\n\nWhen the requester wants this agent to gain a reusable action or capability that it can invoke in future turns, implement it as an authored eve tool under /source/tools. This applies even when the request describes the action without using the word \u201Ctool.\u201D Follow the path-derived naming and defineTool conventions in the mounted eve tools documentation and existing source.\n\nDo not substitute a loose Python, shell, or JavaScript file for a model-callable tool. A support script is acceptable only when an authored eve tool invokes it as an implementation detail, or when the requester explicitly asks for a standalone script instead of an agent capability.";
13
+ export declare const registryWorkflowInstructions = "## Add integrations\n\nBefore adding a new eve-managed channel, connection, extension, instrumentation, or memory integration, call search_registry alongside source discovery. If an item fulfills the requirement, install it with registry_add using its exact address. If no matching item fulfills the requirement, or if the developer asks for a custom implementation, write the integration yourself.\n\nModifying the behavior of an existing skill or tool does not require a registry search. Registry search blocks implementation, not source inspection. Serialize registry installation and dependent edits. Run registry_add separately from file edits and other registry installations.\n\nRegistry installation is outside the source sandbox.";
14
+ export declare const documentationInstructions = "## Consult documentation\n\nThe eve framework documentation is mounted read-only at /eve-docs. Prefer source and existing local patterns. Before reading docs, identify the specific unresolved API question. Search the relevant file for its heading or term, then read only the bounded surrounding section. Do not concatenate wildcard files or read a full page when a section answers the question. Stop when the question is resolved.";
15
+ export declare const workingInstructions = "## Work efficiently\n\nSkip task lists for simple work - only use them for complex actions. Never spend a turn only reporting status or updating the task list - batch them with other calls.\n\nTreat a successful file-edit tool result as confirmation; do not reread a file solely to verify that the edit succeeded. Do not approximate unavailable build or test commands with broad source searches.";
@@ -0,0 +1,29 @@
1
+ function renderDescription(e){return e.filter(e=>e.length>0).join(` `)}function renderInstructions(e){return e.filter(e=>e.length>0).join(`
2
+
3
+ `)}const sourceDelegation=`If the requested change references a tool or skill, include the exact identifier. Do not infer source paths; let the child resolve the appropriate file under /source. Delegate the requested change and existing constraints without adding unrequested features, implementation steps, or reporting requirements.`,persistenceDelegation=`Treat requests for persistent changes to future behavior or capabilities as source-modification requests, even when the requester does not mention files or source code. Infer persistence from the request and conversation rather than waiting for phrases such as “modify your source.” For example, asking the agent to stop always doing something, add a capability, or change future responses calls for inspecting and editing the authored source instead of providing a one-turn workaround.`,namedInstallationDelegation=`Treat questions phrased as whether you can install, add, enable, or connect to a named product or service as requests to extend this eve agent and delegate immediately. Do not assume they refer to device software, ask what kind of installation they mean, or deny them because you lack access to the user's device. The subagent determines whether the request maps to an integration, channel, connection, or other capability, then checks registry availability and any required setup.`,followUpDelegation=`Resolve short follow-ups such as “yes” or “do it” against the preceding conversation. If whether the requested change should persist is genuinely ambiguous, ask one concise clarifying question.`,repairDelegation=`If a tool or capability created or changed by this subagent later fails or behaves incorrectly, explain the observed problem and offer to delegate a repair. Do not start the repair until the user confirms. Treat that confirmation as a source-modification request and delegate it immediately, including the exact identifier, failing behavior, expected behavior, and existing constraints.`,roleInstructions=`## Role
4
+
5
+ You are an expert coding assistant operating inside of an eve agent. You help users by reading files, editing code, and writing new files that shape the behavior of the agent itself.`,sourceWorkspaceInstructions=`## Source workspace
6
+
7
+ The source code of the eve agent is mounted read-write at /source. /source is the authored agent directory. Locate source files with bash. Read source contents with read_file, not shell commands. Before generating an overwrite, ensure read_file has succeeded for that path. Shell reads do not satisfy write_file's read-before-write requirement. edit_file instead validates exact matches against current contents. Never modify source files with bash, sed, awk, redirection, or scripting.
8
+
9
+ Resolve named tools by filename under /source/tools before searching contents. Tool identifiers derive from filenames and may not occur in the implementation.`,sourceEditingInstructions=`## Implement changes
10
+
11
+ Use edit_file for localized changes; include only the unique matching text. For a complete rewrite, use read_file then write_file; do not encode the whole old file as one replacement. If tool arguments fail argument parsing, retry the same tool with corrected encoding.
12
+
13
+ Once paths are known, batch independent file reads and edits to different files. Never edit the same file concurrently.`,toolAuthoringInstructions=`## Add model-callable actions
14
+
15
+ When the requester wants this agent to gain a reusable action or capability that it can invoke in future turns, implement it as an authored eve tool under /source/tools. This applies even when the request describes the action without using the word “tool.” Follow the path-derived naming and defineTool conventions in the mounted eve tools documentation and existing source.
16
+
17
+ Do not substitute a loose Python, shell, or JavaScript file for a model-callable tool. A support script is acceptable only when an authored eve tool invokes it as an implementation detail, or when the requester explicitly asks for a standalone script instead of an agent capability.`,registryWorkflowInstructions=`## Add integrations
18
+
19
+ Before adding a new eve-managed channel, connection, extension, instrumentation, or memory integration, call search_registry alongside source discovery. If an item fulfills the requirement, install it with registry_add using its exact address. If no matching item fulfills the requirement, or if the developer asks for a custom implementation, write the integration yourself.
20
+
21
+ Modifying the behavior of an existing skill or tool does not require a registry search. Registry search blocks implementation, not source inspection. Serialize registry installation and dependent edits. Run registry_add separately from file edits and other registry installations.
22
+
23
+ Registry installation is outside the source sandbox.`,documentationInstructions=`## Consult documentation
24
+
25
+ The eve framework documentation is mounted read-only at /eve-docs. Prefer source and existing local patterns. Before reading docs, identify the specific unresolved API question. Search the relevant file for its heading or term, then read only the bounded surrounding section. Do not concatenate wildcard files or read a full page when a section answers the question. Stop when the question is resolved.`,workingInstructions=`## Work efficiently
26
+
27
+ Skip task lists for simple work - only use them for complex actions. Never spend a turn only reporting status or updating the task list - batch them with other calls.
28
+
29
+ Treat a successful file-edit tool result as confirmation; do not reread a file solely to verify that the edit succeeded. Do not approximate unavailable build or test commands with broad source searches.`;export{documentationInstructions,followUpDelegation,namedInstallationDelegation,persistenceDelegation,registryWorkflowInstructions,renderDescription,renderInstructions,repairDelegation,roleInstructions,sourceDelegation,sourceEditingInstructions,sourceWorkspaceInstructions,toolAuthoringInstructions,workingInstructions};
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{toErrorMessage}from"#shared/errors.js";import{getVercelOidcToken}from"#compiled/@vercel/oidc/index.js";import{readVercelProjectLink}from"#internal/vercel/project-link.js";const VercelOidcClaimsSchema=z.object({owner_id:z.string().min(1),project_id:z.string().min(1)}),LocalDevelopmentUserOidcClaimsSchema=VercelOidcClaimsSchema.extend({environment:z.literal(`development`),user_id:z.string().min(1)});async function resolveDevelopmentOidcToken(e){try{let t={team:e.ownerId,project:e.projectId};return e.forceRefresh===!0&&(t.expirationBufferMs=2**53-1),validateDevelopmentOidcToken((await getVercelOidcToken(t)).trim(),e)}catch(e){return{kind:`resolution-failed`,message:toErrorMessage(e)}}}async function resolveLinkedDevelopmentOidcToken(e){let t=await readVercelProjectLink(e);if(t===void 0)return``;let n={ownerId:t.orgId,projectId:t.projectId},r=await resolveDevelopmentOidcToken(n);if(r.kind===`resolved`&&isLocalDevelopmentUserToken(r.token))return r.token;if(r.kind!==`resolved`&&r.kind!==`target-mismatch`)return``;let i=await resolveDevelopmentOidcToken({...n,forceRefresh:!0});return i.kind===`resolved`&&isLocalDevelopmentUserToken(i.token)?i.token:``}function isLocalDevelopmentUserToken(e){let t=decodeOidcPayload(e);return t!==void 0&&z.validate(LocalDevelopmentUserOidcClaimsSchema,t)}function validateDevelopmentOidcToken(e,t){let n=decodeOidcPayload(e);if(n===void 0)return e.split(`.`)[1]?{kind:`malformed-token`,reason:`invalid-json-payload`}:{kind:`malformed-token`,reason:`missing-payload`};let r=VercelOidcClaimsSchema.safeParse(n);if(!r.success)return{kind:`invalid-claims`,invalidClaims:r.error.issues.map(e=>{let t=e.path[0];return t===`owner_id`||t===`project_id`?t:`claims`})};let i=[];return r.data.owner_id!==t.ownerId&&i.push(`owner_id`),r.data.project_id!==t.projectId&&i.push(`project_id`),i.length>0?{kind:`target-mismatch`,mismatchedClaims:i}:{kind:`resolved`,token:e}}function decodeOidcPayload(e){let t=e.split(`.`)[1];if(t)try{return JSON.parse(Buffer.from(t,`base64url`).toString(`utf8`))}catch{return}}const VERCEL_PROTECTION_BYPASS_HEADER=`x-vercel-protection-bypass`;export{VERCEL_PROTECTION_BYPASS_HEADER,resolveDevelopmentOidcToken,resolveLinkedDevelopmentOidcToken};
1
+ import{z}from"#compiled/zod/index.js";import{toErrorMessage}from"#shared/errors.js";import{readVercelProjectLink}from"#internal/vercel/project-link.js";import{getVercelOidcToken}from"#compiled/@vercel/oidc/index.js";const VercelOidcClaimsSchema=z.object({owner_id:z.string().min(1),project_id:z.string().min(1)}),LocalDevelopmentUserOidcClaimsSchema=VercelOidcClaimsSchema.extend({environment:z.literal(`development`),user_id:z.string().min(1)});async function resolveDevelopmentOidcToken(e){try{let t={team:e.ownerId,project:e.projectId};return e.forceRefresh===!0&&(t.expirationBufferMs=2**53-1),validateDevelopmentOidcToken((await getVercelOidcToken(t)).trim(),e)}catch(e){return{kind:`resolution-failed`,message:toErrorMessage(e)}}}async function resolveLinkedDevelopmentOidcToken(e){let t=await readVercelProjectLink(e);if(t===void 0)return``;let n={ownerId:t.orgId,projectId:t.projectId},r=await resolveDevelopmentOidcToken(n);if(r.kind===`resolved`&&isLocalDevelopmentUserToken(r.token))return r.token;if(r.kind!==`resolved`&&r.kind!==`target-mismatch`)return``;let i=await resolveDevelopmentOidcToken({...n,forceRefresh:!0});return i.kind===`resolved`&&isLocalDevelopmentUserToken(i.token)?i.token:``}function isLocalDevelopmentUserToken(e){let t=decodeOidcPayload(e);return t!==void 0&&z.validate(LocalDevelopmentUserOidcClaimsSchema,t)}function validateDevelopmentOidcToken(e,t){let n=decodeOidcPayload(e);if(n===void 0)return e.split(`.`)[1]?{kind:`malformed-token`,reason:`invalid-json-payload`}:{kind:`malformed-token`,reason:`missing-payload`};let r=VercelOidcClaimsSchema.safeParse(n);if(!r.success)return{kind:`invalid-claims`,invalidClaims:r.error.issues.map(e=>{let t=e.path[0];return t===`owner_id`||t===`project_id`?t:`claims`})};let i=[];return r.data.owner_id!==t.ownerId&&i.push(`owner_id`),r.data.project_id!==t.projectId&&i.push(`project_id`),i.length>0?{kind:`target-mismatch`,mismatchedClaims:i}:{kind:`resolved`,token:e}}function decodeOidcPayload(e){let t=e.split(`.`)[1];if(t)try{return JSON.parse(Buffer.from(t,`base64url`).toString(`utf8`))}catch{return}}const VERCEL_PROTECTION_BYPASS_HEADER=`x-vercel-protection-bypass`;export{VERCEL_PROTECTION_BYPASS_HEADER,resolveDevelopmentOidcToken,resolveLinkedDevelopmentOidcToken};
@@ -1 +1 @@
1
- import{readFile}from"node:fs/promises";import{resolveDiscoveryProject}from"#discover/project.js";import pc from"#compiled/picocolors/index.js";import{join}from"node:path";import{parseModelHelper}from"#shared/model-helper.js";import{discoverAgent}from"#discover/discover-agent.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{CHATGPT_MODEL_SELECTION_PREFIX}from"#shared/chatgpt-model.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{readModelSelectionFromSource}from"#source-change/apply-model-selection.js";import{createStaticSourceChange}from"#source-change/static-source-change.js";function formatApplyModelSettingsOutcome(e){return e.kind===`rejected`?e.message:e.kind===`unchanged`?`Model settings are already up to date.`:e.changed.length===1&&e.changed[0]===`model`&&e.model!==void 0?`Model changed to ${pc.bold(e.model)}. Live on your next prompt.`:`Model settings updated: ${e.changed.map(t=>t===`model`?`model ${e.model??`updated`}`:t===`reasoning`?`reasoning ${e.reasoning??`provider default`}`:`Fast mode ${e.fastMode?`on`:`off`}`).join(`, `)}. Live on your next prompt.`}async function changeAgentModelSettings(e){let{appRoot:t,patch:n}=e;if(n.model.kind===`set`){let e=await validateModelSlug(t,n.model.value);if(e!==null)return{kind:`rejected`,message:e}}let r=await resolveDiscoveryProject(t),{manifest:i}=await discoverAgent(r),a=await createStaticSourceChange(i).updateModelSettings(n);if(a.kind===`bail`)return{kind:`rejected`,message:`Couldn't edit ${a.at.logicalPath}: ${a.reason}. Change the model settings by hand.`};if(a.changed.length===0)return{kind:`unchanged`};let o={kind:`changed`,changed:a.changed};return n.model.kind===`set`&&(o.model=n.model.value),n.reasoning.kind!==`keep`&&(o.reasoning=n.reasoning.kind===`set`?n.reasoning.value:null),n.gatewayServiceTier.kind!==`keep`&&(o.fastMode=n.gatewayServiceTier.kind===`set`),o}async function changeAgentModel(e){let{appRoot:t,slug:n}=e,r=await validateModelSlug(t,n);return r===null?changeValidatedAgentModel(e):{kind:`rejected`,message:r}}async function changeValidatedAgentModel(e){let{appRoot:t,slug:n}=e,r=await resolveDiscoveryProject(t),{manifest:i}=await discoverAgent(r),a=await createStaticSourceChange(i).updateModelName(n);return a.kind===`bail`?{kind:`rejected`,message:`Couldn't edit ${a.at.logicalPath}: ${a.reason}. Change \`model\` by hand.`}:a.from===a.to?{kind:`unchanged`,model:a.to}:{kind:`changed`,to:a.to}}async function validateModelSlug(e,t){if(parseModelHelper(t)!==void 0)return null;if(t.startsWith(CHATGPT_MODEL_SELECTION_PREFIX))return"Choose a bare OpenAI model id after `chatgpt/`.";if(!t.includes(`/`))return`\`${t}\` isn't a provider/model id (e.g. anthropic/claude-sonnet-5).`;let n=createCompiledRuntimeModelCatalogLoader(e);try{if(await n.getModelLimits(formatLanguageModelGatewayId(t))===null)return`I couldn't confirm \`${t}\` in the AI Gateway model catalog, so I didn't change agent.ts.`}catch{return null}return null}async function readAuthoredModelSelection(e){let t=await resolveDiscoveryProject(e),{manifest:n}=await discoverAgent(t);if(!n.configModule)return;let r=await readFile(join(t.agentRoot,n.configModule.logicalPath),`utf8`);return readModelSelectionFromSource(r)}export{changeAgentModel,changeAgentModelSettings,changeValidatedAgentModel,formatApplyModelSettingsOutcome,readAuthoredModelSelection,validateModelSlug};
1
+ import{readFile}from"node:fs/promises";import{join}from"node:path";import{resolveDiscoveryProject}from"#discover/project.js";import pc from"#compiled/picocolors/index.js";import{parseModelHelper}from"#shared/model-helper.js";import{discoverAgent}from"#discover/discover-agent.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{CHATGPT_MODEL_SELECTION_PREFIX}from"#shared/chatgpt-model.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{readModelSelectionFromSource}from"#source-change/apply-model-selection.js";import{createStaticSourceChange}from"#source-change/static-source-change.js";function formatApplyModelSettingsOutcome(e){return e.kind===`rejected`?e.message:e.kind===`unchanged`?`Model settings are already up to date.`:e.changed.length===1&&e.changed[0]===`model`&&e.model!==void 0?`Model changed to ${pc.bold(e.model)}. Live on your next prompt.`:`Model settings updated: ${e.changed.map(t=>t===`model`?`model ${e.model??`updated`}`:t===`reasoning`?`reasoning ${e.reasoning??`provider default`}`:`Fast mode ${e.fastMode?`on`:`off`}`).join(`, `)}. Live on your next prompt.`}async function changeAgentModelSettings(e){let{appRoot:t,patch:n}=e;if(n.model.kind===`set`){let e=await validateModelSlug(t,n.model.value);if(e!==null)return{kind:`rejected`,message:e}}let r=await resolveDiscoveryProject(t),{manifest:i}=await discoverAgent(r),a=await createStaticSourceChange(i).updateModelSettings(n);if(a.kind===`bail`)return{kind:`rejected`,message:`Couldn't edit ${a.at.logicalPath}: ${a.reason}. Change the model settings by hand.`};if(a.changed.length===0)return{kind:`unchanged`};let o={kind:`changed`,changed:a.changed};return n.model.kind===`set`&&(o.model=n.model.value),n.reasoning.kind!==`keep`&&(o.reasoning=n.reasoning.kind===`set`?n.reasoning.value:null),n.gatewayServiceTier.kind!==`keep`&&(o.fastMode=n.gatewayServiceTier.kind===`set`),o}async function changeAgentModel(e){let{appRoot:t,slug:n}=e,r=await validateModelSlug(t,n);return r===null?changeValidatedAgentModel(e):{kind:`rejected`,message:r}}async function changeValidatedAgentModel(e){let{appRoot:t,slug:n}=e,r=await resolveDiscoveryProject(t),{manifest:i}=await discoverAgent(r),a=await createStaticSourceChange(i).updateModelName(n);return a.kind===`bail`?{kind:`rejected`,message:`Couldn't edit ${a.at.logicalPath}: ${a.reason}. Change \`model\` by hand.`}:a.from===a.to?{kind:`unchanged`,model:a.to}:{kind:`changed`,to:a.to}}async function validateModelSlug(e,t){if(parseModelHelper(t)!==void 0)return null;if(t.startsWith(CHATGPT_MODEL_SELECTION_PREFIX))return"Choose a bare OpenAI model id after `chatgpt/`.";if(!t.includes(`/`))return`\`${t}\` isn't a provider/model id (e.g. anthropic/claude-sonnet-5).`;let n=createCompiledRuntimeModelCatalogLoader(e);try{if(await n.getModelLimits(formatLanguageModelGatewayId(t))===null)return`I couldn't confirm \`${t}\` in the AI Gateway model catalog, so I didn't change agent.ts.`}catch{return null}return null}async function readAuthoredModelSelection(e){let t=await resolveDiscoveryProject(e),{manifest:n}=await discoverAgent(t);if(!n.configModule)return;let r=await readFile(join(t.agentRoot,n.configModule.logicalPath),`utf8`);return readModelSelectionFromSource(r)}export{changeAgentModel,changeAgentModelSettings,changeValidatedAgentModel,formatApplyModelSettingsOutcome,readAuthoredModelSelection,validateModelSlug};
@@ -1 +1 @@
1
- import{defineSetupIntegration}from"../types.js";import{describeIntegrationSetupEnvironment}from"../shared/environment.js";import{installScaffoldDependencies}from"../shared/scaffold.js";import{relative}from"node:path";import{ensurePackageDependencies}from"#setup/scaffold/index.js";import{confirm,select,text}from"#setup/ask.js";import{classifySelfModificationConfig,connectorName,defaultSelfModificationSetupOperations,directoryError,gitRefError,renderSelfModificationConfig,repositoryPartError}from"#self-modification/setup.js";import{SELF_MODIFICATION_CONFIG_PATH}from"#self-modification/git-workspace.js";import{detectLegacySelfModificationScaffold,removeLegacySelfModificationScaffold}from"#self-modification/migration.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,DEFAULT_MICROSANDBOX_PACKAGE_VERSION}from"#setup/scaffold/version-tokens.js";const defaultApplyDependencies={ensurePackageDependencies,installScaffoldDependencies},SELF_MODIFICATION_PRODUCTION_DEPENDENCIES={"@vercel/connect":DEFAULT_CONNECT_PACKAGE_VERSION,microsandbox:DEFAULT_MICROSANDBOX_PACKAGE_VERSION};function validationResult(e){return e??null}async function prepareLegacyScaffoldCleanup(e){let t=await detectLegacySelfModificationScaffold(e.appRoot);return t===void 0?void 0:await e.asker.ask(confirm({key:`self-modification-cleanup`,message:`A legacy self-modification scaffold was found at ${relative(e.appRoot,t.root)}. This scaffold format is no longer supported. Do you want to remove it?`,recommended:!0,required:!0}))?t:void 0}function withLegacyScaffold(e,t){return t===void 0?e:{...e,legacyScaffold:t}}async function prepareSelfModificationSetup(e,t=defaultSelfModificationSetupOperations(e.appRoot,void 0,e.projectRoot)){let n=await prepareLegacyScaffoldCleanup(e),r=await t.readConfig();if(classifySelfModificationConfig(r)===`authored`)return e.presenter.note(`The existing ${SELF_MODIFICATION_CONFIG_PATH} contains authored configuration and was not overwritten.`,`Manual update required`,{tone:`warning`}),withLegacyScaffold({kind:`authored`},n);if(await e.asker.ask(select({key:`self-modification-mode`,message:`How should self-modification be enabled?`,options:[{id:`deployed`,value:`deployed`,label:`Enable for deployed`,hint:`Let deployed agents propose source changes through draft pull requests`},{id:`local`,value:`local`,label:`Keep local`,hint:`Only enable source editing during local development`}],recommended:`local`,required:!0}))===`local`)return withLegacyScaffold({kind:`local`},n);let[i,a,o]=await Promise.all([e.resolveVercelProject(`self-modification`),t.detectGitRepository(),t.detectChannelNames()]),s=await e.asker.ask(text({key:`self-modification-repository-owner`,message:`GitHub repository owner`,detected:a.owner,required:!0,validate:e=>validationResult(repositoryPartError(e))})),c=await e.asker.ask(text({key:`self-modification-repository-name`,message:`GitHub repository name`,detected:a.repo,required:!0,validate:e=>validationResult(repositoryPartError(e))})),l=await e.asker.ask(text({key:`self-modification-repository-directory`,message:`Application directory relative to the repository root`,detected:a.directory??`.`,required:!0,validate:e=>validationResult(directoryError(e))})),u=await e.asker.ask(text({key:`self-modification-target-branch`,message:`Target branch`,detected:a.branch??`main`,required:!0,validate:e=>validationResult(gitRefError(e))})),d=connectorName(s,c),f={branch:u,channelNames:o,connector:`github/${d}`,directory:l,repository:`github.com/${s}/${c}`,vercelBackend:!0};return e.presenter.note(renderSelfModificationConfig(f),`Generated ${SELF_MODIFICATION_CONFIG_PATH}`),e.presenter.note(`Vercel Connect will issue short-lived GitHub App credentials restricted to this repository. Install the managed GitHub App and select only this repository. Review, merge, and deployment remain separate operator boundaries.`,`Security summary`),withLegacyScaffold(await e.asker.ask(confirm({key:`self-modification-confirm`,message:`Create or attach this GitHub connector and write this configuration?`,recommended:!1,required:!0}))?{kind:`deployed`,connectorName:d,project:i,values:f}:{kind:`local`},n)}async function applySelfModificationSetup(e,t,n=defaultSelfModificationSetupOperations(t.appRoot,void 0,t.projectRoot),r=defaultApplyDependencies){if(e.legacyScaffold!==void 0&&(await removeLegacySelfModificationScaffold(t.appRoot,e.legacyScaffold),t.presenter.log.success(`Removed the retired self-modification scaffold.`)),e.kind===`authored`)return{facts:[{label:`Self-modification`,value:`manual configuration update required`}]};if(e.kind===`local`)return{facts:[]};let i=await n.findOrCreateConnector(e.connectorName,e.project);await n.attachConnector(i,e.project);let a=await r.ensurePackageDependencies({dependencies:SELF_MODIFICATION_PRODUCTION_DEPENDENCIES,projectRoot:t.appRoot});return await r.installScaffoldDependencies({changed:a.length>0,log:t.presenter.log,projectPath:t.appRoot,signal:t.signal}),await n.writeConfig(renderSelfModificationConfig({...e.values,connector:i})),t.presenter.log.success(`Updated ${SELF_MODIFICATION_CONFIG_PATH}.`),t.presenter.nextSteps([`Install the managed GitHub App for the configured repository, then deploy or redeploy.`,e.values.vercelBackend?"After deployment, try self-modification by running `eve dev <deployment-url>` from this linked project. The generated policy admits its Vercel OIDC identity over HTTP; configured channels remain denied until you update `agent/extensions/self-modification/extension.ts`.":"Before deployment, configure `deployed.authorize` in `agent/extensions/self-modification/extension.ts` to admit a trusted principal for your deployment's channel. After deployment, use that channel to try self-modification."]),{deploymentRequired:!0,facts:[{label:`Repository`,value:e.values.repository},{label:`Application directory`,value:e.values.directory},{label:`Target branch`,value:e.values.branch},{label:`Credential`,value:i}]}}async function prepareLocalSelfModificationSetup(e,t=defaultSelfModificationSetupOperations(e.appRoot,void 0,e.projectRoot)){let n=await prepareLegacyScaffoldCleanup(e),r=await t.readConfig();return classifySelfModificationConfig(r)===`authored`?(e.presenter.note(`The existing ${SELF_MODIFICATION_CONFIG_PATH} contains authored configuration and was not overwritten.`,`Manual update required`,{tone:`warning`}),withLegacyScaffold({kind:`authored`},n)):withLegacyScaffold({kind:`local`},n)}function describeEnvironment(e){if(e.vercel.kind===`available`)return describeIntegrationSetupEnvironment(e);switch(e.vercel.reason){case`logged-out`:return`No authenticated Vercel account found. Local editing remains available; deployed proposals require Vercel Connect.`;case`cli-missing`:return`Vercel CLI not found. Local editing remains available; deployed proposals require Vercel Connect.`;case`unavailable`:return`Could not verify the Vercel account. Local editing remains available; deployed proposals require Vercel Connect.`}}const SELF_MODIFICATION_SETUP=defineSetupIntegration({kind:`self-modification`,label:`Self-modification`,hint:`Local source editing is enabled`,describeEnvironment,prepare:prepareLocalSelfModificationSetup,apply:applySelfModificationSetup}),SELF_MODIFICATION_PRODUCTION_SETUP=defineSetupIntegration({kind:`self-modification-production`,label:`Self-modification production`,hint:`Configure deployed draft pull requests`,describeEnvironment,prepare:prepareSelfModificationSetup,apply:applySelfModificationSetup});export{SELF_MODIFICATION_PRODUCTION_SETUP,SELF_MODIFICATION_SETUP,applySelfModificationSetup,prepareLocalSelfModificationSetup,prepareSelfModificationSetup};
1
+ import{defineSetupIntegration}from"../types.js";import{describeIntegrationSetupEnvironment}from"../shared/environment.js";import{installScaffoldDependencies}from"../shared/scaffold.js";import{relative}from"node:path";import{ensurePackageDependencies}from"#setup/scaffold/index.js";import{confirm,select,text}from"#setup/ask.js";import{DEPLOYED_SELF_MODIFICATION_CONFIG_PATH,SELF_MODIFICATION_CONFIG_PATH,classifySelfModificationConfig,connectorName,defaultSelfModificationSetupOperations,directoryError,gitRefError,renderSelfModificationConfig,repositoryPartError}from"#self-modification/setup.js";import{detectLegacySelfModificationScaffold,removeLegacySelfModificationScaffold}from"#self-modification/migration.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,DEFAULT_MICROSANDBOX_PACKAGE_VERSION}from"#setup/scaffold/version-tokens.js";const defaultApplyDependencies={ensurePackageDependencies,installScaffoldDependencies},SELF_MODIFICATION_PRODUCTION_DEPENDENCIES={"@vercel/connect":DEFAULT_CONNECT_PACKAGE_VERSION,microsandbox:DEFAULT_MICROSANDBOX_PACKAGE_VERSION};function validationResult(e){return e??null}async function prepareLegacyScaffoldCleanup(e){let t=await detectLegacySelfModificationScaffold(e.appRoot);return t===void 0?void 0:await e.asker.ask(confirm({key:`self-modification-cleanup`,message:`A legacy self-modification scaffold was found at ${relative(e.appRoot,t.root)}. This scaffold format is no longer supported. Do you want to remove it?`,recommended:!0,required:!0}))?t:void 0}function withLegacyScaffold(e,t){return t===void 0?e:{...e,legacyScaffold:t}}async function prepareSelfModificationSetup(e,t=defaultSelfModificationSetupOperations(e.appRoot,void 0,e.projectRoot)){let n=await prepareLegacyScaffoldCleanup(e),r=await t.readConfig();if(classifySelfModificationConfig(r)===`authored`)return e.presenter.note(`The existing ${DEPLOYED_SELF_MODIFICATION_CONFIG_PATH} contains authored configuration and was not overwritten.`,`Manual update required`,{tone:`warning`}),withLegacyScaffold({kind:`authored`},n);if(await e.asker.ask(select({key:`self-modification-mode`,message:`How should self-modification be enabled?`,options:[{id:`deployed`,value:`deployed`,label:`Enable for deployed`,hint:`Let deployed agents propose source changes through draft pull requests`},{id:`local`,value:`local`,label:`Keep local`,hint:`Only enable source editing during local development`}],recommended:`local`,required:!0}))===`local`)return withLegacyScaffold({kind:`local`},n);let[i,a,o]=await Promise.all([e.resolveVercelProject(`self-modification`),t.detectGitRepository(),t.detectChannelNames()]),s=await e.asker.ask(text({key:`self-modification-repository-owner`,message:`GitHub repository owner`,detected:a.owner,required:!0,validate:e=>validationResult(repositoryPartError(e))})),c=await e.asker.ask(text({key:`self-modification-repository-name`,message:`GitHub repository name`,detected:a.repo,required:!0,validate:e=>validationResult(repositoryPartError(e))})),l=await e.asker.ask(text({key:`self-modification-repository-directory`,message:`Application directory relative to the repository root`,detected:a.directory??`.`,required:!0,validate:e=>validationResult(directoryError(e))})),u=await e.asker.ask(text({key:`self-modification-target-branch`,message:`Target branch`,detected:a.branch??`main`,required:!0,validate:e=>validationResult(gitRefError(e))})),d=connectorName(s,c),f={branch:u,channelNames:o,connector:`github/${d}`,directory:l,repository:`github.com/${s}/${c}`,vercelBackend:!0};return e.presenter.note(renderSelfModificationConfig(f),`Generated ${DEPLOYED_SELF_MODIFICATION_CONFIG_PATH}`),e.presenter.note(`Vercel Connect will issue short-lived GitHub App credentials restricted to this repository. Install the managed GitHub App and select only this repository. Review, merge, and deployment remain separate operator boundaries.`,`Security summary`),withLegacyScaffold(await e.asker.ask(confirm({key:`self-modification-confirm`,message:`Create or attach this GitHub connector and write this configuration?`,recommended:!1,required:!0}))?{kind:`deployed`,connectorName:d,project:i,values:f}:{kind:`local`},n)}async function applySelfModificationSetup(e,t,n=defaultSelfModificationSetupOperations(t.appRoot,void 0,t.projectRoot),r=defaultApplyDependencies){if(e.legacyScaffold!==void 0&&(await removeLegacySelfModificationScaffold(t.appRoot,e.legacyScaffold),t.presenter.log.success(`Removed the retired self-modification scaffold.`)),e.kind===`authored`)return{facts:[{label:`Self-modification`,value:`manual configuration update required`}]};if(e.kind===`local`)return{facts:[]};let i=await n.findOrCreateConnector(e.connectorName,e.project);await n.attachConnector(i,e.project);let a=await r.ensurePackageDependencies({dependencies:SELF_MODIFICATION_PRODUCTION_DEPENDENCIES,projectRoot:t.appRoot});return await r.installScaffoldDependencies({changed:a.length>0,log:t.presenter.log,projectPath:t.appRoot,signal:t.signal}),await n.writeConfig(renderSelfModificationConfig({...e.values,connector:i})),t.presenter.log.success(`Updated ${DEPLOYED_SELF_MODIFICATION_CONFIG_PATH}.`),t.presenter.nextSteps([`Install the managed GitHub App for the configured repository, then deploy or redeploy.`,e.values.vercelBackend?`After deployment, try self-modification by running \`eve dev <deployment-url>\` from this linked project. The generated policy admits its Vercel OIDC identity over HTTP; configured channels remain denied until you update \`${DEPLOYED_SELF_MODIFICATION_CONFIG_PATH}\`.`:`Before deployment, configure \`authorize\` in \`${DEPLOYED_SELF_MODIFICATION_CONFIG_PATH}\` to admit a trusted principal for your deployment's channel. After deployment, use that channel to try self-modification.`]),{deploymentRequired:!0,facts:[{label:`Repository`,value:e.values.repository},{label:`Application directory`,value:e.values.directory},{label:`Target branch`,value:e.values.branch},{label:`Credential`,value:i}]}}async function prepareLocalSelfModificationSetup(e,t=defaultSelfModificationSetupOperations(e.appRoot,void 0,e.projectRoot)){let n=await prepareLegacyScaffoldCleanup(e),r=await t.readLocalConfig();return classifySelfModificationConfig(r)===`authored`?(e.presenter.note(`The existing ${SELF_MODIFICATION_CONFIG_PATH} contains authored configuration and was not overwritten.`,`Manual update required`,{tone:`warning`}),withLegacyScaffold({kind:`authored`},n)):withLegacyScaffold({kind:`local`},n)}function describeEnvironment(e){if(e.vercel.kind===`available`)return describeIntegrationSetupEnvironment(e);switch(e.vercel.reason){case`logged-out`:return`No authenticated Vercel account found. Local editing remains available; deployed proposals require Vercel Connect.`;case`cli-missing`:return`Vercel CLI not found. Local editing remains available; deployed proposals require Vercel Connect.`;case`unavailable`:return`Could not verify the Vercel account. Local editing remains available; deployed proposals require Vercel Connect.`}}const SELF_MODIFICATION_SETUP=defineSetupIntegration({kind:`self-modification`,label:`Self-modification`,hint:`Local source editing is enabled`,describeEnvironment,prepare:prepareLocalSelfModificationSetup,apply:applySelfModificationSetup}),SELF_MODIFICATION_PRODUCTION_SETUP=defineSetupIntegration({kind:`self-modification-production`,label:`Self-modification production`,hint:`Configure deployed draft pull requests`,describeEnvironment,prepare:prepareSelfModificationSetup,apply:applySelfModificationSetup});export{SELF_MODIFICATION_PRODUCTION_SETUP,SELF_MODIFICATION_SETUP,applySelfModificationSetup,prepareLocalSelfModificationSetup,prepareSelfModificationSetup};