eve 0.67.0 → 0.67.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 +19 -0
- package/dist/src/channel/channel-address.d.ts +2 -2
- package/dist/src/channel/compiled-channel.d.ts +3 -2
- package/dist/src/channel/cross-channel-receive.d.ts +1 -18
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/forwarded-principal.d.ts +3 -2
- package/dist/src/channel/resolve-text.d.ts +2 -1
- package/dist/src/channel/schedule-auth.d.ts +0 -2
- package/dist/src/channel/schedule-auth.js +1 -1
- package/dist/src/channel/schedule.d.ts +2 -2
- package/dist/src/channel/session-callback.d.ts +2 -1
- package/dist/src/channel/types.d.ts +0 -7
- package/dist/src/chunks/{use-eve-agent-OCHP4s0z.js → use-eve-agent-D4HVZBjn.js} +1 -1
- package/dist/src/chunks/{use-eve-agent-DzdyI97Z.js → use-eve-agent-DXcE_8Ja.js} +1 -1
- package/dist/src/cli/acp/command.d.ts +2 -1
- package/dist/src/cli/agent-command.d.ts +2 -1
- package/dist/src/cli/agent-detection.d.ts +0 -1
- package/dist/src/cli/agent-detection.js +1 -1
- package/dist/src/cli/application-command.d.ts +2 -1
- package/dist/src/cli/application-root.d.ts +3 -8
- package/dist/src/cli/application-root.js +1 -1
- package/dist/src/cli/commands/agent-instructions.d.ts +0 -4
- package/dist/src/cli/commands/agent-instructions.js +3 -3
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.js +1 -1
- package/dist/src/cli/commands/init-project.d.ts +0 -1
- package/dist/src/cli/commands/init-project.js +1 -1
- package/dist/src/cli/commands/init-target.d.ts +1 -1
- package/dist/src/cli/commands/init-telemetry.d.ts +2 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/registry-declared-setups.d.ts +2 -1
- package/dist/src/cli/commands/registry-install-transaction.d.ts +0 -13
- package/dist/src/cli/commands/registry-install-transaction.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
- package/dist/src/cli/commands/registry-presentation.d.ts +0 -1
- package/dist/src/cli/commands/registry-presentation.js +1 -1
- package/dist/src/cli/commands/registry-project.d.ts +2 -1
- package/dist/src/cli/commands/registry.d.ts +0 -4
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/setup-headless.d.ts +2 -1
- package/dist/src/cli/commands/vercel-non-interactive.d.ts +2 -1
- package/dist/src/cli/dev/diagnostic-dump.d.ts +0 -2
- package/dist/src/cli/dev/diagnostic-dump.js +1 -1
- package/dist/src/cli/dev/diagnostic-sink.d.ts +3 -2
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.d.ts +2 -1
- package/dist/src/cli/dev/tui/argument-typeahead.d.ts +2 -1
- package/dist/src/cli/dev/tui/dev-rebuild-status.d.ts +2 -1
- package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +2 -1
- package/dist/src/cli/dev/tui/errors.d.ts +2 -7
- package/dist/src/cli/dev/tui/errors.js +1 -1
- package/dist/src/cli/dev/tui/flow-drawer.d.ts +2 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +1 -1
- package/dist/src/cli/dev/tui/mcp-connection-status.d.ts +2 -1
- package/dist/src/cli/dev/tui/message-queue.d.ts +4 -3
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +2 -1
- package/dist/src/cli/dev/tui/provider-picker.d.ts +3 -2
- package/dist/src/cli/dev/tui/question-panel.d.ts +2 -1
- package/dist/src/cli/dev/tui/registry-result-message.d.ts +3 -4
- package/dist/src/cli/dev/tui/registry-result-message.js +1 -1
- package/dist/src/cli/dev/tui/remote-connection-probe.d.ts +3 -2
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +2 -2
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +2 -2
- package/dist/src/cli/dev/tui/status-line.d.ts +2 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +3 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -2
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tool-block-groups.d.ts +3 -2
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +2 -1
- package/dist/src/cli/dev/tui/traces/trace-content.d.ts +0 -9
- package/dist/src/cli/dev/tui/traces/trace-content.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-view.d.ts +3 -2
- package/dist/src/cli/dev/tui/traces/trace-viewer-session.d.ts +2 -1
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.d.ts +2 -3
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.js +1 -1
- package/dist/src/cli/dev/ui-options.d.ts +3 -2
- package/dist/src/cli/dev/url-target.d.ts +2 -1
- package/dist/src/cli/invoke/command.d.ts +0 -11
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +1 -1
- package/dist/src/cli/telemetry/index.d.ts +0 -6
- package/dist/src/cli/telemetry/preference.d.ts +2 -1
- package/dist/src/cli/ui/alt-screen.d.ts +3 -2
- package/dist/src/cli/ui/live-region.d.ts +3 -2
- package/dist/src/cli/ui/output.d.ts +1 -16
- package/dist/src/cli/ui/output.js +2 -5
- package/dist/src/client/eve-agent-store-helpers.d.ts +0 -1
- package/dist/src/client/eve-agent-store-helpers.js +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +2 -1
- package/dist/src/client/session-utils.d.ts +3 -2
- package/dist/src/compiled/.vendor-stamp.json +6 -6
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +4 -3
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +23 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/hook-wake.d.ts +69 -36
- package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +25 -22
- package/dist/src/compiled/@workflow/core/runtime/run-spec-version.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +59 -1
- package/dist/src/compiled/@workflow/core/runtime/step-latency.d.ts +3 -2
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +34 -12
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/serialization.d.ts +7 -2
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +29 -0
- package/dist/src/compiled/@workflow/core/types.d.ts +1 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +13 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +14 -4
- package/dist/src/compiled/@workflow/world/index.d.ts +2 -2
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +2 -1
- package/dist/src/compiled/@workflow/world/shared.d.ts +24 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +23 -0
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DzJovO_f.js → attribute-changes-D721NpZv.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/{dist-BQSf8Hax.js → dist-BUFGAKRb.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-CaNNONeg.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{frames-qKc30rjg.js → frames-Dr9fHWdo.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{global-BQnKzRXo.js → global-DKbOgrts.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/helpers-DkKxg_yn.js +1 -0
- package/dist/src/compiled/_chunks/workflow/logger-D4GJNTk4.js +14 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-uTW-jBYz.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-5DmiMN9b.js +1 -0
- package/dist/src/compiled/_chunks/workflow/serialization-CNIYl1D3.js +3 -0
- package/dist/src/compiled/_chunks/workflow/sleep-DFKgN7UG.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-3_1djUuL.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-BrsMYqJg.js → ws-transport--rYOVIaf.js} +1 -1
- package/dist/src/compiler/artifacts.d.ts +4 -27
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/compile-agent.d.ts +2 -1
- package/dist/src/compiler/compile-agent.js +1 -1
- package/dist/src/compiler/diagnostics.d.ts +0 -11
- package/dist/src/compiler/diagnostics.js +1 -1
- package/dist/src/compiler/manifest.d.ts +0 -4
- package/dist/src/compiler/module-map.d.ts +1 -5
- package/dist/src/compiler/module-map.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +2 -1
- package/dist/src/compiler/normalize-instructions.d.ts +2 -6
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.d.ts +0 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +2 -1
- package/dist/src/compiler/project-sources.d.ts +0 -14
- package/dist/src/compiler/project-sources.js +1 -1
- package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +1 -2
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/context/build-base-tool-context.d.ts +2 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +0 -4
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +0 -1
- package/dist/src/context/dynamic-tool-metadata.js +1 -1
- package/dist/src/context/memory-lifecycle.d.ts +0 -8
- package/dist/src/context/memory-lifecycle.js +1 -1
- package/dist/src/discover/connections.d.ts +0 -15
- package/dist/src/discover/connections.js +1 -1
- package/dist/src/discover/diagnostics.d.ts +0 -12
- package/dist/src/discover/diagnostics.js +1 -1
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/discover-subagent.d.ts +0 -1
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/extensions.d.ts +3 -10
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +5 -9
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/grammar.d.ts +0 -46
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.d.ts +5 -4
- package/dist/src/discover/memory.d.ts +0 -1
- package/dist/src/discover/memory.js +1 -1
- package/dist/src/discover/named-source-directory.js +1 -1
- package/dist/src/discover/project-source.d.ts +2 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/discover/sandbox.js +1 -1
- package/dist/src/discover/skills.d.ts +0 -4
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/evals/cli/eval-client.d.ts +2 -1
- package/dist/src/evals/judge.d.ts +2 -1
- package/dist/src/evals/runner/execute-task.d.ts +1 -1
- package/dist/src/evals/types.d.ts +1 -1
- package/dist/src/eve-channel/support.d.ts +1 -3
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/execution/dynamic-workflow/schema.d.ts +2 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/effective-agent-config.d.ts +2 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +3 -5
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/history-view.d.ts +2 -1
- package/dist/src/execution/node-step.d.ts +3 -2
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +2 -4
- package/dist/src/execution/sandbox/active-handles.js +1 -1
- package/dist/src/execution/sandbox/bash.d.ts +2 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -6
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +3 -2
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -3
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +1 -1
- package/dist/src/execution/sandbox/dockerfile.d.ts +0 -1
- package/dist/src/execution/sandbox/dockerfile.js +1 -1
- package/dist/src/execution/sandbox/ensure.d.ts +2 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +1 -18
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/sandbox/require-sandbox.d.ts +0 -11
- package/dist/src/execution/sandbox/require-sandbox.js +1 -1
- package/dist/src/execution/sandbox/truncate-output.d.ts +2 -5
- package/dist/src/execution/sandbox/truncate-output.js +2 -2
- package/dist/src/execution/session/admission.d.ts +3 -2
- package/dist/src/execution/session/event-sink.d.ts +2 -1
- package/dist/src/execution/session/finalization.d.ts +2 -1
- package/dist/src/execution/session/handoff.d.ts +3 -2
- package/dist/src/execution/session/route-selected-delivery.d.ts +2 -1
- package/dist/src/execution/session/timeout-control.d.ts +2 -1
- package/dist/src/execution/session-activity.d.ts +0 -3
- package/dist/src/execution/session-activity.js +1 -1
- package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
- package/dist/src/execution/session.d.ts +3 -2
- package/dist/src/execution/stable-workflow-names.d.ts +0 -6
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/ask-question-workflow.js +1 -1
- package/dist/src/execution/tools/connection-search.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +2 -1
- package/dist/src/execution/tools/subagent/start.js +1 -1
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +4 -3
- package/dist/src/execution/tools/workflow/background.d.ts +2 -6
- package/dist/src/execution/tools/workflow/background.js +1 -1
- package/dist/src/execution/tools/workflow/owner-channels.d.ts +1 -1
- package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +2 -1
- package/dist/src/execution/web-fetch/execute.d.ts +2 -2
- package/dist/src/execution/web-fetch/request.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/computer-use-driver-source.d.ts +0 -2
- package/dist/src/extensions/code/extension/lib/computer-use-driver-source.js +57 -57
- package/dist/src/extensions/code/extension/lib/computer-use.d.ts +1 -1
- package/dist/src/extensions/code/extension/lib/generated-paths.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +5 -5
- package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
- package/dist/src/extensions/code/extension/lib/guidelines.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/patch.d.ts +3 -2
- package/dist/src/extensions/code/extension/lib/prwatch-github.d.ts +1 -2
- package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
- package/dist/src/extensions/code/extension/lib/prwatch-registry.d.ts +2 -1
- package/dist/src/framework/host-inventory.d.ts +3 -2
- package/dist/src/harness/approval-candidates.d.ts +4 -3
- package/dist/src/harness/approval-delivery-coordinator.d.ts +2 -1
- package/dist/src/harness/authorization.d.ts +0 -9
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +2 -1
- package/dist/src/harness/coordination.d.ts +0 -4
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/input-requests.d.ts +1 -10
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +0 -5
- package/dist/src/harness/pending-input-batches.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +9 -0
- package/dist/src/harness/provider-safety.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +2 -1
- package/dist/src/harness/session-limit-continuation.d.ts +0 -4
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-usage-limits.d.ts +2 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-model-output.d.ts +2 -1
- package/dist/src/harness/turn-cancellation.d.ts +2 -7
- package/dist/src/harness/turn-cancellation.js +1 -1
- package/dist/src/harness/turn-client-context.d.ts +2 -1
- package/dist/src/harness/workflow-stream-error.d.ts +0 -7
- package/dist/src/harness/workflow-stream-error.js +1 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/state.d.ts +2 -2
- package/dist/src/internal/agent-name.d.ts +0 -2
- package/dist/src/internal/agent-name.js +1 -1
- package/dist/src/internal/application/build-profile.d.ts +2 -2
- package/dist/src/internal/application/cache-metadata.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/dev-environment.d.ts +2 -8
- package/dist/src/internal/application/dev-environment.js +1 -1
- package/dist/src/internal/application/optional-package-import.js +1 -1
- package/dist/src/internal/application/optional-package-install.js +1 -1
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.d.ts +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.d.ts +0 -5
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/application/tsconfig-dependencies.d.ts +0 -16
- package/dist/src/internal/application/tsconfig-dependencies.js +1 -1
- package/dist/src/internal/authored-asset-import-plugin.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-definition/source-identity.d.ts +1 -1
- package/dist/src/internal/authored-module-evaluation-error.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
- package/dist/src/internal/bundler/extension-scope-plugin.d.ts +2 -1
- package/dist/src/internal/bundler/extension-scope-plugin.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -12
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/bundler/vendored-dependency-log.d.ts +7 -0
- package/dist/src/internal/bundler/vendored-dependency-log.js +1 -0
- package/dist/src/internal/eve-project-root.d.ts +0 -3
- package/dist/src/internal/eve-project-root.js +1 -1
- package/dist/src/internal/external-resources-snapshot.d.ts +1 -1
- package/dist/src/internal/external-resources.d.ts +0 -1
- package/dist/src/internal/external-resources.js +1 -1
- package/dist/src/internal/gateway.d.ts +2 -0
- package/dist/src/internal/gateway.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/instrumentation-layout.js +1 -1
- package/dist/src/internal/invocation/metadata.d.ts +1 -1
- package/dist/src/internal/materialized-authored-modules.d.ts +2 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/mcp/protected-resource.d.ts +2 -1
- package/dist/src/internal/mcp/streamable-http-server.d.ts +4 -5
- package/dist/src/internal/mcp/streamable-http-server.js +1 -1
- package/dist/src/internal/model-catalog.d.ts +2 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +0 -4
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +0 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/development-generation.d.ts +0 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/channel-routes.d.ts +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-candidate.d.ts +2 -1
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/extension-external-dependency-plugin.js +1 -1
- package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -1
- package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +2 -26
- package/dist/src/internal/nitro/host/schedule-task-routes.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +1 -1
- package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.d.ts +2 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +2 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -1
- package/dist/src/internal/vercel/assemble-eve-services.d.ts +3 -2
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +2 -3
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
- package/dist/src/internal/vercel/project-link.d.ts +2 -1
- package/dist/src/internal/vercel/project-link.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-codec.d.ts +2 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/world-compatibility.d.ts +2 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -9
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -3
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +0 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/activity.d.ts +3 -3
- package/dist/src/protocol/activity.js +1 -1
- package/dist/src/protocol/baggage.d.ts +2 -2
- package/dist/src/protocol/cancel-turn.d.ts +0 -2
- package/dist/src/protocol/event-dedupe.d.ts +2 -1
- package/dist/src/protocol/event-id.d.ts +0 -6
- package/dist/src/protocol/event-id.js +1 -1
- package/dist/src/protocol/traceparent.d.ts +2 -1
- package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -4
- package/dist/src/public/channels/chat-sdk/audience.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.d.ts +1 -1
- package/dist/src/public/channels/github/api.d.ts +2 -22
- package/dist/src/public/channels/github/api.js +1 -1
- package/dist/src/public/channels/github/auth.d.ts +0 -9
- package/dist/src/public/channels/github/auth.js +1 -1
- package/dist/src/public/channels/github/binding.d.ts +3 -2
- package/dist/src/public/channels/github/checkout.d.ts +3 -3
- package/dist/src/public/channels/github/defaults.d.ts +3 -2
- package/dist/src/public/channels/github/githubChannel.d.ts +1 -1
- package/dist/src/public/channels/github/limits.d.ts +0 -2
- package/dist/src/public/channels/github/limits.js +2 -2
- package/dist/src/public/channels/github/pr-context.d.ts +2 -3
- package/dist/src/public/channels/github/pr-context.js +1 -1
- package/dist/src/public/channels/github/state.d.ts +2 -1
- package/dist/src/public/channels/github/verify.d.ts +2 -1
- package/dist/src/public/channels/linear/defaults.d.ts +2 -1
- package/dist/src/public/channels/linear/inbound-images.d.ts +2 -1
- package/dist/src/public/channels/slack/app-manifest.d.ts +3 -4
- package/dist/src/public/channels/slack/app-manifest.js +1 -1
- package/dist/src/public/channels/slack/hitl.d.ts +0 -4
- package/dist/src/public/channels/slack/hitl.js +2 -2
- package/dist/src/public/channels/slack/inbound.d.ts +2 -1
- package/dist/src/public/channels/slack/model-context.d.ts +0 -18
- package/dist/src/public/channels/slack/model-context.js +1 -1
- package/dist/src/public/channels/slack/mrkdwn.d.ts +0 -2
- package/dist/src/public/channels/slack/mrkdwn.js +1 -1
- package/dist/src/public/channels/slack/privacy.d.ts +2 -1
- package/dist/src/public/channels/slack/verify.d.ts +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +1 -1
- package/dist/src/public/channels/telegram/audience.d.ts +2 -3
- package/dist/src/public/channels/telegram/audience.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +1 -1
- package/dist/src/public/channels/twilio/defaults.d.ts +0 -7
- package/dist/src/public/channels/twilio/defaults.js +1 -1
- package/dist/src/public/channels/twilio/routing.d.ts +2 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +1 -1
- package/dist/src/public/channels/upload-policy.d.ts +0 -11
- package/dist/src/public/channels/upload-policy.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/index.js +1 -1
- package/dist/src/public/memory/file/provider.js +1 -1
- package/dist/src/public/models/openai/chatgpt/model.d.ts +2 -1
- package/dist/src/public/models/openai/chatgpt/token-broker.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.d.ts +3 -2
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/skills/index.js +1 -1
- package/dist/src/public/sveltekit/dev-server.d.ts +3 -2
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +0 -4
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/connections/instance-identity.d.ts +0 -3
- package/dist/src/runtime/connections/instance-identity.js +1 -1
- package/dist/src/runtime/connections/mcp-tracing.d.ts +1 -6
- package/dist/src/runtime/connections/mcp-tracing.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +0 -9
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/hooks/registry.d.ts +0 -7
- package/dist/src/runtime/hooks/registry.js +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +2 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +0 -1
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/resolve-agent.d.ts +2 -2
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-dynamic-tool.d.ts +0 -16
- package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +1 -2
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/runtime/schedules/register.d.ts +0 -4
- package/dist/src/runtime/schedules/register.js +1 -1
- package/dist/src/self-modification/credentials.d.ts +1 -4
- package/dist/src/self-modification/credentials.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/search_traces.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +0 -1
- package/dist/src/self-modification/filesystem.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +0 -3
- package/dist/src/self-modification/git-workspace.js +1 -1
- package/dist/src/self-modification/github-publisher.d.ts +2 -1
- package/dist/src/self-modification/migration.d.ts +0 -1
- package/dist/src/self-modification/migration.js +1 -1
- package/dist/src/self-modification/mode.d.ts +2 -1
- package/dist/src/self-modification/proposal.d.ts +0 -2
- package/dist/src/self-modification/proposal.js +2 -2
- package/dist/src/self-modification/setup.js +1 -1
- package/dist/src/services/dev-client/agent-info-probe.d.ts +2 -1
- package/dist/src/services/dev-client/request-headers.d.ts +1 -1
- package/dist/src/services/dev-client/vercel-auth-error.d.ts +0 -8
- package/dist/src/services/dev-client/vercel-auth-error.js +2 -3
- package/dist/src/setup/ai-gateway-api-key.d.ts +2 -1
- package/dist/src/setup/append-env.d.ts +3 -2
- package/dist/src/setup/ask.d.ts +3 -3
- package/dist/src/setup/boxes/apply-ai-gateway-credential.d.ts +2 -1
- package/dist/src/setup/boxes/deploy-project.d.ts +4 -3
- package/dist/src/setup/boxes/link-project.d.ts +2 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +2 -1
- package/dist/src/setup/boxes/select-model.d.ts +2 -37
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/option-row.d.ts +1 -1
- package/dist/src/setup/cli/prompt-ui.d.ts +0 -10
- package/dist/src/setup/cli/prompt-ui.js +1 -1
- package/dist/src/setup/cli/rail-log.d.ts +0 -2
- package/dist/src/setup/cli/rail-log.js +2 -2
- package/dist/src/setup/connect-provisioning.d.ts +2 -1
- package/dist/src/setup/connection-connector.d.ts +2 -1
- package/dist/src/setup/flows/link.d.ts +2 -1
- package/dist/src/setup/flows/model-login.d.ts +1 -1
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/provider.d.ts +2 -45
- package/dist/src/setup/flows/provider.js +1 -4
- package/dist/src/setup/flows/registry-session.d.ts +3 -2
- package/dist/src/setup/integrations/discord/api.d.ts +2 -1
- package/dist/src/setup/integrations/discord/connect.d.ts +3 -3
- package/dist/src/setup/integrations/discord/connect.js +1 -1
- package/dist/src/setup/integrations/discord/setup.d.ts +2 -1
- package/dist/src/setup/integrations/file-memory/vercel.d.ts +1 -1
- package/dist/src/setup/integrations/github/connect.d.ts +3 -3
- package/dist/src/setup/integrations/github/connect.js +1 -1
- package/dist/src/setup/integrations/github/setup.d.ts +1 -1
- package/dist/src/setup/integrations/linear/connect.d.ts +2 -2
- package/dist/src/setup/integrations/linear/connect.js +1 -1
- package/dist/src/setup/integrations/linear/setup.d.ts +1 -1
- package/dist/src/setup/integrations/linq/connect.d.ts +3 -4
- package/dist/src/setup/integrations/linq/connect.js +1 -1
- package/dist/src/setup/integrations/linq/management.d.ts +2 -1
- package/dist/src/setup/integrations/linq/setup.d.ts +1 -9
- package/dist/src/setup/integrations/linq/setup.js +1 -1
- package/dist/src/setup/integrations/photon/connect.d.ts +5 -7
- package/dist/src/setup/integrations/photon/connect.js +1 -1
- package/dist/src/setup/integrations/photon/management.d.ts +5 -4
- package/dist/src/setup/integrations/photon/setup-flow.d.ts +2 -1
- package/dist/src/setup/integrations/registry.d.ts +0 -2
- package/dist/src/setup/integrations/registry.js +1 -1
- package/dist/src/setup/integrations/runner.d.ts +3 -2
- package/dist/src/setup/integrations/shared/scaffold.d.ts +2 -1
- package/dist/src/setup/integrations/shared/vercel-project.d.ts +2 -1
- package/dist/src/setup/integrations/shopify/setup.d.ts +2 -1
- package/dist/src/setup/integrations/teams/connect.d.ts +3 -3
- package/dist/src/setup/integrations/teams/connect.js +1 -1
- package/dist/src/setup/integrations/teams/setup.d.ts +2 -1
- package/dist/src/setup/integrations/web/setup.d.ts +2 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/primitives/pm/process-result.d.ts +2 -1
- package/dist/src/setup/primitives/pm/shared.d.ts +2 -1
- package/dist/src/setup/primitives/process-output.d.ts +2 -1
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/project-resolution.d.ts +0 -2
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/provider-settings.js +1 -1
- package/dist/src/setup/quit-guard.d.ts +3 -2
- package/dist/src/setup/scaffold/connections/catalog.d.ts +0 -13
- package/dist/src/setup/scaffold/connections/catalog.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +2 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/files.d.ts +2 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +0 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/setup/scaffold/workspace-glob.d.ts +0 -1
- package/dist/src/setup/scaffold/workspace-glob.js +1 -1
- package/dist/src/setup/scaffold/workspace-root.d.ts +2 -1
- package/dist/src/setup/scaffold/workspace-root.js +1 -1
- package/dist/src/setup/slack-connect-create.d.ts +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +5 -5
- package/dist/src/setup/slack-connect.d.ts +0 -4
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/slackbot.d.ts +3 -3
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/vercel-api-failure.d.ts +0 -2
- package/dist/src/setup/vercel-api-failure.js +1 -1
- package/dist/src/setup/vercel-project-api.d.ts +1 -1
- package/dist/src/setup/vercel-project.d.ts +4 -38
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/action-types.d.ts +1 -58
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +0 -3
- package/dist/src/shared/agent-turn-outcome.d.ts +1 -3
- package/dist/src/shared/agent-turn-outcome.js +1 -1
- package/dist/src/shared/chatgpt-model.d.ts +0 -1
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/conversation-context.d.ts +2 -1
- package/dist/src/shared/conversation-identity.d.ts +2 -0
- package/dist/src/shared/conversation-identity.js +1 -0
- package/dist/src/shared/extension-package-contract.d.ts +2 -1
- package/dist/src/shared/forwarded-trace-policy.d.ts +3 -2
- package/dist/src/shared/gateway-service-tier.d.ts +2 -1
- package/dist/src/shared/memory-state.d.ts +0 -8
- package/dist/src/shared/memory-state.js +1 -1
- package/dist/src/shared/sandbox-environment.d.ts +0 -1
- package/dist/src/shared/sandbox-environment.js +1 -1
- package/dist/src/shared/skill-package.d.ts +0 -5
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/skill-paths.d.ts +0 -13
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/token-usage.d.ts +0 -7
- package/dist/src/shared/token-usage.js +1 -1
- package/dist/src/shared/ulid.d.ts +2 -8
- package/dist/src/shared/ulid.js +1 -1
- package/dist/src/shared/vercel-project.d.ts +2 -1
- package/dist/src/shared/vercel-services.d.ts +2 -2
- package/dist/src/shared/workflow-sandbox.d.ts +0 -7
- package/dist/src/source-change/agent-config-ast.d.ts +2 -1
- package/dist/src/source-change/agent-config-string-path.d.ts +2 -2
- package/dist/src/source-change/apply-agent-model-settings.d.ts +2 -1
- package/dist/src/source-change/apply-model-selection.d.ts +2 -1
- package/dist/src/source-change/static-source-change.d.ts +4 -3
- package/dist/src/subagents/invocation.d.ts +1 -1
- package/dist/src/subagents/tool.d.ts +2 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.d.ts +0 -3
- package/dist/src/tools/durable-callbacks.d.ts +1 -2
- package/dist/src/tools/durable-callbacks.js +1 -1
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +1 -1
- package/dist/src/tools/native-definition.d.ts +2 -1
- package/dist/src/tracing/agent-action-instrumentation.d.ts +2 -1
- package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
- package/dist/src/tracing/agent-memory-instrumentation.d.ts +2 -1
- package/dist/src/tracing/agent-otel-attributes.js +1 -1
- package/dist/src/tracing/agent-otel-provider.d.ts +2 -1
- package/dist/src/tracing/agent-span-id-generator.d.ts +0 -1
- package/dist/src/tracing/agent-span-id-generator.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.d.ts +2 -1
- package/dist/src/tracing/agent-tool-span-context.d.ts +3 -2
- package/dist/src/tracing/agent-trace-context-store.d.ts +0 -2
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +0 -24
- package/dist/src/tracing/agent-trace-state.js +1 -1
- package/dist/src/tracing/batch-span-processor.d.ts +2 -1
- package/dist/src/tracing/conversation-context.d.ts +0 -2
- package/dist/src/tracing/conversation-context.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-trace-analysis.d.ts +4 -3
- package/dist/src/tracing/local-trace-discovery-index.d.ts +0 -2
- package/dist/src/tracing/local-trace-discovery-index.js +1 -1
- package/dist/src/tracing/local-trace-query.d.ts +2 -1
- package/dist/src/tracing/local-trace-retention.d.ts +4 -4
- package/dist/src/tracing/telemetry-budget.d.ts +0 -1
- package/dist/src/tracing/telemetry-budget.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +7 -0
- package/package.json +8 -8
- package/dist/src/cli/commands/channel-add-conflicts.d.ts +0 -21
- package/dist/src/cli/commands/channel-add-conflicts.js +0 -1
- package/dist/src/cli/commands/init-confirm.d.ts +0 -12
- package/dist/src/cli/commands/init-confirm.js +0 -1
- package/dist/src/cli/commands/registry-search-presentation.d.ts +0 -16
- package/dist/src/cli/commands/registry-search-presentation.js +0 -6
- package/dist/src/compiled/_chunks/workflow/dist-BfMqXLK3.js +0 -3
- package/dist/src/compiled/_chunks/workflow/helpers-CNMO7zB1.js +0 -1
- package/dist/src/compiled/_chunks/workflow/logger-BCEj9caG.js +0 -14
- package/dist/src/compiled/_chunks/workflow/resume-hook-QS_cMwHn.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-CA5wWV2S.js +0 -1
- package/dist/src/compiled/_chunks/workflow/serialization-CJ265vSe.js +0 -3
- package/dist/src/compiled/_chunks/workflow/sleep-CBn94Ayv.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wait-until-Bo2U6ON9.js +0 -1
- package/dist/src/compiler/compile-from-memory.d.ts +0 -44
- package/dist/src/compiler/compile-from-memory.js +0 -1
- package/dist/src/execution/connection-auth-tool-result.d.ts +0 -2
- package/dist/src/execution/connection-auth-tool-result.js +0 -1
- package/dist/src/internal/process/pnpm.d.ts +0 -28
- package/dist/src/internal/process/pnpm.js +0 -1
- package/dist/src/public/channels/slack/api-encoding.d.ts +0 -5
- package/dist/src/public/channels/slack/api-encoding.js +0 -1
- package/dist/src/public/definitions/instrumentation.d.ts +0 -1
- package/dist/src/public/definitions/instrumentation.js +0 -1
- package/dist/src/public/models/openai/chatgpt/unsigned-jwt.d.ts +0 -5
- package/dist/src/public/models/openai/chatgpt/unsigned-jwt.js +0 -1
- package/dist/src/sandbox/backends/probes.d.ts +0 -7
- package/dist/src/sandbox/backends/probes.js +0 -1
- package/dist/src/setup/channel-add-conflicts.d.ts +0 -28
- package/dist/src/setup/channel-add-conflicts.js +0 -1
- package/dist/src/setup/gateway-models.d.ts +0 -10
- package/dist/src/setup/gateway-models.js +0 -1
- package/dist/src/setup/primitives/run-pnpm.d.ts +0 -1
- package/dist/src/setup/primitives/run-pnpm.js +0 -1
- package/dist/src/shared/dispatch-action.d.ts +0 -30
- package/dist/src/shared/dispatch-action.js +0 -1
|
@@ -1090,61 +1090,6 @@ if (response.statusCode !== 200) {
|
|
|
1090
1090
|
} else {
|
|
1091
1091
|
process.stdout.write(response.body);
|
|
1092
1092
|
}
|
|
1093
|
-
`,STATE_MJS_SOURCE=`const MAX_GROUNDING_ELEMENTS = 80;
|
|
1094
|
-
|
|
1095
|
-
/**
|
|
1096
|
-
* @typedef {{
|
|
1097
|
-
* element_index?: number;
|
|
1098
|
-
* frame?: { h?: number; w?: number; x?: number; y?: number };
|
|
1099
|
-
* label?: unknown;
|
|
1100
|
-
* [key: string]: unknown;
|
|
1101
|
-
* }} GroundingElement
|
|
1102
|
-
*/
|
|
1103
|
-
|
|
1104
|
-
/**
|
|
1105
|
-
* Keep the model-facing state aligned with the visible desktop screenshot.
|
|
1106
|
-
*
|
|
1107
|
-
* @param {unknown[]} elements
|
|
1108
|
-
* @returns {GroundingElement[]}
|
|
1109
|
-
*/
|
|
1110
|
-
export function selectGroundingElements(elements, screen = { width: 1920, height: 1080 }) {
|
|
1111
|
-
return elements
|
|
1112
|
-
.filter((element) => isVisibleLabeledElement(element, screen))
|
|
1113
|
-
.slice(0, MAX_GROUNDING_ELEMENTS);
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
/**
|
|
1117
|
-
* @param {unknown} value
|
|
1118
|
-
* @returns {value is GroundingElement}
|
|
1119
|
-
*/
|
|
1120
|
-
function isVisibleLabeledElement(value, screen) {
|
|
1121
|
-
if (typeof value !== "object" || value === null) return false;
|
|
1122
|
-
const element = /** @type {GroundingElement} */ (value);
|
|
1123
|
-
const frame = element.frame;
|
|
1124
|
-
if (typeof element.label !== "string" || element.label.trim().length === 0) return false;
|
|
1125
|
-
if (typeof frame !== "object" || frame === null) return false;
|
|
1126
|
-
if (
|
|
1127
|
-
!Number.isFinite(frame.x) ||
|
|
1128
|
-
!Number.isFinite(frame.y) ||
|
|
1129
|
-
!Number.isFinite(frame.w) ||
|
|
1130
|
-
!Number.isFinite(frame.h)
|
|
1131
|
-
) {
|
|
1132
|
-
return false;
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
const x = /** @type {number} */ (frame.x);
|
|
1136
|
-
const y = /** @type {number} */ (frame.y);
|
|
1137
|
-
const width = /** @type {number} */ (frame.w);
|
|
1138
|
-
const height = /** @type {number} */ (frame.h);
|
|
1139
|
-
return (
|
|
1140
|
-
width > 0 &&
|
|
1141
|
-
height > 0 &&
|
|
1142
|
-
x < screen.width &&
|
|
1143
|
-
y < screen.height &&
|
|
1144
|
-
x + width > 0 &&
|
|
1145
|
-
y + height > 0
|
|
1146
|
-
);
|
|
1147
|
-
}
|
|
1148
1093
|
`,TYPING_MJS_SOURCE=`const DEMO_TYPING_SPEED = 1.2;
|
|
1149
1094
|
const MIN_DELAY_MS = 35;
|
|
1150
1095
|
const MAX_DELAY_MS = 220;
|
|
@@ -1298,7 +1243,62 @@ function deterministicUnit(start, end, salt) {
|
|
|
1298
1243
|
value ^= value << 5;
|
|
1299
1244
|
return (value >>> 0) / 0x1_0000_0000;
|
|
1300
1245
|
}
|
|
1301
|
-
`,
|
|
1246
|
+
`,COMPUTER_USE_DRIVER_SOURCES={"server.mjs":SERVER_MJS_SOURCE,"client.mjs":CLIENT_MJS_SOURCE,"state.mjs":`const MAX_GROUNDING_ELEMENTS = 80;
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* @typedef {{
|
|
1250
|
+
* element_index?: number;
|
|
1251
|
+
* frame?: { h?: number; w?: number; x?: number; y?: number };
|
|
1252
|
+
* label?: unknown;
|
|
1253
|
+
* [key: string]: unknown;
|
|
1254
|
+
* }} GroundingElement
|
|
1255
|
+
*/
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* Keep the model-facing state aligned with the visible desktop screenshot.
|
|
1259
|
+
*
|
|
1260
|
+
* @param {unknown[]} elements
|
|
1261
|
+
* @returns {GroundingElement[]}
|
|
1262
|
+
*/
|
|
1263
|
+
export function selectGroundingElements(elements, screen = { width: 1920, height: 1080 }) {
|
|
1264
|
+
return elements
|
|
1265
|
+
.filter((element) => isVisibleLabeledElement(element, screen))
|
|
1266
|
+
.slice(0, MAX_GROUNDING_ELEMENTS);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* @param {unknown} value
|
|
1271
|
+
* @returns {value is GroundingElement}
|
|
1272
|
+
*/
|
|
1273
|
+
function isVisibleLabeledElement(value, screen) {
|
|
1274
|
+
if (typeof value !== "object" || value === null) return false;
|
|
1275
|
+
const element = /** @type {GroundingElement} */ (value);
|
|
1276
|
+
const frame = element.frame;
|
|
1277
|
+
if (typeof element.label !== "string" || element.label.trim().length === 0) return false;
|
|
1278
|
+
if (typeof frame !== "object" || frame === null) return false;
|
|
1279
|
+
if (
|
|
1280
|
+
!Number.isFinite(frame.x) ||
|
|
1281
|
+
!Number.isFinite(frame.y) ||
|
|
1282
|
+
!Number.isFinite(frame.w) ||
|
|
1283
|
+
!Number.isFinite(frame.h)
|
|
1284
|
+
) {
|
|
1285
|
+
return false;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
const x = /** @type {number} */ (frame.x);
|
|
1289
|
+
const y = /** @type {number} */ (frame.y);
|
|
1290
|
+
const width = /** @type {number} */ (frame.w);
|
|
1291
|
+
const height = /** @type {number} */ (frame.h);
|
|
1292
|
+
return (
|
|
1293
|
+
width > 0 &&
|
|
1294
|
+
height > 0 &&
|
|
1295
|
+
x < screen.width &&
|
|
1296
|
+
y < screen.height &&
|
|
1297
|
+
x + width > 0 &&
|
|
1298
|
+
y + height > 0
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
`,"typing.mjs":TYPING_MJS_SOURCE,"pointer-motion.mjs":POINTER_MOTION_MJS_SOURCE,"package.json":`{
|
|
1302
1302
|
"name": "computer-use-driver",
|
|
1303
1303
|
"private": true,
|
|
1304
1304
|
"type": "module",
|
|
@@ -1306,4 +1306,4 @@ function deterministicUnit(start, end, salt) {
|
|
|
1306
1306
|
"@trycua/cua-driver": "0.12.5"
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
|
-
|
|
1309
|
+
`};export{CLIENT_MJS_SOURCE,COMPUTER_USE_DRIVER_SOURCES,POINTER_MOTION_MJS_SOURCE,SERVER_MJS_SOURCE,TYPING_MJS_SOURCE};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Generated files must change through the deterministic command that
|
|
6
6
|
* generates them, never through model-authored patches.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
interface GeneratedPathMatch {
|
|
9
9
|
readonly path: string;
|
|
10
10
|
readonly label: string;
|
|
11
11
|
readonly remedy: string;
|
|
@@ -16,3 +16,4 @@ export declare function patchTargetPaths(patchText: string): readonly string[];
|
|
|
16
16
|
export declare function findGeneratedPatchTargets(patchText: string): readonly GeneratedPathMatch[];
|
|
17
17
|
/** One actionable error message covering every generated target in the patch. */
|
|
18
18
|
export declare function generatedPatchTargetsError(matches: readonly GeneratedPathMatch[]): string;
|
|
19
|
+
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export declare const DEFAULT_GREP_LIMIT = 50;
|
|
2
1
|
export declare const MAX_GREP_LIMIT = 200;
|
|
3
2
|
export declare const MAX_GREP_COMMAND_BYTES: number;
|
|
4
3
|
export declare const MAX_GREP_LINE_BYTES: number;
|
|
5
4
|
export declare const MAX_GREP_RETURN_BYTES: number;
|
|
6
5
|
export declare const GREP_OUTPUT_MODES: readonly ["files_with_matches", "content", "count"];
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
type GrepOutputMode = (typeof GREP_OUTPUT_MODES)[number];
|
|
7
|
+
interface GrepCommandInput {
|
|
9
8
|
readonly contextLines: number;
|
|
10
9
|
readonly glob: string | undefined;
|
|
11
10
|
readonly ignoreCase: boolean;
|
|
@@ -22,7 +21,7 @@ export interface GrepSearchResult {
|
|
|
22
21
|
readonly path: string;
|
|
23
22
|
readonly truncated: boolean;
|
|
24
23
|
}
|
|
25
|
-
|
|
24
|
+
interface GrepSandbox {
|
|
26
25
|
resolvePath(path: string): string;
|
|
27
26
|
run(input: {
|
|
28
27
|
abortSignal?: AbortSignal;
|
|
@@ -33,7 +32,7 @@ export interface GrepSandbox {
|
|
|
33
32
|
stdout: string;
|
|
34
33
|
}>;
|
|
35
34
|
}
|
|
36
|
-
|
|
35
|
+
interface GrepToolInput {
|
|
37
36
|
readonly context?: number;
|
|
38
37
|
readonly glob?: string;
|
|
39
38
|
readonly ignoreCase?: boolean;
|
|
@@ -59,3 +58,4 @@ export declare function processGrepOutput(input: {
|
|
|
59
58
|
readonly path: string;
|
|
60
59
|
readonly stdout: string;
|
|
61
60
|
}): GrepSearchResult;
|
|
61
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{shellQuote}from"./shell.js";const
|
|
1
|
+
import{shellQuote}from"./shell.js";const MAX_GREP_LIMIT=200,MAX_GREP_COMMAND_BYTES=262144,MAX_GREP_LINE_BYTES=8192,MAX_GREP_RETURN_BYTES=65536,REGEX_META=/[\\^$.*+?()[\]{}|]/u,GREP_OUTPUT_MODES=[`files_with_matches`,`content`,`count`];function shouldUseFixedStrings(e,t){return t===!0||t!==!1&&!REGEX_META.test(e)}function effectiveOutputMode(e){return e??`files_with_matches`}function effectiveLimit(e){return Math.min(Math.max(1,e??50),200)}function assertWorkspacePath(e,t){if(t!==void 0&&t.split(/[\\/]/u).includes(`..`))throw Error(`grep path must not contain '..'`);if(e!==`/workspace`&&!e.startsWith(`/workspace/`))throw Error(`grep path must stay under /workspace: ${e}`);if(e.split(`/`).includes(`..`))throw Error(`grep path must not contain '..'`);return e}async function executeGrepSearch(e,t,n){let r=assertWorkspacePath(t.resolvePath(e.path??`/workspace`),e.path),i=await sandboxRealPath(t,t.resolvePath(``),`sandbox workspace`,n),a=await sandboxRealPath(t,r,`grep path`,n);assertRealPathWithinWorkspace(a,i);let o=effectiveOutputMode(e.outputMode),s=effectiveLimit(e.limit),c=buildSearchCommand({contextLines:e.context??0,glob:e.glob,ignoreCase:e.ignoreCase===!0,limit:s,literal:shouldUseFixedStrings(e.pattern,e.literal),outputMode:o,path:a,pattern:e.pattern}),l=await t.run({abortSignal:n,command:c}),u=truncateUtf8(l.stdout,MAX_GREP_COMMAND_BYTES),d=u.truncated;if(l.exitCode!==0&&l.exitCode!==1||l.exitCode===1&&l.stderr.trim().length>0){let e=l.stderr.trim()||u.value.trim()||`no command output`;throw Error(`grep failed (exit ${l.exitCode}): ${truncateUtf8(e,MAX_GREP_LINE_BYTES).value}`)}return processGrepOutput({commandTruncated:d,limit:s,outputMode:o,path:r,stdout:u.value})}async function sandboxRealPath(e,t,n,r){let i=await e.run({abortSignal:r,command:`realpath -z -- ${shellQuote(t)}`});if(i.exitCode!==0){let e=i.stderr.trim()||i.stdout.trim()||`no command output`;throw Error(`${n} could not be resolved: ${truncateUtf8(e,MAX_GREP_LINE_BYTES).value}`)}let a=i.stdout.endsWith(`\0`)?i.stdout.slice(0,-1):i.stdout;if(a.length===0||a.includes(`\0`))throw Error(`${n} returned an invalid realpath`);return a}function assertRealPathWithinWorkspace(e,t){if(e!==t&&!e.startsWith(`${t}/`))throw Error(`grep path resolves outside /workspace: ${e}`)}function buildSearchCommand(e){return[`set -o pipefail`,`{`,` if command -v rg >/dev/null 2>&1; then`,` ${buildRipgrepCommand(e)}`,` else`,` ${buildPosixGrepCommand(e)}`,` fi`,`} 2>&1 | head -c 262145`,"search_status=${PIPESTATUS[0]}",`if [ "$search_status" -eq 141 ]; then exit 0; fi`,`exit "$search_status"`].join(`
|
|
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{
|
|
6
|
+
`);return c&&(l+=r),{content:l,matchCount:o,outputMode:e.outputMode,path:e.path,truncated:c}}function normalizeContentLine(e){let t=e.lastIndexOf(`\0`);if(t===-1)return{isMatch:!1,line:e};let n=e.slice(0,t),r=e.slice(t+1),i=/^(\d+)([:-])(.*)$/u.exec(r);if(i===null)return{isMatch:!1,line:`${n}:${r}`};let[,a,o,s]=i;return{isMatch:o===`:`,line:`${n}${o}${a}${o}${s}`}}function parseCountLine(e){let t=e.lastIndexOf(`:`);if(t===-1)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)&&n>0?n:0}function truncateUtf8(e,t){if(Buffer.byteLength(e)<=t)return{truncated:!1,value:e};let n=0,r=``;for(let i of e){let e=Buffer.byteLength(i);if(n+e>t)break;r+=i,n+=e}return{truncated:!0,value:r}}export{GREP_OUTPUT_MODES,MAX_GREP_COMMAND_BYTES,MAX_GREP_LIMIT,MAX_GREP_LINE_BYTES,MAX_GREP_RETURN_BYTES,assertWorkspacePath,buildPosixGrepCommand,buildRipgrepCommand,buildSearchCommand,effectiveLimit,effectiveOutputMode,executeGrepSearch,processGrepOutput,shouldUseFixedStrings};
|
|
@@ -8,7 +8,7 @@ export interface SandboxLike {
|
|
|
8
8
|
stderr: string;
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
interface RepoGuidelines {
|
|
12
12
|
/** Repo-relative path of the root guideline file, or null when absent. */
|
|
13
13
|
rootPath: string | null;
|
|
14
14
|
/** Root guideline content (capped at {@link MAX_GUIDELINE_BYTES}). */
|
|
@@ -23,3 +23,4 @@ export interface RepoGuidelines {
|
|
|
23
23
|
* AGENTS.md beats CLAUDE.md (CLAUDE.md is often just a pointer at it).
|
|
24
24
|
*/
|
|
25
25
|
export declare function discoverGuidelines(sandbox: SandboxLike, dir: string): Promise<RepoGuidelines>;
|
|
26
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SandboxSession } from "eve/sandbox";
|
|
2
|
-
|
|
2
|
+
type PatchHunk = {
|
|
3
3
|
readonly type: "add";
|
|
4
4
|
readonly path: string;
|
|
5
5
|
readonly contents: string;
|
|
@@ -12,7 +12,7 @@ export type PatchHunk = {
|
|
|
12
12
|
readonly movePath?: string;
|
|
13
13
|
readonly chunks: readonly UpdateChunk[];
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
interface UpdateChunk {
|
|
16
16
|
readonly oldLines: readonly string[];
|
|
17
17
|
readonly newLines: readonly string[];
|
|
18
18
|
readonly changeContext?: string;
|
|
@@ -33,3 +33,4 @@ export declare function applyPatchToSandbox(input: {
|
|
|
33
33
|
}): Promise<AppliedPatchFile[]>;
|
|
34
34
|
export declare function parsePatch(patchText: string): readonly PatchHunk[];
|
|
35
35
|
export declare function deriveUpdatedContent(path: string, chunks: readonly UpdateChunk[], original: string): string;
|
|
36
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const RepoSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
3
2
|
export declare const PullRequestWatchInputSchema: z.ZodObject<{
|
|
4
3
|
repo: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
5
4
|
pullRequestNumber: z.ZodNumber;
|
|
@@ -41,7 +40,7 @@ export interface PullRequestWatchSnapshot {
|
|
|
41
40
|
readonly state: "open" | "closed" | "merged";
|
|
42
41
|
readonly url: string;
|
|
43
42
|
}
|
|
44
|
-
|
|
43
|
+
interface PullRequestWatchNotificationState {
|
|
45
44
|
readonly previousSnapshot: PullRequestWatchSnapshot | null;
|
|
46
45
|
readonly redHeadPolls: number;
|
|
47
46
|
readonly redHeadWakeSent: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import extension_default from"../extension.js";import{deleteTokenCacheEntry,getToken}from"../../../../node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/token.js";import"../../../../node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/index.js";import{z}from"#compiled/zod/index.js";const RepoSchema=z.string().trim().regex(/^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/u).transform(e=>e.toLowerCase()),PullRequestWatchInputSchema=z.object({repo:RepoSchema,pullRequestNumber:z.number().int().positive(),reviewOwner:z.string().trim().min(1),redHeadOid:z.string().regex(/^[0-9a-f]{40}$/iu).transform(e=>e.toLowerCase())}),PrwatchDeleteInputSchema=z.object({repo:RepoSchema,pullRequestNumber:z.number().int().positive()}),PullRequestSchema=z.object({head:z.object({sha:z.string().min(1)}),html_url:z.string().url(),merged:z.boolean().optional().default(!1),state:z.enum([`open`,`closed`])}),ReviewSchema=z.object({commit_id:z.string().nullable(),state:z.string(),submitted_at:z.string().nullable(),user:z.object({login:z.string()}).nullable()});function initialPullRequestWatchNotificationState(){return{previousSnapshot:null,redHeadPolls:0,redHeadWakeSent:!1}}function framePullRequestWatchWake(e){return`${e}\n\nThis is an internal watch wake, not a request for a progress report. Continue any necessary work. Send a user-facing response only when the original request is complete or a new blocker requires human input. Otherwise, finish by replying with exactly <eve-empty-delivery/> and no other text. Do not report that nothing changed or that work is still in progress.`}function reviewFingerprint(e){return e?.ownerReviewState===null||e===null?null:`${e.ownerReviewState}:${e.ownerReviewSubmittedAt??``}`}function advancePullRequestWatchNotification(e){let t=e.state.previousSnapshot,n=e.snapshot.headOid!==(t?.headOid??e.redHeadOid),r=t!==null&&reviewFingerprint(e.snapshot)!==reviewFingerprint(t),i=e.snapshot.headOid===e.redHeadOid,a=i?e.state.redHeadPolls+1:0,o=null;return n?o=`head_changed`:r?o=`owner_review_changed`:i&&!e.state.redHeadWakeSent&&a===e.staleAfterPolls&&(o=`red_head_stalled`),{state:{previousSnapshot:e.snapshot,redHeadPolls:a,redHeadWakeSent:e.state.redHeadWakeSent||o===`red_head_stalled`},wakeReason:o}}var RetryablePullRequestWatchError=class extends Error{},GitHubWatchResponseError=class extends Error{status;constructor(e,t){super(t),this.name=`GitHubWatchResponseError`,this.status=e}};function errorStatus(e){return typeof e!=`object`||!e||!(`status`in e)?null:typeof e.status==`number`?e.status:null}function shouldRefreshPullRequestWatchToken(e){return errorStatus(e)===401}function isRetryablePullRequestWatchError(e){let t=errorStatus(e);return t===429||t!==null&&t>=500||e instanceof RetryablePullRequestWatchError||e instanceof TypeError||e instanceof Error&&(/^GitHub watch (?:request|token request) failed:/u.test(e.message)||/\((?:429|5\d{2})\b/u.test(e.message))}function pullRequestWatchSnapshot(e){let t=e.reviewOwner.toLowerCase(),n=e.pullRequest.head.sha.toLowerCase(),r=e.reviews.filter(e=>e.commit_id?.toLowerCase()===n&&e.user?.login.toLowerCase()===t).at(-1);return{headOid:n,ownerApprovedCurrentHead:r?.state.toUpperCase()===`APPROVED`,ownerReviewState:r?.state.toUpperCase()??null,ownerReviewSubmittedAt:r?.submitted_at??null,state:e.pullRequest.merged?`merged`:e.pullRequest.state,url:e.pullRequest.html_url}}function repoParts(e){let[t,n]=e.split(`/`);if(t===void 0||n===void 0)throw Error(`Invalid GitHub repository: ${e}`);return{owner:t,name:n}}function repoFullName(e){let t=repoParts(e);return`${t.owner}/${t.name}`}function repoApiPath(e){let t=repoParts(e);return`/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}`}function redactGithubToken(e,t){return t.length===0?e:e.split(t).join(`[redacted]`)}function githubHeaders(e){return{Accept:`application/vnd.github+json`,Authorization:`Bearer ${e}`,"X-GitHub-Api-Version":`2022-11-28`}}function githubTokenParams(e,t){return{authorizationDetails:[{org:e,repositories:[t],type:`github_app_installation`}],subject:{type:`app`}}}async function mintWatchToken(e){let t=extension_default.config.github;if(t===void 0)throw Error(`GitHub is not configured for this agent.`);let n=repoParts(e);if(n.owner!==t.org.toLowerCase())throw Error(`Repository ${e} is outside ${t.org}.`);let r=await getToken(t.connector,githubTokenParams(t.org,n.name));if(r.length===0)throw Error(`Connect returned an empty GitHub token for ${e}.`);return r}async function invalidateWatchToken(e){let t=extension_default.config.github;if(t===void 0)return;let n=repoParts(e);deleteTokenCacheEntry(t.connector,githubTokenParams(t.org,n.name))}async function githubJson(e,t){let n;try{n=await fetch(e,{headers:githubHeaders(t)})}catch(e){throw new RetryablePullRequestWatchError(`GitHub watch request failed: ${e instanceof Error?e.message:String(e)}`)}if(n.ok)return n.json();let r=await n.text().catch(()=>``),i=`GitHub request failed (${n.status} ${n.statusText})`+(r.length>0?`: ${redactGithubToken(r,t)}`:``);throw n.status===429||n.status>=500?new RetryablePullRequestWatchError(i):new GitHubWatchResponseError(n.status,i)}async function readPullRequestWatchSnapshotWithToken(e,t){let n=`https://api.github.com${repoApiPath(e.repo)}/pulls/${e.pullRequestNumber}`,r=PullRequestSchema.parse(await githubJson(n,t));if(r.state===`closed`||r.merged)return pullRequestWatchSnapshot({pullRequest:r,reviewOwner:e.reviewOwner,reviews:[]});let i=[];for(let r=1;r<=20;r+=1){let a=z.array(ReviewSchema).parse(await githubJson(`${n}/reviews?per_page=100&page=${r}`,t));if(i.push(...a),a.length<100)break;if(r===20)throw Error(`PR #${e.pullRequestNumber} has too many reviews to verify`)}return pullRequestWatchSnapshot({pullRequest:r,reviewOwner:e.reviewOwner,reviews:i})}async function readPullRequestWatchSnapshot(e){for(let t=0;t<2;t+=1){let n;try{n=await mintWatchToken(e.repo)}catch(e){throw isRetryablePullRequestWatchError(e)?new RetryablePullRequestWatchError(`GitHub watch token request failed: ${e instanceof Error?e.message:String(e)}`):e}try{return await readPullRequestWatchSnapshotWithToken(e,n)}catch(n){if(t>0||!shouldRefreshPullRequestWatchToken(n))throw n;await invalidateWatchToken(e.repo)}}throw Error(`Pull request watch token refresh exhausted unexpectedly.`)}export{PrwatchDeleteInputSchema,PullRequestWatchInputSchema,
|
|
1
|
+
import extension_default from"../extension.js";import{deleteTokenCacheEntry,getToken}from"../../../../node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/token.js";import"../../../../node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/index.js";import{z}from"#compiled/zod/index.js";const RepoSchema=z.string().trim().regex(/^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/u).transform(e=>e.toLowerCase()),PullRequestWatchInputSchema=z.object({repo:RepoSchema,pullRequestNumber:z.number().int().positive(),reviewOwner:z.string().trim().min(1),redHeadOid:z.string().regex(/^[0-9a-f]{40}$/iu).transform(e=>e.toLowerCase())}),PrwatchDeleteInputSchema=z.object({repo:RepoSchema,pullRequestNumber:z.number().int().positive()}),PullRequestSchema=z.object({head:z.object({sha:z.string().min(1)}),html_url:z.string().url(),merged:z.boolean().optional().default(!1),state:z.enum([`open`,`closed`])}),ReviewSchema=z.object({commit_id:z.string().nullable(),state:z.string(),submitted_at:z.string().nullable(),user:z.object({login:z.string()}).nullable()});function initialPullRequestWatchNotificationState(){return{previousSnapshot:null,redHeadPolls:0,redHeadWakeSent:!1}}function framePullRequestWatchWake(e){return`${e}\n\nThis is an internal watch wake, not a request for a progress report. Continue any necessary work. Send a user-facing response only when the original request is complete or a new blocker requires human input. Otherwise, finish by replying with exactly <eve-empty-delivery/> and no other text. Do not report that nothing changed or that work is still in progress.`}function reviewFingerprint(e){return e?.ownerReviewState===null||e===null?null:`${e.ownerReviewState}:${e.ownerReviewSubmittedAt??``}`}function advancePullRequestWatchNotification(e){let t=e.state.previousSnapshot,n=e.snapshot.headOid!==(t?.headOid??e.redHeadOid),r=t!==null&&reviewFingerprint(e.snapshot)!==reviewFingerprint(t),i=e.snapshot.headOid===e.redHeadOid,a=i?e.state.redHeadPolls+1:0,o=null;return n?o=`head_changed`:r?o=`owner_review_changed`:i&&!e.state.redHeadWakeSent&&a===e.staleAfterPolls&&(o=`red_head_stalled`),{state:{previousSnapshot:e.snapshot,redHeadPolls:a,redHeadWakeSent:e.state.redHeadWakeSent||o===`red_head_stalled`},wakeReason:o}}var RetryablePullRequestWatchError=class extends Error{},GitHubWatchResponseError=class extends Error{status;constructor(e,t){super(t),this.name=`GitHubWatchResponseError`,this.status=e}};function errorStatus(e){return typeof e!=`object`||!e||!(`status`in e)?null:typeof e.status==`number`?e.status:null}function shouldRefreshPullRequestWatchToken(e){return errorStatus(e)===401}function isRetryablePullRequestWatchError(e){let t=errorStatus(e);return t===429||t!==null&&t>=500||e instanceof RetryablePullRequestWatchError||e instanceof TypeError||e instanceof Error&&(/^GitHub watch (?:request|token request) failed:/u.test(e.message)||/\((?:429|5\d{2})\b/u.test(e.message))}function pullRequestWatchSnapshot(e){let t=e.reviewOwner.toLowerCase(),n=e.pullRequest.head.sha.toLowerCase(),r=e.reviews.filter(e=>e.commit_id?.toLowerCase()===n&&e.user?.login.toLowerCase()===t).at(-1);return{headOid:n,ownerApprovedCurrentHead:r?.state.toUpperCase()===`APPROVED`,ownerReviewState:r?.state.toUpperCase()??null,ownerReviewSubmittedAt:r?.submitted_at??null,state:e.pullRequest.merged?`merged`:e.pullRequest.state,url:e.pullRequest.html_url}}function repoParts(e){let[t,n]=e.split(`/`);if(t===void 0||n===void 0)throw Error(`Invalid GitHub repository: ${e}`);return{owner:t,name:n}}function repoFullName(e){let t=repoParts(e);return`${t.owner}/${t.name}`}function repoApiPath(e){let t=repoParts(e);return`/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}`}function redactGithubToken(e,t){return t.length===0?e:e.split(t).join(`[redacted]`)}function githubHeaders(e){return{Accept:`application/vnd.github+json`,Authorization:`Bearer ${e}`,"X-GitHub-Api-Version":`2022-11-28`}}function githubTokenParams(e,t){return{authorizationDetails:[{org:e,repositories:[t],type:`github_app_installation`}],subject:{type:`app`}}}async function mintWatchToken(e){let t=extension_default.config.github;if(t===void 0)throw Error(`GitHub is not configured for this agent.`);let n=repoParts(e);if(n.owner!==t.org.toLowerCase())throw Error(`Repository ${e} is outside ${t.org}.`);let r=await getToken(t.connector,githubTokenParams(t.org,n.name));if(r.length===0)throw Error(`Connect returned an empty GitHub token for ${e}.`);return r}async function invalidateWatchToken(e){let t=extension_default.config.github;if(t===void 0)return;let n=repoParts(e);deleteTokenCacheEntry(t.connector,githubTokenParams(t.org,n.name))}async function githubJson(e,t){let n;try{n=await fetch(e,{headers:githubHeaders(t)})}catch(e){throw new RetryablePullRequestWatchError(`GitHub watch request failed: ${e instanceof Error?e.message:String(e)}`)}if(n.ok)return n.json();let r=await n.text().catch(()=>``),i=`GitHub request failed (${n.status} ${n.statusText})`+(r.length>0?`: ${redactGithubToken(r,t)}`:``);throw n.status===429||n.status>=500?new RetryablePullRequestWatchError(i):new GitHubWatchResponseError(n.status,i)}async function readPullRequestWatchSnapshotWithToken(e,t){let n=`https://api.github.com${repoApiPath(e.repo)}/pulls/${e.pullRequestNumber}`,r=PullRequestSchema.parse(await githubJson(n,t));if(r.state===`closed`||r.merged)return pullRequestWatchSnapshot({pullRequest:r,reviewOwner:e.reviewOwner,reviews:[]});let i=[];for(let r=1;r<=20;r+=1){let a=z.array(ReviewSchema).parse(await githubJson(`${n}/reviews?per_page=100&page=${r}`,t));if(i.push(...a),a.length<100)break;if(r===20)throw Error(`PR #${e.pullRequestNumber} has too many reviews to verify`)}return pullRequestWatchSnapshot({pullRequest:r,reviewOwner:e.reviewOwner,reviews:i})}async function readPullRequestWatchSnapshot(e){for(let t=0;t<2;t+=1){let n;try{n=await mintWatchToken(e.repo)}catch(e){throw isRetryablePullRequestWatchError(e)?new RetryablePullRequestWatchError(`GitHub watch token request failed: ${e instanceof Error?e.message:String(e)}`):e}try{return await readPullRequestWatchSnapshotWithToken(e,n)}catch(n){if(t>0||!shouldRefreshPullRequestWatchToken(n))throw n;await invalidateWatchToken(e.repo)}}throw Error(`Pull request watch token refresh exhausted unexpectedly.`)}export{PrwatchDeleteInputSchema,PullRequestWatchInputSchema,advancePullRequestWatchNotification,framePullRequestWatchWake,initialPullRequestWatchNotificationState,isRetryablePullRequestWatchError,pullRequestWatchSnapshot,readPullRequestWatchSnapshot,repoFullName,shouldRefreshPullRequestWatchToken};
|
|
@@ -5,7 +5,7 @@ export interface PrwatchTarget {
|
|
|
5
5
|
export interface PrwatchRegistration extends PrwatchTarget {
|
|
6
6
|
readonly callId: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
interface PrwatchRecord {
|
|
9
9
|
readonly callId: string;
|
|
10
10
|
readonly cancelled: boolean;
|
|
11
11
|
}
|
|
@@ -25,3 +25,4 @@ export declare function registerActivePrwatch(input: PrwatchRegistration): Promi
|
|
|
25
25
|
export declare function prwatchWasCancelled(input: PrwatchRegistration): Promise<boolean>;
|
|
26
26
|
export declare function finishPrwatch(input: PrwatchRegistration): Promise<void>;
|
|
27
27
|
export declare function deletePrwatch(input: PrwatchTarget): Promise<boolean>;
|
|
28
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type HostHttpMethod = "ALL" | "GET" | "POST";
|
|
2
|
+
interface HostHttpRegistration {
|
|
3
3
|
readonly capability: "workflow" | "development" | "schedule";
|
|
4
4
|
readonly method: HostHttpMethod;
|
|
5
5
|
readonly path: string;
|
|
6
6
|
readonly reservationOnly?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const HOST_HTTP_INVENTORY: readonly HostHttpRegistration[];
|
|
9
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SessionAuthContext } from "#channel/types.js";
|
|
2
2
|
import type { AuthorizationChallenge } from "#harness/authorization.js";
|
|
3
3
|
import type { SessionStateMap } from "#harness/types.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type ApprovalCandidateStatus = "pending" | "authorization-required" | "allowed" | "rejected" | "failed" | "timed-out" | "stale";
|
|
5
|
+
interface ApprovalCandidateAuditRecord {
|
|
6
6
|
readonly candidateId: string;
|
|
7
7
|
readonly requestId: string;
|
|
8
8
|
readonly responder: ApprovalResponderIdentity;
|
|
@@ -37,7 +37,7 @@ export interface ActiveApprovalCandidate {
|
|
|
37
37
|
readonly authorizationChallenges?: readonly AuthorizationChallenge[];
|
|
38
38
|
readonly pendingEventEmitted?: boolean;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
interface ApprovalStateTransition {
|
|
41
41
|
readonly changed: boolean;
|
|
42
42
|
readonly state: SessionStateMap | undefined;
|
|
43
43
|
}
|
|
@@ -107,3 +107,4 @@ export declare function getApprovalAuditState(state: SessionStateMap | undefined
|
|
|
107
107
|
readonly candidateHistory: readonly ApprovalCandidateAuditRecord[];
|
|
108
108
|
readonly settlements: readonly ApprovalSettlementAuditRecord[];
|
|
109
109
|
};
|
|
110
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AuthorizationChallenge } from "#harness/authorization.js";
|
|
2
2
|
import type { HarnessSession, HarnessToolMap, StepInput } from "#harness/types.js";
|
|
3
3
|
import type { InputRequest } from "#shared/input.js";
|
|
4
|
-
|
|
4
|
+
interface ApprovalDeliveryResult {
|
|
5
5
|
readonly challenges: readonly AuthorizationChallenge[];
|
|
6
6
|
readonly feedback: readonly string[];
|
|
7
7
|
readonly kind: "continue" | "continue-coordination" | "authorization-required" | "responses-completed" | "park";
|
|
@@ -33,3 +33,4 @@ export declare function coordinateApprovalDelivery(input: {
|
|
|
33
33
|
readonly tools: HarnessToolMap;
|
|
34
34
|
readonly prepareTools?: (request: InputRequest) => Promise<HarnessToolMap>;
|
|
35
35
|
}): Promise<ApprovalDeliveryResult>;
|
|
36
|
+
export {};
|
|
@@ -49,15 +49,6 @@ export interface AuthorizationResult {
|
|
|
49
49
|
* and parks the session. Channels render sign-in buttons.
|
|
50
50
|
*/
|
|
51
51
|
export declare function requestAuthorization(challenges: readonly AuthorizationChallenge[]): AuthorizationSignal;
|
|
52
|
-
/**
|
|
53
|
-
* Returns a model-safe copy of `signal` with runtime-only challenge state stripped.
|
|
54
|
-
*
|
|
55
|
-
* Used for the copy the AI SDK records as a tool output. The shape stays a
|
|
56
|
-
* valid {@link AuthorizationSignal} so every `isAuthorizationSignal` consumer
|
|
57
|
-
* still detects it; the park detector reads the full resume, principal, and
|
|
58
|
-
* resolved-instance state from the harness's out-of-band stash.
|
|
59
|
-
*/
|
|
60
|
-
export declare function redactSignalResume(signal: AuthorizationSignal): AuthorizationSignal;
|
|
61
52
|
/**
|
|
62
53
|
* Reads the authorization callback on resume. Returns `undefined` if
|
|
63
54
|
* not resuming from an authorization request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createEveConnectionCallbackRoutePath}from"#protocol/routes.js";import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{contextStorage,loadContext}from"#context/container.js";import{ActivityRootTurnIdKey,SessionIdKey}from"#context/keys.js";import{ContextKey}from"#context/key.js";import{createWorkflowCallbackUrl}from"#execution/workflow-callback-url.js";import{createUlid}from"#shared/ulid.js";const AUTHORIZATION_BRAND=`__eveAuthorization`,AUTHORIZATION_PENDING_BRAND=`__eveAuthorizationPending`;function requestAuthorization(e){return{[AUTHORIZATION_BRAND]:!0,challenges:e}}function
|
|
1
|
+
import{createEveConnectionCallbackRoutePath}from"#protocol/routes.js";import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{contextStorage,loadContext}from"#context/container.js";import{ActivityRootTurnIdKey,SessionIdKey}from"#context/keys.js";import{ContextKey}from"#context/key.js";import{createWorkflowCallbackUrl}from"#execution/workflow-callback-url.js";import{createUlid}from"#shared/ulid.js";const AUTHORIZATION_BRAND=`__eveAuthorization`,AUTHORIZATION_PENDING_BRAND=`__eveAuthorizationPending`;function requestAuthorization(e){return{[AUTHORIZATION_BRAND]:!0,challenges:e}}function getAuthorizationResult(e){let t=loadContext().get(PendingAuthorizationResultKey);if(t&&t.length!==0)return e===void 0?t[0]:t.find(t=>t.name===e)}function getAuthorizationResults(){return loadContext().get(PendingAuthorizationResultKey)??[]}function consumeAuthorizationResult(e,t){let n=loadContext(),r=n.get(PendingAuthorizationResultKey);if(!r||r.length===0)return;let i=r.findIndex(n=>n.name===e&&n.instanceId===t);if(i===-1&&t!==void 0&&r.some(t=>t.name===e&&t.instanceId!==void 0))throw Error(`Authorization for "${e}" cannot complete because its resolved connection changed while sign-in was pending. Start sign-in again.`);if(i===-1)return;let a=r[i],o=r.filter((e,t)=>t!==i);return n.delete(PendingAuthorizationResultKey),o.length>0&&n.set(PendingAuthorizationResultKey,o),a}function getHookUrl(e,t){let n=loadContext(),r=n.get(SessionIdKey),i=n.get(CallbackBaseUrlKey),a=n.get(AuthorizationHookKey)??(r?authHookToken(r):void 0);if(a&&i)return createWorkflowCallbackUrl(i,createEveConnectionCallbackRoutePath(e,t,a))}function createAuthorizationAttempt(e){let t=createUlid(),n=getHookUrl(e,t);return n===void 0?void 0:{attemptId:t,hookUrl:n}}function isAuthorizationSignal(e){return typeof e!=`object`||!e?!1:e[AUTHORIZATION_BRAND]===!0}function isAuthorizationPendingModelOutput(e){return typeof e!=`object`||!e?!1:e[AUTHORIZATION_PENDING_BRAND]===!0}function authorizationPendingAsJsonObject(e){return{[AUTHORIZATION_PENDING_BRAND]:!0,connections:[...e.connections]}}function modelFacingAuthorizationOutput(e){return authorizationPendingAsJsonObject({connections:e.challenges.map(e=>e.name)})}function authorizationPendingModelText(e){return e.length===0?`Authorization required. Waiting for the user to sign in.`:e.length===1?`Authorization required for ${e[0]}. Waiting for the user to sign in.`:`Authorization required for ${e.join(`, `)}. Waiting for the user to sign in.`}function isPendingAuthorizationToolOutput(e){return isAuthorizationPendingModelOutput(e)||isAuthorizationSignal(e)}function authHookToken(e){return sessionInboxHookToken(sessionCommandHookToken(e))}const PendingAuthorizationResultKey=new ContextKey(`eve.pendingAuthorizationResult`),CallbackBaseUrlKey=new ContextKey(`eve.callbackBaseUrl`),AuthorizationHookKey=new ContextKey(`eve.authorizationHook`),PENDING_AUTHORIZATION_KEY=`eve.runtime.pendingAuthorization`;function setPendingAuthorization(e,t){let n=resolveActiveAuthorizationChallenges(t.challenges),r=getPendingAuthorization(e),i=r?.challenges??[],a=getSupersededAuthorizationChallenges(e,n),o=contextStorage.getStore()?.get(ActivityRootTurnIdKey),s={...r?.activityRootTurnIds};for(let e of a)delete s[authorizationAttemptKey(e)];if(o!==void 0)for(let e of n)s[authorizationAttemptKey(e)]=o;return{...e,[PENDING_AUTHORIZATION_KEY]:{...Object.keys(s).length===0?{}:{activityRootTurnIds:s},challenges:[...i.filter(e=>!a.includes(e)),...n]}}}function resolveActiveAuthorizationChallenges(e){return e.filter((t,n)=>!e.slice(n+1).some(e=>t.name===e.name&&samePrincipal(t.principal,e.principal)))}function getSupersededAuthorizationChallenges(e,t){return(getPendingAuthorization(e)?.challenges??[]).filter(e=>t.some(t=>e.name===t.name&&samePrincipal(e.principal,t.principal)))}function samePrincipal(e,t){return e===void 0||t===void 0?e===t:e.type===`app`||t.type===`app`?e.type===t.type:e.id===t.id&&e.issuer===t.issuer}function clearPendingAuthorization(e,t){if(e===void 0||e[PENDING_AUTHORIZATION_KEY]===void 0)return e;if(t!==void 0){if(t.length===0)return e;let n=getPendingAuthorization(e);if(n!==void 0){let r=new Set(t),i=n.challenges.filter(e=>!r.has(authorizationAttemptKey(e)));if(i.length>0)return{...e,[PENDING_AUTHORIZATION_KEY]:pendingAuthorizationValue(n,i)}}}let n={...e};return delete n[PENDING_AUTHORIZATION_KEY],Object.keys(n).length>0?n:void 0}function pendingAuthorizationValue(e,t){let n=Object.fromEntries(t.flatMap(t=>{let n=authorizationAttemptKey(t),r=e.activityRootTurnIds?.[n];return r===void 0?[]:[[n,r]]}));return{...Object.keys(n).length===0?{}:{activityRootTurnIds:n},challenges:t}}function authorizationAttemptKey(e){return e.attemptId??e.candidateId??e.name}function getPendingAuthorization(e){if(!e)return;let t=e[PENDING_AUTHORIZATION_KEY];if(typeof t==`object`&&t)return t}function hasPendingAuthorization(e){return getPendingAuthorization(e)!==void 0}export{AuthorizationHookKey,CallbackBaseUrlKey,PendingAuthorizationResultKey,authHookToken,authorizationPendingAsJsonObject,authorizationPendingModelText,clearPendingAuthorization,consumeAuthorizationResult,createAuthorizationAttempt,getAuthorizationResult,getAuthorizationResults,getHookUrl,getPendingAuthorization,getSupersededAuthorizationChallenges,hasPendingAuthorization,isAuthorizationPendingModelOutput,isAuthorizationSignal,isPendingAuthorizationToolOutput,modelFacingAuthorizationOutput,requestAuthorization,resolveActiveAuthorizationChallenges,setPendingAuthorization};
|
|
@@ -2,7 +2,7 @@ import type { ModelMessage } from "ai";
|
|
|
2
2
|
export declare const COMPACTION_CHECKPOINT_MARKER = "Summary of our conversation so far:";
|
|
3
3
|
/** Synthetic resumption prompt used when no real user message can be replayed. */
|
|
4
4
|
export declare const COMPACTION_RESUMPTION_MESSAGE = "Continue.";
|
|
5
|
-
|
|
5
|
+
interface CompactionPrompt {
|
|
6
6
|
readonly prompt: string;
|
|
7
7
|
readonly system: string;
|
|
8
8
|
}
|
|
@@ -34,3 +34,4 @@ export declare const TRANSCRIPT_PAYLOAD_LIMIT = 2000;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function stubContentOutputFileParts(output: unknown): unknown;
|
|
36
36
|
export declare function sliceUtf16Safe(value: string, limit: number): string;
|
|
37
|
+
export {};
|
|
@@ -39,10 +39,6 @@ interface ResolvePendingCoordinationResult {
|
|
|
39
39
|
}
|
|
40
40
|
/** Returns the pending coordination batch stored on the session, if any. */
|
|
41
41
|
export declare function getPendingCoordinationBatch(state: SessionStateMap | undefined): PendingCoordinationBatch | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Returns true when the session is parked on pending task/control coordination.
|
|
44
|
-
*/
|
|
45
|
-
export declare function hasPendingCoordinationBatch(state: SessionStateMap | undefined): boolean;
|
|
46
42
|
export declare function clearPendingCoordinationBatch(session: HarnessSession): HarnessSession;
|
|
47
43
|
/**
|
|
48
44
|
* Stores one pending coordination batch on the session.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseJsonObject}from"#shared/json.js";import{createActionResultEvent}from"#protocol/message.js";import{findBlockingWorkflowToolRun,removeBlockingWorkflowToolRuns}from"#harness/workflow-tool-runs.js";import{clearProxyInputRequestsForChild,clearProxyInputRequestsWhere}from"#harness/proxy-input-requests.js";import{findRunningAgentHandle,isResultBoundToRunningHandle}from"#subagents/handles/query.js";import{accumulateSessionUsage,getTurnUsageState,setTurnUsageState}from"#harness/turn-tag-state.js";import{resolveRuntimeActionResultsForCallIds}from"#runtime/actions/results.js";import{settleAgentTurn}from"#subagents/handles/transitions.js";import{markRuntimeWorkflowToolAction}from"#shared/action-types.js";import{normalizeToolModelOutput}from"#harness/tool-model-output.js";const PENDING_COORDINATION_BATCH_KEY=`eve.runtime.pendingCoordinationBatch`;function readSubagentResultOutcome(e){return e.origin===`child`?e.outcome:void 0}function getPendingCoordinationBatch(e){let t=e?.[PENDING_COORDINATION_BATCH_KEY];if(typeof t!=`object`||!t)return;let n=t;if(Array.isArray(n.runtimeActions)&&Array.isArray(n.tasks)&&Array.isArray(n.responseMessages)&&typeof n.event==`object`&&n.event!==null)return n}function
|
|
1
|
+
import{parseJsonObject}from"#shared/json.js";import{createActionResultEvent}from"#protocol/message.js";import{findBlockingWorkflowToolRun,removeBlockingWorkflowToolRuns}from"#harness/workflow-tool-runs.js";import{clearProxyInputRequestsForChild,clearProxyInputRequestsWhere}from"#harness/proxy-input-requests.js";import{findRunningAgentHandle,isResultBoundToRunningHandle}from"#subagents/handles/query.js";import{accumulateSessionUsage,getTurnUsageState,setTurnUsageState}from"#harness/turn-tag-state.js";import{resolveRuntimeActionResultsForCallIds}from"#runtime/actions/results.js";import{settleAgentTurn}from"#subagents/handles/transitions.js";import{markRuntimeWorkflowToolAction}from"#shared/action-types.js";import{normalizeToolModelOutput}from"#harness/tool-model-output.js";const PENDING_COORDINATION_BATCH_KEY=`eve.runtime.pendingCoordinationBatch`;function readSubagentResultOutcome(e){return e.origin===`child`?e.outcome:void 0}function getPendingCoordinationBatch(e){let t=e?.[PENDING_COORDINATION_BATCH_KEY];if(typeof t!=`object`||!t)return;let n=t;if(Array.isArray(n.runtimeActions)&&Array.isArray(n.tasks)&&Array.isArray(n.responseMessages)&&typeof n.event==`object`&&n.event!==null)return n}function clearPendingCoordinationBatch(e){if(e.state?.[PENDING_COORDINATION_BATCH_KEY]===void 0)return e;let t={...e.state};return delete t[PENDING_COORDINATION_BATCH_KEY],{...e,state:Object.keys(t).length>0?t:void 0}}function setPendingCoordinationBatch(e){assertUniqueCoordinationCallIds([...e.runtimeActions,...e.tasks]);let t={...e.session.state};return t[PENDING_COORDINATION_BATCH_KEY]={runtimeActions:[...e.runtimeActions],tasks:[...e.tasks],event:e.event,localFanoutSize:e.localFanoutSize,responseMessages:[...e.responseMessages]},{...e.session,state:t}}function assertUniqueCoordinationCallIds(e){let t=new Set;for(let n of e){if(t.has(n.callId))throw Error(`Coordination batch contains duplicate callId "${n.callId}".`);t.add(n.callId)}}function resolveReadyCoordinationResults(e){let t=getPendingCoordinationBatch(e.session.state);if(t!==void 0)return resolveResultsForCoordinationBatch({batch:t,results:e.results,state:e.session.state})}function resolveResultsForCoordinationBatch(e){return resolveRuntimeActionResultsForCallIds({pendingCallIds:[...e.batch.runtimeActions,...e.batch.tasks].map(e=>e.callId),results:e.results.filter(t=>isResultBoundToRunningHandle(e.state,t))})}async function resolvePendingCoordination(e){let t=getPendingCoordinationBatch(e.session.state);if(t===void 0)return{messages:[...e.session.history],outcome:`continue`,session:e.session};let n=resolveReadyCoordinationResults({results:e.stepInput?.runtimeActionResults??[],session:e.session});if(n===void 0)return{messages:[...e.session.history],outcome:`unresolved`,session:e.session};let r=e.session;for(let e of n){if(e.kind!==`subagent-result`||e.origin!==`child`||readBackgroundTaskReceipt(e)!==void 0)continue;let t=findRunningAgentHandle(r.state,{callId:e.callId});if(t===void 0)continue;let n=readSubagentResultOutcome(e);if(n===void 0)continue;n.kind===`terminal`&&`continuationToken`in t.address&&(r=clearProxyInputRequestsForChild(r,t.address.continuationToken));let i=settleAgentTurn(r,{operationId:t.operation.id,outcome:n});i.kind===`settled`&&(r=i.session)}for(let e of n){if(e.kind!==`tool-result`)continue;let n=findBlockingWorkflowToolRun(r.state,e.callId,t.event.turnId);n!==void 0&&(r=removeBlockingWorkflowToolRuns(clearProxyInputRequestsWhere(r,e=>e.answerHook?.runId===n.address.runId),t.event.turnId,n.callId))}let i={...r.state};delete i[PENDING_COORDINATION_BATCH_KEY],r={...r,state:Object.keys(i).length>0?i:void 0};for(let e of n){if(e.kind!==`subagent-result`)continue;let t=readSubagentResultOutcome(e);t!==void 0&&(r=setTurnUsageState(r,accumulateSessionUsage({previous:getTurnUsageState(r.state),usage:t.usageDelta})))}if(e.emit!==void 0)for(let r of n){if(r.kind===`subagent-result`&&r.origin===`child`&&r.outcome.result.kind===`succeeded`&&readBackgroundTaskReceipt(r)===void 0){let t={callId:r.callId,output:typeof r.output==`string`?r.output:JSON.stringify(r.output),subagentName:r.subagentName};await e.emit({data:t,type:`subagent.completed`})}await e.emit(createActionResultEvent({result:r,sequence:t.event.sequence,stepIndex:t.event.stepIndex,turnId:t.event.turnId}))}let a=[];for(let t of n){switch(t.kind){case`load-skill-result`:a.push({output:toToolResultOutput(t),toolCallId:t.callId,toolName:`load_skill`,type:`tool-result`});continue;case`subagent-result`:a.push({output:toToolResultOutput(t),toolCallId:t.callId,toolName:t.subagentName,type:`tool-result`});continue;case`tool-result`:a.push({output:await projectToolResultOutput(t,e.tools?.get(t.toolName)),toolCallId:t.callId,toolName:t.toolName,type:`tool-result`});continue}throw Error(`Unsupported runtime action result kind "${String(t)}".`)}let o=[...r.history,...t.responseMessages];return a.length>0&&o.push({content:a,role:`tool`}),{messages:o,outcome:`resolved`,session:r}}function readBackgroundTaskReceipt(e){return`backgroundTask`in e?e.backgroundTask:void 0}function createRuntimeActionRequestFromToolCall(e){let t=e.tools.get(e.toolCall.toolName),n=resolveToolCallInputObject(e.toolCall.input,{callId:e.toolCall.toolCallId,toolName:e.toolCall.toolName});if(t?.frameworkAction===`load-skill`)return{callId:e.toolCall.toolCallId,input:n,kind:`load-skill`};let r={callId:e.toolCall.toolCallId,input:n,kind:`tool-call`,toolName:e.toolCall.toolName};return t?.workflowId===void 0?r:markRuntimeWorkflowToolAction(r)}function createCoordinationRequestFromToolCall(e){let t=e.tools.get(e.toolCall.toolName),n=resolveToolCallInputObject(e.toolCall.input,{callId:e.toolCall.toolCallId,toolName:e.toolCall.toolName});if(t?.runtimeAction?.kind===`task-control`)return{kind:`runtime-action`,request:{callId:e.toolCall.toolCallId,input:n,kind:`tool-call`,toolName:e.toolCall.toolName}};if(t?.workflowId!==void 0)return{kind:`task`,request:{callId:e.toolCall.toolCallId,executeInput:t.executeInput?.(n),input:n,kind:`workflow-task`,toolName:e.toolCall.toolName,workflowId:t.workflowId}};throw Error(`Deferred tool "${e.toolCall.toolName}" has no task or runtime action.`)}function resolveToolCallInputObject(e,t){if(e==null||typeof e==`string`&&e.trim()===``)return{};try{return parseJsonObject(typeof e==`string`?parseJsonStringInput(e):e)}catch(e){let n=e instanceof Error?e.message:String(e);throw TypeError(`Failed to parse tool-call arguments for "${t.toolName}" (${t.callId}): ${n}`,{cause:e})}}function parseJsonStringInput(e){return JSON.parse(e)}async function projectToolResultOutput(e,t){return e.isError===!0||t?.toModelOutput===void 0?toToolResultOutput(e):normalizeToolModelOutput({output:await t.toModelOutput(e.output),toolCallId:e.callId,toolName:e.toolName})}function toToolResultOutput(e){return typeof e.output==`string`?e.isError===!0?{type:`error-text`,value:e.output}:{type:`text`,value:e.output}:e.isError===!0?{type:`error-json`,value:toMutableJsonValue(e.output)}:{type:`json`,value:toMutableJsonValue(e.output)}}function toMutableJsonValue(e){if(e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e;if(Array.isArray(e))return e.map(e=>toMutableJsonValue(e));let t={};for(let[n,r]of Object.entries(e))t[n]=toMutableJsonValue(r);return t}export{assertUniqueCoordinationCallIds,clearPendingCoordinationBatch,createCoordinationRequestFromToolCall,createRuntimeActionRequestFromToolCall,getPendingCoordinationBatch,resolvePendingCoordination,resolveToolCallInputObject,setPendingCoordinationBatch};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ModelMessage } from "ai";
|
|
2
|
-
import type { RuntimeToolCallActionRequest } from "#shared/action-types.js";
|
|
3
2
|
import type { InputRequest } from "#shared/input.js";
|
|
4
3
|
import { getApprovedTools } from "#harness/hitl/approval-input-requests.js";
|
|
5
4
|
import type { RejectedActionBatch } from "#harness/hitl/approval-input-requests.js";
|
|
@@ -10,7 +9,7 @@ import type { HarnessSession, StepInput } from "#harness/types.js";
|
|
|
10
9
|
export { getApprovedTools, clearPendingSessionLimitPrompt };
|
|
11
10
|
export type { RejectedActionBatch };
|
|
12
11
|
export type { ResolvedInputBatch } from "#harness/input-request-resolution.js";
|
|
13
|
-
export { appendPendingInputBatch, consumeDeferredStepInput, getPendingInputRequestIds,
|
|
12
|
+
export { appendPendingInputBatch, consumeDeferredStepInput, getPendingInputRequestIds, hasPendingInputBatch, } from "#harness/pending-input-batches.js";
|
|
14
13
|
/** Returns true when the step input carries user-facing turn input. */
|
|
15
14
|
export declare function hasStepInput(input?: StepInput): boolean;
|
|
16
15
|
/** Stored partial answers are not runnable work until they can resolve a batch. */
|
|
@@ -34,11 +33,3 @@ export declare function resolvePendingInput(input: {
|
|
|
34
33
|
readonly session: HarnessSession;
|
|
35
34
|
readonly stepInput?: StepInput;
|
|
36
35
|
}): ResolvePendingInputResult;
|
|
37
|
-
/** Creates a runtime tool-call action shape from an AI SDK tool call. */
|
|
38
|
-
export declare function createRuntimeToolCallActionFromToolCall(input: {
|
|
39
|
-
readonly toolCall: {
|
|
40
|
-
readonly input: unknown;
|
|
41
|
-
readonly toolCallId: string;
|
|
42
|
-
readonly toolName: string;
|
|
43
|
-
};
|
|
44
|
-
}): RuntimeToolCallActionRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readClientContext}from"#internal/client-context.js";import{resolveTextToResponses}from"#channel/resolve-text.js";import{appendPendingInputBatch,consumeDeferredStepInput,getDeferredStepInput,getPendingInputBatches,getPendingInputRequestIds,
|
|
1
|
+
import{readClientContext}from"#internal/client-context.js";import{resolveTextToResponses}from"#channel/resolve-text.js";import{appendPendingInputBatch,consumeDeferredStepInput,getDeferredStepInput,getPendingInputBatches,getPendingInputRequestIds,hasPendingInputBatch,queueDeferredStepInput}from"#harness/pending-input-batches.js";import{isApprovalRequest}from"#harness/input-request-class.js";import{compactStepInput}from"#harness/hitl/pending-input-resolution.js";import{hasTailApprovalResponse}from"#harness/current-messages.js";import{findAnsweredApprovalBatches,getApprovedTools,resolveApprovalInputBatches}from"#harness/hitl/approval-input-requests.js";import{clearPendingSessionLimitPrompt,isSessionLimitInputBatch,resolveSessionLimitInput}from"#harness/hitl/session-limit-input-requests.js";function hasStepInput(e){return e===void 0?!1:e.message!==void 0||(e.inputResponses?.length??0)>0}function hasRunnableDeferredStepInput(e){let t=getDeferredStepInput(e);if(t===void 0)return!1;if(t.message!==void 0||(t.context?.length??0)>0||readClientContext(t)!==void 0||t.outputSchema!==void 0||(t.runtimeActionResults?.length??0)>0)return!0;let n=[...t.inputResponses??[],...(t.attributedInputResponses??[]).map(({response:e})=>e)];if(n.length===0)return!1;let r=getPendingInputBatches(e.state),i=routePendingInput(r);switch(i.kind){case`session-limit`:return i.batch.requests.every(e=>n.some(t=>t.requestId===e.requestId));case`approvals`:return findAnsweredApprovalBatches(r,n).length>0}}function selectApprovalReplayBatch(e,t){let n=getPendingInputBatches(e.state);if(n.some(isSessionLimitInputBatch))return;let r=canonicalizeInputResponses((n.length===1?resolveTextMessageInput(n[0],t):t)?.inputResponses??[]),i=findAnsweredApprovalBatches(n,r)[0];return i?.requests.some(e=>isApprovalRequest(e)&&r.some(t=>t.requestId===e.requestId&&t.optionId===`approve`))?i:void 0}function resolvePendingInput(e){let t=[...e.history??e.session.history],n=getPendingInputBatches(e.session.state);if(n.length===0)return{outcome:`continue`,messages:t,session:e.session};let r=routePendingInput(n),i=hasTailApprovalResponse(t),a=r.kind===`session-limit`?r.batch:n.length===1?n[0]:void 0,o=a===void 0?e.stepInput:resolveTextMessageInput(a,e.stepInput),s=canonicalizeInputResponses(o?.inputResponses??[]);if(e.internalStep===!0&&canContinuePastHistoricalInput({activeTurnId:e.activeTurnId,batches:n,responses:s,route:r})&&o?.message===void 0)return{outcome:`continue`,messages:t,session:o===void 0?e.session:queueDeferredStepInput(e.session,compactStepInput(o))};if(s.length===0&&o?.message===void 0){let n=compactStepInput(o);return{outcome:`unresolved`,messages:t,session:n.context!==void 0||readClientContext(n)!==void 0||n.outputSchema!==void 0?queueDeferredStepInput(e.session,n):e.session}}let c={baseHistory:t,batches:n,deferTurnInput:i,resolvedStepInput:o,responses:s,session:e.session};switch(r.kind){case`session-limit`:return resolveSessionLimitInput({...c,pendingBatch:r.batch});case`approvals`:return resolveApprovalInputBatches({...c,resolveApprovalKey:e.resolveApprovalKey})}}function canContinuePastHistoricalInput(e){return e.activeTurnId===void 0||e.route.kind===`session-limit`||e.responses.length>0&&findAnsweredApprovalBatches(e.batches,e.responses).length>0?!1:e.batches.every(t=>t.event!==void 0&&t.event.turnId!==e.activeTurnId)}function routePendingInput(e){let t=e.find(e=>isSessionLimitInputBatch(e));if(t!==void 0)return{batch:t,kind:`session-limit`};for(let t of e)for(let e of t.requests)if(!isApprovalRequest(e))throw TypeError(`Unhandled pending input request kind: ${e.kind}`);return{kind:`approvals`}}function canonicalizeInputResponses(e){let t=new Map;for(let n of e)t.set(n.requestId,n);return[...t.values()]}function resolveTextMessageInput(e,t){if(typeof t?.message!=`string`)return t;let n=new Set(e.requests.map(e=>e.requestId));if(t.inputResponses?.some(e=>n.has(e.requestId)))return t;let r=new Set(e.responseAuthRequiredRequestIds??[]),i=e.requests.filter(e=>!r.has(e.requestId)),a=resolveTextToResponses(t.message,i);return a.length===0?t:compactStepInput({...t,inputResponses:[...t.inputResponses??[],...a],messageConsumed:!0,message:void 0})}export{appendPendingInputBatch,clearPendingSessionLimitPrompt,consumeDeferredStepInput,getApprovedTools,getPendingInputRequestIds,hasPendingInputBatch,hasRunnableDeferredStepInput,hasStepInput,resolvePendingInput,selectApprovalReplayBatch};
|
|
@@ -75,10 +75,5 @@ export declare function consumeDeferredStepInput(input: {
|
|
|
75
75
|
readonly input?: StepInput;
|
|
76
76
|
readonly session: HarnessSession;
|
|
77
77
|
};
|
|
78
|
-
/**
|
|
79
|
-
* Returns true when the session carries queued follow-up input for the next
|
|
80
|
-
* internal harness step.
|
|
81
|
-
*/
|
|
82
|
-
export declare function hasDeferredStepInput(session: HarnessSession): boolean;
|
|
83
78
|
export declare function getDeferredStepInput(session: HarnessSession): StepInput | undefined;
|
|
84
79
|
export declare function queueDeferredStepInput(session: HarnessSession, input: StepInput): HarnessSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{contextStorage}from"#context/container.js";import{ActivityRootTurnIdKey}from"#context/keys.js";import{coalesceTurnInputs}from"#harness/messages.js";const PENDING_INPUT_BATCHES_KEY=`eve.runtime.pendingInputBatches`,LEGACY_PENDING_INPUT_BATCH_KEY=`eve.runtime.pendingInputBatch`,DEFERRED_STEP_INPUT_KEY=`eve.runtime.deferredStepInput`;function hasPendingInputBatch(e){return getPendingInputBatches(e).length>0}function getPendingInputRequestIds(e){return new Set(getPendingInputBatches(e).flatMap(e=>e.requests.map(e=>e.requestId)))}function coercePendingInputBatch(e){if(typeof e!=`object`||!e)return;let t=e;if(Array.isArray(t.requests)&&Array.isArray(t.responseMessages))return t}function getPendingInputBatches(e){let t=e?.[PENDING_INPUT_BATCHES_KEY];if(Array.isArray(t)){let e=t.map(e=>coercePendingInputBatch(e)).filter(e=>e!==void 0);return assertUniqueRequestIds(e),e}let n=coercePendingInputBatch(e?.[LEGACY_PENDING_INPUT_BATCH_KEY]),r=n===void 0?[]:[n];return assertUniqueRequestIds(r),r}function assertUniqueRequestIds(e){let t=new Set;for(let n of e)for(let e of n.requests){if(t.has(e.requestId))throw TypeError(`Internal pending input invariant violated: requestId must be unique across all pending batches: ${JSON.stringify(e.requestId)}.`);t.add(e.requestId)}}function removePendingInputBatches(e,t){let n=new Set(t);return setPendingInputBatches(e,getPendingInputBatches(e.state).filter(e=>!n.has(e)))}function setPendingInputBatches(e,t){assertUniqueRequestIds(t);let n={...e.state};return delete n[LEGACY_PENDING_INPUT_BATCH_KEY],t.length===0?delete n[PENDING_INPUT_BATCHES_KEY]:n[PENDING_INPUT_BATCHES_KEY]=t.map(e=>({event:e.event,activityRootTurnId:e.activityRootTurnId,responseAuthRequiredRequestIds:e.responseAuthRequiredRequestIds,toolReplayIdentities:e.toolReplayIdentities,requests:[...e.requests],responseMessages:[...e.responseMessages]})),{...e,state:Object.keys(n).length>0?n:void 0}}function appendPendingInputBatch(e){return setPendingInputBatches(e.session,[...getPendingInputBatches(e.session.state),{event:e.event,activityRootTurnId:e.activityRootTurnId??contextStorage.getStore()?.get(ActivityRootTurnIdKey),responseAuthRequiredRequestIds:e.responseAuthRequiredRequestIds,toolReplayIdentities:e.toolReplayIdentities,requests:e.requests,responseMessages:e.responseMessages}])}function activityRootTurnIdForInputResponses(e,t){return getPendingInputBatches(e).find(e=>e.requests.some(e=>t.has(e.requestId)))?.activityRootTurnId}function activityRequestIdsForRootTurn(e,t){return getPendingInputBatches(e).flatMap(e=>e.activityRootTurnId===t?e.requests.map(e=>e.requestId):[])}function consumeDeferredStepInput(e){let t=getDeferredStepInput(e.session);if(t===void 0)return e;let n=clearDeferredStepInput(e.session);return e.input===void 0?{input:t,session:n}:{input:coalesceTurnInputs(t,e.input),session:n}}function
|
|
1
|
+
import{contextStorage}from"#context/container.js";import{ActivityRootTurnIdKey}from"#context/keys.js";import{coalesceTurnInputs}from"#harness/messages.js";const PENDING_INPUT_BATCHES_KEY=`eve.runtime.pendingInputBatches`,LEGACY_PENDING_INPUT_BATCH_KEY=`eve.runtime.pendingInputBatch`,DEFERRED_STEP_INPUT_KEY=`eve.runtime.deferredStepInput`;function hasPendingInputBatch(e){return getPendingInputBatches(e).length>0}function getPendingInputRequestIds(e){return new Set(getPendingInputBatches(e).flatMap(e=>e.requests.map(e=>e.requestId)))}function coercePendingInputBatch(e){if(typeof e!=`object`||!e)return;let t=e;if(Array.isArray(t.requests)&&Array.isArray(t.responseMessages))return t}function getPendingInputBatches(e){let t=e?.[PENDING_INPUT_BATCHES_KEY];if(Array.isArray(t)){let e=t.map(e=>coercePendingInputBatch(e)).filter(e=>e!==void 0);return assertUniqueRequestIds(e),e}let n=coercePendingInputBatch(e?.[LEGACY_PENDING_INPUT_BATCH_KEY]),r=n===void 0?[]:[n];return assertUniqueRequestIds(r),r}function assertUniqueRequestIds(e){let t=new Set;for(let n of e)for(let e of n.requests){if(t.has(e.requestId))throw TypeError(`Internal pending input invariant violated: requestId must be unique across all pending batches: ${JSON.stringify(e.requestId)}.`);t.add(e.requestId)}}function removePendingInputBatches(e,t){let n=new Set(t);return setPendingInputBatches(e,getPendingInputBatches(e.state).filter(e=>!n.has(e)))}function setPendingInputBatches(e,t){assertUniqueRequestIds(t);let n={...e.state};return delete n[LEGACY_PENDING_INPUT_BATCH_KEY],t.length===0?delete n[PENDING_INPUT_BATCHES_KEY]:n[PENDING_INPUT_BATCHES_KEY]=t.map(e=>({event:e.event,activityRootTurnId:e.activityRootTurnId,responseAuthRequiredRequestIds:e.responseAuthRequiredRequestIds,toolReplayIdentities:e.toolReplayIdentities,requests:[...e.requests],responseMessages:[...e.responseMessages]})),{...e,state:Object.keys(n).length>0?n:void 0}}function appendPendingInputBatch(e){return setPendingInputBatches(e.session,[...getPendingInputBatches(e.session.state),{event:e.event,activityRootTurnId:e.activityRootTurnId??contextStorage.getStore()?.get(ActivityRootTurnIdKey),responseAuthRequiredRequestIds:e.responseAuthRequiredRequestIds,toolReplayIdentities:e.toolReplayIdentities,requests:e.requests,responseMessages:e.responseMessages}])}function activityRootTurnIdForInputResponses(e,t){return getPendingInputBatches(e).find(e=>e.requests.some(e=>t.has(e.requestId)))?.activityRootTurnId}function activityRequestIdsForRootTurn(e,t){return getPendingInputBatches(e).flatMap(e=>e.activityRootTurnId===t?e.requests.map(e=>e.requestId):[])}function consumeDeferredStepInput(e){let t=getDeferredStepInput(e.session);if(t===void 0)return e;let n=clearDeferredStepInput(e.session);return e.input===void 0?{input:t,session:n}:{input:coalesceTurnInputs(t,e.input),session:n}}function getDeferredStepInput(e){return e.state?.[DEFERRED_STEP_INPUT_KEY]}function queueDeferredStepInput(e,t){let n=getDeferredStepInput(e),r=n===void 0?t:coalesceTurnInputs(n,t),i={...e.state};return i[DEFERRED_STEP_INPUT_KEY]=r,{...e,state:i}}function clearDeferredStepInput(e){if(e.state?.[DEFERRED_STEP_INPUT_KEY]===void 0)return e;let t={...e.state};return delete t[DEFERRED_STEP_INPUT_KEY],{...e,state:Object.keys(t).length>0?t:void 0}}export{activityRequestIdsForRootTurn,activityRootTurnIdForInputResponses,appendPendingInputBatch,consumeDeferredStepInput,getDeferredStepInput,getPendingInputBatches,getPendingInputRequestIds,hasPendingInputBatch,queueDeferredStepInput,removePendingInputBatches};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LanguageModel } from "ai";
|
|
1
2
|
import type { SessionAuthContext } from "#channel/types.js";
|
|
2
3
|
import type { RuntimeModelReference } from "#runtime/agent/bootstrap.js";
|
|
3
4
|
/**
|
|
@@ -5,3 +6,11 @@ import type { RuntimeModelReference } from "#runtime/agent/bootstrap.js";
|
|
|
5
6
|
* raw eve principal. Authored provider options take precedence over the default.
|
|
6
7
|
*/
|
|
7
8
|
export declare function mergeProviderSafetyIdentifier(modelReference: RuntimeModelReference, providerOptions: Readonly<Record<string, unknown>> | undefined, auth: SessionAuthContext | null): Record<string, unknown> | undefined;
|
|
9
|
+
/** Composes the per-call defaults shared by model steps and compaction. */
|
|
10
|
+
export declare function resolveCallProviderOptions(input: {
|
|
11
|
+
readonly auth: SessionAuthContext | null;
|
|
12
|
+
readonly conversationId: string;
|
|
13
|
+
readonly model: LanguageModel;
|
|
14
|
+
readonly modelReference: RuntimeModelReference;
|
|
15
|
+
readonly providerOptions: Readonly<Record<string, unknown>> | undefined;
|
|
16
|
+
}): Record<string, unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{invocationOwnerKey}from"#internal/invocation/metadata.js";import{mergeObjects}from"#shared/objects.js";function mergeProviderSafetyIdentifier(e,t,n){if(n===null)return t;let r=invocationOwnerKey(n),i=e.id.split(`/`,1)[0]?.toLowerCase(),a=i===`openai`?{openai:{safetyIdentifier:r}}:i===`anthropic`?{anthropic:{metadata:{userId:r}}}:void 0;return a===void 0?t:mergeObjects(a,t)}export{mergeProviderSafetyIdentifier};
|
|
1
|
+
import{mergeGatewaySessionId}from"#internal/gateway.js";import{invocationOwnerKey}from"#internal/invocation/metadata.js";import{mergeObjects}from"#shared/objects.js";function mergeProviderSafetyIdentifier(e,t,n){if(n===null)return t;let r=invocationOwnerKey(n),i=e.id.split(`/`,1)[0]?.toLowerCase(),a=i===`openai`?{openai:{safetyIdentifier:r}}:i===`anthropic`?{anthropic:{metadata:{userId:r}}}:void 0;return a===void 0?t:mergeObjects(a,t)}function resolveCallProviderOptions(e){return mergeGatewaySessionId(e.model,mergeProviderSafetyIdentifier(e.modelReference,e.providerOptions,e.auth),e.conversationId)}export{mergeProviderSafetyIdentifier,resolveCallProviderOptions};
|
|
@@ -5,7 +5,7 @@ import type { WebSearchProvider } from "#shared/web-search.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* The provider backend resolved for one web search tool invocation.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
type WebSearchBackend = "anthropic" | "exa" | "google" | "openai" | "parallel";
|
|
9
9
|
/**
|
|
10
10
|
* Returns the framework tool name that produced an upstream provider tool
|
|
11
11
|
* `type`, or `null` when the type is not one we know how to remove.
|
|
@@ -38,3 +38,4 @@ export declare function resolveWebSearchBackend(modelRef: RuntimeModelReference,
|
|
|
38
38
|
* provider matching the current model is loaded.
|
|
39
39
|
*/
|
|
40
40
|
export declare function resolveWebSearchProviderTool(backend: WebSearchBackend): Promise<ToolSet[string]>;
|
|
41
|
+
export {};
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { InputRequest, InputResponse } from "#shared/input.js";
|
|
11
11
|
import type { SessionUsageLimitViolation } from "#harness/turn-tag-state.js";
|
|
12
|
-
/** Synthetic action tool name carried by session-limit continuation requests. */
|
|
13
|
-
export declare const SESSION_LIMIT_CONTINUATION_TOOL_NAME = "session_limit_continuation";
|
|
14
|
-
/** Option id that grants a fresh token budget window. */
|
|
15
|
-
export declare const SESSION_LIMIT_CONTINUE_OPTION_ID = "continue";
|
|
16
12
|
/** Option id that declines continuation and ends the session. */
|
|
17
13
|
export declare const SESSION_LIMIT_STOP_OPTION_ID = "stop";
|
|
18
14
|
/**
|