eve 0.75.0 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/task-card.js +1 -1
- package/dist/src/channel/tool-eligibility.d.ts +1 -2
- package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-D2V9UhLt.js} +68 -10
- package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-QmriPA-w.js} +68 -10
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/link.d.ts +2 -1
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/vercel-non-interactive.d.ts +6 -4
- package/dist/src/cli/commands/vercel-non-interactive.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +0 -6
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/conversation-view.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +3 -0
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +6 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +9 -8
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
- package/dist/src/compiled/@vercel/queue/index.js +47 -0
- package/dist/src/compiled/@workflow/core/global.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +11 -0
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +36 -8
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +10 -6
- package/dist/src/compiled/@workflow/core/runtime/out-of-band-observation.d.ts +159 -0
- package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +28 -4
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- 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/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +4 -4
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-CSqvJx6j.js → attribute-changes-BW-kbMMn.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{helpers-BXCuoPUb.js → helpers-DlLD3ov_.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{resume-hook-CvENCrxc.js → resume-hook-DMsV_b4n.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-8pLWuR2U.js → run-DzdAqdb1.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-vDozzDhh.js → serialization-DPdYS_w2.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{token-BKeK6DmC.js → token-D5ugC3PI.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-util-CddTZ_ef.js → token-util-Bla5Z0G9.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/undici-D-ILjOKD.js +95 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-A344L2AG.js → wait-until-xbRRDuUf.js} +1 -1
- package/dist/src/compiler/connection-ownership.d.ts +6 -0
- package/dist/src/compiler/connection-ownership.js +1 -0
- package/dist/src/compiler/default-tool-policy.d.ts +0 -3
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +21 -20
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +9 -6
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +5 -0
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +2 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +2 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/connections/ownership.d.ts +18 -0
- package/dist/src/connections/ownership.js +1 -0
- package/dist/src/context/build-dynamic-tools.d.ts +3 -9
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +5 -4
- package/dist/src/context/memory-tools.js +1 -1
- package/dist/src/context/schedule-collection-tools.js +1 -1
- package/dist/src/discover/grammar.d.ts +11 -0
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.d.ts +1 -0
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/skills.d.ts +1 -0
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/dynamic/definition.d.ts +7 -5
- package/dist/src/evals/assertions/collector.d.ts +4 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +2 -3
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/evals/assertions/scoped.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +9 -6
- package/dist/src/evals/reported-tool-name.d.ts +9 -0
- package/dist/src/evals/reported-tool-name.js +1 -0
- package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
- package/dist/src/evals/runner/reporters/datadog.js +2 -2
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/target.d.ts +7 -0
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +17 -1
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/agent-sessions/remote.js +1 -1
- package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
- package/dist/src/execution/catalog/connection-auth.js +1 -0
- package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
- package/dist/src/execution/catalog/connection-entry.js +1 -0
- package/dist/src/execution/catalog/listing.d.ts +9 -0
- package/dist/src/execution/catalog/listing.js +3 -0
- package/dist/src/execution/catalog/rank.d.ts +44 -0
- package/dist/src/execution/catalog/rank.js +1 -0
- package/dist/src/execution/catalog/search.d.ts +28 -0
- package/dist/src/execution/catalog/search.js +1 -0
- package/dist/src/execution/catalog/signatures.d.ts +11 -0
- package/dist/src/execution/catalog/signatures.js +1 -0
- package/dist/src/execution/catalog/skills.d.ts +24 -0
- package/dist/src/execution/catalog/skills.js +1 -0
- package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
- package/dist/src/execution/catalog/step-catalog.js +1 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/ndjson-stream.d.ts +6 -6
- package/dist/src/execution/ndjson-stream.js +3 -3
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session/active-turn.d.ts +1 -1
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +5 -5
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +20 -10
- package/dist/src/execution/skills/instructions.js +2 -2
- package/dist/src/execution/tasks/calls.d.ts +6 -5
- package/dist/src/execution/tasks/calls.js +1 -1
- package/dist/src/execution/tasks/model-step.d.ts +10 -10
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/render.d.ts +3 -3
- package/dist/src/execution/tasks/render.js +3 -3
- package/dist/src/execution/tasks/session.d.ts +2 -1
- package/dist/src/execution/tasks/table.d.ts +1 -1
- package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
- package/dist/src/extensions/code/extension/extension.d.ts +4 -18
- package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
- package/dist/src/extensions/code/extension/instructions/github.js +1 -0
- package/dist/src/extensions/code/extension/instructions.md +1 -13
- package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
- package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
- package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
- package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
- package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
- package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
- package/dist/src/extensions/code/extension/lib/patch.js +4 -4
- package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
- package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
- package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
- package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
- package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
- package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
- package/dist/src/extensions/code/extension/skills/pr.js +1 -0
- package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
- package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
- package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
- package/dist/src/extensions/code/extension/tools/gh.js +1 -1
- package/dist/src/extensions/code/extension/tools/grep.js +1 -1
- package/dist/src/extensions/code/tools.d.ts +2 -1
- package/dist/src/extensions/code/tools.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +12 -0
- package/dist/src/extensions/git/extension/extension.js +1 -0
- package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
- package/dist/src/extensions/git/extension/instructions/github.js +1 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
- package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
- package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
- package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
- package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
- package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
- package/dist/src/extensions/git/extension/lib/shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
- package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
- package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
- package/dist/src/extensions/git/extension/skills/pr.js +1 -0
- package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
- package/dist/src/extensions/git/extension/tools/gh.js +1 -0
- package/dist/src/extensions/git/tools.d.ts +27 -0
- package/dist/src/extensions/git/tools.js +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/action-presentation.d.ts +2 -2
- package/dist/src/harness/action-result-helpers.d.ts +10 -2
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/announcements.d.ts +2 -8
- package/dist/src/harness/announcements.js +1 -1
- package/dist/src/harness/compaction/engine.d.ts +8 -19
- package/dist/src/harness/compaction/engine.js +1 -1
- package/dist/src/harness/compaction/step.d.ts +7 -1
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/coordination.d.ts +11 -11
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +1 -5
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-call.d.ts +48 -0
- package/dist/src/harness/execute-call.js +1 -0
- package/dist/src/harness/execute-tool.d.ts +3 -1
- package/dist/src/harness/final-output.d.ts +2 -6
- package/dist/src/harness/final-output.js +1 -1
- package/dist/src/harness/hitl/approvals.d.ts +5 -0
- package/dist/src/harness/hitl/approvals.js +1 -1
- package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
- package/dist/src/harness/hitl/approved-calls.js +1 -1
- package/dist/src/harness/hitl/candidates.d.ts +13 -2
- package/dist/src/harness/hitl/candidates.js +1 -1
- package/dist/src/harness/hitl/coordinator.d.ts +3 -3
- package/dist/src/harness/hitl/coordinator.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +6 -4
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.d.ts +3 -3
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +15 -0
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +5 -8
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.js +1 -1
- package/dist/src/harness/model-call/model.d.ts +4 -5
- package/dist/src/harness/model-call/model.js +1 -1
- package/dist/src/harness/model-call/request.d.ts +4 -4
- package/dist/src/harness/model-call/request.js +1 -1
- package/dist/src/harness/model-call/response.d.ts +2 -1
- package/dist/src/harness/model-call/response.js +1 -1
- package/dist/src/harness/model-call/retry.d.ts +1 -1
- package/dist/src/harness/model-call/retry.js +1 -1
- package/dist/src/harness/model-call/run.d.ts +5 -3
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/model-call/tools.d.ts +14 -24
- package/dist/src/harness/model-call/tools.js +1 -1
- package/dist/src/harness/model-call/usage.js +1 -1
- package/dist/src/harness/model-profile.d.ts +28 -0
- package/dist/src/harness/model-profile.js +1 -0
- package/dist/src/harness/prompt-cache.d.ts +5 -53
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +3 -5
- package/dist/src/harness/provider-safety.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +7 -14
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/session-machine/commit.js +1 -1
- package/dist/src/harness/session-machine/transitions.d.ts +5 -2
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/step/after-model.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +6 -9
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
- package/dist/src/harness/tool-call-io.d.ts +3 -0
- package/dist/src/harness/tool-call-io.js +1 -1
- package/dist/src/harness/tools.d.ts +24 -22
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +12 -0
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +14 -0
- package/dist/src/instrumentation/lifecycle.d.ts +0 -1
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +2 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module.d.ts +2 -1
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/gateway.d.ts +0 -13
- package/dist/src/internal/gateway.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/mcp/skills.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
- package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
- package/dist/src/internal/schedules/consumer-route.js +1 -1
- package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
- package/dist/src/internal/schedules/dev-environment.js +1 -0
- package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
- package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
- package/dist/src/protocol/catalog-tools.d.ts +12 -0
- package/dist/src/protocol/catalog-tools.js +1 -0
- package/dist/src/protocol/message-version.js +1 -1
- package/dist/src/protocol/message.d.ts +1 -1
- package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
- package/dist/src/protocol/remote-agent-protocol.js +1 -1
- package/dist/src/protocol/reply-tool.d.ts +2 -0
- package/dist/src/protocol/reply-tool.js +1 -0
- package/dist/src/protocol/runtime-tools.d.ts +6 -0
- package/dist/src/protocol/runtime-tools.js +1 -0
- package/dist/src/protocol/session-projection.js +1 -1
- package/dist/src/protocol/task-tools.d.ts +4 -4
- package/dist/src/protocol/task-tools.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
- package/dist/src/public/channels/linear/defaults.js +2 -2
- package/dist/src/public/channels/slack/action-status.d.ts +0 -9
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/task-card.d.ts +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
- package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
- package/dist/src/public/definitions/remote-agent.d.ts +6 -3
- package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
- package/dist/src/public/experimental/schedules/index.d.ts +1 -1
- package/dist/src/public/schedules/providers/in-memory.js +1 -1
- package/dist/src/public/schedules/providers/vercel.js +1 -1
- package/dist/src/public/schedules/subscription.d.ts +36 -16
- package/dist/src/public/tools/web-search.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
- package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
- package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/registry.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/tool-result.d.ts +2 -2
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +2 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.d.ts +2 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -3
- package/dist/src/setup/connection-connector.js +1 -2
- package/dist/src/setup/index.d.ts +1 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
- package/dist/src/setup/integrations/slack/setup.js +1 -1
- package/dist/src/setup/primitives/process-output.d.ts +5 -0
- package/dist/src/setup/primitives/process-output.js +2 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +3 -2
- package/dist/src/setup/scaffold/create/web-template.js +384 -412
- package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
- package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
- package/dist/src/setup/slack-connect-create.d.ts +10 -2
- package/dist/src/setup/slack-connect-create.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slack-connect.d.ts +30 -11
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/slack-setup-plan.d.ts +72 -0
- package/dist/src/setup/slack-setup-plan.js +1 -0
- package/dist/src/setup/slackbot.d.ts +75 -35
- package/dist/src/setup/slackbot.js +2 -1
- package/dist/src/setup/vercel-project.d.ts +1 -1
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/action-label.d.ts +10 -0
- package/dist/src/shared/action-label.js +1 -0
- package/dist/src/shared/action-request-name.d.ts +3 -1
- package/dist/src/shared/action-request-name.js +1 -1
- package/dist/src/shared/action-types.d.ts +7 -8
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +11 -3
- package/dist/src/shared/development-env-files.d.ts +4 -0
- package/dist/src/shared/development-env-files.js +1 -0
- package/dist/src/shared/input.d.ts +0 -1
- package/dist/src/shared/map-with-concurrency.d.ts +2 -0
- package/dist/src/shared/map-with-concurrency.js +1 -0
- package/dist/src/shared/skill-definition.d.ts +6 -0
- package/dist/src/shared/skill-package.d.ts +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/web-search.d.ts +15 -2
- package/dist/src/shared/web-search.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tool-stubs/execute.d.ts +0 -3
- package/dist/src/tool-stubs/execute.js +1 -1
- package/dist/src/tool-stubs/rules.js +1 -1
- package/dist/src/tool-stubs/validate-targets.js +1 -1
- package/dist/src/tools/behavior.d.ts +3 -6
- package/dist/src/tools/definition.d.ts +5 -0
- package/dist/src/tools/dynamic.d.ts +5 -2
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/task-cancel.d.ts +1 -1
- package/dist/src/tools/provided/task-wait.d.ts +1 -1
- package/dist/src/tools/provided/web-search.d.ts +20 -7
- package/dist/src/tools/provided/web-search.js +1 -1
- package/dist/src/tools/schema.d.ts +5 -0
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
- package/dist/src/tools/workflow-definition.d.ts +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
- package/dist/src/tracing/agent-otel-turn-state.js +1 -0
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +4 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +8 -8
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/slack.mdx +32 -82
- package/docs/code-extension.mdx +28 -7
- package/docs/concepts/built-in-tools.md +43 -43
- package/docs/concepts/context-control.md +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +4 -4
- package/docs/connections/mcp.mdx +5 -5
- package/docs/connections/openapi.mdx +1 -1
- package/docs/connections/overview.mdx +4 -2
- package/docs/evals/assertions.mdx +5 -3
- package/docs/evals/reporters.mdx +3 -1
- package/docs/evals/tool-stubs.mdx +3 -1
- package/docs/extensions.md +2 -0
- package/docs/guides/dev-tui.md +2 -2
- package/docs/guides/dynamic-capabilities.md +14 -4
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/remote-agents.md +10 -3
- package/docs/instructions.mdx +5 -5
- package/docs/reference/cli.md +2 -2
- package/docs/reference/typescript-api.md +3 -3
- package/docs/skills.mdx +19 -4
- package/docs/subagents/index.mdx +5 -3
- package/docs/tools/overview.mdx +22 -1
- package/docs/tools/tasks-upgrade.md +1 -1
- package/docs/tools/tasks.md +32 -32
- package/docs/tools/workflows.mdx +6 -6
- package/docs/tutorial/team-playbooks.mdx +2 -2
- package/package.json +27 -11
- package/dist/src/compiled/_chunks/workflow/dist-DmXynLVH.js +0 -1
- package/dist/src/compiled/_chunks/workflow/private-Dlf90Zvn.js +0 -1
- package/dist/src/compiled/_chunks/workflow/signal-exit-iIdjQcCK.js +0 -95
- package/dist/src/compiled/_chunks/workflow/sleep-BMqbraZM.js +0 -1
- package/dist/src/execution/connection-announcement.d.ts +0 -7
- package/dist/src/execution/connection-announcement.js +0 -4
- package/dist/src/execution/tools/connection-approval.d.ts +0 -25
- package/dist/src/execution/tools/connection-approval.js +0 -1
- package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
- package/dist/src/execution/tools/connection-search-rank.js +0 -1
- package/dist/src/execution/tools/connection-target.d.ts +0 -18
- package/dist/src/execution/tools/connection-target.js +0 -1
- package/dist/src/execution/tools/connection-tools.d.ts +0 -4
- package/dist/src/execution/tools/connection-tools.js +0 -2
- package/dist/src/execution/tools/load-skill.d.ts +0 -10
- package/dist/src/execution/tools/load-skill.js +0 -1
- package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
- package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -26
- package/dist/src/harness/advertised-tools.js +0 -1
- package/dist/src/harness/nested-actions.d.ts +0 -23
- package/dist/src/harness/nested-actions.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
- package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
- package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
- package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
- package/dist/src/public/tools/load-skill.d.ts +0 -3
- package/dist/src/public/tools/load-skill.js +0 -1
- package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
- package/dist/src/runtime/skills/fragment-context.js +0 -1
- package/dist/src/tools/framework/connection-tools.d.ts +0 -3
- package/dist/src/tools/framework/connection-tools.js +0 -1
- package/dist/src/tools/provided/load-skill.d.ts +0 -2
- package/dist/src/tools/provided/load-skill.js +0 -1
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
- /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{DEVELOPMENT_WORKER_APP_ROOT_ENV}from"#internal/workflow/development-world-protocol.js";import{readDevelopmentRuntimeArtifactsSnapshotRoot}from"#internal/nitro/dev-runtime-artifacts.js";import{createDevelopmentGenerationArtifactsSource,createDevelopmentNitroArtifactsConfig}from"#internal/nitro/host/artifacts-config.js";import{createEveScheduleQueueTrigger,hasVercelScheduleCollections}from"#internal/schedules/consumer-route.js";import{PollingQueueClient}from"#compiled/@vercel/queue/index.js";import{createScheduleCollectionConsumer}from"#internal/nitro/routes/schedule-collection-consumer.js";function installLocalSchedulesRuntimePlugin(e){let t=process.env[DEVELOPMENT_WORKER_APP_ROOT_ENV],n=process.env.VERCEL_QUEUE_BASE_URL,r=process.env.VERCEL_QUEUE_TOKEN;if(!t||!n||!r)throw Error("Local Vercel Schedules requires eve's dev worker and the local Queues API. Start eve through `vc dev` with a CLI that supports local Schedules and Queues.");let i=new URL(n),a=new PollingQueueClient({deploymentId:null,region:`dev1`,resolveBaseUrl:()=>i,token:r}),o=createDevelopmentNitroArtifactsConfig({appRoot:t}),s,c=!1,l,u,poll=async()=>{let e=1e3;try{let e=readDevelopmentRuntimeArtifactsSnapshotRoot(o.devRuntimeArtifactsPointerPath);if(e===void 0)return;if(s?.root!==e){let n=await loadCompiledManifest({compiledArtifactsSource:createDevelopmentGenerationArtifactsSource({appRoot:t,runtimeAppRoot:e})});s={root:e,consumer:createScheduleCollectionConsumer(createDevelopmentNitroArtifactsConfig({appRoot:t,configuredWorld:n.config.experimental?.workflow?.world})),trigger:hasVercelScheduleCollections(n)?createEveScheduleQueueTrigger(n.config.name):void 0}}if(!c&&s.trigger!==void 0){let{consumer:e,trigger:{topic:t,maxDeliveries:n,retryAfterSeconds:r}}=s;await a.receive(t,t,async(t,n)=>{if(c)throw Error(`Local schedule consumer is closing.`);await e.handler(t,n)},{retry:(t,i)=>e.retry(t,i)??(i.deliveryCount>=n?{acknowledge:!0}:{afterSeconds:r})})}u=void 0}catch(t){if(c)return;let n=t instanceof Error?t.message:`Unknown local schedule error`;for(let e of[r,process.env.VERCEL_SCHEDULE_TOKEN])e&&(n=n.replaceAll(e,`[redacted]`));n=n.slice(0,1e3),n!==u&&(console.warn(`[eve] Local schedule delivery failed: ${n}. Check vc dev's local Queues and Schedules APIs; retrying in 5s.`),u=n),e=5e3}finally{c||(l=setTimeout(()=>void poll(),e),l.unref())}};e.hooks.hook(`close`,()=>{c=!0,clearTimeout(l)}),poll()}export{installLocalSchedulesRuntimePlugin as default};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { type MessageHandler, type RetryHandler } from "#compiled/@vercel/queue/index.js";
|
|
1
2
|
import type { NitroArtifactsConfig } from "#internal/nitro/routes/runtime-artifacts.js";
|
|
2
3
|
/** Receives verified Vercel Schedules occurrences and dispatches at-least-once callbacks. */
|
|
3
4
|
export declare function handleScheduleCollectionConsumer(config: NitroArtifactsConfig, request: Request): Promise<Response>;
|
|
5
|
+
/** Shares occurrence verification and dispatch between hosted callbacks and local queue polling. */
|
|
6
|
+
export declare function createScheduleCollectionConsumer(config: NitroArtifactsConfig): {
|
|
7
|
+
readonly handler: MessageHandler<unknown>;
|
|
8
|
+
readonly retry: RetryHandler;
|
|
9
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{parseSchedulePayload}from"#runtime/schedules/payload.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES}from"#internal/schedules/consumer-route.js";import{resolveNitroCompiledArtifactsSource}from"#internal/nitro/routes/runtime-artifacts.js";import{handleCallback}from"#compiled/@vercel/queue/index.js";import{SchedulesApiError,SchedulesClient}from"#compiled/@vercel/schedules/index.js";import{PermanentScheduleMessageError,expectScheduleQueueMessage,verifyScheduleDelivery}from"#internal/schedules/verify-delivery.js";import{readVercelScheduleClientOptions}from"#public/schedules/providers/vercel.js";import{dispatchScheduledOccurrence}from"#runtime/schedules/dispatch-occurrence.js";import{ScheduleCollectionNotDeployedError,loadScheduleCollectionDefinition}from"#runtime/schedules/load-collection.js";import{deriveEveScheduleQueueTopic}from"#runtime/schedules/queue-namespace.js";async function handleScheduleCollectionConsumer(e,t){let{handler:n,retry:r}=createScheduleCollectionConsumer(e);return await handleCallback(n,{retry:r})(t)}function createScheduleCollectionConsumer(e){return{handler:async(t,n)=>{let r=expectScheduleQueueMessage(t),i=r.payload.eve.application,a=r.payload.eve.collection,o=resolveNitroCompiledArtifactsSource(e),[s,c]=await Promise.all([getCompiledRuntimeAgentBundle({compiledArtifactsSource:o}),loadCompiledManifest({compiledArtifactsSource:o})]);if(c.config.name!==i)throw new PermanentScheduleMessageError(`Schedule application does not match this agent.`);if(!r.namespace.startsWith(`eve-`)||n.topicName!==deriveEveScheduleQueueTopic(i))throw new PermanentScheduleMessageError(`Schedule delivery does not match this agent.`);let l;try{l=await loadScheduleCollectionDefinition(s,a,{manifest:c,providerKind:`vercel`})}catch(e){throw e instanceof ScheduleCollectionNotDeployedError?new PermanentScheduleMessageError(e.message):e}let u={collection:a,executionId:r.executionId??n.messageId,name:r.name,scheduleId:r.scheduleId,scheduledAt:r.scheduledAt??r.firedAt??n.createdAt.toISOString()};try{let e;try{e=parseSchedulePayload(r.payload.payload,{application:i,collection:a})}catch{throw new PermanentScheduleMessageError(`Scheduled collection request is invalid.`)}await dispatchScheduledOccurrence({bundle:s,collection:a,definition:l,occurrence:u,payload:e,verifyDelivery:async()=>verifyScheduleDelivery(r,await getSchedule(l,r),i,n.topicName)})}catch(e){throw(e instanceof PermanentScheduleMessageError||n.deliveryCount>=EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES)&&await l.events?.[`occurrence.failed`]?.({collection:a,executionId:u.executionId,name:u.name,occurrence:u,reason:e instanceof Error?e.message:`Scheduled occurrence failed.`,scheduledAt:u.scheduledAt,scheduleId:u.scheduleId,type:`occurrence.failed`}),e}},retry(e){return e instanceof PermanentScheduleMessageError?{acknowledge:!0}:void 0}}}async function getSchedule(e,t){try{return await new SchedulesClient(readVercelScheduleClientOptions(e.provider)??{}).get({name:t.name,namespace:t.namespace})}catch(e){throw e instanceof SchedulesApiError&&e.status===404?new PermanentScheduleMessageError(`Schedule delivery does not match this agent.`):e}}export{createScheduleCollectionConsumer,handleScheduleCollectionConsumer};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CompiledAgentManifest } from "#compiler/manifest.js";
|
|
1
2
|
export declare const EVE_SCHEDULE_COLLECTION_CONSUMER_ROUTE_PATH = "/.well-known/eve/v1/schedules/consumer";
|
|
2
3
|
/** Deliveries the queue attempts before giving up on an occurrence. */
|
|
3
4
|
export declare const EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES = 10;
|
|
@@ -9,6 +10,7 @@ export declare function createEveScheduleQueueTrigger(agentName: string): {
|
|
|
9
10
|
initialDelaySeconds: number;
|
|
10
11
|
maxDeliveries: number;
|
|
11
12
|
};
|
|
13
|
+
export declare function usesLocalVercelSchedules(manifest: Pick<CompiledAgentManifest, "scheduleCollections">): boolean;
|
|
12
14
|
/** Whether a build needs the Vercel schedule consumer: its route and its queue trigger. */
|
|
13
15
|
export declare function hasVercelScheduleCollections(manifest: {
|
|
14
16
|
readonly scheduleCollections?: readonly {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{deriveEveScheduleQueueTopic}from"#runtime/schedules/queue-namespace.js";const EVE_SCHEDULE_COLLECTION_CONSUMER_ROUTE_PATH=`/.well-known/eve/v1/schedules/consumer`,EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES=10;function createEveScheduleQueueTrigger(e){return{type:`queue/v2beta`,topic:deriveEveScheduleQueueTopic(e),retryAfterSeconds:5,initialDelaySeconds:0,maxDeliveries:10}}function hasVercelScheduleCollections(e){return e.scheduleCollections?.some(e=>e.providerKind===`vercel`)??!1}export{EVE_SCHEDULE_COLLECTION_CONSUMER_ROUTE_PATH,EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES,createEveScheduleQueueTrigger,hasVercelScheduleCollections};
|
|
1
|
+
import{deriveEveScheduleQueueTopic}from"#runtime/schedules/queue-namespace.js";import{isVercelSchedulesDevEnvironment}from"#internal/schedules/dev-environment.js";const EVE_SCHEDULE_COLLECTION_CONSUMER_ROUTE_PATH=`/.well-known/eve/v1/schedules/consumer`,EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES=10;function createEveScheduleQueueTrigger(e){return{type:`queue/v2beta`,topic:deriveEveScheduleQueueTopic(e),retryAfterSeconds:5,initialDelaySeconds:0,maxDeliveries:10}}function usesLocalVercelSchedules(e){return isVercelSchedulesDevEnvironment()&&hasVercelScheduleCollections(e)}function hasVercelScheduleCollections(e){return e.scheduleCollections?.some(e=>e.providerKind===`vercel`)??!1}export{EVE_SCHEDULE_COLLECTION_CONSUMER_ROUTE_PATH,EVE_SCHEDULE_CONSUMER_MAX_DELIVERIES,createEveScheduleQueueTrigger,hasVercelScheduleCollections,usesLocalVercelSchedules};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function isVercelSchedulesDevEnvironment(){return process.env.NODE_ENV===`development`&&process.env.VERCEL_DEPLOYMENT_ID===void 0&&process.env.VERCEL_SCHEDULE_DEV_API_VERSION!==void 0}export{isVercelSchedulesDevEnvironment};
|
|
@@ -159,8 +159,8 @@ export interface VercelEveSandboxEntry {
|
|
|
159
159
|
/**
|
|
160
160
|
* One authored skill exposed to the dashboard.
|
|
161
161
|
*
|
|
162
|
-
* Skills are markdown procedures the model loads on demand
|
|
163
|
-
*
|
|
162
|
+
* Skills are markdown procedures the model loads on demand with
|
|
163
|
+
* `eve__skill({ name })`. The summary lists the available
|
|
164
164
|
* skills by `name` + `description` so the dashboard can render the
|
|
165
165
|
* surface without pulling each skill's full markdown body. Consumers
|
|
166
166
|
* that need the full content can drill in through a dedicated endpoint
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function applyVercelWorkflowWorldDefaults(e
|
|
1
|
+
function applyVercelWorkflowWorldDefaults(e){e.streamFlushIntervalMs??=10}export{applyVercelWorkflowWorldDefaults};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const SEARCH_TOOL_NAME = "eve__search";
|
|
2
|
+
/** Calls a deferred entry or connection tool by name. */
|
|
3
|
+
export declare const CALL_TOOL_NAME = "eve__tool";
|
|
4
|
+
/** Loads a skill by name. */
|
|
5
|
+
export declare const SKILL_TOOL_NAME = "eve__skill";
|
|
6
|
+
/**
|
|
7
|
+
* The name an `eve__skill` call takes once it resolves inside the harness,
|
|
8
|
+
* where it reports as a `load-skill` action named for its skill. The colon
|
|
9
|
+
* keeps it out of the tool namespace, because skills and tools have separate
|
|
10
|
+
* names. Stream events and client message parts never carry it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SKILL_ENTRY_NAME = "eve:load-skill";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const SEARCH_TOOL_NAME=`eve__search`,CALL_TOOL_NAME=`eve__tool`,SKILL_TOOL_NAME=`eve__skill`,SKILL_ENTRY_NAME=`eve:load-skill`;export{CALL_TOOL_NAME,SEARCH_TOOL_NAME,SKILL_ENTRY_NAME,SKILL_TOOL_NAME};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_MESSAGE_STREAM_VERSION}from"#protocol/message.js";const currentMessageStreamVersion=EVE_MESSAGE_STREAM_VERSION;function normalizeMessageStreamEvent(e,t){switch(e){case`21`:case`22`:case`23`:case`24`:return normalizeLegacyMessageStreamEvent(e,t);case`25`:case`26`:return validateDeltaMessageStreamEvent(e,t);default:return assertNever(e)}}function normalizePersistedMessageStreamEvent(e){return e.type===`message.appended`&&`messageSoFar`in e.data||e.type===`reasoning.appended`&&`reasoningSoFar`in e.data||e.type===`action.input.appended`&&`inputTextOffset`in e.data?normalizeLegacyMessageStreamEvent(void 0,e):normalizeMessageStreamEvent(currentMessageStreamVersion,e)}function normalizeLegacyMessageStreamEvent(e,t){if(t.type===`message.appended`)return assertLegacyAppendSnapshot(t.data.messageSoFar,t.data.messageDelta,`message`,e),{data:{messageDelta:t.data.messageDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:`message.appended`};if(t.type===`reasoning.appended`)return assertLegacyAppendSnapshot(t.data.reasoningSoFar,t.data.reasoningDelta,`reasoning`,e),{data:{reasoningDelta:t.data.reasoningDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:`reasoning.appended`};if(t.type===`action.input.appended`){if(e!==void 0&&e!==`24`)throw TypeError(`Invalid action input append for stream version ${e}.`);return assertLegacyActionInputOffset(t.data.inputTextOffset,e),{data:{callId:t.data.callId,inputTextDelta:t.data.inputTextDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,toolName:t.data.toolName,turnId:t.data.turnId},meta:t.meta,type:`action.input.appended`}}return t}function validateDeltaMessageStreamEvent(e,t){return t.type===`message.appended`?(assertAppendDelta(t.data.messageDelta,`message`,e),assertUnsupportedAppendField(t.data,`messageOffset`,`message`,e),assertUnsupportedAppendField(t.data,`messageSoFar`,`message`,e)):t.type===`reasoning.appended`?(assertAppendDelta(t.data.reasoningDelta,`reasoning`,e),assertUnsupportedAppendField(t.data,`reasoningOffset`,`reasoning`,e),assertUnsupportedAppendField(t.data,`reasoningSoFar`,`reasoning`,e)):t.type===`action.input.appended`&&(assertAppendDelta(t.data.inputTextDelta,`action input`,e),assertUnsupportedAppendField(t.data,`inputTextOffset`,`action input`,e)),t}function assertAppendDelta(e,t,n){if(typeof e!=`string`)throw TypeError(`Invalid ${t} append delta for stream version ${n}.`)}function assertUnsupportedAppendField(e,t,n,r){if(t in e)throw TypeError(`Invalid ${n} append shape for stream version ${r}.`)}function assertNever(e){throw TypeError(`Unsupported message stream version: ${String(e)}.`)}function assertLegacyActionInputOffset(e,t){if(!Number.isSafeInteger(e)||e<0){let e=t===void 0?`persisted stream`:`stream version ${t}`;throw TypeError(`Invalid action input append offset for ${e}.`)}}function assertLegacyAppendSnapshot(e,t,n,r){let i=e.length-t.length;if(i<0||e.slice(i)!==t){let e=r===void 0?`persisted stream`:`stream version ${r}`;throw TypeError(`Invalid cumulative ${n} append for ${e}.`)}}export{normalizeMessageStreamEvent,normalizePersistedMessageStreamEvent};
|
|
1
|
+
import{EVE_MESSAGE_STREAM_VERSION}from"#protocol/message.js";const currentMessageStreamVersion=EVE_MESSAGE_STREAM_VERSION;function normalizeMessageStreamEvent(e,t){return nameSkillLoads(normalizeAppendEvent(e,t))}function normalizeAppendEvent(e,t){switch(e){case`21`:case`22`:case`23`:case`24`:return normalizeLegacyMessageStreamEvent(e,t);case`25`:case`26`:return validateDeltaMessageStreamEvent(e,t);default:return assertNever(e)}}function normalizePersistedMessageStreamEvent(e){return e.type===`message.appended`&&`messageSoFar`in e.data||e.type===`reasoning.appended`&&`reasoningSoFar`in e.data||e.type===`action.input.appended`&&`inputTextOffset`in e.data?normalizeLegacyMessageStreamEvent(void 0,e):normalizeMessageStreamEvent(currentMessageStreamVersion,e)}function normalizeLegacyMessageStreamEvent(e,t){if(t.type===`message.appended`)return assertLegacyAppendSnapshot(t.data.messageSoFar,t.data.messageDelta,`message`,e),{data:{messageDelta:t.data.messageDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:`message.appended`};if(t.type===`reasoning.appended`)return assertLegacyAppendSnapshot(t.data.reasoningSoFar,t.data.reasoningDelta,`reasoning`,e),{data:{reasoningDelta:t.data.reasoningDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:`reasoning.appended`};if(t.type===`action.input.appended`){if(e!==void 0&&e!==`24`)throw TypeError(`Invalid action input append for stream version ${e}.`);return assertLegacyActionInputOffset(t.data.inputTextOffset,e),{data:{callId:t.data.callId,inputTextDelta:t.data.inputTextDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,toolName:t.data.toolName,turnId:t.data.turnId},meta:t.meta,type:`action.input.appended`}}return t}function nameSkillLoads(e){return e.type!==`actions.requested`||!e.data.actions.some(isUnnamedSkillLoad)?e:{...e,data:{...e.data,actions:e.data.actions.map(e=>isUnnamedSkillLoad(e)?{...e,name:releasedSkillName(e)}:e)}}}function isUnnamedSkillLoad(e){return e.kind===`load-skill`&&typeof Reflect.get(e,`name`)!=`string`}function releasedSkillName(e){let t=e.input.skill;return typeof t==`string`?t:`load_skill`}function validateDeltaMessageStreamEvent(e,t){return t.type===`message.appended`?(assertAppendDelta(t.data.messageDelta,`message`,e),assertUnsupportedAppendField(t.data,`messageOffset`,`message`,e),assertUnsupportedAppendField(t.data,`messageSoFar`,`message`,e)):t.type===`reasoning.appended`?(assertAppendDelta(t.data.reasoningDelta,`reasoning`,e),assertUnsupportedAppendField(t.data,`reasoningOffset`,`reasoning`,e),assertUnsupportedAppendField(t.data,`reasoningSoFar`,`reasoning`,e)):t.type===`action.input.appended`&&(assertAppendDelta(t.data.inputTextDelta,`action input`,e),assertUnsupportedAppendField(t.data,`inputTextOffset`,`action input`,e)),t}function assertAppendDelta(e,t,n){if(typeof e!=`string`)throw TypeError(`Invalid ${t} append delta for stream version ${n}.`)}function assertUnsupportedAppendField(e,t,n,r){if(t in e)throw TypeError(`Invalid ${n} append shape for stream version ${r}.`)}function assertNever(e){throw TypeError(`Unsupported message stream version: ${String(e)}.`)}function assertLegacyActionInputOffset(e,t){if(!Number.isSafeInteger(e)||e<0){let e=t===void 0?`persisted stream`:`stream version ${t}`;throw TypeError(`Invalid action input append offset for ${e}.`)}}function assertLegacyAppendSnapshot(e,t,n,r){let i=e.length-t.length;if(i<0||e.slice(i)!==t){let e=r===void 0?`persisted stream`:`stream version ${r}`;throw TypeError(`Invalid cumulative ${n} append for ${e}.`)}}export{normalizeMessageStreamEvent,normalizePersistedMessageStreamEvent};
|
|
@@ -399,7 +399,7 @@ export interface TaskSettledStreamEvent {
|
|
|
399
399
|
type: "task.settled";
|
|
400
400
|
}
|
|
401
401
|
/**
|
|
402
|
-
* Why the session cancelled a task call: the model called `
|
|
402
|
+
* Why the session cancelled a task call: the model called `eve__task_cancel`,
|
|
403
403
|
* someone cancelled the turn (or, between turns, the tasks still working), or
|
|
404
404
|
* the turn ended while the task still worked.
|
|
405
405
|
*/
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
export declare const REMOTE_AGENT_PROTOCOL_VERSION = 2;
|
|
8
8
|
/** Error code a receiver answers when the caller speaks another protocol version. */
|
|
9
9
|
export declare const REMOTE_AGENT_PROTOCOL_MISMATCH = "REMOTE_AGENT_PROTOCOL_MISMATCH";
|
|
10
|
+
/** Protocol of eve 0.66–0.68, which sent no version. */
|
|
11
|
+
export declare const UNVERSIONED_REMOTE_AGENT_PROTOCOL = 1;
|
|
10
12
|
/** Reads a peer's protocol version, treating an absent one as the unversioned protocol. */
|
|
11
13
|
export declare function readRemoteAgentProtocolVersion(value: unknown): number;
|
|
12
14
|
/** The caller's message when a remote agent's deployment speaks another version. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const REMOTE_AGENT_PROTOCOL_VERSION=2,REMOTE_AGENT_PROTOCOL_MISMATCH=`REMOTE_AGENT_PROTOCOL_MISMATCH
|
|
1
|
+
const REMOTE_AGENT_PROTOCOL_VERSION=2,REMOTE_AGENT_PROTOCOL_MISMATCH=`REMOTE_AGENT_PROTOCOL_MISMATCH`,UNVERSIONED_REMOTE_AGENT_PROTOCOL=1;function readRemoteAgentProtocolVersion(e){return typeof e==`number`?e:1}function formatRemoteAgentProtocolMismatch(e){return`Remote agent "${e.name}" speaks eve remote agent protocol ${String(e.receiverVersion)}, but this deployment speaks protocol 2. Upgrade both deployments to the same eve release.`}export{REMOTE_AGENT_PROTOCOL_MISMATCH,REMOTE_AGENT_PROTOCOL_VERSION,UNVERSIONED_REMOTE_AGENT_PROTOCOL,formatRemoteAgentProtocolMismatch,readRemoteAgentProtocolVersion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const REPLY_TOOL_NAME=`eve__reply`;export{REPLY_TOOL_NAME};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why `name` is taken, for errors to quote; undefined when the name is free.
|
|
3
|
+
* Nothing authored or dynamic may be named `eve` or start with `eve__`: a
|
|
4
|
+
* connection or extension named `eve` would own every `eve__` name.
|
|
5
|
+
*/
|
|
6
|
+
export declare function eveNamespaceReservation(name: string): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function eveNamespaceReservation(e){return e===`eve`||e.startsWith(`eve__`)?`eve reserves the "eve" namespace for its built-in tools`:void 0}export{eveNamespaceReservation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function initialSessionProjection(){return{authorizations:{},calls:{},candidates:{},inputs:{},nextSequence:0,tasks:{},turns:{}}}function updateTurn(e,t,n){let r=e.turns[t];if(r===void 0)return e;let i=n(r);return i===r?e:{...e,turns:{...e.turns,[t]:i}}}function putTask(e,t){return e.tasks[t.taskId]===t?e:{...e,tasks:{...e.tasks,[t.taskId]:t}}}function putTaskCall(e,t){return e.calls[t.callId]===t?e:{...e,calls:{...e.calls,[t.callId]:t}}}function putCall(e,t){return e.calls[t.callId]===t?e:{...e,calls:{...e.calls,[t.callId]:t}}}function updateTask(e,t,n){let r=e.tasks[t];return r===void 0?e:putTask(e,n(r))}function updateCall(e,t,n){let r=e.calls[t];return r===void 0?e:putCall(e,n(r))}const SETTLED_CALL_STATUSES=new Set([`completed`,`failed`,`rejected`,`cancelled`]);function isSettledCallStatus(e){return SETTLED_CALL_STATUSES.has(e)}function settleCall(e,t,n){if(e.taskId!==void 0||isSettledCallStatus(e.status))return e;let{requestId:r,error:i,...a}=e,o={...a,status:t};return e.requestId!==void 0&&(o.requestId=e.requestId),n!==void 0&&(o.error=n),o}function actionName(e){switch(e.kind){case`load-skill`:return
|
|
1
|
+
function initialSessionProjection(){return{authorizations:{},calls:{},candidates:{},inputs:{},nextSequence:0,tasks:{},turns:{}}}function updateTurn(e,t,n){let r=e.turns[t];if(r===void 0)return e;let i=n(r);return i===r?e:{...e,turns:{...e.turns,[t]:i}}}function putTask(e,t){return e.tasks[t.taskId]===t?e:{...e,tasks:{...e.tasks,[t.taskId]:t}}}function putTaskCall(e,t){return e.calls[t.callId]===t?e:{...e,calls:{...e.calls,[t.callId]:t}}}function putCall(e,t){return e.calls[t.callId]===t?e:{...e,calls:{...e.calls,[t.callId]:t}}}function updateTask(e,t,n){let r=e.tasks[t];return r===void 0?e:putTask(e,n(r))}function updateCall(e,t,n){let r=e.calls[t];return r===void 0?e:putCall(e,n(r))}const SETTLED_CALL_STATUSES=new Set([`completed`,`failed`,`rejected`,`cancelled`]);function isSettledCallStatus(e){return SETTLED_CALL_STATUSES.has(e)}function settleCall(e,t,n){if(e.taskId!==void 0||isSettledCallStatus(e.status))return e;let{requestId:r,error:i,...a}=e,o={...a,status:t};return e.requestId!==void 0&&(o.requestId=e.requestId),n!==void 0&&(o.error=n),o}function actionName(e){switch(e.kind){case`load-skill`:return e.name;case`subagent-call`:case`remote-agent-call`:return e.name;case`tool-call`:case`workflow-tool-call`:return e.toolName}}function resultName(e){switch(e.kind){case`load-skill-result`:return e.name;case`subagent-result`:return e.subagentName;default:return e.toolName}}function callStatusAfterApproval(e){switch(e){case`approved`:return`running`;case`denied`:return`rejected`;case`cancelled`:return`cancelled`;default:return}}function foldSession(e,t){let n=t;switch(n.type){case`session.started`:return e.started?e:{...e,started:!0};case`turn.started`:{let{sequence:t,turnId:r}=n.data,i={turnId:r,sequence:t,status:`active`};return{...e,activeTurnId:r,nextSequence:Math.max(e.nextSequence,t+1),turns:{...e.turns,[r]:i}}}case`step.started`:return updateTurn(e,n.data.turnId,e=>{if(!e.waiting&&e.stepIndex===n.data.stepIndex)return e;let{waiting:t,...r}=e;return{...r,stepIndex:n.data.stepIndex}});case`turn.waiting`:return updateTurn(e,n.data.turnId,e=>e.status===`active`&&!e.waiting?{...e,waiting:!0}:e);case`message.appended`:case`message.completed`:case`result.completed`:return(n.type===`message.appended`?n.data.messageDelta.length>0:n.type!==`message.completed`||(n.data.message?.length??0)>0)?updateTurn(e,n.data.turnId,e=>e.outputStarted?e:{...e,outputStarted:!0}):e;case`turn.completed`:case`turn.cancelled`:case`turn.failed`:{let{turnId:t}=n.data,r=n.type===`turn.completed`?`completed`:n.type===`turn.failed`?`failed`:`cancelled`,{waiting:i,...a}=e.turns[t]??{turnId:t,sequence:n.data.sequence};return{...e,activeTurnId:e.activeTurnId===t?void 0:e.activeTurnId,turns:{...e.turns,[t]:{...a,status:r}}}}case`context.cleared`:return{...e,calls:Object.fromEntries(Object.entries(e.calls).filter(([,e])=>e.taskId!==void 0))};case`session.waiting`:return e.activeTurnId===void 0?e:{...e,activeTurnId:void 0};case`session.completed`:case`session.failed`:{let{activeTurnId:t,...n}=e;return{...n,ended:!0}}case`actions.requested`:{let t;for(let r of n.data.actions)e.calls[r.callId]===void 0&&(t??={...e.calls},t[r.callId]={callId:r.callId,name:actionName(r),turnId:n.data.turnId,stepIndex:n.data.stepIndex,status:`running`});return t===void 0?e:{...e,calls:t}}case`action.result`:{let{result:t,status:r,error:i}=n.data,a=e.calls[t.callId];if(a?.taskId!==void 0)return e;let o=r===`rejected`||i?.code===`TOOL_EXECUTION_DENIED`?`rejected`:r===`failed`||t.isError===!0?`failed`:`completed`;if(a===void 0){let r={callId:t.callId,name:resultName(t),turnId:n.data.turnId,stepIndex:n.data.stepIndex,status:o};return i!==void 0&&(r.error=i),putCall(e,r)}return updateCall(e,t.callId,e=>settleCall(e,o,i))}case`task.started`:{let{callId:t,kind:r,name:i,taskId:a,turnId:o}=n.data,s=e.tasks[a]??{taskId:a,name:i,kind:r,calls:{}},c=e;s.calls[t]===void 0&&(c=putTask(c,putTaskCall(s,{callId:t,turnId:o,status:`working`})));let l=c.calls[t];if(l?.taskId===a)return c;let u={callId:t,name:l?.name??i,stepIndex:l?.stepIndex??0,taskId:a,turnId:l?.turnId??o};return l?.requestId!==void 0&&(u.requestId=l.requestId),putCall(c,u)}case`task.settled`:{let{callId:t,error:r,output:i,status:a,taskId:o}=n.data;return updateTask(e,o,e=>{let n=e.calls[t];if(n===void 0||n.status!==`working`)return e;let o={callId:t,turnId:n.turnId,status:a};return putTaskCall(e,a===`completed`&&i!==void 0?{...o,output:i}:a===`failed`&&r!==void 0?{...o,error:r}:o)})}case`input.requested`:{let t={...e.inputs},r;for(let i of n.data.requests){if(t[i.requestId]!==void 0)continue;let a={request:i,sequence:n.data.sequence,turnId:n.data.turnId,stepIndex:n.data.stepIndex,status:`open`};if(n.data.taskId!==void 0&&(a.taskId=n.data.taskId),n.data.callId!==void 0&&(a.callId=n.data.callId),t[i.requestId]=a,i.kind!==`tool-approval`||isRelayed(n.data))continue;let{callId:o,toolName:s}=i.action;r??={...e.calls};let c=r[o];c?.taskId===void 0&&(c!==void 0&&isSettledCallStatus(c.status)||(r[o]={...c??{callId:o,name:s,turnId:n.data.turnId,stepIndex:n.data.stepIndex},requestId:i.requestId,status:`awaiting-input`}))}return r===void 0?{...e,inputs:t}:{...e,calls:r,inputs:t}}case`approval.candidate`:{let{candidateId:t,outcome:r,requestId:i}=n.data;e={...e,candidates:{...e.candidates,[t]:{candidateId:t,outcome:r,requestId:i}}};let a=e.inputs[n.data.requestId];if(a===void 0||a.status===`settled`||n.data.outcome===`pending`||a.status===`open`)return e;let{response:o,...s}=a;return{...e,inputs:{...e.inputs,[n.data.requestId]:{...s,status:`open`}}}}case`approval.settled`:{let t=e.inputs[n.data.requestId];if(t===void 0||t.status===`settled`)return e;let r=n.data.outcome===`approved`?`approved`:`denied`;return settleApprovalCall({...e,inputs:{...e.inputs,[n.data.requestId]:{...t,status:`settled`,outcome:r}}},t,r)}case`input.resolved`:{let t=e;for(let e of n.data.resolutions){let n=t.inputs[e.requestId];if(n===void 0||n.status===`settled`)continue;let r=e.response??n.response,i={...n,status:`settled`,outcome:e.outcome};r!==void 0&&(i.response=r),t={...t,inputs:{...t.inputs,[e.requestId]:i}},t=settleApprovalCall(t,n,e.outcome)}return t}case`authorization.required`:{let t=n.data.attemptId??n.data.name,r={attemptId:t,name:n.data.name,sequence:n.data.sequence,turnId:n.data.turnId,stepIndex:n.data.stepIndex,status:`required`};return n.data.taskId!==void 0&&(r.taskId=n.data.taskId),n.data.principalId!==void 0&&(r.principalId=n.data.principalId),n.data.candidateId!==void 0&&(r.candidateId=n.data.candidateId),n.data.webhookUrl!==void 0&&(r.awaitsCallback=!0),{...e,authorizations:{...e.authorizations,[t]:r}}}case`authorization.completed`:{let t=n.data.attemptId??n.data.name,r={...e.authorizations[t]??{attemptId:t,name:n.data.name,sequence:n.data.sequence,turnId:n.data.turnId,stepIndex:n.data.stepIndex},status:n.data.outcome};return{...e,authorizations:{...e.authorizations,[t]:r}}}default:return e}}function isRelayed(e){return e.callId!==void 0||e.taskId!==void 0}function settleApprovalCall(e,t,n){if(t.request.kind!==`tool-approval`||isRelayed(t))return e;let r=callStatusAfterApproval(n);return r===void 0?e:updateCall(e,t.request.action.callId,e=>e.status!==`awaiting-input`||e.requestId!==t.request.requestId?e:r===`running`?{...e,status:r}:settleCall(e,r))}function turnCoordinates(e){let t=e.activeTurnId===void 0?void 0:e.turns[e.activeTurnId];return t===void 0?{sequence:e.nextSequence,stepIndex:0,turnId:`turn_${e.nextSequence}`}:{sequence:t.sequence,stepIndex:t.stepIndex??0,turnId:t.turnId}}function openInputs(e){return Object.values(e.inputs).filter(e=>e.status!==`settled`)}function openSignIns(e){return Object.values(e.authorizations).filter(e=>e.status===`required`)}function workingTaskCalls(e){return Object.values(e.tasks).flatMap(e=>Object.values(e.calls).filter(e=>e.status===`working`))}function callStatus(e,t,n={}){let r=e.calls[t];if(r===void 0)return;let i=reportedCallStatus(e,r);if(i!==`running`||r.taskId!==void 0)return i;let a=e.turns[r.turnId];return n.streaming===!1||a!==void 0&&a.status!==`active`?`interrupted`:i}function reportedCallStatus(e,t){if(t.taskId===void 0)return t.status;let n=e.tasks[t.taskId]?.calls[t.callId]?.status;return n===void 0||n===`working`?`running`:n}function pruneSessionProjection(e,t={}){let n=new Set(t.requestIds),r=new Set(t.callIds),i=Object.fromEntries(Object.entries(e.calls).filter(([t,i])=>!isSettledCallStatus(reportedCallStatus(e,i))&&callStatus(e,t)!==`interrupted`||r.has(t)||i.requestId!==void 0&&n.has(i.requestId)));for(let e of Object.values(i))e.requestId!==void 0&&n.add(e.requestId);let a=Object.fromEntries(Object.entries(e.inputs).filter(([e,t])=>t.status!==`settled`||n.has(e))),o=new Set(Object.values(i).flatMap(e=>e.taskId===void 0?[]:[e.callId])),s={};for(let[t,n]of Object.entries(e.tasks)){let e=Object.entries(n.calls).filter(([e,t])=>t.status===`working`||o.has(e));e.length>0&&(s[t]={...n,calls:Object.fromEntries(e)})}let c=Object.fromEntries(Object.entries(e.authorizations).filter(([,e])=>e.status===`required`)),l=new Set([...e.activeTurnId===void 0?[]:[e.activeTurnId],...Object.values(a).map(e=>e.turnId),...Object.values(i).map(e=>e.turnId),...Object.values(c).map(e=>e.turnId)]),u=Object.fromEntries(Object.entries(e.turns).filter(([e])=>l.has(e))),d=Object.fromEntries(Object.entries(e.candidates).filter(([,e])=>e.requestId in a));return{...e,authorizations:c,calls:i,candidates:d,inputs:a,tasks:s,turns:u}}export{callStatus,foldSession,initialSessionProjection,isSettledCallStatus,openInputs,openSignIns,pruneSessionProjection,reportedCallStatus,turnCoordinates,workingTaskCalls};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ActionResultStreamEvent } from "#protocol/message.js";
|
|
2
|
-
export declare const TASK_WAIT_TOOL_NAME = "
|
|
3
|
-
export declare const TASK_CANCEL_TOOL_NAME = "
|
|
4
|
-
/** The task tools' names
|
|
2
|
+
export declare const TASK_WAIT_TOOL_NAME = "eve__task_wait";
|
|
3
|
+
export declare const TASK_CANCEL_TOOL_NAME = "eve__task_cancel";
|
|
4
|
+
/** The task tools' names. */
|
|
5
5
|
export declare const TASK_TOOL_NAMES: readonly string[];
|
|
6
6
|
/**
|
|
7
7
|
* Whether a tool call is the model managing its own tasks. The stream keeps
|
|
8
8
|
* these calls so evals and traces can see them, but activity surfaces hide
|
|
9
9
|
* them: people see the tasks, not the model waiting on or stopping them. The
|
|
10
|
-
*
|
|
10
|
+
* `eve` namespace is reserved, so no authored tool matches.
|
|
11
11
|
*/
|
|
12
12
|
export declare function isTaskControlTool(toolName: string): boolean;
|
|
13
13
|
export declare const TOO_MANY_TASKS_CODE = "TOO_MANY_TASKS";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const TASK_WAIT_TOOL_NAME=`
|
|
1
|
+
const TASK_WAIT_TOOL_NAME=`eve__task_wait`,TASK_CANCEL_TOOL_NAME=`eve__task_cancel`,TASK_TOOL_NAMES=[TASK_WAIT_TOOL_NAME,TASK_CANCEL_TOOL_NAME];function isTaskControlTool(e){return TASK_TOOL_NAMES.includes(e)}const TOO_MANY_TASKS_CODE=`TOO_MANY_TASKS`,UNKNOWN_TASK_CODE=`UNKNOWN_TASK`,TASK_RETRY_ERROR_CODES=[TOO_MANY_TASKS_CODE,UNKNOWN_TASK_CODE];function isTaskRetryRefusal(e){if(e.data.status!==`failed`||e.data.result.kind!==`tool-result`)return!1;let t=e.data.result.output;if(typeof t!=`object`||!t)return!1;let n=Reflect.get(t,`code`);return typeof n==`string`&&TASK_RETRY_ERROR_CODES.includes(n)}export{TASK_CANCEL_TOOL_NAME,TASK_TOOL_NAMES,TASK_WAIT_TOOL_NAME,TOO_MANY_TASKS_CODE,UNKNOWN_TASK_CODE,isTaskControlTool,isTaskRetryRefusal};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{parseInputResponses}from"#shared/input.js";import{defaultDeliverResult}from"#channel/adapter.js";import{ContextContainer,contextStorage}from"#context/container.js";import{GET,POST,defineChannel}from"#public/definitions/channel.js";import{ContextKey}from"#context/key.js";import{DEFAULT_UPLOAD_POLICY}from"#public/channels/upload-policy.js";import{EveAttachmentError}from"#internal/attachments/errors.js";import{isNotImplemented}from"#public/channels/chat-sdk/notImplemented.js";import{promptQueueEvents}from"#channel/prompt-queue.js";import{assertWithinLimit}from"#internal/attachments/limited-read.js";import{Chat,Message,ThreadImpl}from"#compiled/chat/index.js";import{defaultAuthorizationEvents}from"#public/channels/chat-sdk/authorization.js";import{parseChatSdkFileRef}from"#public/channels/chat-sdk/attachment-refs.js";import{decodeInputAction,renderInputRequests}from"#public/channels/chat-sdk/input-actions.js";import{chatSdkInstrumentation}from"#public/channels/chat-sdk/audience.js";const log=createLogger(`chat-sdk.channel`),streamTextByState=new WeakMap,ActiveWebhookKey=new ContextKey(`chat-sdk.active-webhook`);function chatSdkChannel(e){let t=new Chat(e),n=e.inputActionPrefix??`eve_input:`,r=e.streaming??!0,i=e.streamingEditIntervalMs??1e3,a={...defaultEvents(n),...e.events};return t.onAction(async r=>{let i=decodeInputAction(r.actionId,n,r.value);if(i){if(!r.thread)throw Error(`chatSdkChannel input actions require a thread on the Chat SDK action event.`);await bridgeRespond(t,[i],{auth:e.resolveInputAuth?await e.resolveInputAuth(r):null,thread:r.thread.toJSON()})}}),{bot:t,channel:defineChannel({kindHint:`chat-sdk`,turnPolicy:e.turnPolicy,fetchFile:e=>fetchAttachment(t,e),state:initialState(),...chatSdkInstrumentation,context(e){return{bot:t,state:e,streaming:r,streamingEditIntervalMs:i,thread:threadFromState(t,e)}},routes:adapterNames(e.adapters).flatMap(n=>{let r=routeForAdapter(n,e),handler=async(r,i)=>{let a=t.webhooks[n],o=new ContextContainer;return o.setVirtualContext(ActiveWebhookKey,{from:i.from}),contextStorage.run(o,()=>a(r,{...e.webhook,waitUntil(e){i.waitUntil(e)}}))};return[GET(r,handler),POST(r,handler)]}),async receive(e,{from:n}){let r=serializeReceiveTarget(t,e.target);return n(r.id).send(e.message,{auth:e.auth,state:{thread:r}})},deliver(e,t){return recordPrincipalUser(t.state,t.session.auth.current,e),defaultDeliverResult(e)},events:a}),send(e,n){return bridgeSend(t,e,n)},respond(e,n){return bridgeRespond(t,e,n)}}}function defaultEvents(e){async function showPrompt(t,n){if(!t.thread)return!1;let r=await t.thread.post(renderInputRequests([n],e));r.id&&t.state.editSupported!==!1&&(t.state.pendingInputCards={...t.state.pendingInputCards,[r.id]:{requests:[n],resolved:{}}})}async function clearAnsweredCards(t,n){let r=n.thread;if(r)for(let[i,a]of Object.entries(n.state.pendingInputCards??{})){let o=t.resolutions.filter(e=>a.requests.some(t=>t.requestId===e.requestId));if(o.length===0)continue;let s={...a.resolved,...Object.fromEntries(o.map(e=>[e.requestId,e]))},{[i]:c,...l}=n.state.pendingInputCards??{};n.state.pendingInputCards=a.requests.every(e=>s[e.requestId]!==void 0)?l:{...l,[i]:{requests:a.requests,resolved:s}};try{await r.adapter.editMessage(r.id,i,renderInputRequests(a.requests,e,s))}catch(e){if(!isNotImplemented(e)){log.warn(`answered input card edit failed`,{error:e,messageId:i});continue}n.state.editSupported=!1,n.state.pendingInputCards={};return}}}let t=promptQueueEvents(showPrompt);return{...defaultAuthorizationEvents(),async"turn.started"(e,t,n){t.state.pendingToolCallMessage=null,clearStream(t.state),await safeStartTyping(t.thread,`Working...`)},async"actions.requested"(e,t,n){let r=t.state.pendingToolCallMessage;if(t.state.pendingToolCallMessage=null,r){await safeStartTyping(t.thread,truncate(r));return}let i=e.actions.map(
|
|
1
|
+
import{actionLabel,visibleActions}from"#shared/action-label.js";import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{parseInputResponses}from"#shared/input.js";import{defaultDeliverResult}from"#channel/adapter.js";import{ContextContainer,contextStorage}from"#context/container.js";import{GET,POST,defineChannel}from"#public/definitions/channel.js";import{ContextKey}from"#context/key.js";import{DEFAULT_UPLOAD_POLICY}from"#public/channels/upload-policy.js";import{EveAttachmentError}from"#internal/attachments/errors.js";import{isNotImplemented}from"#public/channels/chat-sdk/notImplemented.js";import{promptQueueEvents}from"#channel/prompt-queue.js";import{assertWithinLimit}from"#internal/attachments/limited-read.js";import{Chat,Message,ThreadImpl}from"#compiled/chat/index.js";import{defaultAuthorizationEvents}from"#public/channels/chat-sdk/authorization.js";import{parseChatSdkFileRef}from"#public/channels/chat-sdk/attachment-refs.js";import{decodeInputAction,renderInputRequests}from"#public/channels/chat-sdk/input-actions.js";import{chatSdkInstrumentation}from"#public/channels/chat-sdk/audience.js";const log=createLogger(`chat-sdk.channel`),streamTextByState=new WeakMap,ActiveWebhookKey=new ContextKey(`chat-sdk.active-webhook`);function chatSdkChannel(e){let t=new Chat(e),n=e.inputActionPrefix??`eve_input:`,r=e.streaming??!0,i=e.streamingEditIntervalMs??1e3,a={...defaultEvents(n),...e.events};return t.onAction(async r=>{let i=decodeInputAction(r.actionId,n,r.value);if(i){if(!r.thread)throw Error(`chatSdkChannel input actions require a thread on the Chat SDK action event.`);await bridgeRespond(t,[i],{auth:e.resolveInputAuth?await e.resolveInputAuth(r):null,thread:r.thread.toJSON()})}}),{bot:t,channel:defineChannel({kindHint:`chat-sdk`,turnPolicy:e.turnPolicy,fetchFile:e=>fetchAttachment(t,e),state:initialState(),...chatSdkInstrumentation,context(e){return{bot:t,state:e,streaming:r,streamingEditIntervalMs:i,thread:threadFromState(t,e)}},routes:adapterNames(e.adapters).flatMap(n=>{let r=routeForAdapter(n,e),handler=async(r,i)=>{let a=t.webhooks[n],o=new ContextContainer;return o.setVirtualContext(ActiveWebhookKey,{from:i.from}),contextStorage.run(o,()=>a(r,{...e.webhook,waitUntil(e){i.waitUntil(e)}}))};return[GET(r,handler),POST(r,handler)]}),async receive(e,{from:n}){let r=serializeReceiveTarget(t,e.target);return n(r.id).send(e.message,{auth:e.auth,state:{thread:r}})},deliver(e,t){return recordPrincipalUser(t.state,t.session.auth.current,e),defaultDeliverResult(e)},events:a}),send(e,n){return bridgeSend(t,e,n)},respond(e,n){return bridgeRespond(t,e,n)}}}function defaultEvents(e){async function showPrompt(t,n){if(!t.thread)return!1;let r=await t.thread.post(renderInputRequests([n],e));r.id&&t.state.editSupported!==!1&&(t.state.pendingInputCards={...t.state.pendingInputCards,[r.id]:{requests:[n],resolved:{}}})}async function clearAnsweredCards(t,n){let r=n.thread;if(r)for(let[i,a]of Object.entries(n.state.pendingInputCards??{})){let o=t.resolutions.filter(e=>a.requests.some(t=>t.requestId===e.requestId));if(o.length===0)continue;let s={...a.resolved,...Object.fromEntries(o.map(e=>[e.requestId,e]))},{[i]:c,...l}=n.state.pendingInputCards??{};n.state.pendingInputCards=a.requests.every(e=>s[e.requestId]!==void 0)?l:{...l,[i]:{requests:a.requests,resolved:s}};try{await r.adapter.editMessage(r.id,i,renderInputRequests(a.requests,e,s))}catch(e){if(!isNotImplemented(e)){log.warn(`answered input card edit failed`,{error:e,messageId:i});continue}n.state.editSupported=!1,n.state.pendingInputCards={};return}}}let t=promptQueueEvents(showPrompt);return{...defaultAuthorizationEvents(),async"turn.started"(e,t,n){t.state.pendingToolCallMessage=null,clearStream(t.state),await safeStartTyping(t.thread,`Working...`)},async"actions.requested"(e,t,n){let r=t.state.pendingToolCallMessage;if(t.state.pendingToolCallMessage=null,r){await safeStartTyping(t.thread,truncate(r));return}let i=visibleActions(e.actions).map(t=>actionLabel(t,e.presentation));i.length!==0&&await safeStartTyping(t.thread,truncate(`${i.join(`, `)}...`))},async"message.appended"(e,t,n){if(!t.thread||!canStream(t))return;let r=((t.state.streamStepIndex===e.stepIndex?streamTextByState.get(t.state):void 0)??``)+e.messageDelta;if(!r)return;streamTextByState.set(t.state,r);let i=t.state.anchorMessageId;if(!i||t.state.streamStepIndex!==e.stepIndex){let n=await t.thread.post({markdown:r});t.state.anchorMessageId=n.id,t.state.streamStepIndex=e.stepIndex,t.state.lastEditAtMs=Date.now();return}let a=t.state.lastEditAtMs??0;if(!(Date.now()-a<t.streamingEditIntervalMs))try{await editMessage(t.thread,i,r),t.state.lastEditAtMs=Date.now()}catch(e){if(!isNotImplemented(e))throw e;t.state.editSupported=!1,clearStream(t.state)}},...t,async"input.resolved"(e,n,r){await clearAnsweredCards(e,n),await t[`input.resolved`](e,n)},async"message.completed"(e,t,n){if(e.finishReason===`tool-calls`){t.state.pendingToolCallMessage=e.message?firstNonEmptyLine(e.message)??null:null,e.message?await finalizeStreamedMessage(t,e.message,!1):clearStream(t.state);return}if(t.state.pendingToolCallMessage=null,!e.message){clearStream(t.state);return}await finalizeStreamedMessage(t,e.message,!0)},async"turn.failed"(e,t,n){await postFailure(t.thread,`I hit an error while handling your request`,e)},async"session.failed"(e,t){await postFailure(t.thread,`This session could not recover from an error`,e)}}}async function safeStartTyping(e,t){if(e)try{await e.startTyping(t)}catch(e){if(!isNotImplemented(e))throw e}}async function editMessage(e,t,n){await e.adapter.editMessage(e.id,t,{markdown:n})}async function finalizeStreamedMessage(e,t,n){let r=e.thread;if(!r){clearStream(e.state);return}let i=e.state.anchorMessageId;if(canStream(e)&&i)try{await editMessage(r,i,t)}catch(i){if(!isNotImplemented(i))throw i;e.state.editSupported=!1,n&&await r.post({markdown:t})}else n&&await r.post({markdown:t});clearStream(e.state)}function canStream(e){return e.streaming&&e.state.editSupported!==!1}function clearStream(e){e.anchorMessageId=null,e.lastEditAtMs=null,e.streamStepIndex=null,streamTextByState.delete(e)}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}function truncate(e,t=80){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}async function postFailure(e,t,n){if(!e)return;let r=formatErrorHint(n),i=extractErrorId(n.details);await e.post([`${t}${r}.`,`Please try again, rephrase, or reach out if it keeps failing.`,...i?[`Error id: ${i}`]:[]].join(`
|
|
2
2
|
|
|
3
3
|
`))}async function bridgeSend(e,t,n){let r=activeFrom(`send`),{adapterName:i,auth:a,thread:o,...s}=n,c=serializeThread(e,o,i);return r(c.id).send(t,{...s,auth:a??null,state:{thread:c}})}async function bridgeRespond(e,t,n){let r=activeFrom(`respond`),{adapterName:i,auth:a,thread:o,...s}=n;return r(serializeThread(e,o,i).id).respond(parseInputResponses(t),{...s,auth:a??null})}function recordPrincipalUser(e,t,n){if(t===null)return;let r=(n.state?.thread)?.currentMessage?.author;if(r===void 0||r.isBot===!0||r.isMe)return;let i=e.usersByPrincipal?.[t.principalId];i!==r.userId&&i!==null&&(e.usersByPrincipal={...e.usersByPrincipal,[t.principalId]:i===void 0?r.userId:null})}function activeFrom(e){let t=contextStorage.getStore()?.get(ActiveWebhookKey);if(!t)throw Error(`chatSdkChannel().${e} can only run during a Chat SDK webhook handler for this bridge.`);return t.from}function initialState(){return{pendingAuthMessageIds:{},thread:null}}async function fetchAttachment(e,t){let n=parseChatSdkFileRef(new URL(t));if(n===null)return null;await e.initialize();let r=e.getAdapter(n.adapter).rehydrateAttachment?.(n.attachment);if(r?.fetchData===void 0)throw new EveAttachmentError({adapterKind:`chat-sdk`,kind:`resolver-threw`,message:`the ${n.adapter} adapter can't download it after the webhook returns.`});let i;try{i=await r.fetchData()}catch(e){throw e instanceof EveAttachmentError?e:new EveAttachmentError({adapterKind:`chat-sdk`,cause:e,kind:`resolver-threw`,message:`the ${n.adapter} download failed.`})}let a=Buffer.isBuffer(i)?i:Buffer.from(i);return assertWithinLimit(a,DEFAULT_UPLOAD_POLICY.maxBytes,`chat-sdk`),{bytes:a,mediaType:n.attachment.mimeType}}function threadFromState(e,t){if(!t.thread)return null;try{let n=t.thread;return new ThreadImpl({adapter:e.getAdapter(n.adapterName),channelId:n.channelId,channelVisibility:n.channelVisibility,currentMessage:n.currentMessage?Message.fromJSON(n.currentMessage):void 0,id:n.id,isDM:n.isDM,stateAdapter:e.getState()})}catch(e){return log.warn(`failed to rebuild Chat SDK thread from channel state`,{error:e}),null}}function serializeReceiveTarget(e,t){if(t.thread)return t.thread;if(!t.threadId)throw Error(`chatSdkChannel().receive requires target.thread or target.threadId.`);return serializeThread(e,t.threadId,t.adapterName)}function serializeThread(e,t,n){if(typeof t==`string`){let r=n??inferAdapterName(t),i=e.getAdapter(r);return{_type:`chat:Thread`,adapterName:r,channelId:i.channelIdFromThreadId(t),channelVisibility:i.getChannelVisibility?.(t),id:t,isDM:!1}}return isSerializedThread(t)?t:t.toJSON()}function isSerializedThread(e){return`_type`in e&&e._type===`chat:Thread`}function inferAdapterName(e){let t=e.indexOf(`:`);if(t<=0)throw Error(`chatSdkChannel string thread references require options.adapterName.`);return e.slice(0,t)}function adapterNames(e){return Object.keys(e)}function routeForAdapter(e,t){return t.routes?.[e]||`${(t.route??`/eve/v1`).replace(/\/$/u,``)}/${e}`}export{chatSdkChannel};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{extractErrorId,formatErrorHint}from"#internal/logging.js";import{promptQueueEvents}from"#channel/prompt-queue.js";import{createLinearAgentActivity}from"#public/channels/linear/api.js";import{linearInputRequestSignal,renderLinearInputRequests}from"#public/channels/linear/hitl.js";function defaultLinearAuth(e){let t=e.agentActivity?.user??e.agentSession.creator,n=e.agentActivity?.userId??e.agentSession.creatorId??t?.id??`unknown`,r={action:e.action,agent_session_id:e.agentSession.id,organization_id:e.organizationId??e.agentSession.organizationId??``};if(e.delivery.id!==void 0&&(r.delivery_id=e.delivery.id),e.agentSession.issueId!==void 0&&e.agentSession.issueId!==null&&(r.issue_id=e.agentSession.issueId),e.agentSession.issue?.identifier!==void 0&&(r.issue_identifier=e.agentSession.issue.identifier),t!==void 0){let e=linearUserLabel(t);e!==void 0&&(r.user=e)}return{attributes:r,authenticator:`linear-agent-webhook`,issuer:e.organizationId?`linear:${e.organizationId}`:`linear`,principalId:`linear:${n}`,principalType:`user`,subject:n}}function defaultOnAgentSession(e,t){return t.action!==`created`&&t.action!==`prompted`?null:{auth:defaultLinearAuth(t)}}function createDefaultEvents(e={}){async function showPrompt(t,n){await postActivity(t,e,{body:renderLinearInputRequests([n]),type:`elicitation`},linearInputRequestSignal([n]))}return{async"turn.started"(t,n,r){n.state.pendingToolCallMessage=null,await postActivity(n,e,{body:`Working on this.`,type:`thought`},{ephemeral:!0})},async"actions.requested"(t,n,r){let i=n.state.pendingToolCallMessage;if(n.state.pendingToolCallMessage=null,i){await postActivity(n,e,{body:i,type:`thought`},{ephemeral:!0});return}
|
|
1
|
+
import{actionLabel,visibleActions}from"#shared/action-label.js";import{extractErrorId,formatErrorHint}from"#internal/logging.js";import{promptQueueEvents}from"#channel/prompt-queue.js";import{createLinearAgentActivity}from"#public/channels/linear/api.js";import{linearInputRequestSignal,renderLinearInputRequests}from"#public/channels/linear/hitl.js";function defaultLinearAuth(e){let t=e.agentActivity?.user??e.agentSession.creator,n=e.agentActivity?.userId??e.agentSession.creatorId??t?.id??`unknown`,r={action:e.action,agent_session_id:e.agentSession.id,organization_id:e.organizationId??e.agentSession.organizationId??``};if(e.delivery.id!==void 0&&(r.delivery_id=e.delivery.id),e.agentSession.issueId!==void 0&&e.agentSession.issueId!==null&&(r.issue_id=e.agentSession.issueId),e.agentSession.issue?.identifier!==void 0&&(r.issue_identifier=e.agentSession.issue.identifier),t!==void 0){let e=linearUserLabel(t);e!==void 0&&(r.user=e)}return{attributes:r,authenticator:`linear-agent-webhook`,issuer:e.organizationId?`linear:${e.organizationId}`:`linear`,principalId:`linear:${n}`,principalType:`user`,subject:n}}function defaultOnAgentSession(e,t){return t.action!==`created`&&t.action!==`prompted`?null:{auth:defaultLinearAuth(t)}}function createDefaultEvents(e={}){async function showPrompt(t,n){await postActivity(t,e,{body:renderLinearInputRequests([n]),type:`elicitation`},linearInputRequestSignal([n]))}return{async"turn.started"(t,n,r){n.state.pendingToolCallMessage=null,await postActivity(n,e,{body:`Working on this.`,type:`thought`},{ephemeral:!0})},async"actions.requested"(t,n,r){let i=n.state.pendingToolCallMessage;if(n.state.pendingToolCallMessage=null,i){await postActivity(n,e,{body:i,type:`thought`},{ephemeral:!0});return}let a=visibleActions(t.actions);if(a.length!==0){if(a.length>1){await postActivity(n,e,{action:`Running`,parameter:a.map(e=>actionLabel(e,t.presentation)).join(`, `),type:`action`},{ephemeral:!0});return}for(let r of a)await postActivity(n,e,{action:actionLabel(r,t.presentation),parameter:actionParameter(r),type:`action`},{ephemeral:!0})}},...promptQueueEvents(showPrompt),async"authorization.required"(t,n,r){let i=authorizationDisplayName(t.name,t.authorization?.displayName),a=t.authorization?.url,o=linearUserId(r),s;if(a!==void 0){let e={providerName:i,url:a};o!==void 0&&(e.userId=o),s={signal:`auth`,signalMetadata:e}}await postActivity(n,e,{body:authorizationRequiredBody({displayName:i,instructions:t.authorization?.instructions,userCode:t.authorization?.userCode}),type:`elicitation`},s)},async"authorization.completed"(t,n,r){let i=authorizationDisplayName(t.name,t.authorization?.displayName);if(t.outcome===`authorized`){await postActivity(n,e,{body:`Connected to ${i}. Resuming.`,type:`thought`},{ephemeral:!0});return}let a=t.reason===void 0?``:` (${t.reason})`;await postActivity(n,e,{body:`${i} authorization ${formatAuthorizationOutcome(t.outcome)}${a}.`,type:`thought`})},async"message.completed"(t,n,r){if(t.finishReason===`tool-calls`){n.state.pendingToolCallMessage=t.message?firstNonEmptyLine(t.message)??null:null;return}n.state.pendingToolCallMessage=null,t.message&&await postActivity(n,e,{body:t.message,type:`response`})},async"session.failed"(t,n){let r=formatErrorHint(t),i=extractErrorId(t.details);await postActivity(n,e,{body:[`This session could not recover from an error${r}.`,``,`Start a new Linear agent session to continue.`,...i?[``,`Error id: ${i}`]:[]].join(`
|
|
2
2
|
`),type:`error`})},async"turn.failed"(t,n,r){let i=formatErrorHint(t),a=extractErrorId(t.details);await postActivity(n,e,{body:[`I hit an error while handling your request${i}.`,``,`Please try again, rephrase, or reach out if it keeps failing.`,...a?[``,`Error id: ${a}`]:[]].join(`
|
|
3
3
|
`),type:`error`})}}}function postActivity(e,t,n,r={}){return createLinearAgentActivity({api:t.api,credentials:t.credentials,activity:{agentSessionId:requireAgentSessionId(e.state.agentSessionId),content:n,ephemeral:r.ephemeral,signal:r.signal,signalMetadata:r.signalMetadata}})}function requireAgentSessionId(e){if(e===null)throw Error(`linearChannel: cannot post Agent Activity without an Agent Session id.`);return e}function linearUserLabel(e){return e.displayName??e.name??e.email}function authorizationDisplayName(e,t){return t===void 0?e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1):t}function authorizationRequiredBody(e){return[`Authorization required for ${e.displayName}.`,e.instructions,e.userCode===void 0?void 0:`Code: ${e.userCode}`].filter(e=>e!==void 0&&e.length>0).join(`
|
|
4
4
|
|
|
5
|
-
`)}function linearUserId(e){let t=e.session.auth.current;return t?.authenticator===`linear-agent-webhook`?t.subject:void 0}function formatAuthorizationOutcome(e){return e===`timed-out`?`timed out`:e}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}function
|
|
5
|
+
`)}function linearUserId(e){let t=e.session.auth.current;return t?.authenticator===`linear-agent-webhook`?t.subject:void 0}function formatAuthorizationOutcome(e){return e===`timed-out`?`timed out`:e}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}function actionParameter(e){if(e.description)return e.description;if(e.name)return e.name;if(e.input!==void 0)try{return JSON.stringify(e.input)}catch{return``}return``}export{createDefaultEvents,defaultLinearAuth,defaultOnAgentSession};
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typing-indicator text for the turn's calls. It uses each call's start label,
|
|
3
|
-
* the same text its task card row shows, so both surfaces name a call the same
|
|
4
|
-
* way: `Run pnpm test`, `researcher: Find the March incidents`.
|
|
5
|
-
*/
|
|
6
|
-
import type { ActionPresentationByCallId } from "#protocol/message.js";
|
|
7
|
-
import type { RuntimeActionRequest } from "#shared/action-types.js";
|
|
8
|
-
/** The call's start label, or its tool or agent display title. */
|
|
9
|
-
export declare function actionLabel(action: RuntimeActionRequest, presentation: ActionPresentationByCallId | undefined): string;
|
|
10
1
|
/** The first call's label, plus `+N more` when the model made several calls in one step. */
|
|
11
2
|
export declare function withMoreCalls(label: string, count: number): string;
|
|
12
3
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{displayName}from"#shared/display-name.js";import{AGENT_TOOL_NAME}from"#tools/framework/agent-contract.js";function withMoreCalls(e,t){return t<=1?e:`${e} +${String(t-1)} more`}function waitingOnTasks(e){let[t]=e;return e.length===1&&t!==AGENT_TOOL_NAME?`Waiting on ${displayName(t)}...`:e.length===1?`Waiting on a task...`:`Waiting on ${String(e.length)} tasks...`}function reviewingResults(e){let[t]=e;return t!=null&&t!==AGENT_TOOL_NAME&&e.every(e=>e===t)?`Reviewing ${displayName(t)}'s results...`:`Reviewing results...`}export{reviewingResults,waitingOnTasks,withMoreCalls};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{actionLabel,visibleActions}from"#shared/action-label.js";import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{truncateTypingStatus}from"#public/channels/slack/limits.js";import{buildSlackAuthContext,slackUserIdForPrincipal}from"#public/channels/slack/auth.js";import{workingTaskNames}from"#channel/task-card.js";import{reviewingResults,waitingOnTasks,withMoreCalls}from"#public/channels/slack/action-status.js";import{buildAuthCompletedText,buildAuthEphemeralBlocks,buildAuthEphemeralText,buildAuthRequiredPublicText,formatConnectionDisplayName}from"#public/channels/slack/connections.js";import{approvalEvents}from"#public/channels/slack/approval-cards.js";import{deliverCompletedSlackReply}from"#public/channels/slack/reply-delivery.js";import{clearStatus,hideStatus,reasoningStatus,showStatus}from"#public/channels/slack/thread-status.js";const log=createLogger(`slack.defaults`),streamByState=new WeakMap;function stepStream(e,t,n){let r=streamByState.get(e);if(r?.turnId===t&&r.stepIndex===n)return r;let i={calls:null,reasoning:``,reasoningShownAtMs:null,replyChars:0,stepIndex:n,turnId:t};return streamByState.set(e,i),i}function heldWithin(e,t){return e!=null&&t-e>=0&&t-e<3e3}async function showReasoning(e,t,n){let r=reasoningStatus(t.reasoning,n);if(r===void 0||truncateTypingStatus(r)===e.state.threadStatus?.text)return;let i=Date.now();heldWithin(t.reasoningShownAtMs,i)||(await showStatus(e,r),t.reasoningShownAtMs=i)}function extractSemanticErrorSummary(e){if(typeof e.details!=`object`||e.details===null)return null;let t=e.details;if(typeof t.semanticErrorId!=`string`||t.semanticErrorId.length===0||typeof t.name!=`string`||t.name.length===0)return null;let n=typeof t.message==`string`&&t.message.trim().length>0?t.message.trim():e.message?.trim();if(!n)return null;let r=typeof t.hint==`string`&&t.hint.trim().length>0?t.hint.trim():void 0;return r===void 0?{message:n,name:t.name}:{hint:r,message:n,name:t.name}}function formatSemanticErrorBlock(e,t){return[`### ${e.name}`,``,e.message,...e.hint?[``,`**How to fix**`,e.hint]:[],...t?[``,`**Error id:**`,`\`${t}\``]:[]].flatMap(e=>e.split(`
|
|
2
2
|
`)).map(e=>e.length>0?`> ${e}`:`> `).join(`
|
|
3
3
|
`)}function formatSemanticErrorReply(e){return[`${e.introduction}.`,``,formatSemanticErrorBlock(e.summary,e.errorId),...e.summary.hint?[]:[``,e.nextStep],...e.summary.hint&&e.followUp?[``,e.followUp]:[]].join(`
|
|
4
|
-
`)}function defaultSlackAuth(e,t){let n=e.author;return n?buildSlackAuthContext({channelId:t.slack.channelId,fullName:n.fullName,installationTeamId:e.installationTeamId,isBot:n.isBot,teamId:e.teamId,threadTs:t.slack.threadTs,userId:n.userId,userName:n.userName}):null}function defaultOnMessage(e,t){return{auth:defaultSlackAuth(t,e)}}async function defaultReceived(e,t){await t.thread.startTyping(`Thinking...`)}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}const defaultEvents={...approvalEvents,async"turn.waiting"(e,t,n){if(e.on===`input`){await hideStatus(t);return}let r=workingTaskNames(t.state.taskCards?.[e.turnId]?.turn);r.length>0&&await showStatus(t,waitingOnTasks(r))},async"task.settled"(e,t,n){if(e.cancel!==void 0)return;let r=t.state.pendingTaskResults,i=r?.turnId===e.turnId?r.names:[],a=e.kind===`agent`&&e.name!==void 0?e.name:null;t.state.pendingTaskResults={names:[...i,a],turnId:e.turnId}},async"step.started"(e,t,n){if(e.stepIndex===0)return;let r=t.state.pendingTaskResults;t.state.pendingTaskResults=null;let i=r?.turnId===e.turnId?reviewingResults(r.names):t.state.threadStatus?.text??`Thinking...`;await showStatus(t,i,{force:!0})},async"turn.started"(e,t,n){t.state.pendingTaskResults=null,t.state.pendingToolCallMessage=null,streamByState.delete(t.state),await showStatus(t,`Thinking...`,{force:!0})},async"turn.completed"(e,t,n){await clearStatus(t)},async"reasoning.appended"(e,t,n){let r=stepStream(t.state,e.turnId,e.stepIndex);r.reasoning===``&&(r.reasoningShownAtMs=null),r.reasoning+=e.reasoningDelta,await showReasoning(t,r)},async"reasoning.completed"(e,t,n){let r=stepStream(t.state,e.turnId,e.stepIndex);r.reasoning=e.reasoning,await showReasoning(t,r,{complete:!0}),r.reasoning=``},async"message.appended"(e,t,n){let r=stepStream(t.state,e.turnId,e.stepIndex),i=r.replyChars;r.replyChars+=e.messageDelta.length,i<280&&r.replyChars>=280&&await showStatus(t,`Writing a reply...`)},async"actions.requested"(e,t,n){let r=t.state.pendingToolCallMessage;t.state.pendingToolCallMessage=null;let i=e.actions
|
|
4
|
+
`)}function defaultSlackAuth(e,t){let n=e.author;return n?buildSlackAuthContext({channelId:t.slack.channelId,fullName:n.fullName,installationTeamId:e.installationTeamId,isBot:n.isBot,teamId:e.teamId,threadTs:t.slack.threadTs,userId:n.userId,userName:n.userName}):null}function defaultOnMessage(e,t){return{auth:defaultSlackAuth(t,e)}}async function defaultReceived(e,t){await t.thread.startTyping(`Thinking...`)}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}const defaultEvents={...approvalEvents,async"turn.waiting"(e,t,n){if(e.on===`input`){await hideStatus(t);return}let r=workingTaskNames(t.state.taskCards?.[e.turnId]?.turn);r.length>0&&await showStatus(t,waitingOnTasks(r))},async"task.settled"(e,t,n){if(e.cancel!==void 0)return;let r=t.state.pendingTaskResults,i=r?.turnId===e.turnId?r.names:[],a=e.kind===`agent`&&e.name!==void 0?e.name:null;t.state.pendingTaskResults={names:[...i,a],turnId:e.turnId}},async"step.started"(e,t,n){if(e.stepIndex===0)return;let r=t.state.pendingTaskResults;t.state.pendingTaskResults=null;let i=r?.turnId===e.turnId?reviewingResults(r.names):t.state.threadStatus?.text??`Thinking...`;await showStatus(t,i,{force:!0})},async"turn.started"(e,t,n){t.state.pendingTaskResults=null,t.state.pendingToolCallMessage=null,streamByState.delete(t.state),await showStatus(t,`Thinking...`,{force:!0})},async"turn.completed"(e,t,n){await clearStatus(t)},async"reasoning.appended"(e,t,n){let r=stepStream(t.state,e.turnId,e.stepIndex);r.reasoning===``&&(r.reasoningShownAtMs=null),r.reasoning+=e.reasoningDelta,await showReasoning(t,r)},async"reasoning.completed"(e,t,n){let r=stepStream(t.state,e.turnId,e.stepIndex);r.reasoning=e.reasoning,await showReasoning(t,r,{complete:!0}),r.reasoning=``},async"message.appended"(e,t,n){let r=stepStream(t.state,e.turnId,e.stepIndex),i=r.replyChars;r.replyChars+=e.messageDelta.length,i<280&&r.replyChars>=280&&await showStatus(t,`Writing a reply...`)},async"actions.requested"(e,t,n){let r=t.state.pendingToolCallMessage;t.state.pendingToolCallMessage=null;let i=visibleActions(e.actions);if(!r&&i.length===0)return;let a=stepStream(t.state,e.turnId,e.stepIndex),o=!r&&a.calls?{...a.calls,count:a.calls.count+i.length}:{count:i.length,label:r??actionLabel(i[0],e.presentation),narrated:r!=null};a.calls=o,await showStatus(t,o.narrated?o.label:withMoreCalls(o.label,o.count))},async"action.partial"(e,t,n){let r=e.presentation?.[e.result.callId]?.label;r&&!heldWithin(t.state.threadStatus?.atMs,Date.now())&&await showStatus(t,r)},async"action.result"(e,t,n){let r=e.presentation?.[e.result.callId]?.label;r&&await showStatus(t,r)},async"message.completed"(e,t,n){if(e.finishReason===`tool-calls`){t.state.pendingToolCallMessage=e.message?firstNonEmptyLine(e.message)??null:null;return}if(t.state.pendingToolCallMessage=null,!e.message){await clearStatus(t);return}t.state.threadStatus=null,await deliverCompletedSlackReply(t,e.message,{turnId:e.turnId})},async"turn.failed"(e,t,n){let r=extractErrorId(e.details),i=extractSemanticErrorSummary(e);if(i!==null){await t.thread.post(formatSemanticErrorReply({errorId:r,introduction:`I hit an error while handling your request`,nextStep:`Please try again, rephrase, or reach out if it keeps failing.`,summary:i}));return}let a=formatErrorHint(e);await t.thread.post([`I hit an error while handling your request${a}.`,``,`Please try again, rephrase, or reach out if it keeps failing.`,...r?[``,`_Error id: \`${r}\`_`]:[]].join(`
|
|
5
5
|
`))},async"session.failed"(e,t){let n=extractErrorId(e.details),r=extractSemanticErrorSummary(e);if(r!==null){await t.thread.post(formatSemanticErrorReply({errorId:n,followUp:`Start a new thread to continue — I can't pick this one back up.`,introduction:`This session couldn't recover from an error`,nextStep:`Resolve the issue, then start a new thread — I can't pick this one back up.`,summary:r}));return}let i=formatErrorHint(e);await t.thread.post([`This session couldn't recover from an error${i}.`,``,`Start a new thread to continue — I can't pick this one back up.`,...n?[``,`_Error id: \`${n}\`_`]:[]].join(`
|
|
6
6
|
`))},async"authorization.required"(e,t,n){let r=e.authorization?.displayName??formatConnectionDisplayName(e.name),i=slackUserIdForPrincipal(t.state,e.principalId)??null,a=e.authorization?.url,o=t.state.pendingAuthMessageTs??{};if(e.candidateId===void 0&&o[e.name]===void 0){let n=buildAuthRequiredPublicText({displayName:r,recipientUserId:i});try{let r=await t.thread.post(n);r.id&&(t.state.pendingAuthMessageTs={...o,[e.name]:r.id})}catch(t){log.error(`Slack auth public message delivery failed`,{name:e.name,error:t})}}let s=e.authorization?.instructions;if(i&&(a||s)){let{channelId:n,threadTs:o}=t.state,c={cancel:e.candidateId===void 0&&n&&o&&e.turnId?{channelId:n,threadTs:o,turnId:e.turnId}:void 0,displayName:r,instructions:s,url:a,userCode:e.authorization?.userCode};try{await t.thread.postEphemeral(i,{blocks:buildAuthEphemeralBlocks(c),text:buildAuthEphemeralText(c)})}catch(t){log.error(`Slack auth ephemeral delivery failed`,{name:e.name,error:t})}}},async"authorization.completed"(e,t,n){let r=e.authorization?.displayName??formatConnectionDisplayName(e.name);e.outcome===`authorized`&&e.candidateId===void 0&&await showStatus(t,`Connected to ${r}. Resuming...`,{force:!0});let i=t.state.pendingAuthMessageTs??{},a=i[e.name];if(a===void 0)return;let o=buildAuthCompletedText({displayName:r,outcome:e.outcome,reason:e.reason});try{await t.slack.request(`chat.update`,{channel:t.slack.channelId,ts:a,text:o})}catch(t){log.error(`Slack auth status edit failed`,{name:e.name,error:t})}let s={...i};delete s[e.name],t.state.pendingAuthMessageTs=s}};export{defaultEvents,defaultOnMessage,defaultReceived,defaultSlackAuth};
|
|
@@ -5,7 +5,7 @@ import type { SlackChannelInternalEvents } from "#public/channels/slack/slackCha
|
|
|
5
5
|
* eve's default task card: a `task_card` block for one task, or a `plan` block
|
|
6
6
|
* for several, and no card for a turn that started none. A settled task shows
|
|
7
7
|
* one line about how it ended and how long it took. A task the model cancelled
|
|
8
|
-
* with `
|
|
8
|
+
* with `eve__task_cancel` shows as done, since it no longer needed the work; a
|
|
9
9
|
* failed task, or one stopped any other way, shows as an error.
|
|
10
10
|
*/
|
|
11
11
|
export declare function renderDefaultSlackTaskCard(view: TaskCardView): SlackTaskCard | null;
|
|
@@ -40,8 +40,8 @@ export interface McpClientConnectionDefinition {
|
|
|
40
40
|
/**
|
|
41
41
|
* Human-readable summary of the connection and its tools.
|
|
42
42
|
*
|
|
43
|
-
* The model sees it in the
|
|
44
|
-
*
|
|
43
|
+
* The model sees it in the catalog listing eve announces, so it can
|
|
44
|
+
* choose which connection to search with `eve__search`.
|
|
45
45
|
*/
|
|
46
46
|
readonly description: string;
|
|
47
47
|
/**
|
|
@@ -99,8 +99,8 @@ export interface McpClientConnectionDefinition {
|
|
|
99
99
|
*/
|
|
100
100
|
toolCall?: ConnectionToolCallDefinition;
|
|
101
101
|
/**
|
|
102
|
-
* Client-side tool filter. When set, `
|
|
103
|
-
*
|
|
102
|
+
* Client-side tool filter. When set, `eve__search` returns and `eve__tool`
|
|
103
|
+
* calls only tools whose names pass the filter.
|
|
104
104
|
*
|
|
105
105
|
* Specify exactly one of `allow` or `block`.
|
|
106
106
|
*/
|
|
@@ -17,8 +17,8 @@ export type OpenAPISpecSource = string | Record<string, unknown>;
|
|
|
17
17
|
* `"vercel"`.
|
|
18
18
|
*
|
|
19
19
|
* Each operation in the document becomes a connection tool the model can
|
|
20
|
-
* find with `
|
|
21
|
-
* report the call
|
|
20
|
+
* find with `eve__search` and call with `eve__tool` as `vercel__getProjects`, the
|
|
21
|
+
* name events report the call under. The tool name is the operation's
|
|
22
22
|
* `operationId`; operations without one get a deterministic synthesized
|
|
23
23
|
* name (`<method>_<sanitized-path>`).
|
|
24
24
|
*
|
|
@@ -46,8 +46,8 @@ export interface OpenAPIConnectionDefinition {
|
|
|
46
46
|
/**
|
|
47
47
|
* Human-readable summary of the connection and its operations.
|
|
48
48
|
*
|
|
49
|
-
* The model sees it in the
|
|
50
|
-
*
|
|
49
|
+
* The model sees it in the catalog listing eve announces, so it can
|
|
50
|
+
* choose which connection to search.
|
|
51
51
|
*/
|
|
52
52
|
readonly description: string;
|
|
53
53
|
/**
|
|
@@ -100,9 +100,8 @@ export interface OpenAPIConnectionDefinition {
|
|
|
100
100
|
*/
|
|
101
101
|
toolCall?: ConnectionToolCallDefinition;
|
|
102
102
|
/**
|
|
103
|
-
* Operation filter keyed on `operationId`. When set,
|
|
104
|
-
*
|
|
105
|
-
* operations whose id passes the filter.
|
|
103
|
+
* Operation filter keyed on `operationId`. When set, the model can find
|
|
104
|
+
* and call only operations whose id passes the filter.
|
|
106
105
|
*
|
|
107
106
|
* Specify exactly one of `allow` or `block`. Mirrors `tools` on MCP
|
|
108
107
|
* connections, but names operations rather than tools.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HeadersValue } from "#client/types.js";
|
|
2
2
|
import type { OutboundAuthFn } from "#public/agents/auth.js";
|
|
3
|
+
import type { AgentToolExposure } from "#shared/agent-definition.js";
|
|
3
4
|
/**
|
|
4
5
|
* Base URL of a remote eve deployment, either a static string or a function
|
|
5
6
|
* resolved at runtime. Use the function form to read `process.env` for a URL
|
|
@@ -45,10 +46,12 @@ export interface RemoteAgentDefinition {
|
|
|
45
46
|
*/
|
|
46
47
|
readonly path: string;
|
|
47
48
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
49
|
+
* How eve exposes this remote agent to the parent model: `true` lists it as
|
|
50
|
+
* a tool, `"deferred"` makes it a catalog entry the model finds with
|
|
51
|
+
* `eve__search` and calls with `eve__tool`, and `false` keeps it callable only from
|
|
52
|
+
* workflow tools. Defaults to `true`.
|
|
50
53
|
*/
|
|
51
|
-
readonly tool?:
|
|
54
|
+
readonly tool?: AgentToolExposure;
|
|
52
55
|
/**
|
|
53
56
|
* Base URL of the remote eve deployment to call. Accepts a static string
|
|
54
57
|
* (baked at compile time) or a function resolved at runtime — use the
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HeadersValue } from "#client/types.js";
|
|
2
2
|
import { type OutboundAuthFn } from "#public/agents/auth.js";
|
|
3
3
|
import { type RemoteAgentDefinition, type RemoteAgentUrl } from "#public/definitions/remote-agent.js";
|
|
4
|
+
import type { AgentToolExposure } from "#shared/agent-definition.js";
|
|
4
5
|
/** Runtime transport for one workspace peer. */
|
|
5
6
|
export interface WorkspaceAgentTransport {
|
|
6
7
|
readonly auth?: OutboundAuthFn;
|
|
@@ -15,10 +16,12 @@ export interface WorkspaceAgentDefinition {
|
|
|
15
16
|
/** Name of the peer workspace member, such as `research`. */
|
|
16
17
|
readonly name: string;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* How eve exposes this workspace peer to the parent model: `true` lists it
|
|
20
|
+
* as a tool, `"deferred"` makes it a catalog entry the model finds with
|
|
21
|
+
* `eve__search` and calls with `eve__tool`, and `false` keeps it callable only from
|
|
22
|
+
* workflow tools. Defaults to `true`.
|
|
20
23
|
*/
|
|
21
|
-
readonly tool?:
|
|
24
|
+
readonly tool?: AgentToolExposure;
|
|
22
25
|
/** Overrides environment-aware workspace routing and service authentication. */
|
|
23
26
|
readonly transport?: WorkspaceAgentTransport;
|
|
24
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Experimental dynamic schedule subscriptions. APIs may change without notice. */
|
|
2
2
|
export { schedules } from "#public/experimental/schedules/client.js";
|
|
3
|
-
export { defineDynamicSchedules, type DefinedDynamicSchedules, type DynamicSchedulesDefinition, type DynamicSchedulesRunArgs, type DynamicSchedulesToFn, type ScheduleCreateApproval, type ScheduleApprovals, type ScheduleClient, type ScheduleClientCreate, type ScheduleCreate, type ScheduleExpression, type ScheduleTiming, type ScheduleList, type ScheduleOccurrence, type ScheduleOccurrenceIdentity, type SchedulePrincipalReference, type ScheduleOccurrenceEvent, type SchedulePage, type ScheduleProvider, type ScheduleRecord, type ScheduleScopeContext, type ScheduleScopeResolverResult, type ScheduleOperation, type ScheduleState, } from "#public/schedules/subscription.js";
|
|
3
|
+
export { defineDynamicSchedules, type DefinedDynamicSchedules, type DynamicSchedulesDefinition, type DynamicSchedulesRunArgs, type DynamicSchedulesToFn, type ScheduleCreateApproval, type ScheduleApprovals, type ScheduleClient, type ScheduleClientCreate, type ScheduleClientUpdate, type SchedulePatch, type ScheduleCreate, type ScheduleExpression, type ScheduleTiming, type ScheduleList, type ScheduleOccurrence, type ScheduleOccurrenceIdentity, type SchedulePrincipalReference, type ScheduleOccurrenceEvent, type SchedulePage, type ScheduleProvider, type ScheduleRecord, type ScheduleScopeContext, type ScheduleScopeResolverResult, type ScheduleOperation, type ScheduleState, } from "#public/schedules/subscription.js";
|
|
4
4
|
export type { ScheduleDelivery, ScheduleDeliveryTarget, ScheduleProviderContext, } from "#runtime/schedules/provider-types.js";
|
|
5
5
|
export { byPrincipal } from "#public/schedules/scope.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash,randomUUID}from"node:crypto";function inMemoryScheduleProvider(e={}){let t=new Map,n=new Map,r=new Map,i=new Set,a=new Set,o=e.now??(()=>new Date);return{kind:`in-memory`,async create(e,a){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,a.name);if(t.has(n))throw Error(`Schedule ${JSON.stringify(a.name)} already exists.`);let s=o().getTime(),c={createdAt:s,expression:normalizeExpression(a.expression),payload:a.payload,name:a.name,scheduleId:allocateScheduleId(e,a.name,r,i),state:a.expression.type===`single`&&Date.parse(a.expression.at)<=s?`completed`:`active`,target:e.target,updatedAt:s};return t.set(n,c),publicRecord(c)})},async list(e,n){let r=[...t.entries()].filter(([t])=>t.startsWith(collectionPrefix(e))).map(([,e])=>publicRecord(e)).sort((e,t)=>e.name.localeCompare(t.name)),i=decodeCursor(n.cursor),a=normalizeLimit(n.limit),o=r.slice(i,i+a),s=i+o.length;return{cursor:s<r.length?String(s):null,data:o}},async get(e,n){let r=t.get(scheduleKey(e,n));return r===void 0?null:publicRecord(r)},async enable(e,r){return setState(t,n,e,r,`active`,o)},async disable(e,r){return setState(t,n,e,r,`inactive`,o)},async invoke(e,r){let i=n.get(e.operationId);if(i!==void 0){e.target.deliver!==void 0&&await e.target.deliver(i);return}let s=requireSchedule(t,scheduleKey(e,r),r);if(s.state===`completed`)throw Error(`Completed schedule ${JSON.stringify(r)} cannot be invoked.`);let c=o().toISOString(),l={payload:s.payload,occurrence:{executionId:allocateOccurrenceId(e.operationId,a),name:s.name,scheduleId:s.scheduleId,scheduledAt:c}};n.set(e.operationId,l),s.target.deliver!==void 0&&await s.target.deliver(l)},async delete(e,i){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,i),a=t.delete(n);return a&&r.delete(n),a})}}}async function setState(e,t,n,r,i,a){return withOperationResult(t,n.operationId,()=>{let t=scheduleKey(n,r),o={...requireSchedule(e,t,r),state:i,updatedAt:a().getTime()};return e.set(t,o),publicRecord(o)})}function requireSchedule(e,t,n){let r=e.get(t);if(r===void 0)throw Error(`Schedule ${JSON.stringify(n)} was not found.`);return r}function withOperationResult(e,t,n){if(e.has(t))return e.get(t);let r=n();return e.set(t,r),r}function allocateOccurrenceId(e,t){let n=`manual_${createHash(`sha256`).update(e).digest(`base64url`)}`,r=n,i=0;for(;t.has(r);)r=`${n}_${++i}`;return t.add(r),r}function normalizeExpression(e){if(e.type===`cron`){let t={type:`cron`,cron:e.cron.trim().replace(/\s+/gu,` `)};return e.timezone!==void 0&&(t.timezone=e.timezone),e.jitter!==void 0&&(t.jitter=e.jitter),t}let t={type:`single`,at:e.at};return e.timezone!==void 0&&(t.timezone=e.timezone),t}function publicRecord(e){return{createdAt:e.createdAt,expression:e.expression,name:e.name,scheduleId:e.scheduleId,state:e.state,updatedAt:e.updatedAt}}function collectionPrefix(e){return`${e.collection}\0${e.namespace}\0`}function scheduleKey(e,t){return`${collectionPrefix(e)}${t}`}function allocateScheduleId(e,t,n,r){let i=scheduleKey(e,t),a=n.get(i);if(a!==void 0)return a;let o;do o=`mem_${createHash(`sha256`).update(`${i}:${randomUUID()}`).digest(`hex`)}`;while(r.has(o));return n.set(i,o),r.add(o),o}function normalizeLimit(e){if(e===void 0)return 20;if(!Number.isSafeInteger(e)||e<1||e>100)throw Error(`Schedule list limit must be an integer from 1 through 100.`);return e}function decodeCursor(e){if(e===void 0)return 0;let t=Number(e);if(!Number.isSafeInteger(t)||t<0)throw Error(`Invalid schedule cursor.`);return t}export{inMemoryScheduleProvider};
|
|
1
|
+
import{createHash,randomUUID}from"node:crypto";function inMemoryScheduleProvider(e={}){let t=new Map,n=new Map,r=new Map,i=new Set,a=new Set,o=e.now??(()=>new Date);return{kind:`in-memory`,async create(e,a){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,a.name);if(t.has(n))throw Error(`Schedule ${JSON.stringify(a.name)} already exists.`);let s=o().getTime(),c={createdAt:s,expression:normalizeExpression(a.expression),payload:a.payload,name:a.name,scheduleId:allocateScheduleId(e,a.name,r,i),state:a.expression.type===`single`&&Date.parse(a.expression.at)<=s?`completed`:`active`,target:e.target,updatedAt:s};return t.set(n,c),publicRecord(c)})},async list(e,n){let r=[...t.entries()].filter(([t])=>t.startsWith(collectionPrefix(e))).map(([,e])=>publicRecord(e)).sort((e,t)=>e.name.localeCompare(t.name)),i=decodeCursor(n.cursor),a=normalizeLimit(n.limit),o=r.slice(i,i+a),s=i+o.length;return{cursor:s<r.length?String(s):null,data:o}},async get(e,n){let r=t.get(scheduleKey(e,n));return r===void 0?null:publicRecord(r)},async update(e,r,i){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,r),a=requireSchedule(t,n,r),s={...a,expression:i.expression===void 0?a.expression:normalizeExpression(i.expression),payload:i.payload===void 0?a.payload:i.payload,updatedAt:o().getTime()};return t.set(n,s),publicRecord(s)})},async enable(e,r){return setState(t,n,e,r,`active`,o)},async disable(e,r){return setState(t,n,e,r,`inactive`,o)},async invoke(e,r){let i=n.get(e.operationId);if(i!==void 0){e.target.deliver!==void 0&&await e.target.deliver(i);return}let s=requireSchedule(t,scheduleKey(e,r),r);if(s.state===`completed`)throw Error(`Completed schedule ${JSON.stringify(r)} cannot be invoked.`);let c=o().toISOString(),l={payload:s.payload,occurrence:{executionId:allocateOccurrenceId(e.operationId,a),name:s.name,scheduleId:s.scheduleId,scheduledAt:c}};n.set(e.operationId,l),s.target.deliver!==void 0&&await s.target.deliver(l)},async delete(e,i){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,i),a=t.delete(n);return a&&r.delete(n),a})}}}async function setState(e,t,n,r,i,a){return withOperationResult(t,n.operationId,()=>{let t=scheduleKey(n,r),o={...requireSchedule(e,t,r),state:i,updatedAt:a().getTime()};return e.set(t,o),publicRecord(o)})}function requireSchedule(e,t,n){let r=e.get(t);if(r===void 0)throw Error(`Schedule ${JSON.stringify(n)} was not found.`);return r}function withOperationResult(e,t,n){if(e.has(t))return e.get(t);let r=n();return e.set(t,r),r}function allocateOccurrenceId(e,t){let n=`manual_${createHash(`sha256`).update(e).digest(`base64url`)}`,r=n,i=0;for(;t.has(r);)r=`${n}_${++i}`;return t.add(r),r}function normalizeExpression(e){if(e.type===`cron`){let t={type:`cron`,cron:e.cron.trim().replace(/\s+/gu,` `)};return e.timezone!==void 0&&(t.timezone=e.timezone),e.jitter!==void 0&&(t.jitter=e.jitter),t}let t={type:`single`,at:e.at};return e.timezone!==void 0&&(t.timezone=e.timezone),t}function publicRecord(e){return{createdAt:e.createdAt,expression:e.expression,name:e.name,scheduleId:e.scheduleId,state:e.state,updatedAt:e.updatedAt}}function collectionPrefix(e){return`${e.collection}\0${e.namespace}\0`}function scheduleKey(e,t){return`${collectionPrefix(e)}${t}`}function allocateScheduleId(e,t,n,r){let i=scheduleKey(e,t),a=n.get(i);if(a!==void 0)return a;let o;do o=`mem_${createHash(`sha256`).update(`${i}:${randomUUID()}`).digest(`hex`)}`;while(r.has(o));return n.set(i,o),r.add(o),o}function normalizeLimit(e){if(e===void 0)return 20;if(!Number.isSafeInteger(e)||e<1||e>100)throw Error(`Schedule list limit must be an integer from 1 through 100.`);return e}function decodeCursor(e){if(e===void 0)return 0;let t=Number(e);if(!Number.isSafeInteger(t)||t<0)throw Error(`Invalid schedule cursor.`);return t}export{inMemoryScheduleProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{deriveEveScheduleQueueTopic}from"#runtime/schedules/queue-namespace.js";import{inMemoryScheduleProvider}from"#public/schedules/providers/in-memory.js";const DEVELOPMENT_PROVIDER=inMemoryScheduleProvider(),CLIENT_OPTIONS=new WeakMap;function readVercelScheduleClientOptions(e){return CLIENT_OPTIONS.get(e)}function vercelScheduleProvider(e={}){if(isEveDevEnvironment())return DEVELOPMENT_PROVIDER;let client=t=>createClient(e,t),t={kind:`vercel`,async create(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).create({expression:toVercelExpression(t.expression),jitter:t.expression.type===`cron`?t.expression.jitter:void 0,name:t.name,namespace:e.namespace,payload:createDispatchPayload(e,t.payload),target:{topic:deriveEveScheduleQueueTopic(e.target.key)},timezone:t.expression.timezone}))},async list(e,t){let n=t.cursor?.trim()||void 0,r={namespace:e.namespace};n!==void 0&&(r.cursor=n),t.limit!==void 0&&(r.limit=t.limit);let i=await(await client(e.abortSignal)).list(r);return{cursor:i.cursor,data:i.data.map(fromVercelSchedule)}},async get(e,t){let n=await getScheduleOrNull(await client(e.abortSignal),t,e.namespace);return n===null?null:fromVercelSchedule(n)},async enable(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).enable({name:t,namespace:e.namespace}))},async disable(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).disable({name:t,namespace:e.namespace}))},async invoke(e,t){await(await client(e.abortSignal)).invoke({name:t,namespace:e.namespace})},async delete(e,t){try{return await(await client(e.abortSignal)).delete({name:t,namespace:e.namespace}),!0}catch(e){if(isNotFoundError(e))return!1;throw e}}};return CLIENT_OPTIONS.set(t,e),t}async function createClient(e,t){assertSupportedVercelEnvironment();let{SchedulesClient:n}=await import(`#compiled/@vercel/schedules/index.js`);t.throwIfAborted();let r=e.fetch??fetch;return new n({...e,fetch:(e,n)=>r(e,{...n,signal:t})})}function createDispatchPayload(e,t){return{eve:{application:e.target.key,collection:e.collection,version:1},payload:t}}function toVercelExpression(e){return e.type===`cron`?{type:`cron`,cron:e.cron}:{type:`single`,at:e.at}}function fromVercelSchedule(e){let t;if(e.expression.type===`cron`){let n={type:`cron`,cron:e.expression.cron,timezone:e.timezone};e.jitter!==void 0&&(n.jitter=e.jitter),t=n}else t={type:`single`,at:e.expression.at,timezone:e.timezone};return{createdAt:e.createdAt,expression:t,name:e.name,scheduleId:e.scheduleId,state:e.state,updatedAt:e.updatedAt}}async function getScheduleOrNull(e,t,n){try{return await e.get({name:t,namespace:n})}catch(e){if(isNotFoundError(e))return null;throw e}}function isNotFoundError(e){return typeof e==`object`&&!!e&&Reflect.get(e,`name`)===`SchedulesApiError`&&Reflect.get(e,`status`)===404}function assertSupportedVercelEnvironment(){if(!process.env.VERCEL?.trim())throw Error(`vercelScheduleProvider() requires a Vercel production deployment or eve dev.`);if(process.env.VERCEL_ENV!==`production`)throw Error("Vercel Schedules currently supports production deployments only. Deploy with `vercel --prod`.")}export{readVercelScheduleClientOptions,vercelScheduleProvider};
|
|
1
|
+
import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{deriveEveScheduleQueueTopic}from"#runtime/schedules/queue-namespace.js";import{isVercelSchedulesDevEnvironment}from"#internal/schedules/dev-environment.js";import{inMemoryScheduleProvider}from"#public/schedules/providers/in-memory.js";const DEVELOPMENT_PROVIDER=inMemoryScheduleProvider(),CLIENT_OPTIONS=new WeakMap;function readVercelScheduleClientOptions(e){return CLIENT_OPTIONS.get(e)}function vercelScheduleProvider(e={}){if(isEveDevEnvironment()&&!isVercelSchedulesDevEnvironment())return DEVELOPMENT_PROVIDER;let client=t=>createClient(e,t),t={kind:`vercel`,async create(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).create({expression:toVercelExpression(t.expression),jitter:t.expression.type===`cron`?t.expression.jitter:void 0,name:t.name,namespace:e.namespace,payload:createDispatchPayload(e,t.payload),target:{topic:deriveEveScheduleQueueTopic(e.target.key)},timezone:t.expression.timezone}))},async list(e,t){let n=t.cursor?.trim()||void 0,r={namespace:e.namespace};n!==void 0&&(r.cursor=n),t.limit!==void 0&&(r.limit=t.limit);let i=await(await client(e.abortSignal)).list(r);return{cursor:i.cursor,data:i.data.map(fromVercelSchedule)}},async get(e,t){let n=await getScheduleOrNull(await client(e.abortSignal),t,e.namespace);return n===null?null:fromVercelSchedule(n)},async update(e,t,n){let r=n.expression,i={name:t,namespace:e.namespace};return r!==void 0&&(i.expression=toVercelExpression(r),i.timezone=r.timezone??`UTC`,i.jitter=r.type===`cron`?r.jitter??null:null),n.payload!==void 0&&(i.payload=createDispatchPayload(e,n.payload)),fromVercelSchedule(await(await client(e.abortSignal)).update(i))},async enable(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).enable({name:t,namespace:e.namespace}))},async disable(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).disable({name:t,namespace:e.namespace}))},async invoke(e,t){await(await client(e.abortSignal)).invoke({name:t,namespace:e.namespace})},async delete(e,t){try{return await(await client(e.abortSignal)).delete({name:t,namespace:e.namespace}),!0}catch(e){if(isNotFoundError(e))return!1;throw e}}};return CLIENT_OPTIONS.set(t,e),t}async function createClient(e,t){assertSupportedVercelEnvironment();let{SchedulesClient:n}=await import(`#compiled/@vercel/schedules/index.js`);t.throwIfAborted();let r=e.fetch??fetch;return new n({...e,fetch:(e,n)=>r(e,{...n,signal:t})})}function createDispatchPayload(e,t){return{eve:{application:e.target.key,collection:e.collection,version:1},payload:t}}function toVercelExpression(e){return e.type===`cron`?{type:`cron`,cron:e.cron}:{type:`single`,at:e.at}}function fromVercelSchedule(e){let t;if(e.expression.type===`cron`){let n={type:`cron`,cron:e.expression.cron,timezone:e.timezone};e.jitter!==void 0&&(n.jitter=e.jitter),t=n}else t={type:`single`,at:e.expression.at,timezone:e.timezone};return{createdAt:e.createdAt,expression:t,name:e.name,scheduleId:e.scheduleId,state:e.state,updatedAt:e.updatedAt}}async function getScheduleOrNull(e,t,n){try{return await e.get({name:t,namespace:n})}catch(e){if(isNotFoundError(e))return null;throw e}}function isNotFoundError(e){return typeof e==`object`&&!!e&&Reflect.get(e,`name`)===`SchedulesApiError`&&Reflect.get(e,`status`)===404}function assertSupportedVercelEnvironment(){if(!isVercelSchedulesDevEnvironment()){if(!process.env.VERCEL?.trim())throw Error(`vercelScheduleProvider() requires a Vercel production deployment or eve dev.`);if(process.env.VERCEL_ENV!==`production`)throw Error("Vercel Schedules currently supports production deployments only. Deploy with `vercel --prod`.")}}export{readVercelScheduleClientOptions,vercelScheduleProvider};
|