eve 0.79.2 → 0.80.1
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 +30 -0
- package/dist/src/compiled/.vendor-stamp.json +8 -8
- package/dist/src/compiled/@chat-adapter/slack/api.d.ts +6 -0
- 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 +14 -8
- package/dist/src/compiled/@chat-adapter/slack/index.js +33 -32
- package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +37 -1
- package/dist/src/compiled/@chat-adapter/twilio/index.js +2 -2
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +1 -1
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +1 -1
- package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/ai-sdk-telemetry.d.ts +2 -2
- package/dist/src/compiled/{@eve/tracing/agent-tracing.d.ts → @vercel/agent-runs/agent-run.d.ts} +3 -3
- package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/index.d.ts +1 -1
- package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/index.js +1 -1
- package/dist/src/compiled/@vercel/connect/index.js +5 -5
- package/dist/src/compiled/@vercel/connect/token.d.ts +11 -1
- package/dist/src/compiled/@workflow/world-vercel/index.js +3 -3
- package/dist/src/compiled/_chunks/node/chunk-NBSLXVG3-Bt7pDfyn.js +12 -0
- package/dist/src/compiled/_chunks/node/dist-BKsV21Vu.js +6 -0
- package/dist/src/compiled/_chunks/node/dist-CO_n_hUa.js +98 -0
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +6 -6
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -4
- 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/context/schedule-collection-tools.js +1 -1
- package/dist/src/execution/catalog/connection-auth.d.ts +4 -2
- package/dist/src/execution/catalog/connection-auth.js +1 -1
- package/dist/src/execution/catalog/connection-entry.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session-event-stream.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +2 -0
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/web-fetch/execute.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +6 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +3 -1
- package/dist/src/extensions/git/extension/extension.js +1 -1
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.d.ts +14 -0
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -1
- package/dist/src/harness/compaction/engine.js +2 -2
- package/dist/src/harness/compaction/prompt.d.ts +6 -0
- package/dist/src/harness/compaction/prompt.js +1 -1
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.d.ts +2 -2
- package/dist/src/harness/model-call/recovery.d.ts +2 -3
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/principal-summary.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +1 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/session-init.d.ts +2 -1
- package/dist/src/instrumentation/session-init.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
- package/dist/src/internal/authored-package-boundary.d.ts +4 -0
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +2 -2
- package/dist/src/internal/logging.js +1 -1
- package/dist/src/internal/nitro/host/application-route-registry.d.ts +7 -2
- package/dist/src/internal/nitro/host/application-route-registry.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/external-dependency-output-check-plugin.d.ts +23 -0
- package/dist/src/internal/nitro/host/external-dependency-output-check-plugin.js +3 -0
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.d.ts +3 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
- package/dist/src/internal/nitro/routes/connection-events.d.ts +5 -0
- package/dist/src/internal/nitro/routes/connection-events.js +1 -0
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.js +1 -1
- package/dist/src/public/channels/slack/blocks.js +2 -2
- package/dist/src/public/connections/index.d.ts +1 -0
- package/dist/src/public/definitions/connections/events.d.ts +43 -0
- package/dist/src/public/definitions/connections/events.js +1 -0
- package/dist/src/public/definitions/connections/mcp.d.ts +3 -0
- package/dist/src/public/schedules/subscription.d.ts +4 -3
- package/dist/src/runtime/connections/events/actions.d.ts +17 -0
- package/dist/src/runtime/connections/events/actions.js +1 -0
- package/dist/src/runtime/connections/events/delivery.d.ts +10 -0
- package/dist/src/runtime/connections/events/delivery.js +1 -0
- package/dist/src/runtime/connections/events/dispatch-step.d.ts +20 -0
- package/dist/src/runtime/connections/events/dispatch-step.js +1 -0
- package/dist/src/runtime/connections/events/lifecycle-step.d.ts +42 -0
- package/dist/src/runtime/connections/events/lifecycle-step.js +1 -0
- package/dist/src/runtime/connections/events/owner.d.ts +38 -0
- package/dist/src/runtime/connections/events/owner.js +1 -0
- package/dist/src/runtime/connections/events/path.d.ts +4 -0
- package/dist/src/runtime/connections/events/path.js +1 -0
- package/dist/src/runtime/connections/events/state.d.ts +37 -0
- package/dist/src/runtime/connections/events/state.js +1 -0
- package/dist/src/runtime/connections/events/workflow.d.ts +28 -0
- package/dist/src/runtime/connections/events/workflow.js +1 -0
- package/dist/src/runtime/connections/mcp-client.d.ts +4 -2
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/resolve-connection.js +1 -1
- package/dist/src/runtime/schedules/collection-client.d.ts +0 -2
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/types.d.ts +11 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/connections.js +2 -2
- package/dist/src/setup/scaffold/version-tokens.d.ts +1 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +12 -4
- package/dist/src/shared/connection-events.d.ts +84 -0
- package/dist/src/shared/connection-events.js +1 -0
- package/dist/src/shared/connection-types.d.ts +10 -0
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/no-reply.d.ts +5 -0
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tracing/eve/agent-approval-instrumentation.d.ts +2 -2
- package/dist/src/tracing/eve/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/eve/agent-memory-instrumentation.d.ts +2 -2
- package/dist/src/tracing/eve/agent-memory-instrumentation.js +1 -1
- package/dist/src/tracing/eve/agent-otel-provider.d.ts +1 -1
- package/dist/src/tracing/eve/agent-tool-instrumentation.d.ts +3 -3
- package/dist/src/tracing/eve/agent-trace-context.js +1 -1
- package/dist/src/tracing/eve/agent-trace-state.d.ts +1 -1
- package/dist/src/tracing/eve/connection-events.d.ts +25 -0
- package/dist/src/tracing/eve/connection-events.js +1 -0
- package/dist/src/tracing/eve/content-span-processor.js +1 -1
- package/dist/src/tracing/eve/delegation.js +1 -1
- package/dist/src/tracing/eve/gateway.d.ts +1 -1
- package/dist/src/tracing/eve/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/eve/invoke-tool-span.js +1 -1
- package/dist/src/tracing/eve/mcp.d.ts +2 -1
- package/dist/src/tracing/eve/mcp.js +1 -1
- package/dist/src/tracing/eve/metadata.d.ts +1 -1
- package/dist/src/tracing/eve/operation-input.d.ts +2 -2
- package/dist/src/tracing/eve/operation-input.js +1 -1
- package/dist/src/tracing/eve/otel-declaration.d.ts +5 -0
- package/dist/src/tracing/eve/otel-registration.d.ts +2 -2
- package/dist/src/tracing/eve/otel-registration.js +1 -1
- package/dist/src/tracing/eve/profile.d.ts +1 -1
- package/dist/src/tracing/eve/session.d.ts +2 -2
- package/dist/src/tracing/local/trace-summary.js +1 -1
- package/docs/agent-config.md +38 -13
- package/docs/code-extension.mdx +28 -0
- package/docs/concepts/built-in-tools.md +2 -0
- package/docs/connections/mcp.mdx +105 -0
- package/docs/connections/openapi.mdx +2 -0
- package/docs/guides/instrumentation/otel.mdx +10 -0
- package/docs/sandbox/vercel.mdx +46 -0
- package/package.json +8 -8
- package/dist/src/compiled/_chunks/node/chunk-6QHBXN7B-gl4n6nmi.js +0 -12
- package/dist/src/compiled/_chunks/node/dist-DYDVZ-FS.js +0 -98
- package/dist/src/compiled/_chunks/node/dist-iEFkK9qw.js +0 -6
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/agent-transport.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/ai-sdk-payload.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/otel-error.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/otel-ids.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/otel.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/adapters/serialization.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/ai-sdk.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/ai-sdk.js +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/capture.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/activation.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/attributes.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/content-policy.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/context.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/delegation.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/mcp.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/scopes.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/snapshot.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/span-kinds.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/types.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/core/writer.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/delegation.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/delegation.js +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/operations.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/otel.d.ts +0 -0
- /package/dist/src/compiled/{@eve/tracing → @vercel/agent-runs}/otel.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.80.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a3654ef: Compaction now keeps the start and end of an oversized tool result instead of only its start, so failures, errors, and the `bash` exit code at the end of the output survive.
|
|
8
|
+
- 5666d2f: Hosted builds now fail with a clear error when the build output imports a `build.externalDependencies` package, or a subpath of one, that Node's ESM resolver does not resolve to a file inside the output. Previously the build succeeded and the deployed function crashed at boot with `ERR_MODULE_NOT_FOUND` (for example when only a workspace package installed the dependency) or `ERR_PACKAGE_PATH_NOT_EXPORTED` (when the copied version does not export the imported subpath). The error names the import and the app `package.json` to add the package to.
|
|
9
|
+
- c1b079c: Publish framework-neutral tracing as `@vercel/agent-runs` with singular `createAgentRun` and `AgentRun` APIs; eve still bundles it without a new runtime dependency. Also fix a development-server build failure in npm-installed apps when generating source maps.
|
|
10
|
+
- 0857ff4: Reject OpenAPI path parameter values equal to `.` or `..` before sending requests, so URL normalization cannot change the intended route. This validation also applies to application-provided arguments.
|
|
11
|
+
|
|
12
|
+
## 0.80.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 4210766: `git({ github })` accepts an optional `authorize` callback that runs once per `gh` tool invocation with the caller, declared repository, and repository-scoped token; returning `false` blocks the command. It gates caller/repository access, not individual API requests or operations, and allowed commands use the app token's permissions rather than the caller's GitHub permissions.
|
|
17
|
+
- 3fea287: Dropped traces and policies excluding either content direction now request Workflow data deletion when the run ends; set `experimental.workflow.retention: "default"` to retain completed transcripts independently of tracing. Expired session-history reads return `410 session_expired` before streaming, including when the World retains purged chunk records.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- a5e33ec: Root sessions now accept empty model responses with `finishReason: "stop"` without retrying them or reporting a model-call failure. Recovery for delegated sessions, incomplete streams, and empty non-`stop` responses is unchanged.
|
|
22
|
+
- aa3d3fc: Scheduled sessions and their locally delegated tasks can now use dynamic scheduling tools and the schedule client to manage schedules, including conditional updates or disabling future occurrences. Collection scope authorization and tool approval policies still apply.
|
|
23
|
+
- b1de5d3: eve now vendors chat 4.42.0 and requires the optional `chat` peer at `^4.42.0`. chat 4.41 broke Workflow DevKit workflows in host apps (vercel/chat#969).
|
|
24
|
+
- 1f410e9: Dynamic schedule collections can defer their generated management tools to the catalog with `tool: "deferred"`, keeping them out of the model's initial tool list while still making them searchable and callable.
|
|
25
|
+
- a475f2d: Dynamic tools now capture locals bound by an array rest element (`const [first, ...rest] = ...`) or a rest parameter (`(...args) =>`). Before, the hoisted callback threw `ReferenceError` and the resolver's tools were dropped.
|
|
26
|
+
- 6d67e9a: Add experimental MCP connection event callback definitions and preserve the Connect runtime events bridge while keeping compiler metadata serializable.
|
|
27
|
+
- 3aa7dc5: Add experimental Connect-managed event subscriptions and per-connection webhook receivers. Durable event handlers run independently of conversation sessions; only an explicit `attachSession(...).send(...)` enters a session. Each watch saves its binding before subscribing, and each delivery runs independently under that binding. Subscribe with `ttlMs` in milliseconds or `null` to watch until stopped; `expiresAt` is returned as the calculated deadline. Requires `@vercel/connect@2.5.2` or later.
|
|
28
|
+
|
|
29
|
+
Return immediately from the durable sleep tool when steering has already interrupted its execution.
|
|
30
|
+
- 6d67e9a: Keep a session's deadline stable across workflow replay and compaction handoffs.
|
|
31
|
+
- 5243d1d: `web_fetch` now converts HTML pages served without a `Content-Type` header instead of returning truncated raw source.
|
|
32
|
+
|
|
3
33
|
## 0.79.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"moduleFingerprints": {
|
|
3
3
|
"@eve/catalog": "d5babf703f0f589f123ee2043b72bcb4823ccccbe5034315c3b70fbae7cd76a0",
|
|
4
|
-
"@eve/tracing": "f9d137e4e8838f1a359a8897b7229ecb243f441386b8e5e78fd71445be04b4ad",
|
|
5
4
|
"just-secrets": "1ce67d437d0bb06df02e4e99180a3c5f5edf0010314010226e97b96d462bba5d",
|
|
5
|
+
"@vercel/agent-runs": "94231f05d03adf6e62c1c56a941d763e7ed8a25a7c2f3c17a920f68225319325",
|
|
6
6
|
"@workflow/world-local": "a10e78551f65fc607cf75261a569d852c40bc9cfac13a7fb6e15c88bf1ccf429"
|
|
7
7
|
},
|
|
8
8
|
"moduleVersions": {
|
|
@@ -10,17 +10,16 @@
|
|
|
10
10
|
"@ai-sdk/anthropic": "4.0.78",
|
|
11
11
|
"@cfworker/json-schema": "4.1.1",
|
|
12
12
|
"@ai-sdk/code-mode": "1.0.94",
|
|
13
|
-
"chat": "4.
|
|
14
|
-
"@chat-adapter/slack": "4.
|
|
15
|
-
"@chat-adapter/state-memory": "4.
|
|
16
|
-
"@chat-adapter/twilio": "4.
|
|
13
|
+
"chat": "4.42.0",
|
|
14
|
+
"@chat-adapter/slack": "4.42.0",
|
|
15
|
+
"@chat-adapter/state-memory": "4.42.0",
|
|
16
|
+
"@chat-adapter/twilio": "4.42.0",
|
|
17
17
|
"@clack/core": "1.3.1",
|
|
18
18
|
"chokidar": "5.0.0",
|
|
19
19
|
"commander": "14.0.3",
|
|
20
20
|
"eventsource-parser": "3.1.0",
|
|
21
21
|
"env-runner": "0.1.16",
|
|
22
22
|
"@eve/catalog": "0.0.1",
|
|
23
|
-
"@eve/tracing": "0.0.0",
|
|
24
23
|
"@ai-sdk/google": "4.0.93",
|
|
25
24
|
"jose": "6.2.3",
|
|
26
25
|
"js-yaml": "4.3.2",
|
|
@@ -43,8 +42,9 @@
|
|
|
43
42
|
"@shadcn/registry": "0.1.3",
|
|
44
43
|
"@standard-schema/spec": "1.1.0",
|
|
45
44
|
"turndown": "7.2.4",
|
|
45
|
+
"@vercel/agent-runs": "0.0.1",
|
|
46
46
|
"@vercel/blob": "2.8.0",
|
|
47
|
-
"@vercel/connect": "2.
|
|
47
|
+
"@vercel/connect": "2.5.2",
|
|
48
48
|
"@vercel/detect-agent": "1.2.3",
|
|
49
49
|
"@vercel/oidc": "3.8.0",
|
|
50
50
|
"@vercel/otel": "2.1.3",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"zod": "4.5.4",
|
|
62
62
|
"zod-validation-error": "5.0.0"
|
|
63
63
|
},
|
|
64
|
-
"scriptHash": "
|
|
64
|
+
"scriptHash": "b055ff3422ddffe62e6ae90372223ff24902f7043d6f3fc1fb85f93565b81a1d",
|
|
65
65
|
"toolVersions": {
|
|
66
66
|
"rolldown": "1.2.9",
|
|
67
67
|
"typescript": "7.0.2"
|
|
@@ -67,6 +67,12 @@ interface SlackFileUpload {
|
|
|
67
67
|
title?: string;
|
|
68
68
|
}
|
|
69
69
|
interface SlackUploadOptions extends SlackApiOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Block Kit blocks for the message that shares the files. Slack renders the
|
|
72
|
+
* files below the blocks. Cannot be combined with `initialComment`, which
|
|
73
|
+
* Slack would otherwise use while silently ignoring `blocks`.
|
|
74
|
+
*/
|
|
75
|
+
blocks?: unknown[];
|
|
70
76
|
channelId?: string;
|
|
71
77
|
initialComment?: string;
|
|
72
78
|
threadTs?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../_chunks/node/chunk-7WDLOIRP-B_IWkVtZ.js";var t=class extends Error{method;response;status;constructor(e,t){super(e),this.name=`SlackApiError`,this.method=t.method,this.response=t.response,this.status=t.status}},n=`https://slack.com/api/`;async function r(e){return typeof e==`function`?await e():e}async function i(e,i,a){let o=await r(a.token),s=f(i,a.contentType??`form`),c=await(a.fetch??fetch)(new URL(e,a.apiUrl??n),{body:s.body,headers:{authorization:`Bearer ${o}`,"content-type":s.contentType},method:`POST`}),l=await c.json();if(!c.ok)throw new t(`Slack ${e} returned HTTP ${c.status}`,{method:e,response:l,status:c.status});return l}async function a(e){let t=await i(`chat.postMessage`,m(e),e);return p(`chat.postMessage`,t),{channel:x(t.channel),id:b(t.ts),raw:t}}async function o(e){let t=await i(`chat.postEphemeral`,{...m(e),user:e.user},e);return p(`chat.postEphemeral`,t),{channel:x(t.channel),id:b(t.message_ts),raw:t}}async function s(e){let t=await i(`chat.update`,{...m(e),ts:e.ts},e);return p(`chat.update`,t),{channel:x(t.channel),id:b(t.ts),raw:t}}async function c(e){let t=await i(`chat.delete`,{channel:e.channel,ts:e.ts},e);return p(`chat.delete`,t),t}async function l(e,n,r={}){let i=await(r.fetch??fetch)(e,{body:JSON.stringify(h(n)),headers:{"content-type":`application/json`},method:`POST`});if(!i.ok)throw new t(`Slack response_url returned HTTP ${i.status}`,{method:`response_url`,status:i.status})}async function u(e,n){if(e.length===0)return{fileIds:[],raw:{ok:!0}};let a=await r(n.token),o=n.fetch??fetch,s=[];for(let r of e){let e=await y(r.data),c=await i(`files.getUploadURLExternal`,{alt_txt:r.altText,filename:r.filename,length:e.byteLength,snippet_type:r.snippetType},n);p(`files.getUploadURLExternal`,c);let l=b(c.upload_url),u=b(c.file_id);if(!(l&&u))throw new t(`Slack files.getUploadURLExternal returned no upload URL`,{method:`files.getUploadURLExternal`,response:c});let d=await o(l,{body:e,headers:{authorization:`Bearer ${a}`,"content-type":`application/octet-stream`},method:`POST`});if(!d.ok)throw new t(`Slack file upload returned HTTP ${d.status}`,{method:`files.upload`,status:d.status});s.push(u)}let c=await i(`files.completeUploadExternal`,{channel_id:n.channelId,files:e.map((e,t)=>({id:s[t],title:e.title??e.filename})),initial_comment:n.initialComment,thread_ts:n.threadTs},n);return p(`files.completeUploadExternal`,c),{fileIds:s,raw:c}}async function d(n){let i=n.fetch??fetch,a=e(n.url,n.apiUrl)?await r(n.token):void 0,o=await i(n.url,{headers:a?{authorization:`Bearer ${a}`}:void 0});if(!o.ok)throw new t(`Slack file fetch returned HTTP ${o.status}`,{method:`files.fetch`,status:o.status});return o}function f(e,t=`form`){if(t===`json`)return{body:JSON.stringify(v(e)),contentType:`application/json`};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,_(r));return{body:n.toString(),contentType:`application/x-www-form-urlencoded`}}function p(e,n){if(n.ok!==!0)throw new t(`Slack ${e} failed: ${n.error??`unknown_error`}`,{method:e,response:n})}function m(e){return g(e),{blocks:e.blocks,channel:e.channel,markdown_text:e.markdownText,metadata:e.metadata,reply_broadcast:e.replyBroadcast,text:e.text,thread_ts:e.threadTs,unfurl_links:e.unfurlLinks,unfurl_media:e.unfurlMedia}}function h(e){return{blocks:e.blocks,delete_original:e.deleteOriginal,replace_original:e.replaceOriginal,response_type:e.responseType,text:e.text,thread_ts:e.threadTs}}function g(e){if(e.markdownText!==void 0&&(e.text!==void 0||e.blocks!==void 0))throw TypeError(`markdownText cannot be used with text or blocks`)}function _(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function v(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}async function y(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(await e.arrayBuffer())}function b(e){return typeof e==`string`?e:``}function x(e){return typeof e==`string`?e:void 0}async function S(e){let t=await i(`conversations.replies`,{channel:e.channel,cursor:e.cursor,include_all_metadata:e.includeAllMetadata,inclusive:e.inclusive,latest:e.latest,limit:e.limit,oldest:e.oldest,ts:e.ts},e);return p(`conversations.replies`,t),{messages:Array.isArray(t.messages)?t.messages:[],nextCursor:w(t),raw:t}}async function C(e){if(!(e.triggerId||e.interactivityPointer))throw TypeError(`triggerId or interactivityPointer is required`);let t=await i(`views.open`,{interactivity_pointer:e.interactivityPointer,trigger_id:e.triggerId,view:e.view},e);return p(`views.open`,t),{raw:t,view:t.view}}function w(e){let t=e.response_metadata?.next_cursor;return typeof t==`string`&&t.length>0?t:void 0}export{t as SlackApiError,p as assertSlackOk,i as callSlackApi,c as deleteSlackMessage,f as encodeSlackApiBody,d as fetchSlackFile,S as fetchSlackThreadReplies,C as openSlackView,o as postSlackEphemeral,a as postSlackMessage,r as resolveSlackBotToken,l as sendSlackResponseUrl,s as updateSlackMessage,u as uploadSlackFiles};
|
|
1
|
+
import{t as e}from"../../_chunks/node/chunk-7WDLOIRP-B_IWkVtZ.js";var t=class extends Error{method;response;status;constructor(e,t){super(e),this.name=`SlackApiError`,this.method=t.method,this.response=t.response,this.status=t.status}},n=`https://slack.com/api/`;async function r(e){return typeof e==`function`?await e():e}async function i(e,i,a){let o=await r(a.token),s=f(i,a.contentType??`form`),c=await(a.fetch??fetch)(new URL(e,a.apiUrl??n),{body:s.body,headers:{authorization:`Bearer ${o}`,"content-type":s.contentType},method:`POST`}),l=await c.json();if(!c.ok)throw new t(`Slack ${e} returned HTTP ${c.status}`,{method:e,response:l,status:c.status});return l}async function a(e){let t=await i(`chat.postMessage`,m(e),e);return p(`chat.postMessage`,t),{channel:x(t.channel),id:b(t.ts),raw:t}}async function o(e){let t=await i(`chat.postEphemeral`,{...m(e),user:e.user},e);return p(`chat.postEphemeral`,t),{channel:x(t.channel),id:b(t.message_ts),raw:t}}async function s(e){let t=await i(`chat.update`,{...m(e),ts:e.ts},e);return p(`chat.update`,t),{channel:x(t.channel),id:b(t.ts),raw:t}}async function c(e){let t=await i(`chat.delete`,{channel:e.channel,ts:e.ts},e);return p(`chat.delete`,t),t}async function l(e,n,r={}){let i=await(r.fetch??fetch)(e,{body:JSON.stringify(h(n)),headers:{"content-type":`application/json`},method:`POST`});if(!i.ok)throw new t(`Slack response_url returned HTTP ${i.status}`,{method:`response_url`,status:i.status})}async function u(e,n){if(n.blocks!==void 0&&n.initialComment!==void 0)throw TypeError(`blocks cannot be used with initialComment`);if(e.length===0)return{fileIds:[],raw:{ok:!0}};let a=await r(n.token),o=n.fetch??fetch,s=[];for(let r of e){let e=await y(r.data),c=await i(`files.getUploadURLExternal`,{alt_txt:r.altText,filename:r.filename,length:e.byteLength,snippet_type:r.snippetType},n);p(`files.getUploadURLExternal`,c);let l=b(c.upload_url),u=b(c.file_id);if(!(l&&u))throw new t(`Slack files.getUploadURLExternal returned no upload URL`,{method:`files.getUploadURLExternal`,response:c});let d=await o(l,{body:e,headers:{authorization:`Bearer ${a}`,"content-type":`application/octet-stream`},method:`POST`});if(!d.ok)throw new t(`Slack file upload returned HTTP ${d.status}`,{method:`files.upload`,status:d.status});s.push(u)}let c=await i(`files.completeUploadExternal`,{blocks:n.blocks,channel_id:n.channelId,files:e.map((e,t)=>({id:s[t],title:e.title??e.filename})),initial_comment:n.initialComment,thread_ts:n.threadTs},n);return p(`files.completeUploadExternal`,c),{fileIds:s,raw:c}}async function d(n){let i=n.fetch??fetch,a=e(n.url,n.apiUrl)?await r(n.token):void 0,o=await i(n.url,{headers:a?{authorization:`Bearer ${a}`}:void 0});if(!o.ok)throw new t(`Slack file fetch returned HTTP ${o.status}`,{method:`files.fetch`,status:o.status});return o}function f(e,t=`form`){if(t===`json`)return{body:JSON.stringify(v(e)),contentType:`application/json`};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,_(r));return{body:n.toString(),contentType:`application/x-www-form-urlencoded`}}function p(e,n){if(n.ok!==!0)throw new t(`Slack ${e} failed: ${n.error??`unknown_error`}`,{method:e,response:n})}function m(e){return g(e),{blocks:e.blocks,channel:e.channel,markdown_text:e.markdownText,metadata:e.metadata,reply_broadcast:e.replyBroadcast,text:e.text,thread_ts:e.threadTs,unfurl_links:e.unfurlLinks,unfurl_media:e.unfurlMedia}}function h(e){return{blocks:e.blocks,delete_original:e.deleteOriginal,replace_original:e.replaceOriginal,response_type:e.responseType,text:e.text,thread_ts:e.threadTs}}function g(e){if(e.markdownText!==void 0&&(e.text!==void 0||e.blocks!==void 0))throw TypeError(`markdownText cannot be used with text or blocks`)}function _(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function v(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}async function y(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(await e.arrayBuffer())}function b(e){return typeof e==`string`?e:``}function x(e){return typeof e==`string`?e:void 0}async function S(e){let t=await i(`conversations.replies`,{channel:e.channel,cursor:e.cursor,include_all_metadata:e.includeAllMetadata,inclusive:e.inclusive,latest:e.latest,limit:e.limit,oldest:e.oldest,ts:e.ts},e);return p(`conversations.replies`,t),{messages:Array.isArray(t.messages)?t.messages:[],nextCursor:w(t),raw:t}}async function C(e){if(!(e.triggerId||e.interactivityPointer))throw TypeError(`triggerId or interactivityPointer is required`);let t=await i(`views.open`,{interactivity_pointer:e.interactivityPointer,trigger_id:e.triggerId,view:e.view},e);return p(`views.open`,t),{raw:t,view:t.view}}function w(e){let t=e.response_metadata?.next_cursor;return typeof t==`string`&&t.length>0?t:void 0}export{t as SlackApiError,p as assertSlackOk,i as callSlackApi,c as deleteSlackMessage,f as encodeSlackApiBody,d as fetchSlackFile,S as fetchSlackThreadReplies,C as openSlackView,o as postSlackEphemeral,a as postSlackMessage,r as resolveSlackBotToken,l as sendSlackResponseUrl,s as updateSlackMessage,u as uploadSlackFiles};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as e}from"../../_chunks/node/chunk-
|
|
1
|
+
import{d as e}from"../../_chunks/node/chunk-NBSLXVG3-Bt7pDfyn.js";var t=class extends Error{constructor(e){super(e),this.name=`SlackBlockError`}},n={actionId:255,actionsElements:25,blockId:255,blocks:50,buttonText:75,buttonUrl:3e3,buttonValue:2e3,chartDataPoints:20,chartLabel:20,chartsPerMessage:2,chartSegments:12,chartSeries:12,chartTitle:50,fields:10,fieldText:2e3,headerText:150,imageAlt:2e3,imageUrl:3e3,optionDescription:75,optionText:75,optionValue:150,options:100,placeholder:150,radioOptions:10,sectionText:3e3,tableChars:1e4,tableColumns:20,tablePageSize:100,tableRows:100,textObject:3e3},r=`input:`,i=`input-freeform:`,a=`input-freeform-submit`,o=`input-freeform-block`,s=`input-freeform-text`,ee=/^(?<requestId>.+):button:\d+$/u;function c(e){let t={text:{text:g(e.prompt,n.sectionText),type:`mrkdwn`},type:`section`},r=e.options??[];if(r.length===0)return[t,{elements:[p(e.requestId)],type:`actions`}];let i=e.allowFreeform?[p(e.requestId)]:[];if(e.display===`radio`)return[t,{elements:[te(e),...i],type:`actions`}];if(e.display===`select`)return[t,{elements:[h(e),...i],type:`actions`}];let a=i.length>0?n.actionsElements-1:n.actionsElements;return[t,{elements:r.slice(0,a).map((t,n)=>m(e.requestId,t,n)).concat(i),type:`actions`}]}function l(e){if(!e.actionId.startsWith(`input:`))return null;let t=e.actionId.slice(r.length);if(e.selectedOptionValue!==void 0)return t?{optionId:e.selectedOptionValue,requestId:t}:null;let n=ee.exec(t)?.groups?.requestId;return n&&e.value!==void 0?{optionId:e.value,requestId:n}:null}function u(e){let t=g(e.title??e.prompt??`Your answer`,24),r=[];return e.prompt&&r.push({text:{text:g(e.prompt,n.sectionText),type:`mrkdwn`},type:`section`}),r.push({block_id:o,element:{action_id:s,multiline:!0,type:`plain_text_input`},label:{text:`Answer`,type:`plain_text`},type:`input`}),{blocks:r,callback_id:a,close:{text:`Cancel`,type:`plain_text`},private_metadata:typeof e.metadata==`string`?e.metadata:JSON.stringify(e.metadata),submit:{text:`Submit`,type:`plain_text`},title:{text:t,type:`plain_text`},type:`modal`}}function d(e){return e.find(e=>e.blockId===`input-freeform-block`&&e.actionId===`input-freeform-text`)?.value}function f(e){let t=[];return e.promptBlock&&typeof e.promptBlock==`object`&&t.push(e.promptBlock),t.push({text:{text:`:white_check_mark: *${e.answer}*`,type:`mrkdwn`},type:`section`}),e.userId&&t.push({elements:[{text:`Answered by <@${e.userId}>`,type:`mrkdwn`}],type:`context`}),t}function p(e){return{action_id:`${i}${e}`,style:`primary`,text:{text:`Type your answer`,type:`plain_text`},type:`button`,value:e}}function m(e,t,i){return _({action_id:`${r}${e}:button:${i}`,style:t.style===`primary`||t.style===`danger`?t.style:void 0,text:{text:g(t.label,n.buttonText),type:`plain_text`},type:`button`,value:g(t.id,n.buttonValue)})}function h(e){let t=(e.options??[]).map(e=>({text:{text:g(e.label,n.optionText),type:`plain_text`},value:g(e.id,n.optionValue)}));return{action_id:`${r}${e.requestId}`,options:t.slice(0,n.options),placeholder:{text:`Choose an option`,type:`plain_text`},type:`static_select`}}function te(e){let t=(e.options??[]).map(e=>({text:{text:g(e.label,n.optionText),type:`plain_text`},value:g(e.id,n.optionValue)}));return t.length>n.radioOptions?h(e):{action_id:`${r}${e.requestId}`,options:t,type:`radio_buttons`}}function g(e,t){return e.length>t?e.slice(0,t):e}function _(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}var v=` `,y=/\{\{emoji:([a-zA-Z0-9_+-]+)\}\}/g;function b(e,t={}){let r=[],i={chartCount:0,convertEmoji:t.convertEmoji??w,maxBlocks:t.maxBlocks??n.blocks,usedTable:!1};e.title&&r.push({text:K(e.title,i.convertEmoji,n.headerText),type:`header`}),e.subtitle&&r.push({elements:[G(e.subtitle,i.convertEmoji,n.textObject)],type:`context`}),e.imageUrl&&r.push({alt_text:Y(i.convertEmoji(e.title||`Card image`),n.imageAlt),image_url:Y(e.imageUrl,n.imageUrl),type:`image`});for(let t of e.children)r.push(...T(t,i));return r.slice(0,i.maxBlocks)}var x=b;function S(e,t={}){let n=t.convertEmoji??w,r=[];e.title&&r.push(`*${n(e.title)}*`),e.subtitle&&r.push(n(e.subtitle));for(let t of e.children){let e=W(t,n);e&&r.push(e)}return r.join(`
|
|
2
2
|
`)}var C=S;function w(e){return e.replace(y,`:$1:`)}function T(e,t){switch(e.type){case`actions`:return[k(e,t.convertEmoji)];case`chart`:return[z(e,t)];case`divider`:return[{type:`divider`}];case`fields`:return[L(e,t.convertEmoji)];case`image`:return[D(e,t.convertEmoji)];case`link`:return[O(e,t.convertEmoji)];case`section`:return e.children.flatMap(e=>T(e,t));case`table`:return R(e,t);case`text`:return[E(e,t.convertEmoji)];default:return Z(e)}}function E(t,r){let i=e(r(t.content));return t.style===`muted`?{elements:[G(i,e=>e,n.textObject)],type:`context`}:{text:G(t.style===`bold`?`*${i}*`:i,e=>e,n.sectionText),type:`section`}}function D(e,t){return{alt_text:Y(t(e.alt||`Image`),n.imageAlt),image_url:Y(e.url,n.imageUrl),type:`image`}}function O(e,t){return{text:G(`<${e.url}|${t(e.label)}>`,e=>e,n.sectionText),type:`section`}}function k(e,t){return{elements:e.children.slice(0,n.actionsElements).map(e=>A(e,t)),type:`actions`}}function A(e,t){switch(e.type){case`button`:return j(e,t);case`link-button`:return M(e,t);case`radio_select`:return P(e,t);case`select`:return N(e,t);default:return Z(e)}}function j(e,t){return Q({action_id:Y(e.id,n.actionId),style:J(e.style),text:K(e.label,t,n.buttonText),type:`button`,value:e.value===void 0?void 0:Y(e.value,n.buttonValue)})}function M(e,t){return Q({action_id:Y(e.id??`link-${e.url}`,n.actionId),style:J(e.style),text:K(e.label,t,n.buttonText),type:`button`,url:Y(e.url,n.buttonUrl)})}function N(e,t){let r=e.options.slice(0,n.options).map(e=>I(e,t,`plain_text`));return Q({action_id:Y(e.id,n.actionId),initial_option:F(r,e.initialOption),options:r,placeholder:e.placeholder?K(e.placeholder,t,n.placeholder):void 0,type:`static_select`})}function P(e,t){let r=e.options.slice(0,n.radioOptions).map(e=>I(e,t,`mrkdwn`));return Q({action_id:Y(e.id,n.actionId),initial_option:F(r,e.initialOption),options:r,type:`radio_buttons`})}function F(e,t){if(t===void 0)return;let r=Y(t,n.optionValue);return e.find(e=>e.value===r)}function I(e,t,r){return Q({description:e.description?{text:Y(t(e.description),n.optionDescription),type:r}:void 0,text:{text:Y(t(e.label),n.optionText),type:r},value:Y(e.value,n.optionValue)})}function L(t,r){return{fields:t.children.slice(0,n.fields).map(t=>G(`*${e(r(t.label))}*
|
|
3
3
|
${e(r(t.value))}`,e=>e,n.fieldText)),type:`section`}}function R(e,t){let r=[e.headers,...e.rows].flat().reduce((e,t)=>e+t.length,0);if(t.usedTable||e.rows.length+1>n.tableRows||e.headers.length>n.tableColumns||r>n.tableChars)return[{text:B($(e)),type:`section`}];t.usedTable=!0;let i=[e.headers.map(e=>q(e,t.convertEmoji)),...e.rows.map(e=>e.map(e=>q(e,t.convertEmoji)))];return e.rows.length===0?[Q({column_settings:e.align?.slice(0,n.tableColumns).map(e=>e?{align:e}:null),rows:i,type:`table`})]:[Q({caption:t.convertEmoji(e.caption||`Table`),page_size:e.pageSize===void 0?void 0:Math.min(n.tablePageSize,Math.max(1,Math.floor(e.pageSize))),rows:i,type:`data_table`})]}function z(e,t){let r=t.chartCount<n.chartsPerMessage?V(e,t.convertEmoji):null;return r?(t.chartCount+=1,r):{text:B(U(e)),type:`section`}}function B(e){let t=e=>`\`\`\`
|
|
4
4
|
${e}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"../../_chunks/node/chunk-
|
|
1
|
+
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"../../_chunks/node/chunk-NBSLXVG3-Bt7pDfyn.js";export{d as createSlackMrkdwn,o as createSlackPlainText,l as escapeSlackText,i as formatSlackChannel,e as formatSlackDate,s as formatSlackLink,u as formatSlackSpecialMention,t as formatSlackUser,a as formatSlackUserGroup,f as linkBareSlackMentions,n as markdownBoldToSlackMrkdwn,r as slackMrkdwnToMarkdown,c as unescapeSlackText};
|
|
@@ -2,7 +2,7 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
|
|
2
2
|
import { AttachmentTransport } from './_chat-adapter-shared.js';
|
|
3
3
|
export { AttachmentTransport, EncryptedTokenData, decodeKey } from './_chat-adapter-shared.js';
|
|
4
4
|
import { WebClientOptions, WebClient } from './_slack-web-api.js';
|
|
5
|
-
import { Message, AppContextEntity, CardElement, BaseFormatConverter, Root, AdapterPostableMessage, Logger, Adapter, ChatInstance, UserInfo, WebhookOptions, OptionsLoadResult, ModalResponse, ModalElement, AgentSessionStatus, LinkPreview, Attachment,
|
|
5
|
+
import { Message, AppContextEntity, CardElement, BaseFormatConverter, Root, AdapterPostableMessage, Logger, RawMessage, Adapter, ChatInstance, UserInfo, WebhookOptions, OptionsLoadResult, ModalResponse, ModalElement, AgentSessionStatus, LinkPreview, Attachment, EphemeralMessage, ScheduledMessage, FileUpload, PlanModel, PlanContent, EmojiValue, TypingOptions, StreamChunk, StreamOptions, FetchOptions, FetchResult, ThreadInfo, ChannelVisibility, FormattedContent, ListThreadsOptions, ListThreadsResult, ChannelInfo } from '#compiled/chat/index.js';
|
|
6
6
|
import { S as SlackFetch } from './fetch-QqNM_Ef3.js';
|
|
7
7
|
import { S as SlackWebhookVerifier } from './types-CdGmMyOr.js';
|
|
8
8
|
|
|
@@ -216,6 +216,14 @@ interface SlackSuggestedPromptsContext {
|
|
|
216
216
|
* resolver to skip setting prompts for that thread.
|
|
217
217
|
*/
|
|
218
218
|
type SlackSuggestedPrompts = SlackSuggestedPromptsOptions | ((context: SlackSuggestedPromptsContext) => SlackSuggestedPromptsOptions | null | undefined | Promise<SlackSuggestedPromptsOptions | null | undefined>);
|
|
219
|
+
/**
|
|
220
|
+
* Result of `SlackAdapter.stream()`. A reply that streams longer than
|
|
221
|
+
* `streamSegmentMaxAgeMs` is split into several Slack messages; `id` is the
|
|
222
|
+
* last one and `messageIds` lists all of them in order, ending with `id`.
|
|
223
|
+
*/
|
|
224
|
+
interface SlackStreamResult extends RawMessage<unknown> {
|
|
225
|
+
messageIds: string[];
|
|
226
|
+
}
|
|
219
227
|
/** Context passed to a dynamic agent-session title resolver. */
|
|
220
228
|
interface SlackSessionTitleContext {
|
|
221
229
|
channelId: string;
|
|
@@ -875,6 +883,7 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
875
883
|
* (single-workspace) → throws.
|
|
876
884
|
*/
|
|
877
885
|
protected getToken(): Promise<string>;
|
|
886
|
+
getConcurrencyScope(): string | undefined;
|
|
878
887
|
/**
|
|
879
888
|
* Add the current token to API call options.
|
|
880
889
|
* Workaround for Slack WebClient types not including `token` in per-method args.
|
|
@@ -1318,11 +1327,11 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1318
1327
|
* Slack expires a native stream after roughly five minutes, so a reply
|
|
1319
1328
|
* that streams longer than `streamSegmentMaxAgeMs` is finalized and
|
|
1320
1329
|
* continued in a new message. The returned `id` is the last message of
|
|
1321
|
-
* the reply
|
|
1330
|
+
* the reply, and `messageIds` lists every message of the reply in order.
|
|
1322
1331
|
*
|
|
1323
1332
|
* Falls back to post-and-edit when the thread lacks native stream context.
|
|
1324
1333
|
*/
|
|
1325
|
-
stream(threadId: string, textStream: AsyncIterable<string | StreamChunk>, options?: StreamOptions): Promise<
|
|
1334
|
+
stream(threadId: string, textStream: AsyncIterable<string | StreamChunk>, options?: StreamOptions): Promise<SlackStreamResult | null>;
|
|
1326
1335
|
/**
|
|
1327
1336
|
* Open a direct message conversation with a user.
|
|
1328
1337
|
* Returns a thread ID that can be used to post messages.
|
|
@@ -1339,11 +1348,8 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1339
1348
|
*
|
|
1340
1349
|
* Slack's API returns oldest-first, so for backward direction we:
|
|
1341
1350
|
* 1. Use `latest` parameter to fetch messages before a timestamp (cursor)
|
|
1342
|
-
* 2.
|
|
1351
|
+
* 2. Follow Slack's native cursors to the end, retaining the last N plus one
|
|
1343
1352
|
* 3. Return messages in chronological order (oldest first within the page)
|
|
1344
|
-
*
|
|
1345
|
-
* Note: For very large threads (>1000 messages), the first backward call
|
|
1346
|
-
* may not return the absolute most recent messages. This is a Slack API limitation.
|
|
1347
1353
|
*/
|
|
1348
1354
|
protected fetchMessagesBackward(channel: string, threadTs: string, threadId: string, limit: number, cursor?: string): Promise<FetchResult<unknown>>;
|
|
1349
1355
|
fetchThread(threadId: string): Promise<ThreadInfo>;
|
|
@@ -1479,4 +1485,4 @@ declare class SlackAdapter implements Adapter<SlackThreadId, unknown> {
|
|
|
1479
1485
|
}
|
|
1480
1486
|
declare function createSlackAdapter(config?: SlackAdapterConfig): SlackAdapter;
|
|
1481
1487
|
|
|
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 };
|
|
1488
|
+
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 SlackStreamResult, type SlackSuggestedPrompt, type SlackSuggestedPrompts, type SlackSuggestedPromptsContext, type SlackSuggestedPromptsOptions, type SlackThreadId, buildFeedbackButtonsBlock, cardToBlockKit, cardToFallbackText, createSlackAdapter, getAppContext, normalizeAppContextEntities };
|