eve 0.63.0 → 0.64.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 +32 -0
- package/dist/src/ai/evaluate.js +1 -1
- package/dist/src/channel/channel-address.d.ts +4 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +4 -1
- package/dist/src/channel/cross-channel-receive.d.ts +4 -1
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/session.d.ts +3 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +7 -0
- package/dist/src/chunks/{use-eve-agent-C5-yqRuq.js → use-eve-agent-BdKlQF32.js} +8 -8
- package/dist/src/chunks/{use-eve-agent-CVWk5KKy.js → use-eve-agent-IIuxkn6y.js} +8 -8
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +2 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +11 -1
- package/dist/src/cli/dev/tui/line-editor.js +3 -3
- package/dist/src/cli/dev/tui/model-picker.d.ts +2 -0
- package/dist/src/cli/dev/tui/model-picker.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.js +1 -1
- package/dist/src/cli/dev/tui/setup-selection-input.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +6 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +8 -14
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +4 -2
- package/dist/src/compiled/.vendor-stamp.json +11 -11
- package/dist/src/compiled/@chat-adapter/slack/_chat-adapter-shared.d.ts +1 -0
- package/dist/src/compiled/@chat-adapter/slack/api.d.ts +3 -2
- package/dist/src/compiled/@chat-adapter/slack/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/format.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +410 -63
- package/dist/src/compiled/@chat-adapter/slack/index.js +47 -25
- package/dist/src/compiled/@chat-adapter/twilio/api.d.ts +5 -1
- package/dist/src/compiled/@chat-adapter/twilio/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +37 -3
- package/dist/src/compiled/@chat-adapter/twilio/index.js +5 -1
- package/dist/src/compiled/@chat-adapter/twilio/webhook.d.ts +2 -2
- package/dist/src/compiled/@chat-adapter/twilio/webhook.js +1 -1
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +6 -6
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +50 -50
- package/dist/src/compiled/@vercel/sandbox/index.js +4 -4
- package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +6 -3
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +37 -5
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/invocations.d.ts +35 -0
- package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +90 -0
- package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +8 -6
- package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/serialization.d.ts +5 -1
- 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/set-attributes.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/attributes-validation.d.ts +5 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +2 -2
- package/dist/src/compiled/@workflow/world/index.d.ts +2 -1
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +12 -1
- package/dist/src/compiled/@workflow/world/invocation.d.ts +19 -0
- package/dist/src/compiled/@workflow/world/queue.d.ts +24 -3
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/node/chunk-6QHBXN7B-gl4n6nmi.js +12 -0
- package/dist/src/compiled/_chunks/node/chunk-7WDLOIRP-B_IWkVtZ.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-KBOOTKHF-DJqFk2r1.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-TREVQR3E-CLsTAn-O.js +1 -0
- package/dist/src/compiled/_chunks/node/dist-DYDVZ-FS.js +98 -0
- package/dist/src/compiled/_chunks/node/dist-iEFkK9qw.js +6 -0
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DFx4eluc.js +6 -0
- package/dist/src/compiled/_chunks/workflow/{dist-D38gP7YF.js → dist-DjECvUyK.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{frames-QcJfYHmh.js → frames-D_Q-7A1N.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{helpers-6kObVbfS.js → helpers-Bw52uyzw.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{logger-NN5YHpYy.js → logger-DFNCa8Nl.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BhA_nDEV.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-DJevv8zz.js → run-BT6SQv5f.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-C5KgPESk.js → serialization-Cl0SYU0I.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/sleep-DB4AH9-A.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-BMY_tOr-.js → wait-until-Dzhr6tzf.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{ws-transport-DSDcKH08.js → ws-transport-BpTMh40s.js} +1 -1
- package/dist/src/compiled/chat/index.d.ts +1 -725
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +1 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +23 -15
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +14 -18
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-sandbox.d.ts +2 -7
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.d.ts +2 -0
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/container.d.ts +1 -1
- package/dist/src/context/container.js +1 -1
- package/dist/src/context/key-names.d.ts +1 -0
- package/dist/src/context/key-names.js +1 -1
- package/dist/src/context/keys.d.ts +7 -2
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/context/providers/session.d.ts +19 -2
- package/dist/src/context/session-context.d.ts +1 -1
- package/dist/src/discover/sandbox.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/context.d.ts +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/define-eval-config.d.ts +7 -7
- package/dist/src/evals/define-eval-config.js +1 -1
- package/dist/src/evals/define-eval.d.ts +5 -2
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +2 -0
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +2 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/run-evals.d.ts +2 -0
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +22 -6
- package/dist/src/eve-channel/create-request.d.ts +2 -1
- package/dist/src/eve-channel/delivery-policy-request.d.ts +4 -0
- package/dist/src/eve-channel/delivery-policy-request.js +1 -0
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +2 -1
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +2 -1
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +7 -8
- package/dist/src/execution/sandbox/active-handles.js +1 -1
- package/dist/src/execution/sandbox/bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +4 -5
- package/dist/src/execution/sandbox/bindings/docker-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/docker-session.js +2 -2
- package/dist/src/execution/sandbox/bindings/docker.d.ts +16 -18
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +2 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +9 -5
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +13 -26
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/{local-backend-utils.d.ts → local-provider-utils.d.ts} +7 -5
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/local.d.ts +3 -3
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +30 -8
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +9 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +10 -4
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +11 -21
- package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-errors.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lookup.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-options.d.ts +1 -2
- package/dist/src/execution/sandbox/bindings/vercel-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +20 -12
- package/dist/src/execution/sandbox/bindings/vercel.js +2 -2
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-prewarm.d.ts +5 -0
- package/dist/src/execution/sandbox/development-prewarm.js +1 -1
- package/dist/src/execution/sandbox/development-run.d.ts +2 -3
- package/dist/src/execution/sandbox/dockerfile.d.ts +25 -0
- package/dist/src/execution/sandbox/dockerfile.js +1 -0
- package/dist/src/execution/sandbox/ensure.d.ts +0 -17
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +23 -27
- package/dist/src/execution/sandbox/prewarm.js +1 -2
- package/dist/src/execution/sandbox/provider-files.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-files.js +1 -0
- package/dist/src/execution/sandbox/provider-host-development.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-host-development.js +1 -0
- package/dist/src/execution/sandbox/provider-host.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-host.js +1 -0
- package/dist/src/execution/sandbox/provider-identity.d.ts +1 -0
- package/dist/src/execution/sandbox/provider-identity.js +1 -0
- package/dist/src/execution/sandbox/ripgrep-probe.d.ts +0 -7
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +8 -8
- package/dist/src/execution/sandbox/session.js +1 -1
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +1 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +2 -1
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/emit-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
- package/dist/src/execution/tools/subagent/start.d.ts +1 -0
- package/dist/src/framework/sources/modules/sandbox.d.ts +2 -1
- package/dist/src/framework/sources/modules/sandbox.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +1 -1
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- package/dist/src/harness/input-requests.d.ts +6 -0
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/messages.d.ts +2 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -0
- package/dist/src/harness/pending-input-batches.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/instrumentation/ai-sdk-warnings.d.ts +6 -0
- package/dist/src/instrumentation/ai-sdk-warnings.js +1 -0
- package/dist/src/instrumentation/runtime.d.ts +1 -0
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +2 -0
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/nitro/host/artifacts-config.d.ts +6 -1
- package/dist/src/internal/nitro/host/artifacts-config.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +16 -0
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +5 -0
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +3 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +1 -0
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/runtime-registry.d.ts +2 -2
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -1
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +4 -5
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +5 -43
- package/dist/src/public/definitions/sandbox.js +1 -1
- package/dist/src/public/local-dev.d.ts +4 -5
- package/dist/src/public/sandbox/docker-sandbox.d.ts +16 -40
- package/dist/src/public/sandbox/docker.d.ts +2 -2
- package/dist/src/public/sandbox/docker.js +1 -1
- package/dist/src/public/sandbox/index.d.ts +4 -9
- package/dist/src/public/sandbox/index.js +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +11 -6
- package/dist/src/public/sandbox/just-bash.d.ts +2 -2
- package/dist/src/public/sandbox/just-bash.js +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +11 -17
- package/dist/src/public/sandbox/microsandbox.d.ts +2 -2
- package/dist/src/public/sandbox/microsandbox.js +1 -1
- package/dist/src/public/sandbox/provider.d.ts +1 -0
- package/dist/src/public/sandbox/provider.js +1 -0
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +10 -41
- package/dist/src/public/sandbox/vercel.d.ts +2 -2
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/runtime/cache-key.js +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +6 -1
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -0
- package/dist/src/runtime/loaders/artifact-paths.js +1 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +3 -0
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -1
- package/dist/src/runtime/local-dev-capability.d.ts +14 -12
- package/dist/src/runtime/local-dev-capability.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-sandbox.d.ts +1 -10
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +13 -0
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -0
- package/dist/src/runtime/sandbox/registry.d.ts +2 -9
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/sessions/runtime-session.js +1 -1
- package/dist/src/runtime/types.d.ts +13 -26
- package/dist/src/runtime/workspace/types.d.ts +1 -1
- package/dist/src/sandbox/providers/default.d.ts +27 -0
- package/dist/src/sandbox/providers/default.js +1 -0
- package/dist/src/sandbox/providers/docker.d.ts +11 -0
- package/dist/src/sandbox/providers/docker.js +1 -0
- package/dist/src/sandbox/providers/just-bash.d.ts +4 -0
- package/dist/src/sandbox/providers/just-bash.js +1 -0
- package/dist/src/sandbox/providers/microsandbox.d.ts +12 -0
- package/dist/src/sandbox/providers/microsandbox.js +1 -0
- package/dist/src/sandbox/providers/vercel.d.ts +12 -0
- package/dist/src/sandbox/providers/vercel.js +1 -0
- package/dist/src/sandbox/providers.d.ts +5 -0
- package/dist/src/sandbox/providers.js +1 -0
- package/dist/src/sandbox/state.d.ts +6 -25
- package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/sandbox.d.ts +2 -25
- package/dist/src/self-modification/extension/subagents/agent/sandbox.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/publish.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +3 -1
- package/dist/src/self-modification/filesystem.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +1 -1
- package/dist/src/self-modification/git.d.ts +1 -1
- package/dist/src/self-modification/sandbox.d.ts +14 -9
- package/dist/src/self-modification/sandbox.js +1 -1
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +4 -2
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +3 -2
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/default-agent-model.d.ts +1 -1
- package/dist/src/shared/default-agent-model.js +1 -1
- package/dist/src/shared/sandbox-environment.d.ts +45 -0
- package/dist/src/shared/sandbox-environment.js +1 -0
- package/dist/src/shared/sandbox-network-policy.d.ts +8 -3
- package/dist/src/shared/sandbox-network-policy.js +1 -1
- package/dist/src/shared/sandbox-prepared-artifacts.d.ts +16 -0
- package/dist/src/shared/sandbox-prepared-artifacts.js +1 -0
- package/dist/src/shared/sandbox-provider.d.ts +110 -0
- package/dist/src/shared/sandbox-provider.js +1 -0
- package/dist/src/shared/sandbox-session.d.ts +18 -41
- package/dist/src/shared/sandbox-template-error.d.ts +9 -0
- package/dist/src/shared/sandbox-template-error.js +1 -0
- package/dist/src/subagents/tool.d.ts +1 -1
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/delivery-context.d.ts +6 -4
- package/dist/src/tasks/delivery-context.js +1 -1
- package/dist/src/tasks/delivery-policy.d.ts +2 -0
- package/dist/src/tasks/delivery-policy.js +1 -1
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +40 -45
- package/docs/agent-config.md +2 -2
- package/docs/channels/eve.mdx +1 -1
- package/docs/channels/overview.mdx +48 -0
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/dynamic-configuration/meta.json +5 -0
- package/docs/evals/overview.mdx +43 -0
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/client/overview.mdx +1 -1
- package/docs/guides/deployment/overview.md +1 -1
- package/docs/guides/deployment/self-hosting.md +5 -5
- package/docs/guides/deployment/vercel.mdx +10 -12
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/hooks.md +4 -0
- package/docs/memory/meta.json +1 -1
- package/docs/memory/overview.mdx +4 -0
- package/docs/meta.json +13 -16
- package/docs/patterns/meta.json +2 -2
- package/docs/protocols/acp.md +1 -1
- package/docs/protocols/ucp.mdx +1 -1
- package/docs/reference/cli.md +10 -9
- package/docs/reference/meta.json +4 -1
- package/docs/reference/typescript-api.md +1 -24
- package/docs/sandbox/default.mdx +17 -0
- package/docs/sandbox/docker.mdx +29 -0
- package/docs/sandbox/index.mdx +216 -0
- package/docs/sandbox/just-bash.mdx +18 -0
- package/docs/sandbox/meta.json +5 -0
- package/docs/sandbox/microsandbox.mdx +31 -0
- package/docs/sandbox/vercel.mdx +106 -0
- package/docs/schedules.mdx +35 -1
- package/docs/subagents/index.mdx +31 -13
- package/docs/subagents/meta.json +1 -1
- package/docs/tools/overview.mdx +14 -6
- package/docs/tutorial/run-analysis.mdx +6 -5
- package/package.json +20 -11
- package/dist/src/compiled/_chunks/node/chunk-5OX2R7AJ-CxVV-owP.js +0 -1
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-B__hKQV7.js +0 -1
- package/dist/src/compiled/_chunks/node/chunk-QZV7YRVM-Dzw4WEBv.js +0 -1
- package/dist/src/compiled/_chunks/node/dist-CweJdVFE.js +0 -6
- package/dist/src/compiled/_chunks/node/dist-Da54NuK8.js +0 -96
- package/dist/src/compiled/_chunks/workflow/attribute-changes-A6HfMNG3.js +0 -6
- package/dist/src/compiled/_chunks/workflow/resume-hook-CAqlhwic.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-CbUwdv6O.js +0 -1
- package/dist/src/compiled/chat/_mdast.d.ts +0 -24
- package/dist/src/compiled/chat/_workflow-serde.d.ts +0 -3
- package/dist/src/compiled/chat/jsx-runtime-_JEEAotp.d.ts +0 -907
- package/dist/src/execution/sandbox/bindings/local-backend-utils.js +0 -1
- package/dist/src/execution/sandbox/lazy-backend.d.ts +0 -15
- package/dist/src/execution/sandbox/lazy-backend.js +0 -1
- package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +0 -8
- package/dist/src/execution/sandbox/template-prewarm-lock.js +0 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +0 -17
- package/dist/src/internal/authored-definition/sandbox.js +0 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +0 -16
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +0 -2
- package/dist/src/public/definitions/sandbox-backend.d.ts +0 -17
- package/dist/src/public/definitions/sandbox-backend.js +0 -1
- package/dist/src/public/sandbox/backends/default.d.ts +0 -1
- package/dist/src/public/sandbox/backends/default.js +0 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +0 -1
- package/dist/src/public/sandbox/backends/docker.js +0 -1
- package/dist/src/public/sandbox/backends/just-bash.d.ts +0 -1
- package/dist/src/public/sandbox/backends/just-bash.js +0 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +0 -1
- package/dist/src/public/sandbox/backends/microsandbox.js +0 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +0 -1
- package/dist/src/public/sandbox/backends/vercel.js +0 -1
- package/dist/src/runtime/sandbox/keys.d.ts +0 -42
- package/dist/src/runtime/sandbox/keys.js +0 -1
- package/dist/src/runtime/sandbox/template-plan.d.ts +0 -24
- package/dist/src/runtime/sandbox/template-plan.js +0 -1
- package/dist/src/sandbox/backends/default.d.ts +0 -42
- package/dist/src/sandbox/backends/default.js +0 -1
- package/dist/src/sandbox/backends/docker.d.ts +0 -14
- package/dist/src/sandbox/backends/docker.js +0 -1
- package/dist/src/sandbox/backends/just-bash.d.ts +0 -17
- package/dist/src/sandbox/backends/just-bash.js +0 -1
- package/dist/src/sandbox/backends/microsandbox.d.ts +0 -17
- package/dist/src/sandbox/backends/microsandbox.js +0 -1
- package/dist/src/sandbox/backends/vercel.d.ts +0 -30
- package/dist/src/sandbox/backends/vercel.js +0 -1
- package/dist/src/shared/sandbox-backend.d.ts +0 -176
- package/dist/src/shared/sandbox-backend.js +0 -1
- package/dist/src/shared/sandbox-definition.d.ts +0 -112
- package/dist/src/shared/sandbox-definition.js +0 -1
- package/docs/sandbox.mdx +0 -342
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { AttachmentTransport } from './_chat-adapter-shared.js';
|
|
3
|
+
export { AttachmentTransport, EncryptedTokenData, decodeKey } from './_chat-adapter-shared.js';
|
|
2
4
|
import { WebClientOptions, WebClient } from './_slack-web-api.js';
|
|
3
|
-
import { Message, AppContextEntity, BaseFormatConverter, Root, AdapterPostableMessage,
|
|
5
|
+
import { Message, AppContextEntity, CardElement, BaseFormatConverter, Root, AdapterPostableMessage, Logger, Adapter, ChatInstance, UserInfo, WebhookOptions, OptionsLoadResult, ModalResponse, ModalElement, AgentSessionStatus, LinkPreview, Attachment, RawMessage, EphemeralMessage, ScheduledMessage, FileUpload, PlanModel, PlanContent, EmojiValue, TypingOptions, StreamChunk, StreamOptions, FetchOptions, FetchResult, ThreadInfo, ChannelVisibility, FormattedContent, ListThreadsOptions, ListThreadsResult, ChannelInfo } from '#compiled/chat/index.js';
|
|
6
|
+
import { S as SlackFetch } from './fetch-QqNM_Ef3.js';
|
|
4
7
|
import { S as SlackWebhookVerifier } from './types-CdGmMyOr.js';
|
|
5
|
-
export { EncryptedTokenData, decodeKey } from './_chat-adapter-shared.js';
|
|
6
8
|
|
|
7
9
|
/** A single entity in a Slack active-view context (wire shape). */
|
|
8
10
|
interface SlackAppContextEntity {
|
|
@@ -38,6 +40,28 @@ declare function normalizeAppContextEntities(context: SlackAppContext | undefine
|
|
|
38
40
|
*/
|
|
39
41
|
declare function getAppContext(message: Message): AppContextEntity[];
|
|
40
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Slack Block Kit converter for cross-platform cards.
|
|
45
|
+
*
|
|
46
|
+
* Converts CardElement to Slack Block Kit blocks.
|
|
47
|
+
* @see https://api.slack.com/block-kit
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
interface SlackBlock {
|
|
51
|
+
block_id?: string;
|
|
52
|
+
type: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Convert a CardElement to Slack Block Kit blocks.
|
|
57
|
+
*/
|
|
58
|
+
declare function cardToBlockKit(card: CardElement): SlackBlock[];
|
|
59
|
+
/**
|
|
60
|
+
* Generate fallback text from a card element.
|
|
61
|
+
* Used when blocks aren't supported or for notifications.
|
|
62
|
+
*/
|
|
63
|
+
declare function cardToFallbackText(card: CardElement): string;
|
|
64
|
+
|
|
41
65
|
/**
|
|
42
66
|
* Slack format conversion.
|
|
43
67
|
*
|
|
@@ -90,28 +114,6 @@ declare class SlackFormatConverter extends BaseFormatConverter {
|
|
|
90
114
|
private nodeToMrkdwn;
|
|
91
115
|
}
|
|
92
116
|
|
|
93
|
-
/**
|
|
94
|
-
* Slack Block Kit converter for cross-platform cards.
|
|
95
|
-
*
|
|
96
|
-
* Converts CardElement to Slack Block Kit blocks.
|
|
97
|
-
* @see https://api.slack.com/block-kit
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
interface SlackBlock {
|
|
101
|
-
block_id?: string;
|
|
102
|
-
type: string;
|
|
103
|
-
[key: string]: unknown;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Convert a CardElement to Slack Block Kit blocks.
|
|
107
|
-
*/
|
|
108
|
-
declare function cardToBlockKit(card: CardElement): SlackBlock[];
|
|
109
|
-
/**
|
|
110
|
-
* Generate fallback text from a card element.
|
|
111
|
-
* Used when blocks aren't supported or for notifications.
|
|
112
|
-
*/
|
|
113
|
-
declare function cardToFallbackText(card: CardElement): string;
|
|
114
|
-
|
|
115
117
|
/**
|
|
116
118
|
* Slack modal (view) converter.
|
|
117
119
|
* Converts ModalElement to Slack Block Kit view format.
|
|
@@ -157,6 +159,10 @@ type SlackBotToken = string | (() => string | Promise<string>);
|
|
|
157
159
|
interface SlackInstallation {
|
|
158
160
|
botToken: string;
|
|
159
161
|
botUserId?: string;
|
|
162
|
+
/** Enterprise Grid org ID, when the workspace belongs to (or the app is installed org-wide on) a Grid org */
|
|
163
|
+
enterpriseId?: string;
|
|
164
|
+
/** True when this is an Enterprise Grid org-wide installation (stored under the enterprise ID) */
|
|
165
|
+
isEnterpriseInstall?: boolean;
|
|
160
166
|
teamName?: string;
|
|
161
167
|
}
|
|
162
168
|
/** Options for the feedback buttons appended to streamed replies. */
|
|
@@ -197,7 +203,7 @@ interface SlackSuggestedPromptsContext {
|
|
|
197
203
|
enterpriseId?: string;
|
|
198
204
|
/** Active-view context entities (agent_view, when Slack folds context in). */
|
|
199
205
|
entities?: AppContextEntity[];
|
|
200
|
-
/** Team the user opened the
|
|
206
|
+
/** Team the user opened the conversation from. */
|
|
201
207
|
teamId?: string;
|
|
202
208
|
/** Assistant thread root (legacy assistant_view; absent under agent_view). */
|
|
203
209
|
threadTs?: string;
|
|
@@ -210,6 +216,19 @@ interface SlackSuggestedPromptsContext {
|
|
|
210
216
|
* resolver to skip setting prompts for that thread.
|
|
211
217
|
*/
|
|
212
218
|
type SlackSuggestedPrompts = SlackSuggestedPromptsOptions | ((context: SlackSuggestedPromptsContext) => SlackSuggestedPromptsOptions | null | undefined | Promise<SlackSuggestedPromptsOptions | null | undefined>);
|
|
219
|
+
/** Context passed to a dynamic agent-session title resolver. */
|
|
220
|
+
interface SlackSessionTitleContext {
|
|
221
|
+
channelId: string;
|
|
222
|
+
text: string;
|
|
223
|
+
threadTs: string;
|
|
224
|
+
userId: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Automatic agent-session title configuration. `true` uses the first line of
|
|
228
|
+
* the root message, `false` disables automatic titles, and a resolver can
|
|
229
|
+
* provide a custom title or return null to skip it.
|
|
230
|
+
*/
|
|
231
|
+
type SlackSessionTitle = boolean | ((context: SlackSessionTitleContext) => string | null | Promise<string | null>);
|
|
213
232
|
interface SlackAdapterConfig {
|
|
214
233
|
/**
|
|
215
234
|
* Enable Slack's Agent messaging experience (`agent_view` manifest mode).
|
|
@@ -248,6 +267,24 @@ interface SlackAdapterConfig {
|
|
|
248
267
|
* when a stream falls back to post-and-edit.
|
|
249
268
|
*/
|
|
250
269
|
feedbackButtons?: boolean | SlackFeedbackButtonsOptions;
|
|
270
|
+
/**
|
|
271
|
+
* Fetch implementation for response_url requests and Socket Mode webhook
|
|
272
|
+
* forwarding. Defaults to globalThis.fetch at request time. Does not affect
|
|
273
|
+
* Web API clients, Socket Mode connections, files, or standalone /api helpers.
|
|
274
|
+
*/
|
|
275
|
+
fetch?: SlackFetch;
|
|
276
|
+
/**
|
|
277
|
+
* Transport for lazy and rehydrated file downloads. Replaces the default
|
|
278
|
+
* DNS-pinned HTTPS transport, which is the only place resolved addresses
|
|
279
|
+
* are checked against the private-range blocklist, so the transport or
|
|
280
|
+
* egress proxy must reject internal destination addresses and DNS
|
|
281
|
+
* rebinding. Return the raw response without following redirects, and
|
|
282
|
+
* honor the supplied AbortSignal. The downloader still validates URLs,
|
|
283
|
+
* limits redirects, scopes credentials, destroys the response at the
|
|
284
|
+
* deadline, and caps the body size. Subclass createFileTransport()
|
|
285
|
+
* overrides take precedence.
|
|
286
|
+
*/
|
|
287
|
+
fileTransport?: AttachmentTransport;
|
|
251
288
|
/**
|
|
252
289
|
* Prefix for the state key used to store workspace installations.
|
|
253
290
|
* Defaults to `slack:installation`. The full key will be `{prefix}:{teamId}`.
|
|
@@ -282,10 +319,22 @@ interface SlackAdapterConfig {
|
|
|
282
319
|
* the workspace rejects the first native call.
|
|
283
320
|
*/
|
|
284
321
|
nativeStreaming?: boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Automatically title new agent sessions from their root user message.
|
|
324
|
+
* Defaults to true when `agentView` is enabled. Pass false to disable or a
|
|
325
|
+
* resolver to customize the title.
|
|
326
|
+
*/
|
|
327
|
+
sessionTitle?: SlackSessionTitle;
|
|
285
328
|
/** Signing secret for webhook verification. Defaults to SLACK_SIGNING_SECRET env var. */
|
|
286
329
|
signingSecret?: string;
|
|
287
330
|
/** Shared secret for authenticating forwarded socket mode events. Auto-detected from SLACK_SOCKET_FORWARDING_SECRET. Falls back to appToken if not set. */
|
|
288
331
|
socketForwardingSecret?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Maximum lifetime of one native Slack stream segment before the adapter
|
|
334
|
+
* finalizes it and continues in a new segment. Defaults to 240 seconds,
|
|
335
|
+
* safely below Slack's roughly five-minute stream expiry.
|
|
336
|
+
*/
|
|
337
|
+
streamSegmentMaxAgeMs?: number;
|
|
289
338
|
/**
|
|
290
339
|
* Suggested prompts to pin automatically when an assistant/agent thread
|
|
291
340
|
* opens. Applied on `assistant_thread_started` (legacy `assistant_view`)
|
|
@@ -318,7 +367,12 @@ interface SlackAdapterConfig {
|
|
|
318
367
|
* });
|
|
319
368
|
* ```
|
|
320
369
|
*
|
|
321
|
-
*
|
|
370
|
+
* `agent` also configures Socket Mode, both its HTTP calls and its
|
|
371
|
+
* WebSocket. `tls` and `apiUrl` reach only Socket Mode's HTTP calls; the
|
|
372
|
+
* SDK opens the WebSocket with the agent alone, so a custom CA or other
|
|
373
|
+
* TLS settings for that connection belong on the agent. None of these
|
|
374
|
+
* configure `fetch` or `fileTransport`. Other options apply only to Web
|
|
375
|
+
* API clients. Use `apiUrl` to override the Slack Web API base URL.
|
|
322
376
|
*/
|
|
323
377
|
webClientOptions?: Omit<WebClientOptions, "slackApiUrl">;
|
|
324
378
|
/**
|
|
@@ -354,6 +408,8 @@ declare function buildFeedbackButtonsBlock(options?: SlackFeedbackButtonsOptions
|
|
|
354
408
|
interface SlackForwardedSocketEvent {
|
|
355
409
|
body: Record<string, unknown>;
|
|
356
410
|
eventType: string;
|
|
411
|
+
/** Slack redelivery count for the original socket delivery, used for event dedup */
|
|
412
|
+
retryNum?: number;
|
|
357
413
|
timestamp: number;
|
|
358
414
|
type: "socket_event";
|
|
359
415
|
}
|
|
@@ -366,14 +422,69 @@ interface SlackThreadId {
|
|
|
366
422
|
channel: string;
|
|
367
423
|
threadTs: string;
|
|
368
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Block inside a Slack message event (`event.blocks` or `attachment.blocks`).
|
|
427
|
+
* Extends the open Block Kit shape with the fields the parser reads directly;
|
|
428
|
+
* everything else stays reachable through the index signature.
|
|
429
|
+
*/
|
|
430
|
+
interface SlackMessageBlock extends SlackBlock {
|
|
431
|
+
elements?: SlackMessageBlock[];
|
|
432
|
+
rows?: unknown;
|
|
433
|
+
/** `{ code: true }` marks an inline-code text element. */
|
|
434
|
+
style?: {
|
|
435
|
+
code?: boolean;
|
|
436
|
+
};
|
|
437
|
+
text?: string;
|
|
438
|
+
url?: string;
|
|
439
|
+
user_id?: string;
|
|
440
|
+
}
|
|
441
|
+
/** Table extracted from a Slack table block, one mrkdwn string per cell. */
|
|
442
|
+
interface SlackTableData {
|
|
443
|
+
/**
|
|
444
|
+
* True when the source rows carry no header styling. GFM tables always
|
|
445
|
+
* render their first row as a header, so headerless tables get an empty
|
|
446
|
+
* header row prepended instead of promoting the first data row.
|
|
447
|
+
*/
|
|
448
|
+
headerless: boolean;
|
|
449
|
+
rows: string[][];
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* One piece of attachment text. `mrkdwn` parts go through the format
|
|
453
|
+
* converter (formatting characters are markup); `literal` parts render as
|
|
454
|
+
* plain text where only Slack control sequences (`<@U…>`, `<url|label>`,
|
|
455
|
+
* entity escapes) are honored, so literal `*`/`_`/backticks survive.
|
|
456
|
+
*/
|
|
457
|
+
type SlackAttachmentPart = {
|
|
458
|
+
literal: string;
|
|
459
|
+
} | {
|
|
460
|
+
mrkdwn: string;
|
|
461
|
+
};
|
|
462
|
+
/** Renderable content of one attachment. */
|
|
463
|
+
interface SlackAttachmentContent {
|
|
464
|
+
/** Structured content. When present, Slack renders only the blocks. */
|
|
465
|
+
blocks: SlackMessageBlock[];
|
|
466
|
+
parts: SlackAttachmentPart[];
|
|
467
|
+
tables: SlackTableData[];
|
|
468
|
+
}
|
|
369
469
|
/** Slack event payload (raw message format) */
|
|
370
470
|
interface SlackEvent {
|
|
371
471
|
/** Legacy attachments (unfurl previews, app unfurls, etc.) */
|
|
372
472
|
attachments?: Array<{
|
|
473
|
+
blocks?: SlackMessageBlock[];
|
|
474
|
+
fallback?: string;
|
|
475
|
+
fields?: Array<{
|
|
476
|
+
title?: string;
|
|
477
|
+
value?: string;
|
|
478
|
+
short?: boolean;
|
|
479
|
+
}>;
|
|
373
480
|
from_url?: string;
|
|
374
481
|
image_url?: string;
|
|
482
|
+
is_app_unfurl?: boolean;
|
|
375
483
|
is_msg_unfurl?: boolean;
|
|
484
|
+
/** Field names Slack renders as mrkdwn ("pretext", "text", "fields") */
|
|
485
|
+
mrkdwn_in?: string[];
|
|
376
486
|
original_url?: string;
|
|
487
|
+
pretext?: string;
|
|
377
488
|
service_icon?: string;
|
|
378
489
|
service_name?: string;
|
|
379
490
|
text?: string;
|
|
@@ -382,24 +493,20 @@ interface SlackEvent {
|
|
|
382
493
|
title_link?: string;
|
|
383
494
|
}>;
|
|
384
495
|
/** Rich text blocks containing structured elements (links, mentions, etc.) */
|
|
385
|
-
blocks?:
|
|
386
|
-
type: string;
|
|
387
|
-
elements?: Array<{
|
|
388
|
-
type: string;
|
|
389
|
-
elements?: Array<{
|
|
390
|
-
type: string;
|
|
391
|
-
url?: string;
|
|
392
|
-
text?: string;
|
|
393
|
-
}>;
|
|
394
|
-
}>;
|
|
395
|
-
}>;
|
|
496
|
+
blocks?: SlackMessageBlock[];
|
|
396
497
|
bot_id?: string;
|
|
498
|
+
bot_profile?: {
|
|
499
|
+
user_id?: string;
|
|
500
|
+
};
|
|
397
501
|
channel?: string;
|
|
398
502
|
/** Channel type: "channel", "group", "mpim", or "im" (DM) */
|
|
399
503
|
channel_type?: string;
|
|
504
|
+
/** Deleted message timestamp on message_deleted events */
|
|
505
|
+
deleted_ts?: string;
|
|
400
506
|
edited?: {
|
|
401
507
|
ts: string;
|
|
402
508
|
};
|
|
509
|
+
event_ts?: string;
|
|
403
510
|
files?: Array<{
|
|
404
511
|
id?: string;
|
|
405
512
|
mimetype?: string;
|
|
@@ -415,6 +522,8 @@ interface SlackEvent {
|
|
|
415
522
|
latest_reply?: string;
|
|
416
523
|
/** Inner message on message_changed events */
|
|
417
524
|
message?: SlackEvent;
|
|
525
|
+
/** Previous message snapshot on message_deleted events */
|
|
526
|
+
previous_message?: SlackEvent;
|
|
418
527
|
/** Number of replies in the thread (present on thread parent messages) */
|
|
419
528
|
reply_count?: number;
|
|
420
529
|
subtype?: string;
|
|
@@ -474,6 +583,24 @@ interface SlackAssistantContextChangedEvent {
|
|
|
474
583
|
event_ts: string;
|
|
475
584
|
type: "assistant_thread_context_changed";
|
|
476
585
|
}
|
|
586
|
+
interface SlackAgentSessionStoppedEvent {
|
|
587
|
+
channel: string;
|
|
588
|
+
event_ts: string;
|
|
589
|
+
streaming_message_ts: string[];
|
|
590
|
+
thread_ts: string;
|
|
591
|
+
type: "agent_session_stopped";
|
|
592
|
+
user: string;
|
|
593
|
+
}
|
|
594
|
+
interface SlackAgentSessionTitleChangedEvent {
|
|
595
|
+
channel: string;
|
|
596
|
+
event_ts: string;
|
|
597
|
+
previous_title?: string;
|
|
598
|
+
team_id: string;
|
|
599
|
+
thread_ts: string;
|
|
600
|
+
title: string;
|
|
601
|
+
type: "agent_session_title_changed";
|
|
602
|
+
user: string;
|
|
603
|
+
}
|
|
477
604
|
/** Slack app_home_opened event payload */
|
|
478
605
|
interface SlackAppHomeOpenedEvent {
|
|
479
606
|
channel: string;
|
|
@@ -509,7 +636,24 @@ interface SlackUserChangeEvent {
|
|
|
509
636
|
}
|
|
510
637
|
/** Slack webhook payload envelope */
|
|
511
638
|
interface SlackWebhookPayload {
|
|
639
|
+
/**
|
|
640
|
+
* Installation the event is delivered for (truncated to one entry).
|
|
641
|
+
* Slack documents this — not the top-level fields — as the authoritative
|
|
642
|
+
* location of is_enterprise_install/enterprise_id on event envelopes.
|
|
643
|
+
*/
|
|
644
|
+
authorizations?: Array<{
|
|
645
|
+
enterprise_id?: string | null;
|
|
646
|
+
team_id?: string | null;
|
|
647
|
+
is_enterprise_install?: boolean;
|
|
648
|
+
}>;
|
|
512
649
|
challenge?: string;
|
|
650
|
+
/**
|
|
651
|
+
* Workspace the event is contextualized to. Delivered at the envelope top
|
|
652
|
+
* level (not inside `event`); set on Slack Connect events hosted on an
|
|
653
|
+
* "away" workspace so calls to the originating channel can echo it back as
|
|
654
|
+
* `client_context_team_id`.
|
|
655
|
+
*/
|
|
656
|
+
context_team_id?: string;
|
|
513
657
|
/** Enterprise ID for Enterprise Grid org-wide installs */
|
|
514
658
|
enterprise_id?: string;
|
|
515
659
|
event?: SlackEvent | SlackReactionEvent | SlackAssistantThreadStartedEvent | SlackAssistantContextChangedEvent | SlackAppHomeOpenedEvent | SlackMemberJoinedChannelEvent | SlackUserChangeEvent;
|
|
@@ -573,6 +717,7 @@ interface SlackViewSubmissionPayload {
|
|
|
573
717
|
state: {
|
|
574
718
|
values: Record<string, Record<string, {
|
|
575
719
|
value?: string;
|
|
720
|
+
selected_date?: string;
|
|
576
721
|
selected_option?: {
|
|
577
722
|
value: string;
|
|
578
723
|
};
|
|
@@ -619,10 +764,13 @@ interface CachedUser {
|
|
|
619
764
|
declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
620
765
|
readonly name = "slack";
|
|
621
766
|
readonly userName: string;
|
|
767
|
+
readonly supportsTurnCancellation: boolean;
|
|
622
768
|
protected readonly _client: WebClient;
|
|
623
769
|
protected readonly tokenClientCache: Map<string, WebClient>;
|
|
624
770
|
protected readonly slackApiUrl: string | undefined;
|
|
625
771
|
protected readonly webClientOptions: SlackAdapterConfig["webClientOptions"];
|
|
772
|
+
protected readonly fetch: SlackFetch;
|
|
773
|
+
protected readonly configuredFileTransport: AttachmentTransport | undefined;
|
|
626
774
|
protected readonly signingSecret: string | undefined;
|
|
627
775
|
protected readonly webhookVerifier: ((request: Request, body: string) => unknown | Promise<unknown>) | undefined;
|
|
628
776
|
protected readonly defaultBotTokenProvider: (() => string | Promise<string>) | undefined;
|
|
@@ -634,6 +782,8 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
634
782
|
protected static readonly USER_CACHE_TTL_MS: number;
|
|
635
783
|
protected static readonly CHANNEL_CACHE_TTL_MS: number;
|
|
636
784
|
protected static readonly REVERSE_INDEX_TTL_MS: number;
|
|
785
|
+
/** How long delivered event IDs are remembered for retry deduplication. Slack retries at ~1 min and ~5 min, and the opt-in Delayed Events feature redelivers hourly for up to 24 hours. */
|
|
786
|
+
protected static readonly EVENT_DEDUPE_TTL_MS: number;
|
|
637
787
|
/**
|
|
638
788
|
* Cache of channel IDs known to be external/shared (Slack Connect).
|
|
639
789
|
* Populated from `is_ext_shared_channel` in incoming webhook payloads.
|
|
@@ -641,11 +791,13 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
641
791
|
private readonly _externalChannels;
|
|
642
792
|
protected readonly appToken: string | undefined;
|
|
643
793
|
protected readonly agentView: boolean;
|
|
794
|
+
protected readonly sessionTitle: SlackSessionTitle;
|
|
644
795
|
protected readonly suggestedPrompts?: SlackSuggestedPrompts;
|
|
645
796
|
protected readonly loadingMessages?: string[];
|
|
646
797
|
/** Normalized feedbackButtons config (`true` becomes `{}`). */
|
|
647
798
|
protected readonly feedbackButtons?: SlackFeedbackButtonsOptions;
|
|
648
799
|
protected readonly nativeStreaming: boolean;
|
|
800
|
+
protected readonly streamSegmentMaxAgeMs: number;
|
|
649
801
|
/**
|
|
650
802
|
* Latched when the workspace rejects native streaming with an error that
|
|
651
803
|
* won't heal (e.g. `unknown_method` on GovSlack) so later streams skip the
|
|
@@ -666,6 +818,14 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
666
818
|
isExtSharedChannel?: boolean;
|
|
667
819
|
enterpriseId?: string;
|
|
668
820
|
isEnterpriseInstall?: boolean;
|
|
821
|
+
/** team_id (or enterprise_id for org-wide installs) the current request resolved its token from */
|
|
822
|
+
installationId?: string;
|
|
823
|
+
/** Workspace the current event occurred in — required as an explicit team_id on workspace-scoped API calls when using an org-wide token */
|
|
824
|
+
teamId?: string;
|
|
825
|
+
/** context_team_id from the incoming event, echoed back as client_context_team_id on channel-addressed calls (away-hosted shared channels) */
|
|
826
|
+
contextTeamId?: string;
|
|
827
|
+
/** Channel the context_team_id came from — the echo only applies to calls targeting that channel */
|
|
828
|
+
contextChannel?: string;
|
|
669
829
|
}>;
|
|
670
830
|
/** Bot user ID (e.g., U_BOT_123) used for mention detection */
|
|
671
831
|
get botUserId(): string | undefined;
|
|
@@ -718,6 +878,17 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
718
878
|
/**
|
|
719
879
|
* Add the current token to API call options.
|
|
720
880
|
* Workaround for Slack WebClient types not including `token` in per-method args.
|
|
881
|
+
*
|
|
882
|
+
* For Enterprise Grid org-wide installs the token spans every workspace in
|
|
883
|
+
* the org, so workspace-scoped Web API methods (conversations.list,
|
|
884
|
+
* users.list, usergroups.*, …) require an explicit `team_id`. Slack
|
|
885
|
+
* documents always passing it as safe — the field is ignored on
|
|
886
|
+
* workspace-level tokens and on methods that don't take it.
|
|
887
|
+
*
|
|
888
|
+
* When the incoming event carried a `context_team_id` (shared channels
|
|
889
|
+
* hosted on an "away" workspace), it is echoed back as
|
|
890
|
+
* `client_context_team_id` on channel-addressed calls, per Slack's
|
|
891
|
+
* Enterprise Grid guidance.
|
|
721
892
|
*/
|
|
722
893
|
protected withToken<T extends Record<string, any>>(options: T): Promise<T & {
|
|
723
894
|
token: string;
|
|
@@ -737,9 +908,17 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
737
908
|
* Handle the Slack OAuth V2 callback.
|
|
738
909
|
* Accepts the incoming request, extracts the authorization code,
|
|
739
910
|
* exchanges it for tokens, and saves the installation.
|
|
911
|
+
*
|
|
912
|
+
* For Enterprise Grid org-wide installs (`is_enterprise_install`), Slack
|
|
913
|
+
* returns `team: null` and the installation is keyed by the enterprise ID
|
|
914
|
+
* instead — the returned `teamId` is always the storage key, so it can be
|
|
915
|
+
* passed back to `getInstallation` / `deleteInstallation` for both install
|
|
916
|
+
* types.
|
|
740
917
|
*/
|
|
741
918
|
handleOAuthCallback(request: Request, options?: SlackOAuthCallbackOptions): Promise<{
|
|
742
919
|
teamId: string;
|
|
920
|
+
enterpriseId?: string;
|
|
921
|
+
isEnterpriseInstall: boolean;
|
|
743
922
|
installation: SlackInstallation;
|
|
744
923
|
}>;
|
|
745
924
|
/**
|
|
@@ -749,8 +928,18 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
749
928
|
/**
|
|
750
929
|
* Run a function with a specific bot token in context.
|
|
751
930
|
* Use this for operations outside webhook handling (cron jobs, workflows).
|
|
752
|
-
|
|
753
|
-
|
|
931
|
+
*
|
|
932
|
+
* In multi-workspace deployments, pass `installationId` (the `team_id`, or
|
|
933
|
+
* `enterprise_id` for org-wide installs — the same key the installation was
|
|
934
|
+
* stored under) so per-user caches (profile cache and display-name mention
|
|
935
|
+
* index) are scoped to that installation. Without it these fall back to the
|
|
936
|
+
* unscoped global key, which can bleed one tenant's cached profiles and
|
|
937
|
+
* mention resolution into another when the same process posts for multiple
|
|
938
|
+
* workspaces.
|
|
939
|
+
*/
|
|
940
|
+
withBotToken<T>(token: string, fn: () => T, options?: {
|
|
941
|
+
installationId?: string;
|
|
942
|
+
}): T;
|
|
754
943
|
/**
|
|
755
944
|
* Resolve the bot token for an installation from the external provider or state adapter.
|
|
756
945
|
* @param installationId - team_id or enterprise_id depending on install type
|
|
@@ -768,7 +957,49 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
768
957
|
installationId: string;
|
|
769
958
|
isEnterpriseInstall: boolean;
|
|
770
959
|
enterpriseId?: string;
|
|
960
|
+
teamId?: string;
|
|
771
961
|
} | null;
|
|
962
|
+
/**
|
|
963
|
+
* Extract installation info from an already-parsed interactive payload
|
|
964
|
+
* (socket mode delivers these as objects rather than form-urlencoded).
|
|
965
|
+
*/
|
|
966
|
+
protected extractInstallationFromInteractivePayload(payload: Record<string, unknown>): {
|
|
967
|
+
installationId: string;
|
|
968
|
+
isEnterpriseInstall: boolean;
|
|
969
|
+
enterpriseId?: string;
|
|
970
|
+
teamId?: string;
|
|
971
|
+
} | null;
|
|
972
|
+
/**
|
|
973
|
+
* Resolve the multi-workspace request context for an event_callback
|
|
974
|
+
* payload. Shared by the HTTP webhook path and the socket-mode path so
|
|
975
|
+
* both resolve per-installation tokens the same way.
|
|
976
|
+
*
|
|
977
|
+
* Returns:
|
|
978
|
+
* - the resolved context to run the event under,
|
|
979
|
+
* - `"not-applicable"` when no resolution is needed (single-workspace
|
|
980
|
+
* mode, or the payload carries no installation ID) — process without
|
|
981
|
+
* a request context,
|
|
982
|
+
* - `"unresolved"` when an installation ID was present but no
|
|
983
|
+
* installation was found — drop the event.
|
|
984
|
+
*/
|
|
985
|
+
protected resolveEventRequestContext(payload: SlackWebhookPayload): Promise<{
|
|
986
|
+
token: string;
|
|
987
|
+
botUserId?: string;
|
|
988
|
+
enterpriseId?: string;
|
|
989
|
+
isEnterpriseInstall: boolean;
|
|
990
|
+
installationId: string;
|
|
991
|
+
teamId?: string;
|
|
992
|
+
contextTeamId?: string;
|
|
993
|
+
contextChannel?: string;
|
|
994
|
+
} | "not-applicable" | "unresolved">;
|
|
995
|
+
/**
|
|
996
|
+
* Scope prefix for installation-owned cache keys. In multi-workspace
|
|
997
|
+
* deployments user profiles, display-name indexes, and channel names must
|
|
998
|
+
* not be shared across installations. Single-workspace mode (and code
|
|
999
|
+
* running outside a webhook context) uses the unscoped key.
|
|
1000
|
+
*/
|
|
1001
|
+
protected installationCacheScope(): string;
|
|
1002
|
+
protected unfurlCacheKey(channelId: string, messageTs: string): string;
|
|
772
1003
|
/**
|
|
773
1004
|
* Look up user info from Slack API with caching via state adapter.
|
|
774
1005
|
* Returns null when the API call fails.
|
|
@@ -781,6 +1012,25 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
781
1012
|
protected lookupChannel(channelId: string): Promise<string>;
|
|
782
1013
|
getUser(userId: string): Promise<UserInfo | null>;
|
|
783
1014
|
handleWebhook(request: Request, options?: WebhookOptions): Promise<Response>;
|
|
1015
|
+
/**
|
|
1016
|
+
* Handle a slash command, resolving the per-installation token first in
|
|
1017
|
+
* multi-workspace mode. Shared by the HTTP webhook and socket-mode paths.
|
|
1018
|
+
*/
|
|
1019
|
+
protected runSlashCommand(params: URLSearchParams, options?: WebhookOptions): Promise<Response>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Record that an event delivery was dispatched, so redeliveries
|
|
1022
|
+
* (`x-slack-retry-num` / socket `retry_num`) can be dropped. Fire-and-forget:
|
|
1023
|
+
* a failed write only means a retry gets reprocessed, which downstream
|
|
1024
|
+
* message dedup already tolerates.
|
|
1025
|
+
*/
|
|
1026
|
+
protected markEventDelivered(payload: SlackWebhookPayload): void;
|
|
1027
|
+
/**
|
|
1028
|
+
* Check whether a retried event delivery was already dispatched. Only
|
|
1029
|
+
* consulted on retries (retryNum > 0), so first deliveries pay no state
|
|
1030
|
+
* read. Events missed entirely (never dispatched, e.g. delivered while
|
|
1031
|
+
* disconnected) have no marker and are still recovered via the retry.
|
|
1032
|
+
*/
|
|
1033
|
+
protected isDuplicateEventDelivery(payload: SlackWebhookPayload, retryNum?: number): Promise<boolean>;
|
|
784
1034
|
/** Extract and dispatch events from a validated payload */
|
|
785
1035
|
protected processEventPayload(payload: SlackWebhookPayload, options?: WebhookOptions): void;
|
|
786
1036
|
/**
|
|
@@ -808,6 +1058,15 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
808
1058
|
protected handleViewClosed(payload: SlackViewClosedPayload, options?: WebhookOptions): void;
|
|
809
1059
|
protected modalResponseToSlack(response: ModalResponse, contextId?: string): SlackModalResponse;
|
|
810
1060
|
protected convertModalJSX(modal: ModalElement): ModalElement;
|
|
1061
|
+
/**
|
|
1062
|
+
* Transport-shaped WebClient options for Socket Mode. SocketModeClient
|
|
1063
|
+
* Object.assigns clientOptions over its own app-token headers and mutates
|
|
1064
|
+
* the object to install retry defaults, so headers and retryConfig are not
|
|
1065
|
+
* forwarded and every call returns a fresh object.
|
|
1066
|
+
*/
|
|
1067
|
+
private socketTransportOptions;
|
|
1068
|
+
/** POSTs a JSON body through the configured fetch. */
|
|
1069
|
+
private postJson;
|
|
811
1070
|
/**
|
|
812
1071
|
* Start Socket Mode connection.
|
|
813
1072
|
* Creates a SocketModeClient, registers event handlers, and connects.
|
|
@@ -816,7 +1075,7 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
816
1075
|
/**
|
|
817
1076
|
* Route a socket mode event to the appropriate handler.
|
|
818
1077
|
*/
|
|
819
|
-
protected routeSocketEvent(body: Record<string, unknown>, eventType: string, ack: (response?: Record<string, unknown>) => Promise<void>, options?: WebhookOptions): Promise<void>;
|
|
1078
|
+
protected routeSocketEvent(body: Record<string, unknown>, eventType: string, ack: (response?: Record<string, unknown>) => Promise<void>, options?: WebhookOptions, retryNum?: number): Promise<void>;
|
|
820
1079
|
/**
|
|
821
1080
|
* Start a transient Socket Mode listener for serverless environments.
|
|
822
1081
|
* The listener maintains a WebSocket for `durationMs`, acks events, and
|
|
@@ -846,7 +1105,8 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
846
1105
|
* Bot message filtering (isMe) is handled centrally by the Chat class.
|
|
847
1106
|
*/
|
|
848
1107
|
protected handleMessageEvent(event: SlackEvent, options?: WebhookOptions): void;
|
|
849
|
-
protected handleMessageChanged(event: SlackEvent,
|
|
1108
|
+
protected handleMessageChanged(event: SlackEvent, options?: WebhookOptions): void;
|
|
1109
|
+
protected handleMessageDeleted(event: SlackEvent, options?: WebhookOptions): void;
|
|
850
1110
|
/**
|
|
851
1111
|
* Handle reaction events from Slack (reaction_added, reaction_removed).
|
|
852
1112
|
*/
|
|
@@ -861,11 +1121,13 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
861
1121
|
* Fires when a user navigates to a different channel with the assistant panel open.
|
|
862
1122
|
*/
|
|
863
1123
|
protected handleAssistantContextChanged(event: SlackAssistantContextChangedEvent, options?: WebhookOptions): void;
|
|
1124
|
+
protected handleAgentSessionStopped(event: SlackAgentSessionStoppedEvent, options?: WebhookOptions): void;
|
|
1125
|
+
protected handleAgentSessionTitleChanged(event: SlackAgentSessionTitleChangedEvent, options?: WebhookOptions): void;
|
|
864
1126
|
/**
|
|
865
1127
|
* Handle app_home_opened events from Slack.
|
|
866
1128
|
* Fires when a user opens the bot's Home tab.
|
|
867
1129
|
*/
|
|
868
|
-
protected handleAppHomeOpened(event: SlackAppHomeOpenedEvent, options?: WebhookOptions): void;
|
|
1130
|
+
protected handleAppHomeOpened(event: SlackAppHomeOpenedEvent, options?: WebhookOptions, teamId?: string): void;
|
|
869
1131
|
/**
|
|
870
1132
|
* Handle app_context_changed events (Slack Agent messaging experience).
|
|
871
1133
|
* Reports the user's current active view via normalized entities.
|
|
@@ -898,32 +1160,45 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
898
1160
|
* the webhook path where a failure must not turn into a 500.
|
|
899
1161
|
*/
|
|
900
1162
|
protected applyConfiguredSuggestedPrompts(context: SlackSuggestedPromptsContext): Promise<void>;
|
|
1163
|
+
protected applyConfiguredSessionTitle(event: SlackEvent): Promise<void>;
|
|
901
1164
|
/**
|
|
902
1165
|
* Set status/thinking indicator for an assistant thread.
|
|
903
|
-
*
|
|
1166
|
+
* Uses Agent Sessions when `agentView` is enabled and the legacy Assistants
|
|
1167
|
+
* API otherwise.
|
|
1168
|
+
*
|
|
1169
|
+
* A custom status is surfaced through the legacy Assistants API: its
|
|
1170
|
+
* compatibility bridge renders the text in the agent-session loading UX.
|
|
1171
|
+
* An empty status clears the loading state via the Agent Sessions
|
|
1172
|
+
* lifecycle.
|
|
904
1173
|
*
|
|
905
1174
|
* When `loadingMessages` is omitted, falls back to the adapter-level
|
|
906
1175
|
* `loadingMessages` config.
|
|
907
1176
|
*/
|
|
908
1177
|
setAssistantStatus(channelId: string, threadTs: string, status: string, loadingMessages?: string[]): Promise<void>;
|
|
909
1178
|
/**
|
|
910
|
-
* Set
|
|
911
|
-
|
|
1179
|
+
* Set a Slack Agent Session lifecycle state, creating the session if needed.
|
|
1180
|
+
*/
|
|
1181
|
+
setSessionStatus(channelId: string, threadTs: string, status: AgentSessionStatus, options?: {
|
|
1182
|
+
initiatorUserId?: string;
|
|
1183
|
+
title?: string;
|
|
1184
|
+
}): Promise<void>;
|
|
1185
|
+
protected renameAgentSession(channelId: string, threadTs: string, title: string): Promise<void>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Set title for an assistant thread or agent session.
|
|
912
1188
|
*/
|
|
913
1189
|
setAssistantTitle(channelId: string, threadTs: string, title: string): Promise<void>;
|
|
914
1190
|
/**
|
|
915
1191
|
* Resolve inline user mentions in Slack mrkdwn text.
|
|
916
1192
|
* Converts <@U123> to <@U123|displayName> so that toAst/extractPlainText
|
|
917
|
-
* renders them as @displayName instead of @U123.
|
|
918
|
-
*
|
|
919
|
-
*
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
*
|
|
924
|
-
* apply.
|
|
1193
|
+
* renders them as @displayName instead of @U123. The bot's own mention is
|
|
1194
|
+
* decoded too: `detectSelfMention` classifies it from the event's blocks
|
|
1195
|
+
* (or, without blocks, this text) before the id markup is replaced.
|
|
1196
|
+
*/
|
|
1197
|
+
protected resolveInlineMentions(text: string): Promise<string>;
|
|
1198
|
+
/**
|
|
1199
|
+
* Look up display names for collected mention IDs in one parallel wave.
|
|
925
1200
|
*/
|
|
926
|
-
|
|
1201
|
+
private lookupMentionNames;
|
|
927
1202
|
/**
|
|
928
1203
|
* Extract link URLs from a Slack event.
|
|
929
1204
|
* Uses the `blocks` field (rich_text blocks with link elements) when available,
|
|
@@ -935,10 +1210,27 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
935
1210
|
* includes a `fetchMessage` callback that fetches and parses the linked message.
|
|
936
1211
|
*/
|
|
937
1212
|
protected createLinkPreview(url: string): LinkPreview;
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
1213
|
+
/**
|
|
1214
|
+
* Whether the message invokes the bot.
|
|
1215
|
+
*
|
|
1216
|
+
* Slack fires `app_mention` for a bot id that only appears inside code, so the
|
|
1217
|
+
* invocation is classified from the message content: a `user` element for the
|
|
1218
|
+
* bot outside code, or a `<@U…>` token outside code in mrkdwn content, is a
|
|
1219
|
+
* mention. Inline (`style.code`) and preformatted content renders literally,
|
|
1220
|
+
* so a bot id there is not.
|
|
1221
|
+
*
|
|
1222
|
+
* Returns `true` for an invocation and `false` when the content refers to
|
|
1223
|
+
* the bot only literally, or not at all on an ordinary message. An
|
|
1224
|
+
* `app_mention` whose content never shows the known bot id is still trusted:
|
|
1225
|
+
* Slack saw a mention under an id the adapter does not know, such as the
|
|
1226
|
+
* `W…` form an Enterprise Grid workspace emits for a `U…` bot. Without any
|
|
1227
|
+
* bot id, `app_mention` is trusted the same way and other messages stay
|
|
1228
|
+
* undetermined for the SDK's text-based fallback.
|
|
1229
|
+
*/
|
|
1230
|
+
protected detectSelfMention(event: SlackEvent, rawText: string, attachments: SlackAttachmentContent[]): boolean | undefined;
|
|
1231
|
+
protected parseSlackMessage(event: SlackEvent, threadId: string): Promise<Message<unknown>>;
|
|
1232
|
+
protected parseSlackTimestamp(ts: string | undefined): Date | undefined;
|
|
1233
|
+
protected enrichLinks(links: LinkPreview[], channelId?: string, messageTs?: string): Promise<LinkPreview[]>;
|
|
942
1234
|
/**
|
|
943
1235
|
* Create an Attachment object from a Slack file.
|
|
944
1236
|
* Includes a fetchData method that uses the bot token for auth.
|
|
@@ -952,7 +1244,12 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
952
1244
|
original_w?: number;
|
|
953
1245
|
original_h?: number;
|
|
954
1246
|
}, teamId?: string): Attachment;
|
|
955
|
-
protected fetchSlackFile(url: string, token:
|
|
1247
|
+
protected fetchSlackFile(url: string, token: SlackBotToken): Promise<Buffer>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Transport used for guarded file downloads. Subclasses can return a
|
|
1250
|
+
* custom AttachmentTransport, overriding the configured fileTransport.
|
|
1251
|
+
*/
|
|
1252
|
+
protected createFileTransport(): AttachmentTransport | undefined;
|
|
956
1253
|
rehydrateAttachment(attachment: Attachment): Attachment;
|
|
957
1254
|
/**
|
|
958
1255
|
* Resolve @name mentions in text to Slack <@USER_ID> format using the
|
|
@@ -1005,7 +1302,8 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1005
1302
|
* @param threadId - The thread to show the indicator in
|
|
1006
1303
|
* @param status - Optional custom status message (e.g., "Searching documents...")
|
|
1007
1304
|
*/
|
|
1008
|
-
startTyping(threadId: string, status?: string): Promise<void>;
|
|
1305
|
+
startTyping(threadId: string, status?: string, options?: TypingOptions): Promise<void>;
|
|
1306
|
+
endTyping(threadId: string, status?: AgentSessionStatus): Promise<void>;
|
|
1009
1307
|
/**
|
|
1010
1308
|
* Stream a message using Slack's native streaming API.
|
|
1011
1309
|
*
|
|
@@ -1017,6 +1315,11 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1017
1315
|
* streaming API as chunk payloads, enabling native task progress cards
|
|
1018
1316
|
* and plan displays in the Slack AI Assistant UI.
|
|
1019
1317
|
*
|
|
1318
|
+
* Slack expires a native stream after roughly five minutes, so a reply
|
|
1319
|
+
* that streams longer than `streamSegmentMaxAgeMs` is finalized and
|
|
1320
|
+
* continued in a new message. The returned `id` is the last message of
|
|
1321
|
+
* the reply; earlier segments are already final and are not tracked.
|
|
1322
|
+
*
|
|
1020
1323
|
* Falls back to post-and-edit when the thread lacks native stream context.
|
|
1021
1324
|
*/
|
|
1022
1325
|
stream(threadId: string, textStream: AsyncIterable<string | StreamChunk>, options?: StreamOptions): Promise<RawMessage<unknown> | null>;
|
|
@@ -1049,6 +1352,25 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1049
1352
|
*/
|
|
1050
1353
|
fetchMessage(threadId: string, messageId: string): Promise<Message<unknown> | null>;
|
|
1051
1354
|
encodeThreadId(platformData: SlackThreadId): string;
|
|
1355
|
+
/**
|
|
1356
|
+
* Thread ID for a message-shaped event. Single source of truth for how
|
|
1357
|
+
* message, edit, and delete events map onto a thread: they must agree, or
|
|
1358
|
+
* an edit dispatches to a different thread than the message it edits.
|
|
1359
|
+
*
|
|
1360
|
+
* For DMs under assistant_view (legacy): top-level messages use empty
|
|
1361
|
+
* threadTs (matches openDM subscriptions); thread replies use thread_ts for
|
|
1362
|
+
* per-conversation isolation.
|
|
1363
|
+
* Under agent_view the Messages-tab conversation is threaded per Slack's
|
|
1364
|
+
* model, each user message being a thread root, so reply in-thread using
|
|
1365
|
+
* `thread_ts ?? ts`.
|
|
1366
|
+
* For channels: always use thread_ts or ts for per-thread IDs.
|
|
1367
|
+
*/
|
|
1368
|
+
protected threadIdForMessageEvent(event: {
|
|
1369
|
+
channel?: string;
|
|
1370
|
+
channel_type?: string;
|
|
1371
|
+
thread_ts?: string;
|
|
1372
|
+
ts?: string;
|
|
1373
|
+
}): string;
|
|
1052
1374
|
/**
|
|
1053
1375
|
* Check if a thread is a direct message conversation.
|
|
1054
1376
|
* Slack DM channel IDs start with 'D'.
|
|
@@ -1070,6 +1392,31 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1070
1392
|
* Used for parseMessage interface - falls back to user ID for username.
|
|
1071
1393
|
*/
|
|
1072
1394
|
protected parseSlackMessageSync(event: SlackEvent, threadId: string): Message<unknown>;
|
|
1395
|
+
protected content(event: SlackEvent, text: string, attachments?: SlackAttachmentContent[]): FormattedContent;
|
|
1396
|
+
/**
|
|
1397
|
+
* Like `content`, but resolves user and channel mentions inside table
|
|
1398
|
+
* cells and attachment content the same way `resolveInlineMentions`
|
|
1399
|
+
* resolves them in body text. All mention IDs are collected up front and
|
|
1400
|
+
* looked up in a single parallel wave so no ID is fetched twice.
|
|
1401
|
+
*/
|
|
1402
|
+
protected resolvedContent(event: SlackEvent, text: string, attachments?: SlackAttachmentContent[]): Promise<FormattedContent>;
|
|
1403
|
+
private assembleContent;
|
|
1404
|
+
/**
|
|
1405
|
+
* Render one attachment's content to block nodes. Literal lines share a
|
|
1406
|
+
* paragraph (separated by hard breaks) so an attachment reads as one block;
|
|
1407
|
+
* mrkdwn parts are parsed in isolation so an unclosed code fence in the
|
|
1408
|
+
* message body or another attachment can't swallow this one's content.
|
|
1409
|
+
* Tables from the attachment's blocks follow its text, keeping each
|
|
1410
|
+
* attachment's content adjacent.
|
|
1411
|
+
*/
|
|
1412
|
+
private attachmentNodes;
|
|
1413
|
+
private tableNode;
|
|
1414
|
+
/**
|
|
1415
|
+
* Convert a cell's mrkdwn text to table cell (phrasing) content via the
|
|
1416
|
+
* same format converter used for body text, so mentions, links, and emoji
|
|
1417
|
+
* render consistently.
|
|
1418
|
+
*/
|
|
1419
|
+
private cellChildren;
|
|
1073
1420
|
/**
|
|
1074
1421
|
* Derive channel ID from a Slack thread ID.
|
|
1075
1422
|
* Slack thread IDs are "slack:CHANNEL:THREAD_TS", channel ID is "slack:CHANNEL".
|
|
@@ -1100,10 +1447,10 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1100
1447
|
*
|
|
1101
1448
|
* Slack messages can come from:
|
|
1102
1449
|
* - User messages: have `user` field (U_xxx format)
|
|
1103
|
-
* - Bot messages: have `bot_id`
|
|
1450
|
+
* - Bot messages: have `bot_id` and may include a bot user ID
|
|
1104
1451
|
*
|
|
1105
1452
|
* We check both because:
|
|
1106
|
-
* - _botUserId is the user ID (U_xxx) - matches event.user
|
|
1453
|
+
* - _botUserId is the user ID (U_xxx) - matches event.user or bot_profile.user_id
|
|
1107
1454
|
* - _botId is the bot ID (B_xxx) - matches event.bot_id
|
|
1108
1455
|
*/
|
|
1109
1456
|
protected isMessageFromSelf(event: SlackEvent): boolean;
|
|
@@ -1132,4 +1479,4 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1132
1479
|
}
|
|
1133
1480
|
declare function createSlackAdapter(config?: SlackAdapterConfig): SlackAdapter;
|
|
1134
1481
|
|
|
1135
|
-
export { SlackAdapter, type SlackAdapterConfig, type SlackAdapterMode, type SlackAppContext, type SlackAppContextChangedEvent, type SlackAppContextEntity, type SlackBotToken, type SlackEvent, type SlackFeedbackButtonsOptions, SlackFormatConverter, type SlackInstallation, SlackFormatConverter as SlackMarkdownConverter, type SlackOAuthCallbackOptions, type SlackReactionEvent, type SlackSuggestedPrompt, type SlackSuggestedPrompts, type SlackSuggestedPromptsContext, type SlackSuggestedPromptsOptions, type SlackThreadId, buildFeedbackButtonsBlock, cardToBlockKit, cardToFallbackText, createSlackAdapter, getAppContext, normalizeAppContextEntities };
|
|
1482
|
+
export { SlackAdapter, type SlackAdapterConfig, type SlackAdapterMode, type SlackAppContext, type SlackAppContextChangedEvent, type SlackAppContextEntity, type SlackBlock, type SlackBotToken, type SlackEvent, type SlackFeedbackButtonsOptions, SlackFormatConverter, type SlackInstallation, SlackFormatConverter as SlackMarkdownConverter, type SlackMessageBlock, type SlackOAuthCallbackOptions, type SlackReactionEvent, type SlackSessionTitle, type SlackSessionTitleContext, type SlackSuggestedPrompt, type SlackSuggestedPrompts, type SlackSuggestedPromptsContext, type SlackSuggestedPromptsOptions, type SlackThreadId, buildFeedbackButtonsBlock, cardToBlockKit, cardToFallbackText, createSlackAdapter, getAppContext, normalizeAppContextEntities };
|