eve 0.75.1 → 0.76.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/channel-address.d.ts +3 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/session-stranded-error.d.ts +25 -0
- package/dist/src/channel/session-stranded-error.js +1 -0
- package/dist/src/channel/session.d.ts +13 -6
- package/dist/src/channel/task-card.js +1 -1
- package/dist/src/channel/tool-eligibility.d.ts +1 -2
- package/dist/src/channel/types.d.ts +29 -1
- package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-BtKWTEpm.js} +99 -24
- package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-jI6EsYAu.js} +99 -24
- package/dist/src/cli/commands/registry-project.d.ts +10 -3
- package/dist/src/cli/commands/registry-project.js +2 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +0 -6
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/conversation-view.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +3 -3
- package/dist/src/cli/dev/tui/stranded-session.d.ts +9 -0
- package/dist/src/cli/dev/tui/stranded-session.js +1 -0
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/client/client-error.d.ts +16 -0
- package/dist/src/client/client-error.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +3 -0
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +6 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/open-stream.d.ts +5 -3
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/transcript-reducer.d.ts +46 -0
- package/dist/src/client/transcript-reducer.js +2 -0
- package/dist/src/compiled/.vendor-stamp.json +3 -2
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
- package/dist/src/compiled/@vercel/queue/index.js +47 -0
- package/dist/src/compiler/connection-ownership.d.ts +6 -0
- package/dist/src/compiler/connection-ownership.js +1 -0
- package/dist/src/compiler/default-tool-policy.d.ts +0 -3
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +23 -22
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +9 -6
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +5 -0
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +2 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +2 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/connections/ownership.d.ts +18 -0
- package/dist/src/connections/ownership.js +1 -0
- package/dist/src/context/accessors.d.ts +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/build-dynamic-tools.d.ts +3 -9
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
- package/dist/src/context/dynamic-resolve-context.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +10 -4
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-tools.js +1 -1
- package/dist/src/context/providers/session.d.ts +1 -0
- package/dist/src/context/providers/session.js +1 -1
- package/dist/src/context/schedule-collection-tools.js +1 -1
- package/dist/src/context/session-context.d.ts +8 -2
- package/dist/src/discover/grammar.d.ts +11 -0
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.d.ts +1 -0
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/skills.d.ts +1 -0
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/dynamic/definition.d.ts +14 -6
- package/dist/src/evals/assertions/collector.d.ts +4 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +2 -3
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/evals/assertions/scoped.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +9 -6
- package/dist/src/evals/reported-tool-name.d.ts +9 -0
- package/dist/src/evals/reported-tool-name.js +1 -0
- package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
- package/dist/src/evals/runner/reporters/datadog.js +2 -2
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/target.d.ts +7 -0
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +19 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/eve-channel/support.d.ts +2 -0
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/execution/agent-sessions/remote.js +1 -1
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
- package/dist/src/execution/catalog/connection-auth.js +1 -0
- package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
- package/dist/src/execution/catalog/connection-entry.js +1 -0
- package/dist/src/execution/catalog/listing.d.ts +9 -0
- package/dist/src/execution/catalog/listing.js +3 -0
- package/dist/src/execution/catalog/rank.d.ts +44 -0
- package/dist/src/execution/catalog/rank.js +1 -0
- package/dist/src/execution/catalog/search.d.ts +28 -0
- package/dist/src/execution/catalog/search.js +1 -0
- package/dist/src/execution/catalog/signatures.d.ts +11 -0
- package/dist/src/execution/catalog/signatures.js +1 -0
- package/dist/src/execution/catalog/skills.d.ts +24 -0
- package/dist/src/execution/catalog/skills.js +1 -0
- package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
- package/dist/src/execution/catalog/step-catalog.js +1 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +15 -0
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/install-workflow-world.d.ts +7 -0
- package/dist/src/execution/install-workflow-world.js +1 -0
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/legacy-session/authorization.js +1 -1
- package/dist/src/execution/legacy-session/inbox.js +1 -1
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session/active-turn.d.ts +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +11 -0
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/timeout-steps.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +5 -5
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-event-stream.d.ts +6 -0
- package/dist/src/execution/session-event-stream.js +1 -1
- package/dist/src/execution/session-inbox/address.d.ts +4 -0
- package/dist/src/execution/session-inbox/address.js +1 -1
- package/dist/src/execution/session-inbox/end-stranded-session.d.ts +22 -0
- package/dist/src/execution/session-inbox/end-stranded-session.js +1 -0
- package/dist/src/execution/session-inbox/hook-release.d.ts +4 -0
- package/dist/src/execution/session-inbox/hook-release.js +1 -0
- package/dist/src/execution/session-inbox/owner.d.ts +48 -0
- package/dist/src/execution/session-inbox/owner.js +1 -0
- package/dist/src/execution/session-inbox/resume.d.ts +12 -0
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-inbox/runnable-owner.d.ts +13 -0
- package/dist/src/execution/session-inbox/runnable-owner.js +1 -0
- package/dist/src/execution/session-inbox/stranded-replay-guard.d.ts +16 -0
- package/dist/src/execution/session-inbox/stranded-replay-guard.js +1 -0
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +20 -10
- package/dist/src/execution/skills/instructions.js +2 -2
- package/dist/src/execution/tasks/calls.d.ts +6 -5
- package/dist/src/execution/tasks/calls.js +1 -1
- package/dist/src/execution/tasks/model-step.d.ts +10 -10
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/render.d.ts +3 -3
- package/dist/src/execution/tasks/render.js +3 -3
- package/dist/src/execution/tasks/session.d.ts +2 -1
- package/dist/src/execution/tasks/table.d.ts +1 -1
- package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +5 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/code/extension/extension.d.ts +4 -18
- package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
- package/dist/src/extensions/code/extension/instructions/github.js +1 -0
- package/dist/src/extensions/code/extension/instructions.md +1 -13
- package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
- package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
- package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
- package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
- package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
- package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
- package/dist/src/extensions/code/extension/lib/patch.js +4 -4
- package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
- package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
- package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
- package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
- package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
- package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
- package/dist/src/extensions/code/extension/skills/pr.js +1 -0
- package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
- package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
- package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
- package/dist/src/extensions/code/extension/tools/gh.js +1 -1
- package/dist/src/extensions/code/extension/tools/grep.js +1 -1
- package/dist/src/extensions/code/tools.d.ts +2 -1
- package/dist/src/extensions/code/tools.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +12 -0
- package/dist/src/extensions/git/extension/extension.js +1 -0
- package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
- package/dist/src/extensions/git/extension/instructions/github.js +1 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
- package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
- package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
- package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
- package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
- package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
- package/dist/src/extensions/git/extension/lib/shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
- package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
- package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
- package/dist/src/extensions/git/extension/skills/pr.js +1 -0
- package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
- package/dist/src/extensions/git/extension/tools/gh.js +1 -0
- package/dist/src/extensions/git/tools.d.ts +27 -0
- package/dist/src/extensions/git/tools.js +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/action-presentation.d.ts +2 -2
- package/dist/src/harness/action-result-helpers.d.ts +10 -2
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/announcements.d.ts +2 -8
- package/dist/src/harness/announcements.js +1 -1
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/coordination.d.ts +11 -11
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +1 -5
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-call.d.ts +48 -0
- package/dist/src/harness/execute-call.js +1 -0
- package/dist/src/harness/execute-tool.d.ts +3 -1
- package/dist/src/harness/final-output.d.ts +2 -6
- package/dist/src/harness/final-output.js +1 -1
- package/dist/src/harness/hitl/approvals.d.ts +5 -0
- package/dist/src/harness/hitl/approvals.js +1 -1
- package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
- package/dist/src/harness/hitl/approved-calls.js +1 -1
- package/dist/src/harness/hitl/candidates.d.ts +13 -2
- package/dist/src/harness/hitl/candidates.js +1 -1
- package/dist/src/harness/hitl/coordinator.d.ts +3 -3
- package/dist/src/harness/hitl/coordinator.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +6 -4
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.d.ts +3 -3
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +15 -0
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +4 -6
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.d.ts +5 -6
- package/dist/src/harness/model-call/errors.js +1 -1
- package/dist/src/harness/model-call/recovery.d.ts +4 -3
- package/dist/src/harness/model-call/request.d.ts +5 -3
- package/dist/src/harness/model-call/request.js +1 -1
- package/dist/src/harness/model-call/response.d.ts +2 -1
- package/dist/src/harness/model-call/response.js +1 -1
- package/dist/src/harness/model-call/run.d.ts +5 -3
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/model-call/tools.d.ts +12 -21
- package/dist/src/harness/model-call/tools.js +1 -1
- package/dist/src/harness/model-profile.d.ts +15 -3
- package/dist/src/harness/model-profile.js +1 -1
- package/dist/src/harness/prompt-cache.d.ts +6 -3
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +2 -1
- package/dist/src/harness/provider-safety.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +7 -6
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/session-machine/commit.js +1 -1
- package/dist/src/harness/session-machine/transitions.d.ts +8 -3
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/step/after-model.js +1 -1
- package/dist/src/harness/step/context.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +4 -6
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
- package/dist/src/harness/tool-call-io.d.ts +3 -0
- package/dist/src/harness/tool-call-io.js +1 -1
- package/dist/src/harness/tools.d.ts +22 -19
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +14 -0
- package/dist/src/instrumentation/lifecycle.d.ts +0 -1
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +2 -1
- package/dist/src/internal/application/compiled-artifacts.js +4 -4
- package/dist/src/internal/application/package.d.ts +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/stamped-package-version.d.ts +5 -0
- package/dist/src/internal/application/stamped-package-version.js +1 -0
- package/dist/src/internal/authored-definition/core.d.ts +3 -0
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module.d.ts +2 -1
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/mcp/skills.js +1 -1
- package/dist/src/internal/model-auth/available-models.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
- package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
- package/dist/src/internal/schedules/consumer-route.js +1 -1
- package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
- package/dist/src/internal/schedules/dev-environment.js +1 -0
- package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
- package/dist/src/internal/workflow/development-run-unavailable-error.d.ts +15 -0
- package/dist/src/internal/workflow/development-run-unavailable-error.js +1 -0
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/catalog-tools.d.ts +12 -0
- package/dist/src/protocol/catalog-tools.js +1 -0
- package/dist/src/protocol/message-version.js +1 -1
- package/dist/src/protocol/message.d.ts +15 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
- package/dist/src/protocol/remote-agent-protocol.js +1 -1
- package/dist/src/protocol/reply-tool.d.ts +2 -0
- package/dist/src/protocol/reply-tool.js +1 -0
- package/dist/src/protocol/runtime-tools.d.ts +6 -0
- package/dist/src/protocol/runtime-tools.js +1 -0
- package/dist/src/protocol/session-projection.js +1 -1
- package/dist/src/protocol/task-tools.d.ts +4 -4
- package/dist/src/protocol/task-tools.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/defaults.js +2 -2
- package/dist/src/public/channels/slack/action-status.d.ts +0 -9
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/task-card.d.ts +1 -1
- package/dist/src/public/context/index.d.ts +1 -1
- package/dist/src/public/definitions/callback-context.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -0
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
- package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
- package/dist/src/public/definitions/remote-agent.d.ts +6 -3
- package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
- package/dist/src/public/experimental/schedules/index.d.ts +1 -1
- package/dist/src/public/models/openai/chatgpt/model.js +1 -1
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/schedules/providers/in-memory.js +1 -1
- package/dist/src/public/schedules/providers/vercel.js +1 -1
- package/dist/src/public/schedules/subscription.d.ts +36 -16
- package/dist/src/public/tanstack/index.d.ts +40 -0
- package/dist/src/public/tanstack/index.js +1 -0
- package/dist/src/public/tools/web-search.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
- package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
- package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/registry.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/tool-result.d.ts +2 -2
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +2 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.d.ts +2 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -3
- package/dist/src/setup/connection-connector.js +1 -2
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/setup/index.d.ts +1 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
- package/dist/src/setup/integrations/slack/setup.js +1 -1
- package/dist/src/setup/integrations/web/framework.d.ts +8 -0
- package/dist/src/setup/integrations/web/framework.js +1 -0
- package/dist/src/setup/integrations/web/hosting.d.ts +43 -0
- package/dist/src/setup/integrations/web/hosting.js +15 -0
- package/dist/src/setup/integrations/web/setup.d.ts +6 -10
- package/dist/src/setup/integrations/web/setup.js +23 -17
- package/dist/src/setup/primitives/process-output.d.ts +5 -0
- package/dist/src/setup/primitives/process-output.js +2 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +7 -3
- package/dist/src/setup/scaffold/create/web-template.js +40 -3
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
- package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
- package/dist/src/setup/slack-connect-create.d.ts +10 -2
- package/dist/src/setup/slack-connect-create.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slack-connect.d.ts +30 -11
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/slack-setup-plan.d.ts +72 -0
- package/dist/src/setup/slack-setup-plan.js +1 -0
- package/dist/src/setup/slackbot.d.ts +75 -35
- package/dist/src/setup/slackbot.js +2 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/shared/action-label.d.ts +10 -0
- package/dist/src/shared/action-label.js +1 -0
- package/dist/src/shared/action-request-name.d.ts +3 -1
- package/dist/src/shared/action-request-name.js +1 -1
- package/dist/src/shared/action-types.d.ts +7 -8
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +36 -3
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/shared/chatgpt-model.d.ts +8 -0
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/development-env-files.d.ts +4 -0
- package/dist/src/shared/development-env-files.js +1 -0
- package/dist/src/shared/input.d.ts +0 -1
- package/dist/src/shared/map-with-concurrency.d.ts +2 -0
- package/dist/src/shared/map-with-concurrency.js +1 -0
- package/dist/src/shared/skill-definition.d.ts +6 -0
- package/dist/src/shared/skill-package.d.ts +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/web-search.d.ts +15 -2
- package/dist/src/shared/web-search.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tool-stubs/execute.d.ts +0 -3
- package/dist/src/tool-stubs/execute.js +1 -1
- package/dist/src/tool-stubs/rules.js +1 -1
- package/dist/src/tool-stubs/validate-targets.js +1 -1
- package/dist/src/tools/behavior.d.ts +3 -6
- package/dist/src/tools/definition.d.ts +5 -0
- package/dist/src/tools/dynamic.d.ts +5 -2
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/task-cancel.d.ts +1 -1
- package/dist/src/tools/provided/task-wait.d.ts +1 -1
- package/dist/src/tools/provided/web-search.d.ts +20 -7
- package/dist/src/tools/provided/web-search.js +1 -1
- package/dist/src/tools/schema.d.ts +5 -0
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
- package/dist/src/tools/workflow-definition.d.ts +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
- package/dist/src/tracing/agent-otel-turn-state.js +1 -0
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +4 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +39 -8
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/custom.mdx +26 -0
- package/docs/channels/eve.mdx +8 -5
- package/docs/channels/slack.mdx +32 -82
- package/docs/code-extension.mdx +28 -7
- package/docs/concepts/built-in-tools.md +60 -43
- package/docs/concepts/context-control.md +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +101 -1
- package/docs/concepts/project-structure.mdx +2 -2
- package/docs/concepts/sessions-runs-and-streaming.md +40 -38
- package/docs/connections/mcp.mdx +5 -5
- package/docs/connections/openapi.mdx +1 -1
- package/docs/connections/overview.mdx +4 -2
- package/docs/evals/assertions.mdx +5 -3
- package/docs/evals/reporters.mdx +3 -1
- package/docs/evals/tool-stubs.mdx +3 -1
- package/docs/extensions.md +2 -0
- package/docs/guides/client/messages.mdx +10 -1
- package/docs/guides/deployment/overview.md +2 -2
- package/docs/guides/dev-tui.md +4 -2
- package/docs/guides/dynamic-capabilities.md +14 -4
- package/docs/guides/frontend/meta.json +9 -1
- package/docs/guides/frontend/nextjs.mdx +1 -1
- package/docs/guides/frontend/overview.mdx +10 -9
- package/docs/guides/frontend/tanstack.mdx +201 -0
- package/docs/guides/remote-agents.md +10 -3
- package/docs/guides/session-context.md +1 -0
- package/docs/install-integrations.mdx +1 -1
- package/docs/instructions.mdx +6 -6
- package/docs/reference/cli.md +2 -2
- package/docs/reference/typescript-api.md +4 -4
- package/docs/skills.mdx +19 -4
- package/docs/subagents/index.mdx +5 -3
- package/docs/tools/human-in-the-loop.md +2 -0
- package/docs/tools/overview.mdx +22 -1
- package/docs/tools/tasks-upgrade.md +1 -1
- package/docs/tools/tasks.md +32 -32
- package/docs/tools/workflows.mdx +6 -6
- package/docs/tutorial/ship-it.mdx +1 -1
- package/docs/tutorial/team-playbooks.mdx +2 -2
- package/package.json +28 -6
- package/dist/src/execution/connection-announcement.d.ts +0 -7
- package/dist/src/execution/connection-announcement.js +0 -4
- package/dist/src/execution/tools/connection-approval.d.ts +0 -25
- package/dist/src/execution/tools/connection-approval.js +0 -1
- package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
- package/dist/src/execution/tools/connection-search-rank.js +0 -1
- package/dist/src/execution/tools/connection-target.d.ts +0 -18
- package/dist/src/execution/tools/connection-target.js +0 -1
- package/dist/src/execution/tools/connection-tools.d.ts +0 -4
- package/dist/src/execution/tools/connection-tools.js +0 -2
- package/dist/src/execution/tools/load-skill.d.ts +0 -10
- package/dist/src/execution/tools/load-skill.js +0 -1
- package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
- package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -26
- package/dist/src/harness/advertised-tools.js +0 -1
- package/dist/src/harness/nested-actions.d.ts +0 -23
- package/dist/src/harness/nested-actions.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
- package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
- package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
- package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
- package/dist/src/public/tools/load-skill.d.ts +0 -3
- package/dist/src/public/tools/load-skill.js +0 -1
- package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
- package/dist/src/runtime/skills/fragment-context.js +0 -1
- package/dist/src/tools/framework/connection-tools.d.ts +0 -3
- package/dist/src/tools/framework/connection-tools.js +0 -1
- package/dist/src/tools/provided/load-skill.d.ts +0 -2
- package/dist/src/tools/provided/load-skill.js +0 -1
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
- /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
|
@@ -49,20 +49,10 @@ Required steps, in order:
|
|
|
49
49
|
|
|
50
50
|
# Repository work
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Pass commands as simple argv with ordinary quoting. Do not use environment assignments, pipes, redirects, substitutions, or other shell syntax. Commands without an explicit repository may use normal `gh` context, but their token remains scoped to the declared repository. An explicit `-R`, `--repo`, `--repo=`, or repository argument to `gh repo clone`, `view`, or `fork` must match the declaration.
|
|
55
|
-
|
|
56
|
-
Determine the repositories needed to complete the task through source discovery and investigation, even when the requester does not name them. Do not ask the requester to enumerate repositories that can be discovered, and never default to the current agent's repository. The agent may select additional repositories as the work reveals them. Each authenticated command declares exactly one target repository and mints a credential lease for that repository at the moment it is needed, so cross-repository work uses separate scoped commands and leases.
|
|
57
|
-
|
|
58
|
-
Clone with `gh repo clone owner/name`. Use authenticated `git fetch`, `git pull`, `git push`, and `git ls-remote` through the `gh` tool too. Local `git status`, `diff`, `add`, `commit`, and `rebase` remain ordinary `bash` commands because they need no GitHub credential. Immediately after entering a checkout and before planning or editing, read its root `AGENTS.md`; use root `CLAUDE.md` only when `AGENTS.md` is absent. Before touching any path, read the nearest nested `AGENTS.md`, falling back to `CLAUDE.md` only when that directory has no `AGENTS.md`.
|
|
52
|
+
Immediately after entering a checkout and before planning or editing, read its root `AGENTS.md`; use root `CLAUDE.md` only when `AGENTS.md` is absent. Before touching any path, read the nearest nested `AGENTS.md`, falling back to `CLAUDE.md` only when that directory has no `AGENTS.md`.
|
|
59
53
|
|
|
60
54
|
Do not rebase before work by default. Rebase only when the requester explicitly asks for it or when an explicitly requested publication or delivery outcome requires a current base. Inspect the worktree first and preserve pre-existing changes.
|
|
61
55
|
|
|
62
|
-
Use GitHub CLI commands through the `gh` tool for issues, pull requests, reviews, Actions, CI, authentication status, configuration, aliases, extensions, and API requests. Common commands include `gh pr create --draft`, `gh pr checks`, `gh run rerun --failed`, and `gh pr review`, but they are not restrictions.
|
|
63
|
-
|
|
64
|
-
Repositories that require verified signatures reject ordinary sandbox commits. Stage the intended changes explicitly, run `gh-signed-commit --repo owner/name --branch <branch> -m <headline>` through the `gh` tool, then create the draft pull request through the same tool.
|
|
65
|
-
|
|
66
56
|
Use apply_patch for authored edits. Formatters and generators may write their own output. Never rewrite files through shell or Python when a focused patch is sufficient. Write small hunks against current file contents. If a hunk misses, re-read that file and rewrite only the failed hunk.
|
|
67
57
|
|
|
68
58
|
Use `grep` for sandbox content search. Start with `files_with_matches` and a narrow path or glob.
|
|
@@ -73,8 +63,6 @@ Make the smallest coherent change. Run focused validation first, then broader ch
|
|
|
73
63
|
|
|
74
64
|
Be mindful of loading large files into your context window.
|
|
75
65
|
|
|
76
|
-
Load the pr skill before publishing. Create one pull request per request unless the requester asks otherwise.
|
|
77
|
-
|
|
78
66
|
## Destructive actions
|
|
79
67
|
|
|
80
68
|
Before deleting, overwriting, or making data difficult to recover, confirm scope and resolve the exact target with read-only checks. Never use a home directory, repository root, workspace root, unresolved variable, broad glob, or command substitution as a recursive destructive target. Prefer recoverable operations and stop when target or authority is unclear.
|
|
@@ -12,7 +12,9 @@ export declare function runPostEditDiagnostics(input: {
|
|
|
12
12
|
readonly addedPaths?: readonly string[];
|
|
13
13
|
readonly changedPaths: readonly string[];
|
|
14
14
|
readonly deletedPaths: readonly string[];
|
|
15
|
-
readonly
|
|
15
|
+
readonly patchRoot: string;
|
|
16
|
+
/** Content each written path had before the patch; null or absent for new files. */
|
|
17
|
+
readonly previousContents?: ReadonlyMap<string, string | null>;
|
|
16
18
|
readonly sandbox: DiagnosticsSandbox;
|
|
17
19
|
}): Promise<PostEditDiagnostic[]>;
|
|
18
20
|
/**
|
|
@@ -22,7 +24,7 @@ export declare function runPostEditDiagnostics(input: {
|
|
|
22
24
|
*/
|
|
23
25
|
export declare function runTypeScriptDiagnostics(input: {
|
|
24
26
|
readonly paths: readonly string[];
|
|
25
|
-
readonly
|
|
27
|
+
readonly patchRoot: string;
|
|
26
28
|
readonly sandbox: DiagnosticsSandbox;
|
|
27
29
|
}): Promise<PostEditDiagnostic[]>;
|
|
28
30
|
/** Drop type diagnostics that already existed before the patch, matched by path, code, and message. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{shellQuote}from"./shell.js";import{toolingPaths}from"./tooling.js";import{extname}from"node:path";async function runPostEditDiagnostics(e){let t=[...new Set([...e.changedPaths,...e.deletedPaths])],n=[];if(t.length>0)try{let
|
|
2
|
-
`)})}catch(e){n.push({check:`whitespace`,path:t,message:`Could not inspect
|
|
1
|
+
import{shellQuote}from"./shell.js";import{toolingPaths}from"./tooling.js";import{extname}from"node:path";async function runPostEditDiagnostics(e){let t=[...new Set([...e.changedPaths,...e.deletedPaths])],n=[],r=!1;if(t.length>0)try{let i=shellQuote(e.patchRoot),a=await e.sandbox.run({command:`git -C ${i} rev-parse --is-inside-work-tree`});if(r=a.exitCode===0&&a.stdout.trim()===`true`,r){let r=await e.sandbox.run({command:`git -C ${i} diff --check -- ${t.map(shellQuote).join(` `)}`});r.exitCode!==0&&n.push({check:`git-diff`,message:boundedDiagnostic(r.stderr||r.stdout||`git diff --check failed`)})}}catch(e){n.push({check:`git-diff`,message:`Could not run git diff --check: ${errorMessage(e)}`})}let i=r?e.addedPaths??[]:e.changedPaths;for(let t of i)try{let r=await e.sandbox.readTextFile({path:`${e.patchRoot}/${t}`});if(r===null)continue;let i=whitespaceIssues(r,e.previousContents?.get(t));i.length>0&&n.push({check:`whitespace`,path:t,message:i.join(`
|
|
2
|
+
`)})}catch(e){n.push({check:`whitespace`,path:t,message:`Could not inspect written file: ${errorMessage(e)}`})}for(let t=0;t<e.changedPaths.length;t+=8){let r=await Promise.all(e.changedPaths.slice(t,t+8).map(async t=>{let n=syntaxCommand(e.patchRoot,t);if(n===null)return null;try{let r=await e.sandbox.run({command:n});if(r.exitCode===0)return null;let i=r.stderr||r.stdout||`syntax check failed`;return i.includes(`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`)?null:{check:`syntax`,path:t,message:boundedDiagnostic(i)}}catch(e){return{check:`syntax`,path:t,message:`Could not run syntax check: ${errorMessage(e)}`}}}));for(let e of r)e!==null&&n.push(e)}return n.push(...await runTypeScriptDiagnostics({paths:e.changedPaths,patchRoot:e.patchRoot,sandbox:e.sandbox})),n}async function runTypeScriptDiagnostics(e){let t=e.paths.filter(isTypeScriptPath);if(t.length===0)return[];let n=toolingPaths(e.sandbox);if(await e.sandbox.readTextFile({path:n.worker})===null)return[];let r=[];for(let i=0;i<t.length;i+=4){let a=await Promise.all(t.slice(i,i+4).map(async t=>{let r=Buffer.from(JSON.stringify({filePath:t,patchRoot:e.patchRoot,typescriptPath:n.typescriptModule}),`utf8`).toString(`base64`);try{let i=await e.sandbox.run({command:`node ${shellQuote(n.worker)}`,env:{EVE_CODE_DIAGNOSTICS_REQUEST:r}});return i.exitCode===0?(JSON.parse(i.stdout).diagnostics??[]).map(e=>({check:`typescript`,code:e.code,column:e.column,line:e.line,message:e.message,path:t})):[{check:`typescript`,path:t,message:boundedDiagnostic(i.stderr||i.stdout||`TypeScript diagnostics failed`)}]}catch(e){return[{check:`typescript`,path:t,message:`Could not run TypeScript diagnostics: ${errorMessage(e)}`}]}}));r.push(...a.flat())}return r}function onlyNewTypeDiagnostics(e,t){let n=new Map;for(let e of t){if(e.check!==`typescript`||e.code===void 0)continue;let t=typeDiagnosticKey(e);n.set(t,(n.get(t)??0)+1)}return e.filter(e=>{if(e.check!==`typescript`||e.code===void 0)return!0;let t=typeDiagnosticKey(e),r=n.get(t)??0;return r===0||(n.set(t,r-1),!1)})}function typeDiagnosticKey(e){return`${e.path??``}\0${e.code??``}\0${e.message}`}function isTypeScriptPath(e){return/\.(?:cts|mts|ts|tsx)$/u.test(e)}function syntaxCommand(e,t){let n=shellQuote(`${e}/${t}`);switch(extname(t).toLowerCase()){case`.cjs`:case`.js`:case`.mjs`:return`node --check ${n}`;case`.cts`:case`.mts`:case`.ts`:return`node --experimental-strip-types --check ${n}`;case`.json`:return`node -e ${shellQuote(`JSON.parse(require('node:fs').readFileSync(process.argv[1], 'utf8'))`)} ${n}`;case`.bash`:case`.sh`:return`bash -n ${n}`;case`.py`:return`if command -v python3 >/dev/null 2>&1; then python3 -c ${shellQuote(`import ast,pathlib,sys; ast.parse(pathlib.Path(sys.argv[1]).read_text())`)} ${n}; fi`;default:return null}}function boundedDiagnostic(e){let t=e.trim().split(`
|
|
3
3
|
`),n=t.slice(-100);for(;n.length>1&&Buffer.byteLength(n.join(`
|
|
4
4
|
`),`utf8`)>8192;)n=n.slice(1);let r=t.length-n.length;return r>0?`[${r} earlier lines omitted]\n${n.join(`
|
|
5
5
|
`)}`:n.join(`
|
|
6
|
-
`)}function whitespaceIssues(e){let t=[];for(let[
|
|
6
|
+
`)}function whitespaceIssues(e,t){let n=new Set(t?.split(/\r?\n/u)??[]),r=[];for(let[t,i]of e.split(/\r?\n/u).entries())if(!n.has(i)&&(/^(?:<<<<<<<|=======|>>>>>>>)(?: |$)/u.test(i)?r.push(`line ${t+1}: unresolved conflict marker`):/[\t ]+$/u.test(i)&&r.push(`line ${t+1}: trailing whitespace`),r.length===20))break;return r}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{onlyNewTypeDiagnostics,runPostEditDiagnostics,runTypeScriptDiagnostics};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare function deprecatedGitHubConfigured(): boolean;
|
|
2
|
+
/** @deprecated Mount `eve/extensions/git` with `github` config, or import `gh` from `eve/extensions/git/tools`. */
|
|
3
|
+
export declare const gh: import("../../../../tools/definition.ts").ToolDefinition<{
|
|
4
|
+
command: string;
|
|
5
|
+
permissions: {
|
|
6
|
+
provider: "github";
|
|
7
|
+
repositories: string[];
|
|
8
|
+
access: "write";
|
|
9
|
+
}[];
|
|
10
|
+
description: string;
|
|
11
|
+
workingDirectory?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
exitCode: number;
|
|
14
|
+
stderr: string;
|
|
15
|
+
stdout: string;
|
|
16
|
+
truncated: boolean;
|
|
17
|
+
}> & {
|
|
18
|
+
execute(input: {
|
|
19
|
+
command: string;
|
|
20
|
+
permissions: {
|
|
21
|
+
provider: "github";
|
|
22
|
+
repositories: string[];
|
|
23
|
+
access: "write";
|
|
24
|
+
}[];
|
|
25
|
+
description: string;
|
|
26
|
+
workingDirectory?: string | undefined;
|
|
27
|
+
}, ctx: import("../../../../tools/definition.ts").ToolContext): Promise<import("eve/extensions/git/sandbox").GitHubShellOutput>;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import extension_default from"../extension.js";import{defineGhTool}from"eve/extensions/git/sandbox";function deprecatedGitHubConfigured(){return extension_default.config.github!==void 0}const gh=defineGhTool(()=>extension_default.config.github);export{deprecatedGitHubConfigured,gh};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WorkspaceSandbox } from "./workspace-root.ts";
|
|
1
2
|
export declare const MAX_GREP_LIMIT = 200;
|
|
2
3
|
export declare const MAX_GREP_COMMAND_BYTES: number;
|
|
3
4
|
export declare const MAX_GREP_LINE_BYTES: number;
|
|
@@ -21,17 +22,6 @@ export interface GrepSearchResult {
|
|
|
21
22
|
readonly path: string;
|
|
22
23
|
readonly truncated: boolean;
|
|
23
24
|
}
|
|
24
|
-
interface GrepSandbox {
|
|
25
|
-
resolvePath(path: string): string;
|
|
26
|
-
run(input: {
|
|
27
|
-
abortSignal?: AbortSignal;
|
|
28
|
-
command: string;
|
|
29
|
-
}): PromiseLike<{
|
|
30
|
-
exitCode: number;
|
|
31
|
-
stderr: string;
|
|
32
|
-
stdout: string;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
25
|
interface GrepToolInput {
|
|
36
26
|
readonly context?: number;
|
|
37
27
|
readonly glob?: string;
|
|
@@ -46,8 +36,8 @@ interface GrepToolInput {
|
|
|
46
36
|
export declare function shouldUseFixedStrings(pattern: string, literal: boolean | undefined): boolean;
|
|
47
37
|
export declare function effectiveOutputMode(outputMode: GrepOutputMode | undefined): GrepOutputMode;
|
|
48
38
|
export declare function effectiveLimit(limit: number | undefined): number;
|
|
49
|
-
export declare function
|
|
50
|
-
export declare function executeGrepSearch(input: GrepToolInput, sandbox:
|
|
39
|
+
export declare function assertNoParentSegments(resolved: string, requested?: string): string;
|
|
40
|
+
export declare function executeGrepSearch(input: GrepToolInput, sandbox: WorkspaceSandbox, abortSignal?: AbortSignal): Promise<GrepSearchResult>;
|
|
51
41
|
export declare function buildSearchCommand(input: GrepCommandInput): string;
|
|
52
42
|
export declare function buildRipgrepCommand(input: GrepCommandInput): string;
|
|
53
43
|
export declare function buildPosixGrepCommand(input: GrepCommandInput): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{shellQuote}from"./shell.js";const MAX_GREP_LIMIT=200,MAX_GREP_COMMAND_BYTES=262144,MAX_GREP_LINE_BYTES=8192,MAX_GREP_RETURN_BYTES=65536,REGEX_META=/[\\^$.*+?()[\]{}|]/u,GREP_OUTPUT_MODES=[`files_with_matches`,`content`,`count`];function shouldUseFixedStrings(e,t){return t===!0||t!==!1&&!REGEX_META.test(e)}function effectiveOutputMode(e){return e??`files_with_matches`}function effectiveLimit(e){return Math.min(Math.max(1,e??50),200)}function
|
|
1
|
+
import{shellQuote}from"./shell.js";import{resolveInWorkspace}from"./workspace-root.js";const MAX_GREP_LIMIT=200,MAX_GREP_COMMAND_BYTES=262144,MAX_GREP_LINE_BYTES=8192,MAX_GREP_RETURN_BYTES=65536,REGEX_META=/[\\^$.*+?()[\]{}|]/u,GREP_OUTPUT_MODES=[`files_with_matches`,`content`,`count`];function shouldUseFixedStrings(e,t){return t===!0||t!==!1&&!REGEX_META.test(e)}function effectiveOutputMode(e){return e??`files_with_matches`}function effectiveLimit(e){return Math.min(Math.max(1,e??50),200)}function assertNoParentSegments(e,t){if(t!==void 0&&t.split(/[\\/]/u).includes(`..`)||e.split(`/`).includes(`..`))throw Error(`grep path must not contain '..'`);return e}async function executeGrepSearch(e,t,n){let r=assertNoParentSegments(t.resolvePath(e.path??``),e.path),{path:i}=await resolveInWorkspace(t,r,`grep path`,n),a=effectiveOutputMode(e.outputMode),o=effectiveLimit(e.limit),s=buildSearchCommand({contextLines:e.context??0,glob:e.glob,ignoreCase:e.ignoreCase===!0,limit:o,literal:shouldUseFixedStrings(e.pattern,e.literal),outputMode:a,path:i,pattern:e.pattern}),c=await t.run({abortSignal:n,command:s}),l=truncateUtf8(c.stdout,MAX_GREP_COMMAND_BYTES),u=l.truncated;if(c.exitCode!==0&&c.exitCode!==1||c.exitCode===1&&c.stderr.trim().length>0){let e=c.stderr.trim()||l.value.trim()||`no command output`;throw Error(`grep failed (exit ${c.exitCode}): ${truncateUtf8(e,MAX_GREP_LINE_BYTES).value}`)}return processGrepOutput({commandTruncated:u,limit:o,outputMode:a,path:r,stdout:l.value})}function buildSearchCommand(e){return[`set -o pipefail`,`{`,` if command -v rg >/dev/null 2>&1; then`,` ${buildRipgrepCommand(e)}`,` else`,` ${buildPosixGrepCommand(e)}`,` fi`,`} 2>&1 | head -c 262145`,"search_status=${PIPESTATUS[0]}",`if [ "$search_status" -eq 141 ]; then exit 0; fi`,`exit "$search_status"`].join(`
|
|
2
2
|
`)}function buildRipgrepCommand(e){let t=[`rg`,`--color=never`,`--hidden`,`--glob`,shellQuote(`!.git/*`)];switch(e.ignoreCase&&t.push(`--ignore-case`),e.literal&&t.push(`--fixed-strings`),e.glob!==void 0&&t.push(`--glob`,shellQuote(e.glob)),e.outputMode){case`files_with_matches`:t.push(`--files-with-matches`,`--max-count`,`1`);break;case`count`:t.push(`--count`);break;case`content`:t.push(`--line-number`,`--with-filename`,`--null`),e.contextLines>0&&t.push(`--context`,String(e.contextLines)),t.push(`--max-count`,String(e.limit))}return t.push(`--`,shellQuote(e.pattern),shellQuote(e.path)),t.join(` `)}function buildPosixGrepCommand(e){let t=[`grep`,`-r`,`--exclude-dir=.git`];switch(e.ignoreCase&&t.push(`-i`),e.literal?t.push(`-F`):t.push(`-E`),e.glob!==void 0&&t.push(`--include=${shellQuote(e.glob)}`),e.outputMode){case`files_with_matches`:t.push(`-l`);break;case`count`:t.push(`-c`);break;case`content`:t.push(`-n`,`-H`,`-Z`),e.contextLines>0&&t.push(`-C`,String(e.contextLines)),t.push(`-m`,String(e.limit))}return t.push(`-e`,shellQuote(e.pattern),shellQuote(e.path)),t.join(` `)}function processGrepOutput(e){let t=e.stdout.split(`
|
|
3
3
|
`),n=[],r=`
|
|
4
4
|
|
|
5
5
|
[Output truncated. Narrow path or glob, or lower context.]`,i=MAX_GREP_RETURN_BYTES-Buffer.byteLength(r),a=0,o=0,s=0,c=e.commandTruncated===!0,appendLine=e=>{let t=Buffer.byteLength(e)+(n.length===0?0:1);return a+t>i?!1:(n.push(e),a+=t,!0)};for(let r=0;r<t.length;r+=1){let i=t[r]??``;if(i.length===0&&r===t.length-1)continue;if(i===`--`){if(n.length>0&&!appendLine(i)){c=!0;break}continue}let a=i,l=e.outputMode!==`content`;if(e.outputMode===`content`){let e=normalizeContentLine(i);a=e.line,l=e.isMatch}let u=0;if(e.outputMode===`count`&&(u=parseCountLine(a),u===0))continue;if(s>=e.limit){c=!0;break}let d=truncateUtf8(a,MAX_GREP_LINE_BYTES);if(d.truncated&&(c=!0),!appendLine(d.value)){c=!0;break}s+=1,e.outputMode===`count`?o+=u:l&&(o+=1)}if(n.length===0)return{content:c?`[Output truncated. Narrow path or glob, or lower context.]`:`No matches found`,matchCount:0,outputMode:e.outputMode,path:e.path,truncated:c};let l=n.join(`
|
|
6
|
-
`);return c&&(l+=r),{content:l,matchCount:o,outputMode:e.outputMode,path:e.path,truncated:c}}function normalizeContentLine(e){let t=e.lastIndexOf(`\0`);if(t===-1)return{isMatch:!1,line:e};let n=e.slice(0,t),r=e.slice(t+1),i=/^(\d+)([:-])(.*)$/u.exec(r);if(i===null)return{isMatch:!1,line:`${n}:${r}`};let[,a,o,s]=i;return{isMatch:o===`:`,line:`${n}${o}${a}${o}${s}`}}function parseCountLine(e){let t=e.lastIndexOf(`:`);if(t===-1)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)&&n>0?n:0}function truncateUtf8(e,t){if(Buffer.byteLength(e)<=t)return{truncated:!1,value:e};let n=0,r=``;for(let i of e){let e=Buffer.byteLength(i);if(n+e>t)break;r+=i,n+=e}return{truncated:!0,value:r}}export{GREP_OUTPUT_MODES,MAX_GREP_COMMAND_BYTES,MAX_GREP_LIMIT,MAX_GREP_LINE_BYTES,MAX_GREP_RETURN_BYTES,
|
|
6
|
+
`);return c&&(l+=r),{content:l,matchCount:o,outputMode:e.outputMode,path:e.path,truncated:c}}function normalizeContentLine(e){let t=e.lastIndexOf(`\0`);if(t===-1)return{isMatch:!1,line:e};let n=e.slice(0,t),r=e.slice(t+1),i=/^(\d+)([:-])(.*)$/u.exec(r);if(i===null)return{isMatch:!1,line:`${n}:${r}`};let[,a,o,s]=i;return{isMatch:o===`:`,line:`${n}${o}${a}${o}${s}`}}function parseCountLine(e){let t=e.lastIndexOf(`:`);if(t===-1)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)&&n>0?n:0}function truncateUtf8(e,t){if(Buffer.byteLength(e)<=t)return{truncated:!1,value:e};let n=0,r=``;for(let i of e){let e=Buffer.byteLength(i);if(n+e>t)break;r+=i,n+=e}return{truncated:!0,value:r}}export{GREP_OUTPUT_MODES,MAX_GREP_COMMAND_BYTES,MAX_GREP_LIMIT,MAX_GREP_LINE_BYTES,MAX_GREP_RETURN_BYTES,assertNoParentSegments,buildPosixGrepCommand,buildRipgrepCommand,buildSearchCommand,effectiveLimit,effectiveOutputMode,executeGrepSearch,processGrepOutput,shouldUseFixedStrings};
|
|
@@ -16,6 +16,8 @@ interface UpdateChunk {
|
|
|
16
16
|
readonly oldLines: readonly string[];
|
|
17
17
|
readonly newLines: readonly string[];
|
|
18
18
|
readonly changeContext?: string;
|
|
19
|
+
/** Function context from a unified-diff range header; git may have truncated it. */
|
|
20
|
+
readonly contextHint?: string;
|
|
19
21
|
readonly endOfFile?: boolean;
|
|
20
22
|
}
|
|
21
23
|
export interface AppliedPatchFile {
|
|
@@ -23,10 +25,14 @@ export interface AppliedPatchFile {
|
|
|
23
25
|
readonly path: string;
|
|
24
26
|
readonly previousPath?: string;
|
|
25
27
|
}
|
|
28
|
+
/** A verified change about to be written, with the content it replaces. */
|
|
29
|
+
export interface PlannedPatchFile extends AppliedPatchFile {
|
|
30
|
+
readonly previousContent: string | null;
|
|
31
|
+
}
|
|
26
32
|
export declare function applyPatchToSandbox(input: {
|
|
27
|
-
readonly beforeCommit?: (files: readonly
|
|
33
|
+
readonly beforeCommit?: (files: readonly PlannedPatchFile[]) => Promise<void>;
|
|
28
34
|
readonly patchText: string;
|
|
29
|
-
readonly
|
|
35
|
+
readonly patchRoot: string;
|
|
30
36
|
readonly sandbox: SandboxSession;
|
|
31
37
|
/** Serializes patches per eve session; every `ctx.getSandbox()` call returns a new handle. */
|
|
32
38
|
readonly sessionId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{shellQuote}from"./shell.js";import{posix}from"node:path";const patchLocks=new Map;async function applyPatchToSandbox(e){return withPatchLock(`${e.sessionId}:${e.
|
|
1
|
+
import{shellQuote}from"./shell.js";import{posix}from"node:path";const patchLocks=new Map;async function applyPatchToSandbox(e){return withPatchLock(`${e.sessionId}:${e.patchRoot}`,()=>applyPatchUnlocked(e))}async function applyPatchUnlocked(e){let t=parsePatch(e.patchText);if(t.length===0)throw Error(`patch rejected: empty patch`);if(t.length>100)throw Error(`patch rejected: at most 100 file operations are allowed`);let n=await planChanges(e.sandbox,e.patchRoot,t);await e.beforeCommit?.(n.map(({operation:e,path:t,previousPath:n,oldContent:r})=>{let i={operation:e,path:t,previousContent:r};return n!==void 0&&(i.previousPath=n),i}));let r=[];try{for(let t of n)await revalidateChange(e.sandbox,e.patchRoot,t),r.push(t),await commitChange(e.sandbox,t)}catch(t){let n=await rollbackChanges(e.sandbox,r),i=t instanceof Error?t.message:String(t),a=n.length===0?``:` Rollback also failed: ${n.join(`; `)}`;throw Error(`apply_patch failed after validation: ${i}.${a}`,{cause:t})}return n.map(({operation:e,path:t,previousPath:n})=>{let r={operation:e,path:t};return n!==void 0&&(r.previousPath=n),r})}async function withPatchLock(e,t){let n=patchLocks.get(e)??Promise.resolve(),r,i=new Promise(e=>{r=e}),a=n.then(()=>i);patchLocks.set(e,a),await n;try{return await t()}finally{r(),patchLocks.get(e)===a&&patchLocks.delete(e)}}function parsePatch(e){let t=stripHeredoc(normalizeLineEndings(e).trim()).split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.trim()===`*** Begin Patch`),r=t.findIndex((e,t)=>t>n&&e.trim()===`*** End Patch`);if(n===-1||r===-1||n>=r)throw Error(`invalid patch format: missing Begin/End markers`);if(t.slice(0,n).some(e=>e.trim().length>0&&!e.trimStart().startsWith(`*** Environment ID:`)))throw Error(`invalid patch format: unexpected content before Begin Patch`);if(t.slice(r+1).some(e=>e.trim().length>0))throw Error(`invalid patch format: unexpected content after End Patch`);let i=[],a=n+1;for(;a<r;){let e=t[a]??``;if(e.startsWith(`*** Environment ID:`)){a+=1;continue}if(e.startsWith(`*** Add File:`)){let n=requirePath(e.slice(13),`add`),o=parseAdd(t,a+1,r);i.push({type:`add`,path:n,contents:o.content}),a=o.next;continue}if(e.startsWith(`*** Delete File:`)){i.push({type:`delete`,path:requirePath(e.slice(16),`delete`)}),a+=1;continue}if(e.startsWith(`*** Update File:`)){let n=requirePath(e.slice(16),`update`),o=a+1,s;t[o]?.startsWith(`*** Move to:`)&&(s=requirePath(t[o].slice(12),`move`),o+=1);let c=parseUpdate(t,o,r);if(c.chunks.length===0&&s===void 0)throw Error(`invalid update hunk for ${n}: expected at least one @@ chunk`);i.push({type:`update`,path:n,movePath:s,chunks:c.chunks}),a=c.next;continue}throw Error(`invalid patch line: ${e}`)}return i}function deriveUpdatedContent(e,t,n){let r=n.includes(`\r
|
|
3
3
|
`)?`\r
|
|
4
4
|
`:`
|
|
@@ -6,15 +6,15 @@ import{shellQuote}from"./shell.js";import{posix}from"node:path";const patchLocks
|
|
|
6
6
|
`);a.at(-1)===``&&a.pop();let o=computeReplacements(a,e,t),s=[...a];for(let[e,t,n]of o.toReversed())s.splice(e,t,...n);s.at(-1)!==``&&s.push(``);let c=s.join(`
|
|
7
7
|
`).replaceAll(`
|
|
8
8
|
`,r);return i.bom?`\uFEFF${c}`:c}function parseAdd(e,t,n){let r=[],i=t;for(;i<n&&!e[i].startsWith(`***`);){let t=e[i];if(!t.startsWith(`+`))throw Error(`invalid add file line: ${t}`);r.push(t.slice(1)),i+=1}return{content:r.join(`
|
|
9
|
-
`),next:i}}function parseUpdate(e,t,n){let r=[],i=t;for(;i<n&&!e[i].startsWith(`***`);){let t=e[i],a=t.startsWith(`@@`);if(!a&&r.length>0)throw Error(`invalid update file line: ${e[i]}`);let o=a
|
|
9
|
+
`),next:i}}const UNIFIED_RANGE_HEADER=/^-\d+(?:,\d+)? \+\d+(?:,\d+)? @@\s*(.*)$/u;function chunkHeader(e){let t=e.slice(2).trim();if(t.length===0)return{changeContext:void 0};let n=UNIFIED_RANGE_HEADER.exec(t);if(!n)return{changeContext:t};let r=n[1].trim();return r.length===0?{changeContext:void 0}:{changeContext:void 0,contextHint:r}}function parseUpdate(e,t,n){let r=[],i=t;for(;i<n&&!e[i].startsWith(`***`);){let t=e[i],a=t.startsWith(`@@`);if(!a&&r.length>0)throw Error(`invalid update file line: ${e[i]}`);let o=a?chunkHeader(t):{changeContext:void 0},s=[],c=[],l=!1;for(a&&(i+=1);i<n&&!e[i].startsWith(`@@`);){let t=e[i];if(t===`*** End of File`){for(l=!0,i+=1;i<n&&e[i]===``;)i+=1;break}if(t.startsWith(`***`))break;if(t===``)s.push(``),c.push(``);else if(t.startsWith(` `))s.push(t.slice(1)),c.push(t.slice(1));else if(t.startsWith(`-`))s.push(t.slice(1));else if(t.startsWith(`+`))c.push(t.slice(1));else throw Error(`invalid update chunk line: ${t}`);i+=1}r.push({oldLines:s,newLines:c,...o,endOfFile:l||void 0})}return{chunks:r,next:i}}async function planChanges(e,t,n){if(await realPath(e,t)!==t)throw Error(`apply_patch verification failed: patch root resolves outside itself: ${t}`);let r=new Set,i=[],a=[];for(let o of n)try{i.push(await planHunk(e,t,r,o))}catch(e){a.push(e instanceof Error?e.message:String(e))}if(a.length>0)throw Error(a.join(`
|
|
10
10
|
|
|
11
11
|
`));return i}async function planHunk(e,t,n,r){let i=resolvePatchPath(t,r.path);if(await assertRealPath(e,t,i.absolutePath),claimPath(n,i.absolutePath),r.type===`add`){if(await e.readTextFile({path:i.absolutePath})!==null)throw Error(`apply_patch verification failed: file already exists: ${i.path}`);return{absolutePath:i.absolutePath,newContent:r.contents.length===0||r.contents.endsWith(`
|
|
12
|
-
`)?r.contents:`${r.contents}\n`,oldContent:null,operation:`add`,path:i.path}}let a=await e.readTextFile({path:i.absolutePath});if(a===null)throw Error(`apply_patch verification failed: file not found: ${i.path}`);let o=await fileMode(e,i.absolutePath);if(r.type===`delete`)return{absolutePath:i.absolutePath,newContent:null,oldContent:a,oldMode:o,operation:`delete`,path:i.path};let s=r.movePath===void 0?i:resolvePatchPath(t,r.movePath);if(s.absolutePath!==i.absolutePath&&(await assertRealPath(e,t,s.absolutePath),claimPath(n,s.absolutePath),await e.readTextFile({path:s.absolutePath})!==null))throw Error(`apply_patch verification failed: move target already exists: ${s.path}`);let c=r.chunks.length===0?a:deriveUpdatedContent(i.path,r.chunks,a);if(c===a&&s.absolutePath===i.absolutePath)throw Error(`apply_patch verification failed: update makes no changes: ${i.path}`);let l={absolutePath:s.absolutePath,newContent:c,oldContent:a,oldMode:o,operation:s.absolutePath===i.absolutePath?`update`:`move`,path:s.path};return s.absolutePath!==i.absolutePath&&(l.previousAbsolutePath=i.absolutePath,l.previousPath=i.path),l}async function commitChange(e,t){if(t.operation===`delete`){await e.removePath({path:t.absolutePath});return}if(t.operation===`move`&&t.previousAbsolutePath!==void 0){await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:!1,path:t.absolutePath}),await e.removePath({path:t.previousAbsolutePath});return}await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:t.operation!==`add`,path:t.absolutePath})}async function revalidateChange(e,t,n){if(await assertRealPath(e,t,n.absolutePath),n.operation===`add`){if(await e.readTextFile({path:n.absolutePath})!==null)throw Error(`apply_patch stale write: add target now exists: ${n.path}`);return}if(n.operation===`move`&&n.previousAbsolutePath!==void 0){await assertRealPath(e,t,n.previousAbsolutePath);let[r,i]=await Promise.all([e.readTextFile({path:n.previousAbsolutePath}),e.readTextFile({path:n.absolutePath})]);if(r!==n.oldContent||i!==null)throw Error(`apply_patch stale write: move inputs changed: ${n.previousPath}`);return}if(await e.readTextFile({path:n.absolutePath})!==n.oldContent)throw Error(`apply_patch stale write: file changed after validation: ${n.path}`)}async function rollbackChanges(e,t){let n=[];for(let r of t.toReversed())try{let t=await e.readTextFile({path:r.absolutePath});if(r.operation===`add`){if(t===null)continue;if(t!==r.newContent)throw Error(`refusing to remove concurrently changed file ${r.path}`);await e.removePath({path:r.absolutePath})}else if(r.operation===`move`&&r.previousAbsolutePath!==void 0){let n=await e.readTextFile({path:r.previousAbsolutePath});if(t===r.newContent&&n===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.previousAbsolutePath}),await e.removePath({path:r.absolutePath});else if(t===r.newContent&&n===r.oldContent)await e.removePath({path:r.absolutePath});else if(t===null&&n===r.newContent)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.previousAbsolutePath});else if(t!==null||n!==r.oldContent)throw Error(`refusing to roll back concurrently changed move ${r.path}`)}else if(r.operation===`delete`){if(t===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.absolutePath});else if(t!==r.oldContent)throw Error(`refusing to overwrite concurrently recreated file ${r.path}`)}else{if(t===r.oldContent)continue;if(t!==r.newContent)throw Error(`refusing to overwrite concurrently changed file ${r.path}`);await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.absolutePath})}}catch(e){n.push(e instanceof Error?e.message:String(e))}return n}async function assertRealPath(e,t,n){let r=await realPath(e,n);if(r!==n||!r.startsWith(`${t}/`))throw Error(`apply_patch verification failed: path crosses a symlink or repository boundary: ${n}`)}async function realPath(e,t){let n=await e.run({command:`realpath -m -- ${shellQuote(t)}`});if(n.exitCode!==0)throw Error(`apply_patch verification failed: could not resolve ${t}: ${n.stderr}`);return n.stdout.trim()}async function ensureParentDirectory(e,t){let n=await e.run({command:`mkdir -p -- ${shellQuote(posix.dirname(t))}`});if(n.exitCode!==0)throw Error(`failed to create parent directory for ${t}: ${n.stderr}`)}async function atomicWrite(e,t){await ensureParentDirectory(e,t.path);let n=posix.join(posix.dirname(t.path),`.${posix.basename(t.path)}.eve-code-${crypto.randomUUID()}.tmp`),r=!1;try{await e.writeTextFile({path:n,content:t.content}),await restoreMode(e,n,t.mode);let i=await e.run({command:`mv ${t.overwrite?``:`-n `}-- ${shellQuote(n)} ${shellQuote(t.path)}`});if(i.exitCode!==0)throw Error(`failed to install ${t.path}: ${i.stderr||i.stdout}`);if(!t.overwrite&&await e.readTextFile({path:n})!==null)throw Error(`apply_patch stale write: target now exists: ${t.path}`);r=!0}finally{r||await e.removePath({path:n,force:!0}).catch(()=>{})}}async function fileMode(e,t){let n=await e.run({command:`stat -c %a -- ${shellQuote(t)}`}),r=n.stdout.trim();if(n.exitCode!==0||!/^[0-7]{3,4}$/u.test(r))throw Error(`apply_patch verification failed: could not read file mode for ${t}`);return r}async function restoreMode(e,t,n){if(n!==void 0&&(await e.run({command:`chmod ${n} -- ${shellQuote(t)}`})).exitCode!==0)throw Error(`failed to restore file mode for ${t}`)}function resolvePatchPath(e,t){let n=t.replaceAll(`\\`,`/`).trim();if(n.length===0||n.includes(`\0`)||posix.isAbsolute(n)||n.split(`/`).some(e=>e===``||e===`.`||e===`..`))throw Error(`invalid patch path: ${t}`);return{absolutePath:posix.join(e,n),path:n}}function claimPath(e,t){if(e.has(t))throw Error(`patch contains overlapping file operations: ${t}`);e.add(t)}function requirePath(e,t){let n=e.trim();if(n.length===0)throw Error(`invalid ${t} file path`);return n}function computeReplacements(e,t,n){let r=[],i=0;for(let a of n){if(a.changeContext!==void 0){let n=seek(e,[a.changeContext],i);if(n===-1)throw Error(formatMissingContextError(t,a.changeContext,e,i));i=n+1}if(a.oldLines.length===0){r.push([e.length,0,a.newLines]);continue}let n=a.oldLines,o=a.newLines,s=seek(e,n,i,a.endOfFile);if(s===-1&&n.at(-1)===``&&(n=n.slice(0,-1),o.at(-1)===``&&(o=o.slice(0,-1)),s=seek(e,n,i,a.endOfFile)),s===-1)throw Error(formatMissingLinesError(t,a.oldLines,e,i));r.push([s,n.length,o]),i=s+n.length}return r.toSorted((e,t)=>e[0]-t[0])}function formatMissingLinesError(e,t,n,r){return[`failed to find expected lines in ${e}.`,``,`Expected:`,boundLines(t,20),``,currentExcerpt(n,t,r),``,`Re-read ${e} and rewrite this hunk against the current contents.`].join(`
|
|
12
|
+
`)?r.contents:`${r.contents}\n`,oldContent:null,operation:`add`,path:i.path}}let a=await e.readTextFile({path:i.absolutePath});if(a===null)throw Error(`apply_patch verification failed: file not found: ${i.path}`);let o=await fileMode(e,i.absolutePath);if(r.type===`delete`)return{absolutePath:i.absolutePath,newContent:null,oldContent:a,oldMode:o,operation:`delete`,path:i.path};let s=r.movePath===void 0?i:resolvePatchPath(t,r.movePath);if(s.absolutePath!==i.absolutePath&&(await assertRealPath(e,t,s.absolutePath),claimPath(n,s.absolutePath),await e.readTextFile({path:s.absolutePath})!==null))throw Error(`apply_patch verification failed: move target already exists: ${s.path}`);let c=r.chunks.length===0?a:deriveUpdatedContent(i.path,r.chunks,a);if(c===a&&s.absolutePath===i.absolutePath)throw Error(`apply_patch verification failed: update makes no changes: ${i.path}`);let l={absolutePath:s.absolutePath,newContent:c,oldContent:a,oldMode:o,operation:s.absolutePath===i.absolutePath?`update`:`move`,path:s.path};return s.absolutePath!==i.absolutePath&&(l.previousAbsolutePath=i.absolutePath,l.previousPath=i.path),l}async function commitChange(e,t){if(t.operation===`delete`){await e.removePath({path:t.absolutePath});return}if(t.operation===`move`&&t.previousAbsolutePath!==void 0){await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:!1,path:t.absolutePath}),await e.removePath({path:t.previousAbsolutePath});return}await atomicWrite(e,{content:t.newContent??``,mode:t.oldMode,overwrite:t.operation!==`add`,path:t.absolutePath})}async function revalidateChange(e,t,n){if(await assertRealPath(e,t,n.absolutePath),n.operation===`add`){if(await e.readTextFile({path:n.absolutePath})!==null)throw Error(`apply_patch stale write: add target now exists: ${n.path}`);return}if(n.operation===`move`&&n.previousAbsolutePath!==void 0){await assertRealPath(e,t,n.previousAbsolutePath);let[r,i]=await Promise.all([e.readTextFile({path:n.previousAbsolutePath}),e.readTextFile({path:n.absolutePath})]);if(r!==n.oldContent||i!==null)throw Error(`apply_patch stale write: move inputs changed: ${n.previousPath}`);return}if(await e.readTextFile({path:n.absolutePath})!==n.oldContent)throw Error(`apply_patch stale write: file changed after validation: ${n.path}`)}async function rollbackChanges(e,t){let n=[];for(let r of t.toReversed())try{let t=await e.readTextFile({path:r.absolutePath});if(r.operation===`add`){if(t===null)continue;if(t!==r.newContent)throw Error(`refusing to remove concurrently changed file ${r.path}`);await e.removePath({path:r.absolutePath})}else if(r.operation===`move`&&r.previousAbsolutePath!==void 0){let n=await e.readTextFile({path:r.previousAbsolutePath});if(t===r.newContent&&n===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.previousAbsolutePath}),await e.removePath({path:r.absolutePath});else if(t===r.newContent&&n===r.oldContent)await e.removePath({path:r.absolutePath});else if(t===null&&n===r.newContent)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.previousAbsolutePath});else if(t!==null||n!==r.oldContent)throw Error(`refusing to roll back concurrently changed move ${r.path}`)}else if(r.operation===`delete`){if(t===null)await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!1,path:r.absolutePath});else if(t!==r.oldContent)throw Error(`refusing to overwrite concurrently recreated file ${r.path}`)}else{if(t===r.oldContent)continue;if(t!==r.newContent)throw Error(`refusing to overwrite concurrently changed file ${r.path}`);await atomicWrite(e,{content:r.oldContent??``,mode:r.oldMode,overwrite:!0,path:r.absolutePath})}}catch(e){n.push(e instanceof Error?e.message:String(e))}return n}async function assertRealPath(e,t,n){let r=await realPath(e,n);if(r!==n||!r.startsWith(`${t}/`))throw Error(`apply_patch verification failed: path crosses a symlink or repository boundary: ${n}`)}async function realPath(e,t){let n=await e.run({command:`realpath -m -- ${shellQuote(t)}`});if(n.exitCode!==0)throw Error(`apply_patch verification failed: could not resolve ${t}: ${n.stderr}`);return n.stdout.trim()}async function ensureParentDirectory(e,t){let n=await e.run({command:`mkdir -p -- ${shellQuote(posix.dirname(t))}`});if(n.exitCode!==0)throw Error(`failed to create parent directory for ${t}: ${n.stderr}`)}async function atomicWrite(e,t){await ensureParentDirectory(e,t.path);let n=posix.join(posix.dirname(t.path),`.${posix.basename(t.path)}.eve-code-${crypto.randomUUID()}.tmp`),r=!1;try{await e.writeTextFile({path:n,content:t.content}),await restoreMode(e,n,t.mode);let i=await e.run({command:`mv ${t.overwrite?``:`-n `}-- ${shellQuote(n)} ${shellQuote(t.path)}`});if(i.exitCode!==0)throw Error(`failed to install ${t.path}: ${i.stderr||i.stdout}`);if(!t.overwrite&&await e.readTextFile({path:n})!==null)throw Error(`apply_patch stale write: target now exists: ${t.path}`);r=!0}finally{r||await e.removePath({path:n,force:!0}).catch(()=>{})}}async function fileMode(e,t){let n=await e.run({command:`stat -c %a -- ${shellQuote(t)}`}),r=n.stdout.trim();if(n.exitCode!==0||!/^[0-7]{3,4}$/u.test(r))throw Error(`apply_patch verification failed: could not read file mode for ${t}`);return r}async function restoreMode(e,t,n){if(n!==void 0&&(await e.run({command:`chmod ${n} -- ${shellQuote(t)}`})).exitCode!==0)throw Error(`failed to restore file mode for ${t}`)}function resolvePatchPath(e,t){let n=t.replaceAll(`\\`,`/`).trim();if(n.length===0||n.includes(`\0`)||posix.isAbsolute(n)||n.split(`/`).some(e=>e===``||e===`.`||e===`..`))throw Error(`invalid patch path: ${t}`);return{absolutePath:posix.join(e,n),path:n}}function claimPath(e,t){if(e.has(t))throw Error(`patch contains overlapping file operations: ${t}`);e.add(t)}function requirePath(e,t){let n=e.trim();if(n.length===0)throw Error(`invalid ${t} file path`);return n}function computeReplacements(e,t,n){let r=[],i=0;for(let a of n){if(a.changeContext!==void 0){let n=seek(e,[a.changeContext],i);if(n===-1)throw Error(formatMissingContextError(t,a.changeContext,e,i));i=n+1}if(a.contextHint!==void 0){let n=seekPrefix(e,a.contextHint,i);if(n!==-1)i=n+1;else if(occurrences(e,a,i)!==1)throw Error(formatMissingContextError(t,a.contextHint,e,i))}if(a.oldLines.length===0){r.push([e.length,0,a.newLines]);continue}let n=a.oldLines,o=a.newLines,s=seek(e,n,i,a.endOfFile);if(s===-1&&n.at(-1)===``&&(n=n.slice(0,-1),o.at(-1)===``&&(o=o.slice(0,-1)),s=seek(e,n,i,a.endOfFile)),s===-1)throw Error(formatMissingLinesError(t,a.oldLines,e,i));r.push([s,n.length,o]),i=s+n.length}return r.toSorted((e,t)=>e[0]-t[0])}function formatMissingLinesError(e,t,n,r){return[`failed to find expected lines in ${e}.`,``,`Expected:`,boundLines(t,20),``,currentExcerpt(n,t,r),``,`Re-read ${e} and rewrite this hunk against the current contents.`].join(`
|
|
13
13
|
`)}function formatMissingContextError(e,t,n,r){return[`failed to find context '${t}' in ${e}.`,``,currentExcerpt(n,[t],r),``,`Re-read ${e} and rewrite this hunk against the current contents.`].join(`
|
|
14
14
|
`)}function currentExcerpt(e,t,n){if(e.length===0)return`Current file is empty.`;let r=closestMatchIndex(e,t,n),i=r===-1?Math.min(n,Math.max(0,e.length-1)):r,a=Math.max(0,i-4),o=Math.min(e.length,a+16);return`${r===-1?`Current contents from line ${a+1}:`:`Closest current content:`}\n${numberedLines(e,a,o)}`}function closestMatchIndex(e,t,n){let r=t.map(e=>e.trim()).filter(e=>e.length>0).toSorted((e,t)=>t.length-e.length).slice(0,3);for(let t of r){let r=seek(e,[t],n);if(r!==-1)return r;let i=seek(e,[t],0);if(i!==-1)return i}return closestScoredLine(e,t)}function closestScoredLine(e,t){let n=new Set(t.join(` `).toLowerCase().split(/\W+/u).filter(e=>e.length>2));if(n.size===0)return-1;let r=-1,i=0;for(let t=0;t<e.length;t+=1){let a=0;for(let r of e[t].toLowerCase().split(/\W+/u))n.has(r)&&(a+=1);a>i&&(i=a,r=t)}return i>=2?r:-1}function boundLines(e,t){return e.length<=t?e.join(`
|
|
15
15
|
`):`${e.slice(0,t).join(`
|
|
16
16
|
`)}\n[${e.length-t} more expected lines omitted]`}function numberedLines(e,t,n){let r=String(n).length;return e.slice(t,n).map((e,n)=>`${String(t+n+1).padStart(r,` `)} | ${e}`).join(`
|
|
17
|
-
`)}function seek(e,t,n,r=!1){if(t.length===0)return-1;for(let i of[exact,trimEnd,trim,normalized]){if(r){let r=e.length-t.length;if(r>=n&&matches(e,t,r,i))return r}for(let r=n;r<=e.length-t.length;r+=1)if(matches(e,t,r,i))return r}return-1}function matches(e,t,n,r){return t.every((t,i)=>r(e[n+i],t))}const exact=(e,t)=>e===t,trimEnd=(e,t)=>e.trimEnd()===t.trimEnd(),trim=(e,t)=>e.trim()===t.trim(),normalized=(e,t)=>normalizeTypography(e.trim())===normalizeTypography(t.trim());function normalizeTypography(e){return e.replace(/[‘’‚‛]/gu,`'`).replace(/[“”„‟]/gu,`"`).replace(/[‐‑‒–—―]/gu,`-`).replace(/…/gu,`...`).replace(/ /gu,` `)}function normalizeLineEndings(e){return e.replaceAll(`\r
|
|
17
|
+
`)}function seek(e,t,n,r=!1){if(t.length===0)return-1;for(let i of[exact,trimEnd,trim,normalized]){if(r){let r=e.length-t.length;if(r>=n&&matches(e,t,r,i))return r}for(let r=n;r<=e.length-t.length;r+=1)if(matches(e,t,r,i))return r}return-1}function occurrences(e,t,n){let r=seekAll(e,t.oldLines,n,t.endOfFile);return r.length>0||t.oldLines.at(-1)!==``?r.length:seekAll(e,t.oldLines.slice(0,-1),n,t.endOfFile).length}function seekAll(e,t,n,r=!1){if(t.length===0)return[];for(let i of[exact,trimEnd,trim,normalized]){let a=e.length-t.length;if(r&&a>=n&&matches(e,t,a,i))return[a];let o=[];for(let r=n;r<=a;r+=1)matches(e,t,r,i)&&o.push(r);if(o.length>0)return o}return[]}function seekPrefix(e,t,n){let r=normalizeTypography(t.trim());for(let t=n;t<e.length;t+=1)if(normalizeTypography(e[t].trim()).startsWith(r))return t;return-1}function matches(e,t,n,r){return t.every((t,i)=>r(e[n+i],t))}const exact=(e,t)=>e===t,trimEnd=(e,t)=>e.trimEnd()===t.trimEnd(),trim=(e,t)=>e.trim()===t.trim(),normalized=(e,t)=>normalizeTypography(e.trim())===normalizeTypography(t.trim());function normalizeTypography(e){return e.replace(/[‘’‚‛]/gu,`'`).replace(/[“”„‟]/gu,`"`).replace(/[‐‑‒–—―]/gu,`-`).replace(/…/gu,`...`).replace(/ /gu,` `)}function normalizeLineEndings(e){return e.replaceAll(`\r
|
|
18
18
|
`,`
|
|
19
19
|
`).replaceAll(`\r`,`
|
|
20
20
|
`)}function splitBom(e){return e.startsWith(``)?{bom:!0,text:e.slice(1)}:{bom:!1,text:e}}function stripHeredoc(e){return e.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/u)?.[2]??e}export{applyPatchToSandbox,deriveUpdatedContent,parsePatch};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
export declare function validateRepositoryRoot(sandbox:
|
|
4
|
-
export {};
|
|
1
|
+
import { type WorkspaceSandbox } from "./workspace-root.ts";
|
|
2
|
+
/** A workspace directory that must also be the top of a git work tree. */
|
|
3
|
+
export declare function validateRepositoryRoot(sandbox: WorkspaceSandbox, root: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shellQuote}from"./shell.js";async function validateRepositoryRoot(e,t){
|
|
1
|
+
import{shellQuote}from"./shell.js";import{resolveWorkspaceDirectory}from"./workspace-root.js";async function validateRepositoryRoot(e,t){let n=await resolveWorkspaceDirectory(e,t),r=await e.run({command:`git -C ${shellQuote(n)} rev-parse --show-toplevel`});if(r.exitCode!==0||r.stdout.trim()!==n)throw Error(`root is not a git work tree root: ${t}`);return n}export{validateRepositoryRoot};
|
|
@@ -10,4 +10,5 @@ export declare function installCodeTooling(sandbox: ToolingSandbox, options?: {
|
|
|
10
10
|
export { authenticateGitHub, authenticateVercel, type BrokeredCredentialOptions, } from "./credentials.ts";
|
|
11
11
|
/** @deprecated Import from `eve/computer-use/sandbox` and mount `eve/computer-use`. */
|
|
12
12
|
export { COMPUTER_USE_REVALIDATION_KEY, installComputerUse, startComputerUse, } from "eve/computer-use/sandbox";
|
|
13
|
-
|
|
13
|
+
/** @deprecated Import from `eve/extensions/git/sandbox`. */
|
|
14
|
+
export { executeGitHubShell, githubShellApproval, type GitHubLeaseRule, type GitHubShellInput, type GitHubShellOutput, } from "eve/extensions/git/sandbox";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DIAGNOSTICS_WORKER_SOURCE,GH_SIGNED_COMMIT_SOURCE,GH_SIGNED_COMMIT_VERSION,TYPESCRIPT_VERSION,ghWrapperSource,toolingPaths,typescriptInstallCommand,vercelWrapperSource}from"./tooling.js";import{authenticateGitHub,authenticateVercel}from"./credentials.js";import{commandFailureDetail}from"./command-failure.js";import{executeGitHubShell,githubShellApproval}from"eve/extensions/git/sandbox";import{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse}from"eve/computer-use/sandbox";const CODE_TOOLING_REVALIDATION_KEY=`eve-code-tooling:3:${GH_SIGNED_COMMIT_VERSION}:${TYPESCRIPT_VERSION}`;async function installCodeTooling(e,t={}){let n=toolingPaths(e);await Promise.all([e.writeTextFile({path:n.ghWrapper,content:ghWrapperSource(e)}),e.writeTextFile({path:n.signedCommit,content:GH_SIGNED_COMMIT_SOURCE}),e.writeTextFile({path:n.workerSource,content:DIAGNOSTICS_WORKER_SOURCE}),...t.vercel===!0?[e.writeTextFile({path:n.vercelWrapper,content:vercelWrapperSource(e)})]:[]]);let r=await e.run({command:toolingInstallCommand(e,t.vercel===!0)});if(r.exitCode!==0)throw Error(`eve-code tooling installation failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}function toolingInstallCommand(e,t){let n=toolingPaths(e),quote=e=>`'${e.replaceAll(`'`,`'"'"'`)}'`;return[`set -e`,`mkdir -p ${quote(n.root)}`,`if ! command -v gh >/dev/null 2>&1; then`,` command -v apt-get >/dev/null 2>&1 || { echo 'eve-code requires gh or apt-get' >&2; exit 1; }`,` if [ "$(id -u)" = 0 ]; then APT=apt-get; else command -v sudo >/dev/null 2>&1 || { echo 'eve-code needs root or sudo to install gh' >&2; exit 1; }; APT='sudo -n apt-get'; fi`,` $APT update && $APT install -y gh`,`fi`,`chmod 755 ${quote(n.ghWrapper)} ${quote(n.signedCommit)}`,`if [ "$(id -u)" = 0 ]; then INSTALL=install; else INSTALL='sudo -n install'; fi`,`$INSTALL -d -o root -g root -m 755 ${quote(n.trustedRoot)} ${quote(n.typescriptRoot)}`,`[ -x /usr/bin/gh ] || { echo 'eve-code requires gh at /usr/bin/gh' >&2; exit 1; }`,`$INSTALL -m 755 /usr/bin/gh ${quote(n.ghReal)}`,`$INSTALL -m 755 ${quote(n.signedCommit)} ${quote(n.trustedSignedCommit)}`,`$INSTALL -m 644 ${quote(n.workerSource)} ${quote(n.worker)}`,`$INSTALL -m 755 ${quote(n.ghWrapper)} /usr/local/bin/gh`,`$INSTALL -m 755 ${quote(n.trustedSignedCommit)} /usr/local/bin/gh-signed-commit`,typescriptInstallCommand(e),...t?[`if [ "$(id -u)" = 0 ]; then npm install -g vercel@latest; else sudo -n npm install -g vercel@latest; fi`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vercel`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vc`]:[]].join(`
|
|
2
2
|
`)}export{CODE_TOOLING_REVALIDATION_KEY,COMPUTER_USE_REVALIDATION_KEY,authenticateGitHub,authenticateVercel,executeGitHubShell,githubShellApproval,installCodeTooling,installComputerUse,startComputerUse};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { SandboxSession } from "eve/sandbox";
|
|
2
|
-
import { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION } from "
|
|
2
|
+
import { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION } from "eve/extensions/git/sandbox";
|
|
3
3
|
export { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION };
|
|
4
4
|
export declare const TYPESCRIPT_VERSION = "6.0.3";
|
|
5
5
|
export declare function toolingPaths(sandbox: Pick<SandboxSession, "resolvePath">): {
|
|
6
6
|
root: string;
|
|
7
7
|
trustedRoot: string;
|
|
8
8
|
env: string;
|
|
9
|
-
ghReal:
|
|
9
|
+
ghReal: "/usr/local/lib/eve-code/gh";
|
|
10
10
|
ghWrapper: string;
|
|
11
11
|
vercelWrapper: string;
|
|
12
12
|
signedCommit: string;
|
|
13
|
-
trustedSignedCommit:
|
|
13
|
+
trustedSignedCommit: "/usr/local/lib/eve-code/gh-signed-commit";
|
|
14
14
|
typescriptRoot: string;
|
|
15
15
|
typescriptModule: string;
|
|
16
16
|
workerSource: string;
|
|
@@ -21,7 +21,7 @@ export declare function vercelWrapperSource(sandbox: Pick<SandboxSession, "resol
|
|
|
21
21
|
export declare function typescriptInstallCommand(sandbox: Pick<SandboxSession, "resolvePath">): string;
|
|
22
22
|
/**
|
|
23
23
|
* Runs inside the sandbox with `node`. Reads one base64 JSON request from
|
|
24
|
-
* `EVE_CODE_DIAGNOSTICS_REQUEST` (`{
|
|
24
|
+
* `EVE_CODE_DIAGNOSTICS_REQUEST` (`{ patchRoot, filePath }`), loads only the
|
|
25
25
|
* bootstrap-installed compiler, and prints `{ diagnostics }`.
|
|
26
26
|
*/
|
|
27
27
|
export declare const DIAGNOSTICS_WORKER_SOURCE: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{shellQuote}from"./shell.js";import{GH_SIGNED_COMMIT_SOURCE,GH_SIGNED_COMMIT_VERSION,GITHUB_TOOLING_PATHS}from"eve/extensions/git/sandbox";const TYPESCRIPT_VERSION=`6.0.3`,TRUSTED_TOOLING_ROOT=`/usr/local/lib/eve-code`,TYPESCRIPT_MODULE=`${TRUSTED_TOOLING_ROOT}/typescript/node_modules/typescript/lib/typescript.js`;function toolingPaths(e){let t=e.resolvePath(`.eve-code`),n=TRUSTED_TOOLING_ROOT;return{root:t,trustedRoot:n,env:`${t}/env`,ghReal:GITHUB_TOOLING_PATHS.ghReal,ghWrapper:`${t}/gh`,vercelWrapper:`${t}/vercel`,signedCommit:`${t}/gh-signed-commit`,trustedSignedCommit:GITHUB_TOOLING_PATHS.trustedSignedCommit,typescriptRoot:`${n}/typescript`,typescriptModule:TYPESCRIPT_MODULE,workerSource:`${t}/diagnostics.cjs`,worker:`${n}/diagnostics.cjs`}}function ghWrapperSource(e){let t=toolingPaths(e);return`#!/usr/bin/env bash\nset -euo pipefail\n[[ ! -f ${JSON.stringify(t.env)} ]] || source ${JSON.stringify(t.env)}\nexport GH_TOKEN="\${GH_TOKEN:-ghp_000000000000000000000000000000000000}"\nexec ${JSON.stringify(t.ghReal)} "$@"\n`}function vercelWrapperSource(e){let t=toolingPaths(e);return`#!/usr/bin/env bash\nset -euo pipefail\n[[ ! -f ${JSON.stringify(t.env)} ]] || source ${JSON.stringify(t.env)}\nexport VERCEL_TOKEN="\${VERCEL_TOKEN:-eve-code-firewall-placeholder}"\nexec node "$(npm root -g)/vercel/dist/index.js" "$@"\n`}function typescriptInstallCommand(e){let{typescriptRoot:t}=toolingPaths(e),n=`${t}/npmrc`,r=[`set -e`,`cd ${shellQuote(t)}`,`umask 022`,`: > ${shellQuote(n)}`,`npm install --prefix ${shellQuote(t)} --ignore-scripts --no-audit --no-fund typescript@${TYPESCRIPT_VERSION}`,`chmod -R go-w ${shellQuote(t)}`].join(`
|
|
2
2
|
`),i=`/usr/bin/env -i HOME=/root PATH=/usr/local/bin:/usr/bin:/bin NPM_CONFIG_USERCONFIG=/dev/null NPM_CONFIG_GLOBALCONFIG=${shellQuote(n)} NPM_CONFIG_REGISTRY=https://registry.npmjs.org /bin/sh -c ${shellQuote(r)}`;return`if [ "$(id -u)" = 0 ]; then ${i}; else sudo -n ${i}; fi`}const DIAGNOSTICS_WORKER_SOURCE=String.raw`const fs = require("node:fs");
|
|
3
3
|
const path = require("node:path");
|
|
4
4
|
|
|
5
5
|
const { EVE_CODE_DIAGNOSTICS_REQUEST = "" } = require("node:process").env;
|
|
6
6
|
const request = JSON.parse(Buffer.from(EVE_CODE_DIAGNOSTICS_REQUEST, "base64").toString());
|
|
7
|
-
const
|
|
8
|
-
const fileName = fs.realpathSync(path.join(
|
|
9
|
-
if (fileName !==
|
|
7
|
+
const patchRoot = fs.realpathSync(request.patchRoot);
|
|
8
|
+
const fileName = fs.realpathSync(path.join(patchRoot, request.filePath));
|
|
9
|
+
if (fileName !== patchRoot && !fileName.startsWith(patchRoot + path.sep)) {
|
|
10
10
|
throw new Error("file escapes repository: " + request.filePath);
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -36,7 +36,7 @@ const host = {
|
|
|
36
36
|
directoryExists: ts.sys.directoryExists,
|
|
37
37
|
fileExists: ts.sys.fileExists,
|
|
38
38
|
getCompilationSettings: () => options,
|
|
39
|
-
getCurrentDirectory: () =>
|
|
39
|
+
getCurrentDirectory: () => patchRoot,
|
|
40
40
|
getDefaultLibFileName: (compilerOptions) => ts.getDefaultLibFilePath(compilerOptions),
|
|
41
41
|
getNewLine: () => ts.sys.newLine,
|
|
42
42
|
getScriptFileNames: () => fileNames,
|
|
@@ -71,12 +71,12 @@ process.stdout.write(JSON.stringify({ diagnostics }));
|
|
|
71
71
|
|
|
72
72
|
function nearestConfig(start) {
|
|
73
73
|
let current = start;
|
|
74
|
-
while (current ===
|
|
74
|
+
while (current === patchRoot || current.startsWith(patchRoot + path.sep)) {
|
|
75
75
|
for (const name of ["tsconfig.json", "jsconfig.json"]) {
|
|
76
76
|
const candidate = path.join(current, name);
|
|
77
77
|
if (fs.existsSync(candidate)) return candidate;
|
|
78
78
|
}
|
|
79
|
-
if (current ===
|
|
79
|
+
if (current === patchRoot) break;
|
|
80
80
|
current = path.dirname(current);
|
|
81
81
|
}
|
|
82
82
|
return null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single containment check for sandbox paths that tools read or write.
|
|
3
|
+
* The workspace root differs by provider (`/workspace`, `/app`, ...), so the
|
|
4
|
+
* boundary is the real path of `resolvePath("")`, never a literal prefix.
|
|
5
|
+
*/
|
|
6
|
+
export interface WorkspaceSandbox {
|
|
7
|
+
resolvePath(path: string): string;
|
|
8
|
+
run(input: {
|
|
9
|
+
abortSignal?: AbortSignal;
|
|
10
|
+
command: string;
|
|
11
|
+
}): PromiseLike<{
|
|
12
|
+
exitCode: number;
|
|
13
|
+
stderr: string;
|
|
14
|
+
stdout: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
/** NUL-delimited output keeps paths that contain newlines unambiguous. */
|
|
18
|
+
export declare function sandboxRealPath(sandbox: WorkspaceSandbox, path: string, label: string, abortSignal?: AbortSignal): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Resolves `path` (default: the workspace root) to a real path inside the real
|
|
21
|
+
* workspace. Symlinks are followed before the check, so a link cannot escape.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveInWorkspace(sandbox: WorkspaceSandbox, path: string | undefined, label: string, abortSignal?: AbortSignal): Promise<{
|
|
24
|
+
readonly path: string;
|
|
25
|
+
readonly workspace: string;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* An absolute directory inside the workspace (default: the workspace root).
|
|
29
|
+
* Git is not required; `validateRepositoryRoot` adds that check.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveWorkspaceDirectory(sandbox: WorkspaceSandbox, root?: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{shellQuote}from"./shell.js";async function sandboxRealPath(e,t,n,r){let i=await e.run({abortSignal:r,command:`realpath -e -z -- ${shellQuote(t)}`});if(i.exitCode!==0){let e=i.stderr.trim()||i.stdout.trim()||`no command output`;throw Error(`${n} could not be resolved: ${e.slice(0,2e3)}`)}let a=i.stdout.endsWith(`\0`)?i.stdout.slice(0,-1):i.stdout;if(a.length===0||a.includes(`\0`))throw Error(`${n} returned an invalid realpath`);return a}async function resolveInWorkspace(e,t,n,r){let i=await sandboxRealPath(e,e.resolvePath(``),`sandbox workspace`,r);if(t===void 0)return{path:i,workspace:i};let a=await sandboxRealPath(e,t,n,r);if(!(i===`/`||a===i||a.startsWith(`${i}/`)))throw Error(`${n} resolves outside the workspace ${i}: ${a}`);return{path:a,workspace:i}}async function resolveWorkspaceDirectory(e,t){if(t!==void 0&&!t.startsWith(`/`))throw Error(`root must be an absolute sandbox path`);return(await resolveInWorkspace(e,t,`root`)).path}export{resolveInWorkspace,resolveWorkspaceDirectory,sandboxRealPath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{deprecatedGitHubConfigured}from"../lib/github-compat.js";import{prSkillDescription,prSkillMarkdown}from"eve/extensions/git/sandbox";import{defineDynamic,defineSkill}from"eve/skills";var pr_default=defineDynamic({events:{"session.started":()=>deprecatedGitHubConfigured()?defineSkill({description:prSkillDescription(!0),markdown:prSkillMarkdown(!0)}):null}});export{pr_default as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PostEditDiagnostic } from "../lib/diagnostics.ts";
|
|
2
2
|
declare const _default: import("eve/tools").ToolDefinition<{
|
|
3
|
-
root
|
|
3
|
+
root?: string | undefined;
|
|
4
4
|
patchText: string;
|
|
5
5
|
}, {
|
|
6
6
|
diagnostics: {
|
|
@@ -18,7 +18,7 @@ declare const _default: import("eve/tools").ToolDefinition<{
|
|
|
18
18
|
}[];
|
|
19
19
|
}> & {
|
|
20
20
|
execute(input: {
|
|
21
|
-
root
|
|
21
|
+
root?: string | undefined;
|
|
22
22
|
patchText: string;
|
|
23
23
|
}, ctx: import("eve/tools").ToolContext): Promise<{
|
|
24
24
|
diagnostics: PostEditDiagnostic[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{onlyNewTypeDiagnostics,runPostEditDiagnostics,runTypeScriptDiagnostics}from"../lib/diagnostics.js";import{findGeneratedPatchTargets,generatedPatchTargetsError}from"../lib/generated-paths.js";import{
|
|
2
|
-
`),approval:never(),label:{start:({root:e})=>`Patch ${e}`},inputSchema:z.object({root:z.string().min(1).describe(`absolute
|
|
1
|
+
import{onlyNewTypeDiagnostics,runPostEditDiagnostics,runTypeScriptDiagnostics}from"../lib/diagnostics.js";import{findGeneratedPatchTargets,generatedPatchTargetsError}from"../lib/generated-paths.js";import{resolveWorkspaceDirectory}from"../lib/workspace-root.js";import{applyPatchToSandbox}from"../lib/patch.js";import{z}from"#compiled/zod/index.js";import{defineTool}from"eve/tools";import{never}from"eve/tools/approval";const DiagnosticSchema=z.object({check:z.enum([`git-diff`,`syntax`,`typescript`,`whitespace`]),code:z.number().int().optional(),column:z.number().int().optional(),line:z.number().int().optional(),message:z.string(),path:z.string().optional()});var apply_patch_default=defineTool({description:[`Apply targeted changes to files in the sandbox workspace. No git checkout is required.`,`Use this instead of rewriting complete files or writing through bash.`,`Write small hunks against current file contents. If a hunk misses, re-read that file and rewrite only the failed hunk. Do not retry the same patch text.`,`The patch is fully parsed and every source file is verified before any write.`,`After writing, the tool runs bounded whitespace, syntax, and TypeScript checks and`,`returns only diagnostics the patch introduced.`,`Patch format:`,`*** Begin Patch`,`*** Add File: path (every content line starts with +)`,`*** Update File: path (optional *** Move to: new-path, followed by @@ chunks)`,`*** Delete File: path`,`*** End Patch`,`Paths are relative to root and may not escape it.`,`Generated files (lockfiles, dist/, vendor-compiled/) are rejected: change them`,`through the command that generates them, never through a patch.`].join(`
|
|
2
|
+
`),approval:never(),label:{start:({root:e})=>`Patch ${e??`workspace`}`},inputSchema:z.object({root:z.string().min(1).optional().describe(`absolute directory inside the sandbox workspace that patch paths are relative to; defaults to the workspace root`),patchText:z.string().min(1).max(5e5).describe(`complete *** Begin Patch text`)}),outputSchema:z.object({diagnostics:z.array(DiagnosticSchema),files:z.array(z.object({operation:z.enum([`add`,`delete`,`move`,`update`]),path:z.string(),previousPath:z.string().optional()}))}),async execute({root:e,patchText:t},n){let r=findGeneratedPatchTargets(t);if(r.length>0)throw Error(generatedPatchTargetsError(r));let i=await n.getSandbox(),a=await resolveWorkspaceDirectory(i,e),o=[],s=new Map,c=await applyPatchToSandbox({async beforeCommit(e){for(let t of e)s.set(t.path,t.previousContent);o=await runTypeScriptDiagnostics({paths:e.filter(e=>e.operation===`update`).map(e=>e.path),patchRoot:a,sandbox:i})},patchText:t,patchRoot:a,sandbox:i,sessionId:n.session.id}),l=c.filter(e=>e.operation!==`delete`).map(e=>e.path),u=c.filter(e=>e.operation===`add`||e.operation===`move`).map(e=>e.path),d=[...c.filter(e=>e.operation===`delete`).map(e=>e.path),...c.flatMap(e=>e.operation===`move`&&e.previousPath!==void 0?[e.previousPath]:[])];return{diagnostics:onlyNewTypeDiagnostics(await runPostEditDiagnostics({addedPaths:u,changedPaths:l,deletedPaths:d,patchRoot:a,previousContents:s,sandbox:i}),o),files:c}}});export{apply_patch_default as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @deprecated Mount `eve/extensions/git` with `github` config. */
|
|
2
|
+
declare const _default: import("eve/tools").DynamicSentinel<(import("eve/tools").ToolDefinition<{
|
|
2
3
|
command: string;
|
|
3
4
|
permissions: {
|
|
4
5
|
provider: "github";
|
|
@@ -22,6 +23,6 @@ declare const _default: import("eve/tools").ToolDefinition<{
|
|
|
22
23
|
}[];
|
|
23
24
|
description: string;
|
|
24
25
|
workingDirectory?: string | undefined;
|
|
25
|
-
}, ctx: import("eve/tools").ToolContext): Promise<import("../lib/
|
|
26
|
-
}
|
|
26
|
+
}, ctx: import("eve/tools").ToolContext): Promise<import("../lib/sandbox.ts").GitHubShellOutput>;
|
|
27
|
+
}) | null>;
|
|
27
28
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{deprecatedGitHubConfigured,gh}from"../lib/github-compat.js";import{defineDynamic}from"eve/tools";var gh_default=defineDynamic({events:{"session.started":()=>deprecatedGitHubConfigured()?gh:null}});export{gh_default as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GREP_OUTPUT_MODES,executeGrepSearch}from"../lib/grep-search.js";import{z}from"#compiled/zod/index.js";import{defineTool}from"eve/tools";const InputSchema=z.object({context:z.number().int().min(0).optional().describe(`Context lines around each content match. Ignored unless outputMode is content.`),glob:z.string().optional().describe(`Limit files, for example "*.ts" or "*.{ts,tsx}".`),ignoreCase:z.boolean().optional().describe(`Case-insensitive search. Defaults to false.`),limit:z.number().int().min(1).max(200).optional().describe(`Maximum rows to return. Defaults to 50.`),literal:z.boolean().optional().describe(`Force a literal match. Defaults to true for identifier-like patterns, false when the pattern uses regex syntax.`),outputMode:z.enum(GREP_OUTPUT_MODES).optional().describe(`files_with_matches lists files and stops at the first hit in each (default). content returns matching lines. count returns per-file totals.`),path:z.string().optional().describe(`Directory or file
|
|
1
|
+
import{GREP_OUTPUT_MODES,executeGrepSearch}from"../lib/grep-search.js";import{z}from"#compiled/zod/index.js";import{defineTool}from"eve/tools";const InputSchema=z.object({context:z.number().int().min(0).optional().describe(`Context lines around each content match. Ignored unless outputMode is content.`),glob:z.string().optional().describe(`Limit files, for example "*.ts" or "*.{ts,tsx}".`),ignoreCase:z.boolean().optional().describe(`Case-insensitive search. Defaults to false.`),limit:z.number().int().min(1).max(200).optional().describe(`Maximum rows to return. Defaults to 50.`),literal:z.boolean().optional().describe(`Force a literal match. Defaults to true for identifier-like patterns, false when the pattern uses regex syntax.`),outputMode:z.enum(GREP_OUTPUT_MODES).optional().describe(`files_with_matches lists files and stops at the first hit in each (default). content returns matching lines. count returns per-file totals.`),path:z.string().optional().describe(`Directory or file inside the workspace. Defaults to the workspace root. Narrow this first.`),pattern:z.string().min(1).describe(`Regex or literal to search for.`)});var grep_default=defineTool({description:[`Fast sandbox content search powered by ripgrep.`,`Start with outputMode files_with_matches and a narrow path or glob. That stops at the first hit per file.`,`Use content only after you know which files matter. Use count to size a pattern before reading hits.`,`Function names and error strings are matched as fixed strings unless you set literal false or the pattern uses regex syntax.`,`With ripgrep, respects .gitignore. The POSIX fallback does not read .gitignore; both include hidden files and exclude .git.`].join(` `),inputSchema:InputSchema,outputSchema:z.object({content:z.string(),matchCount:z.number().int(),outputMode:z.enum(GREP_OUTPUT_MODES),path:z.string(),truncated:z.boolean()}),async execute(e,t){return executeGrepSearch(e,await t.getSandbox(),t.abortSignal)}});export{grep_default as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as apply_patch } from "./extension/tools/apply_patch.ts";
|
|
2
2
|
/** @deprecated Import from `eve/computer-use/tools` and mount `eve/computer-use`. */
|
|
3
3
|
export { computer_use } from "../../computer-use/tools.ts";
|
|
4
|
-
|
|
4
|
+
/** @deprecated Import from `eve/extensions/git/tools` and mount `eve/extensions/git`. */
|
|
5
|
+
export { gh } from "./extension/lib/github-compat.ts";
|
|
5
6
|
export { default as grep } from "./extension/tools/grep.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import computer_use_default from"../../computer-use/extension/tools/computer_use.js";import"../../computer-use/tools.js";import
|
|
1
|
+
import computer_use_default from"../../computer-use/extension/tools/computer_use.js";import"../../computer-use/tools.js";import{gh}from"./extension/lib/github-compat.js";import grep_default from"./extension/tools/grep.js";import apply_patch_default from"./extension/tools/apply_patch.js";export{apply_patch_default as apply_patch,computer_use_default as computer_use,gh,grep_default as grep};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { GitHubConfig } from "./lib/github-shell.ts";
|
|
3
|
+
export type { GitHubLeaseRule } from "./lib/github-shell.ts";
|
|
4
|
+
export type GitHubLeaseBroker = GitHubConfig["broker"];
|
|
5
|
+
declare const _default: import("eve/extension").ExtensionHandle<z.ZodObject<{
|
|
6
|
+
github: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
connector: z.ZodString;
|
|
8
|
+
org: z.ZodString;
|
|
9
|
+
broker: z.ZodCustom<(sandbox: import("../../../shared/sandbox-session.ts").SandboxSession, rules: Readonly<Record<string, readonly import("./lib/github-shell.ts").GitHubLeaseRule[]>> | null) => Promise<void>, (sandbox: import("../../../shared/sandbox-session.ts").SandboxSession, rules: Readonly<Record<string, readonly import("./lib/github-shell.ts").GitHubLeaseRule[]>> | null) => Promise<void>>;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{defineExtension}from"eve/extension";var extension_default=defineExtension({config:z.object({github:z.object({connector:z.string().min(1),org:z.string().min(1),broker:z.custom(e=>typeof e==`function`)}).optional()})});export{extension_default as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import extension_default from"../extension.js";import{githubInstructions}from"../lib/github-guidance.js";import{defineDynamic,defineInstructions}from"eve/instructions";var github_default=defineDynamic({events:{"session.started":()=>defineInstructions({content:githubInstructions(extension_default.config.github!==void 0)})}});export{github_default as default};
|