@cuylabs/channel-slack-agent-core 0.10.0 → 0.11.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/README.md +13 -10
- package/dist/{chunk-L5RAGYVJ.js → chunk-U6RC4SXN.js} +87 -1
- package/dist/history/index.d.ts +7 -17
- package/dist/index.d.ts +4 -28
- package/dist/index.js +12 -60
- package/dist/interactive/index.d.ts +86 -7
- package/dist/shared/index.d.ts +121 -8
- package/dist/shared/index.js +4 -4
- package/docs/README.md +0 -1
- package/docs/concepts/final-response-artifacts.md +9 -7
- package/docs/concepts/tool-task-rendering.md +2 -0
- package/docs/reference/exports.md +10 -20
- package/package.json +4 -54
- package/dist/adapter/index.d.ts +0 -26
- package/dist/adapter/index.js +0 -9
- package/dist/adapter-vbqtraAr.d.ts +0 -31
- package/dist/app-surface.d.ts +0 -82
- package/dist/app-surface.js +0 -10
- package/dist/app.d.ts +0 -60
- package/dist/app.js +0 -11
- package/dist/artifacts/index.d.ts +0 -57
- package/dist/artifacts/index.js +0 -6
- package/dist/assistant/index.d.ts +0 -22
- package/dist/assistant/index.js +0 -14
- package/dist/chunk-6EMFBOXD.js +0 -67
- package/dist/chunk-A2PLAVW6.js +0 -75
- package/dist/chunk-C7CHMYV6.js +0 -226
- package/dist/chunk-DS6E5OEJ.js +0 -85
- package/dist/chunk-ELR6MQD7.js +0 -12
- package/dist/chunk-GEFK72VO.js +0 -921
- package/dist/chunk-KQPUQJ57.js +0 -482
- package/dist/chunk-NNCVHQC4.js +0 -94
- package/dist/chunk-P2DIC42J.js +0 -77
- package/dist/chunk-Q2GU4QLZ.js +0 -187
- package/dist/chunk-QFDXKCAQ.js +0 -82
- package/dist/express-assistant.d.ts +0 -106
- package/dist/express-assistant.js +0 -9
- package/dist/express.d.ts +0 -103
- package/dist/express.js +0 -8
- package/dist/feedback/index.d.ts +0 -1
- package/dist/feedback/index.js +0 -10
- package/dist/options-ByNm2o89.d.ts +0 -323
- package/dist/options-CGUfVStV.d.ts +0 -119
- package/dist/socket.d.ts +0 -143
- package/dist/socket.js +0 -13
- package/dist/types-BeGPexio.d.ts +0 -381
- package/dist/types-Bz4OYEAV.d.ts +0 -87
- package/dist/types-CiwGU6zC.d.ts +0 -56
- package/dist/views/index.d.ts +0 -8
- package/dist/views/index.js +0 -10
- package/docs/concepts/view-workflows.md +0 -52
package/README.md
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Slack adapter for `@cuylabs/agent-core`, built on
|
|
4
4
|
`@cuylabs/channel-slack`.
|
|
5
5
|
|
|
6
|
-
Use this package when an Agent Core application needs
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Use this package when an Agent Core application needs Agent Core-specific Slack
|
|
7
|
+
bindings: event mapping, source adaptation, context fragments, history helpers,
|
|
8
|
+
MCP token bridging, or approval/human-input controller binding.
|
|
9
9
|
|
|
10
|
-
Generic Slack mechanics
|
|
11
|
-
|
|
10
|
+
Generic Slack mechanics, mounts, Assistant rendering, classic message routing,
|
|
11
|
+
feedback, artifacts, interactive stores/builders, response sinks, and
|
|
12
12
|
transports live in `@cuylabs/channel-slack`.
|
|
13
13
|
|
|
14
14
|
## Install
|
|
@@ -33,10 +33,11 @@ without injecting its own client.
|
|
|
33
33
|
Socket Mode:
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import {
|
|
36
|
+
import { mountSlackAppSocket } from "@cuylabs/channel-slack/socket";
|
|
37
|
+
import { adaptAgentTurnSourceToSlackTurnSource } from "@cuylabs/channel-slack-agent-core";
|
|
37
38
|
|
|
38
|
-
await
|
|
39
|
-
source: agent,
|
|
39
|
+
await mountSlackAppSocket({
|
|
40
|
+
source: adaptAgentTurnSourceToSlackTurnSource(agent),
|
|
40
41
|
appToken: process.env.SLACK_APP_TOKEN,
|
|
41
42
|
botToken: process.env.SLACK_BOT_TOKEN,
|
|
42
43
|
});
|
|
@@ -45,9 +46,11 @@ await mountSlackAssistantAgentSocket({
|
|
|
45
46
|
Express Events API:
|
|
46
47
|
|
|
47
48
|
```typescript
|
|
48
|
-
import {
|
|
49
|
+
import { mountSlackApp } from "@cuylabs/channel-slack/app";
|
|
50
|
+
import { adaptAgentTurnSourceToSlackTurnSource } from "@cuylabs/channel-slack-agent-core";
|
|
49
51
|
|
|
50
|
-
await
|
|
52
|
+
await mountSlackApp({
|
|
53
|
+
source: adaptAgentTurnSourceToSlackTurnSource(agent),
|
|
51
54
|
botToken: process.env.SLACK_BOT_TOKEN,
|
|
52
55
|
signingSecret: process.env.SLACK_SIGNING_SECRET,
|
|
53
56
|
});
|
|
@@ -1,3 +1,74 @@
|
|
|
1
|
+
// src/shared/context-fragments.ts
|
|
2
|
+
import {
|
|
3
|
+
currentSlackTurnContext
|
|
4
|
+
} from "@cuylabs/channel-slack/core";
|
|
5
|
+
var DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY = "slackContextFragment";
|
|
6
|
+
function isRecord(value) {
|
|
7
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function isPayload(value) {
|
|
10
|
+
return isRecord(value) && typeof value.content === "string";
|
|
11
|
+
}
|
|
12
|
+
function resolveContextBagValue(slack, key) {
|
|
13
|
+
const value = slack.context?.[key];
|
|
14
|
+
if (typeof value === "string") {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
if (isPayload(value)) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
function resolveDedupeKey(options, context) {
|
|
23
|
+
return typeof options.dedupeKey === "function" ? options.dedupeKey(context) : options.dedupeKey;
|
|
24
|
+
}
|
|
25
|
+
function resolveMetadata(options, context) {
|
|
26
|
+
return typeof options.metadata === "function" ? options.metadata(context) : options.metadata;
|
|
27
|
+
}
|
|
28
|
+
function normalizeFragment(resolved, options, context) {
|
|
29
|
+
const payload = typeof resolved === "string" ? { content: resolved } : isPayload(resolved) ? resolved : void 0;
|
|
30
|
+
if (!payload) {
|
|
31
|
+
return resolved;
|
|
32
|
+
}
|
|
33
|
+
if (payload.content.trim().length === 0) {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
const dedupeKey = payload.dedupeKey ?? resolveDedupeKey(options, context);
|
|
37
|
+
const metadata = payload.metadata ?? resolveMetadata(options, context);
|
|
38
|
+
const maxChars = payload.maxChars ?? options.maxChars;
|
|
39
|
+
return {
|
|
40
|
+
kind: payload.kind ?? options.kind ?? "slack-context",
|
|
41
|
+
content: payload.content,
|
|
42
|
+
role: payload.role ?? options.role ?? "user",
|
|
43
|
+
placement: payload.placement ?? options.placement ?? "after-latest-user",
|
|
44
|
+
lifetime: payload.lifetime ?? options.lifetime ?? "turn",
|
|
45
|
+
source: payload.source ?? options.source ?? "slack",
|
|
46
|
+
title: payload.title ?? options.title ?? "Slack Context",
|
|
47
|
+
budgetBehavior: payload.budgetBehavior ?? options.budgetBehavior ?? "droppable",
|
|
48
|
+
...maxChars !== void 0 ? { maxChars } : {},
|
|
49
|
+
...dedupeKey ? { dedupeKey } : {},
|
|
50
|
+
...metadata ? { metadata } : {}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function createSlackContextFragmentMiddleware(options = {}) {
|
|
54
|
+
const contextKey = options.contextKey ?? DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY;
|
|
55
|
+
return {
|
|
56
|
+
name: options.name ?? "slack-context-fragment",
|
|
57
|
+
async contextFragments(step) {
|
|
58
|
+
const slack = currentSlackTurnContext();
|
|
59
|
+
if (!slack) {
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
const context = { slack, step };
|
|
63
|
+
const resolved = options.resolve ? await options.resolve(context) : resolveContextBagValue(slack, contextKey);
|
|
64
|
+
if (resolved === void 0) {
|
|
65
|
+
return void 0;
|
|
66
|
+
}
|
|
67
|
+
return normalizeFragment(resolved, options, context);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
1
72
|
// src/shared/event-bridge/agent-event-mapper.ts
|
|
2
73
|
function mapAgentEventToSlackTurnEvent(event) {
|
|
3
74
|
switch (event.type) {
|
|
@@ -236,10 +307,25 @@ var UnsupportedSlackInteractiveRequestError = class extends Error {
|
|
|
236
307
|
}
|
|
237
308
|
};
|
|
238
309
|
|
|
310
|
+
// src/shared/event-bridge/turn-source.ts
|
|
311
|
+
function adaptAgentTurnSourceToSlackTurnSource(source) {
|
|
312
|
+
return {
|
|
313
|
+
async *chat(sessionId, message, options) {
|
|
314
|
+
const events = source.chat(sessionId, message, options);
|
|
315
|
+
for await (const event of events) {
|
|
316
|
+
yield mapAgentEventToSlackTurnEvent(event);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
|
|
239
322
|
export {
|
|
323
|
+
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
324
|
+
createSlackContextFragmentMiddleware,
|
|
240
325
|
mapAgentEventToSlackTurnEvent,
|
|
241
326
|
mapAgentSlackEventBridgeOptionsToRuntimeOptions,
|
|
242
327
|
bridgeAgentEventsToSlack,
|
|
243
328
|
resolveSlackEventBridgeOptions,
|
|
244
|
-
UnsupportedSlackInteractiveRequestError
|
|
329
|
+
UnsupportedSlackInteractiveRequestError,
|
|
330
|
+
adaptAgentTurnSourceToSlackTurnSource
|
|
245
331
|
};
|
package/dist/history/index.d.ts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { Logger } from '@cuylabs/agent-core';
|
|
2
2
|
import { SlackHistoryUnavailable, SlackSupplementalHistoryVisibilityMode } from '@cuylabs/channel-slack/history';
|
|
3
|
-
import {
|
|
3
|
+
import { SlackTurnRequestContext, SlackAssistantUtilities } from '@cuylabs/channel-slack/core';
|
|
4
|
+
import { WebClient } from '@slack/web-api';
|
|
4
5
|
import { a as SlackContextFragmentPayload } from '../context-fragments-CQEDcjYR.js';
|
|
5
|
-
import '@slack/bolt';
|
|
6
|
-
import '@slack/web-api';
|
|
7
|
-
import '../options-ByNm2o89.js';
|
|
8
|
-
import '@cuylabs/channel-slack/core';
|
|
9
|
-
import '../interactive-BigrPKnu.js';
|
|
10
|
-
import '@cuylabs/channel-slack/interactive';
|
|
11
|
-
import '../options-CGUfVStV.js';
|
|
12
|
-
import '../artifacts/index.js';
|
|
13
|
-
import '@cuylabs/channel-slack/artifacts';
|
|
14
|
-
import '@cuylabs/channel-slack/feedback';
|
|
15
|
-
import '@cuylabs/channel-slack/assistant';
|
|
16
|
-
import '../types-BeGPexio.js';
|
|
17
|
-
import '../types-Bz4OYEAV.js';
|
|
18
|
-
import '../types-CiwGU6zC.js';
|
|
19
|
-
import '@cuylabs/channel-slack/views';
|
|
20
6
|
|
|
7
|
+
interface SlackAgentHistoryTurnRequestContext extends SlackTurnRequestContext {
|
|
8
|
+
assistant?: SlackAssistantUtilities;
|
|
9
|
+
client?: WebClient;
|
|
10
|
+
}
|
|
21
11
|
interface SlackAgentTurnHistoryOptions {
|
|
22
12
|
enabled: boolean;
|
|
23
13
|
limit: number;
|
|
@@ -40,7 +30,7 @@ interface LoadSlackAgentTurnHistoryContextOptions {
|
|
|
40
30
|
logger?: Pick<Logger, "debug" | "info" | "warn">;
|
|
41
31
|
originChannelId?: string;
|
|
42
32
|
profileResolver?: SlackAgentTurnHistoryProfileResolver;
|
|
43
|
-
request:
|
|
33
|
+
request: SlackAgentHistoryTurnRequestContext;
|
|
44
34
|
}
|
|
45
35
|
type SlackAgentTurnHistoryContextResult = {
|
|
46
36
|
fragment?: SlackContextFragmentPayload;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,17 @@
|
|
|
1
1
|
export { D as DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY, S as SlackContextFragmentMiddlewareOptions, a as SlackContextFragmentPayload, b as SlackContextFragmentResolver, c as SlackContextFragmentResolverContext, d as createSlackContextFragmentMiddleware } from './context-fragments-CQEDcjYR.js';
|
|
2
|
-
export { UnsupportedSlackInteractiveRequestError, bridgeAgentEventsToSlack, mapAgentEventToSlackTurnEvent, mapAgentSlackEventBridgeOptionsToRuntimeOptions } from './shared/index.js';
|
|
3
|
-
export { S as SlackEventBridgeOptions, r as resolveSlackEventBridgeOptions } from './options-CGUfVStV.js';
|
|
2
|
+
export { SlackEventBridgeOptions, UnsupportedSlackInteractiveRequestError, adaptAgentTurnSourceToSlackTurnSource, bridgeAgentEventsToSlack, mapAgentEventToSlackTurnEvent, mapAgentSlackEventBridgeOptionsToRuntimeOptions, resolveSlackEventBridgeOptions } from './shared/index.js';
|
|
4
3
|
export { S as SlackApprovalRequest, a as SlackEventInteractiveRequestHandler, b as SlackHumanInputRequest, c as SlackInteractiveRequest, d as SlackInteractiveRequestBaseContext, e as SlackInteractiveRequestContext, f as SlackInteractiveRequestHandler } from './interactive-BigrPKnu.js';
|
|
5
|
-
export { c as createSlackChannelAdapter } from './adapter-vbqtraAr.js';
|
|
6
|
-
export { S as SlackChannelAdapter, a as SlackChannelOptions, b as SlackSessionStrategy, c as SlackStreamingMode, d as SlackToolStartEvent } from './types-BeGPexio.js';
|
|
7
|
-
export { SlackSessionMap, createSlackSessionMap } from './adapter/index.js';
|
|
8
|
-
export { createSlackAssistantBridge } from './assistant/index.js';
|
|
9
|
-
export { A as AssistantLifecycleArgs, a as AssistantThreadStartedArgs, C as CreateSlackAssistantBridgeOptions, M as MaybePromise, S as SlackAssistantBridge, b as SlackAssistantCancelControlOptions, c as SlackAssistantCancelControlVisibleWhen, d as SlackAssistantFeedbackConfig, e as SlackAssistantSessionStrategy, f as SlackAssistantStatusContext, g as SlackAssistantThreadContextStoreLike, h as SlackAssistantThreadStartedContext, i as SlackAssistantTurnCancelContext, j as SlackAssistantTurnControlsOptions, k as SlackAssistantTurnPreparation, l as SlackAssistantUserMessageContext, r as resolveAssistantSessionId } from './options-ByNm2o89.js';
|
|
10
|
-
export { ParsedAssistantUserMessage, createSlackAssistantThreadContextStore, parseSlackMessageActivityFromMessageEvent } from '@cuylabs/channel-slack/assistant';
|
|
11
|
-
export { CreateSlackFinalResponseArtifactPublisherOptions, SlackFinalResponseArtifactContext, SlackFinalResponseArtifactDeliveryMode, SlackFinalResponseArtifactPublisher, SlackFinalResponseArtifactResult, SlackFinalResponseArtifactValueResolver, createSlackFinalResponseArtifactPublisher } from './artifacts/index.js';
|
|
12
4
|
export { LoadSlackAgentTurnHistoryContextOptions, SlackAgentTurnHistoryContextResult, SlackAgentTurnHistoryOptions, SlackAgentTurnHistoryProfileResolver, emptySlackAgentTurnHistoryContextResult, loadSlackAgentTurnHistoryContext } from './history/index.js';
|
|
13
|
-
export {
|
|
14
|
-
export { createSlackInteractiveController } from './interactive/index.js';
|
|
15
|
-
export { createSlackAgentViewWorkflowController } from './views/index.js';
|
|
16
|
-
export { C as CreateSlackAgentViewWorkflowControllerOptions, S as SlackAgentViewStateValue, a as SlackAgentViewStateValues, b as SlackAgentViewWorkflow, c as SlackAgentViewWorkflowContext, d as SlackAgentViewWorkflowController, e as SlackAgentViewWorkflowDefinition, f as extractSlackAgentViewStateValues, r as readSlackAgentViewStateValue } from './types-CiwGU6zC.js';
|
|
5
|
+
export { SlackInteractiveApprovalRequest, SlackInteractiveController, SlackInteractiveControllerOptions, SlackInteractiveHumanInputRequest, SlackInteractivePendingWaiter, SlackInteractivePostedMessage, SlackInteractiveRequestWaitOptions, SlackInteractiveResolution, createSlackInteractiveController } from './interactive/index.js';
|
|
17
6
|
export { InspectSlackTurnStatusVisibilityOptions, ResolvedSlackTurnStatusVisibilityOptions, RouteSlackAgentEventOptions, SlackActiveToolCall, SlackAgentEventQueue, SlackAgentEventQueueState, SlackSubagentCompletionMessage, SlackSubagentCompletionMessageFormatterOptions, SlackSubagentCompletionNotifierOptions, SlackSubagentCompletionPoster, SlackSubagentCompletionRun, SlackSubagentCompletionSlackContext, SlackSubagentCompletionTurnContext, SlackTurnActivityState, SlackTurnPhase, SlackTurnStatusVisibilityOptions, SlackTurnStatusVisibilityState, SlackTurnStatusVisibilityWarning, SlackTypedApprovalAction, coalesceSlackAgentEvents, createSlackSubagentCompletionNotifier, formatDefaultSlackSubagentCompletionMessage, immediateSlackTextResponse, inspectSlackTurnStatusVisibility, isAbortLikeError, isRunningAgentTurnError, isSlackCancelMessage, isSlackSubagentTerminalEvent, isSlackTerminalTurnPhase, isSlackWaitingForHumanTurnPhase, recordSlackTurnActivity, resolveSlackTurnStatusVisibilityOptions, resolveSlackTypedApprovalAction, routeSlackAgentEvent, shouldInspectSlackTurnStatusVisibility, shouldQueueSlackAgentEvent } from './source/index.js';
|
|
18
|
-
export { MountSlackAgentOptions, MountSlackAgentResult, mountSlackAgent } from './express.js';
|
|
19
|
-
export { MountSlackAssistantAgentOptions, MountSlackAssistantAgentResult, mountSlackAssistantAgent } from './express-assistant.js';
|
|
20
|
-
export { MountSlackAgentAppSocketOptions, MountSlackAgentAppSocketResult, MountSlackAssistantAgentSocketOptions, MountSlackAssistantAgentSocketResult, mountSlackAgentAppSocket, mountSlackAssistantAgentSocket } from './socket.js';
|
|
21
|
-
export { MountSlackAgentAppOptions, MountSlackAgentAppResult, mountSlackAgentApp } from './app.js';
|
|
22
7
|
export { CreateSlackMcpServerConfigOptions, SLACK_MCP_URL, createSlackMcpServerConfig } from './mcp.js';
|
|
23
|
-
export { MountSlackAgentAppTurnRequestContext } from './app-surface.js';
|
|
24
8
|
import '@cuylabs/agent-core';
|
|
25
9
|
import '@cuylabs/channel-slack/core';
|
|
26
10
|
import '@cuylabs/channel-slack/responses';
|
|
27
11
|
import '@cuylabs/channel-slack/runtime';
|
|
28
12
|
import '@cuylabs/channel-slack/interactive';
|
|
29
|
-
import '@slack/bolt';
|
|
30
|
-
import '@slack/web-api';
|
|
31
|
-
import '@cuylabs/channel-slack/feedback';
|
|
32
|
-
import '@cuylabs/channel-slack/artifacts';
|
|
33
13
|
import '@cuylabs/channel-slack/history';
|
|
34
|
-
import '@
|
|
14
|
+
import '@slack/web-api';
|
|
15
|
+
import '@slack/bolt';
|
|
35
16
|
import '@cuylabs/agent-core/dispatch';
|
|
36
|
-
import 'node:http';
|
|
37
|
-
import 'express';
|
|
38
|
-
import '@cuylabs/channel-slack/transports/http';
|
|
39
|
-
import '@cuylabs/channel-slack/auth';
|
|
40
|
-
import '@cuylabs/channel-slack/transports/socket';
|
|
41
17
|
import '@cuylabs/agent-core/mcp';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
SLACK_MCP_URL,
|
|
3
|
+
createSlackMcpServerConfig
|
|
4
|
+
} from "./chunk-RFHXERNL.js";
|
|
4
5
|
import {
|
|
5
6
|
emptySlackAgentTurnHistoryContextResult,
|
|
6
7
|
loadSlackAgentTurnHistoryContext
|
|
@@ -10,8 +11,14 @@ import {
|
|
|
10
11
|
} from "./chunk-OP27SSZU.js";
|
|
11
12
|
import {
|
|
12
13
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
UnsupportedSlackInteractiveRequestError,
|
|
15
|
+
adaptAgentTurnSourceToSlackTurnSource,
|
|
16
|
+
bridgeAgentEventsToSlack,
|
|
17
|
+
createSlackContextFragmentMiddleware,
|
|
18
|
+
mapAgentEventToSlackTurnEvent,
|
|
19
|
+
mapAgentSlackEventBridgeOptionsToRuntimeOptions,
|
|
20
|
+
resolveSlackEventBridgeOptions
|
|
21
|
+
} from "./chunk-U6RC4SXN.js";
|
|
15
22
|
import {
|
|
16
23
|
coalesceSlackAgentEvents,
|
|
17
24
|
createSlackSubagentCompletionNotifier,
|
|
@@ -31,65 +38,18 @@ import {
|
|
|
31
38
|
shouldInspectSlackTurnStatusVisibility,
|
|
32
39
|
shouldQueueSlackAgentEvent
|
|
33
40
|
} from "./chunk-C7VSW4ZM.js";
|
|
34
|
-
import {
|
|
35
|
-
createSlackAgentViewWorkflowController,
|
|
36
|
-
extractSlackAgentViewStateValues,
|
|
37
|
-
readSlackAgentViewStateValue
|
|
38
|
-
} from "./chunk-C7CHMYV6.js";
|
|
39
|
-
import {
|
|
40
|
-
mountSlackAgentApp
|
|
41
|
-
} from "./chunk-P2DIC42J.js";
|
|
42
|
-
import {
|
|
43
|
-
mountSlackAssistantAgent
|
|
44
|
-
} from "./chunk-DS6E5OEJ.js";
|
|
45
|
-
import {
|
|
46
|
-
mountSlackAgent
|
|
47
|
-
} from "./chunk-QFDXKCAQ.js";
|
|
48
|
-
import {
|
|
49
|
-
SLACK_MCP_URL,
|
|
50
|
-
createSlackMcpServerConfig
|
|
51
|
-
} from "./chunk-RFHXERNL.js";
|
|
52
|
-
import {
|
|
53
|
-
mountSlackAgentAppSocket,
|
|
54
|
-
mountSlackAssistantAgentSocket
|
|
55
|
-
} from "./chunk-6EMFBOXD.js";
|
|
56
|
-
import "./chunk-Q2GU4QLZ.js";
|
|
57
|
-
import {
|
|
58
|
-
createSlackAssistantBridge,
|
|
59
|
-
createSlackAssistantThreadContextStore,
|
|
60
|
-
parseSlackMessageActivityFromMessageEvent,
|
|
61
|
-
resolveAssistantSessionId
|
|
62
|
-
} from "./chunk-GEFK72VO.js";
|
|
63
|
-
import "./chunk-ELR6MQD7.js";
|
|
64
|
-
import {
|
|
65
|
-
createSlackChannelAdapter,
|
|
66
|
-
createSlackSessionMap
|
|
67
|
-
} from "./chunk-KQPUQJ57.js";
|
|
68
|
-
import {
|
|
69
|
-
UnsupportedSlackInteractiveRequestError,
|
|
70
|
-
bridgeAgentEventsToSlack,
|
|
71
|
-
mapAgentEventToSlackTurnEvent,
|
|
72
|
-
mapAgentSlackEventBridgeOptionsToRuntimeOptions,
|
|
73
|
-
resolveSlackEventBridgeOptions
|
|
74
|
-
} from "./chunk-L5RAGYVJ.js";
|
|
75
41
|
export {
|
|
76
42
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
77
43
|
SLACK_MCP_URL,
|
|
78
44
|
UnsupportedSlackInteractiveRequestError,
|
|
45
|
+
adaptAgentTurnSourceToSlackTurnSource,
|
|
79
46
|
bridgeAgentEventsToSlack,
|
|
80
47
|
coalesceSlackAgentEvents,
|
|
81
|
-
createSlackAgentViewWorkflowController,
|
|
82
|
-
createSlackAssistantBridge,
|
|
83
|
-
createSlackAssistantThreadContextStore,
|
|
84
|
-
createSlackChannelAdapter,
|
|
85
48
|
createSlackContextFragmentMiddleware,
|
|
86
|
-
createSlackFinalResponseArtifactPublisher,
|
|
87
49
|
createSlackInteractiveController,
|
|
88
50
|
createSlackMcpServerConfig,
|
|
89
|
-
createSlackSessionMap,
|
|
90
51
|
createSlackSubagentCompletionNotifier,
|
|
91
52
|
emptySlackAgentTurnHistoryContextResult,
|
|
92
|
-
extractSlackAgentViewStateValues,
|
|
93
53
|
formatDefaultSlackSubagentCompletionMessage,
|
|
94
54
|
immediateSlackTextResponse,
|
|
95
55
|
inspectSlackTurnStatusVisibility,
|
|
@@ -102,15 +62,7 @@ export {
|
|
|
102
62
|
loadSlackAgentTurnHistoryContext,
|
|
103
63
|
mapAgentEventToSlackTurnEvent,
|
|
104
64
|
mapAgentSlackEventBridgeOptionsToRuntimeOptions,
|
|
105
|
-
mountSlackAgent,
|
|
106
|
-
mountSlackAgentApp,
|
|
107
|
-
mountSlackAgentAppSocket,
|
|
108
|
-
mountSlackAssistantAgent,
|
|
109
|
-
mountSlackAssistantAgentSocket,
|
|
110
|
-
parseSlackMessageActivityFromMessageEvent,
|
|
111
|
-
readSlackAgentViewStateValue,
|
|
112
65
|
recordSlackTurnActivity,
|
|
113
|
-
resolveAssistantSessionId,
|
|
114
66
|
resolveSlackEventBridgeOptions,
|
|
115
67
|
resolveSlackTurnStatusVisibilityOptions,
|
|
116
68
|
resolveSlackTypedApprovalAction,
|
|
@@ -1,11 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import '@
|
|
4
|
-
import '
|
|
5
|
-
import '@slack/bolt';
|
|
6
|
-
import '../interactive-BigrPKnu.js';
|
|
1
|
+
import { ApprovalRequest, ApprovalResolution, HumanInputRequest, HumanInputResponse, ApprovalAction, ApprovalRememberScope } from '@cuylabs/agent-core';
|
|
2
|
+
import { SlackInteractiveActionIds, SlackInteractiveRequestStore, SlackInteractiveRequestRecord, SlackInteractiveActor, SlackInteractiveHumanInputRequest as SlackInteractiveHumanInputRequest$1, SlackInteractiveMessageRef } from '@cuylabs/channel-slack/interactive';
|
|
3
|
+
import { App } from '@slack/bolt';
|
|
4
|
+
import { e as SlackInteractiveRequestContext } from '../interactive-BigrPKnu.js';
|
|
7
5
|
import '@cuylabs/channel-slack/core';
|
|
8
6
|
|
|
7
|
+
type SlackInteractiveApprovalRequest = ApprovalRequest;
|
|
8
|
+
type SlackInteractiveHumanInputRequest = SlackInteractiveHumanInputRequest$1 & Partial<Pick<HumanInputRequest, "sessionId" | "timestamp" | "toolCallId">>;
|
|
9
|
+
type SlackInteractiveResolution = {
|
|
10
|
+
kind: "approval";
|
|
11
|
+
action: ApprovalAction;
|
|
12
|
+
feedback?: string;
|
|
13
|
+
rememberScope?: ApprovalRememberScope;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "human-input";
|
|
16
|
+
response: HumanInputResponse;
|
|
17
|
+
};
|
|
18
|
+
interface SlackInteractiveRequestWaitOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Abort waiting for this request. The controller removes its local waiter and
|
|
21
|
+
* deletes the pending store record when the signal fires.
|
|
22
|
+
*/
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
/**
|
|
25
|
+
* Override the controller-level request timeout for this request. Use `0` to
|
|
26
|
+
* disable timeout cleanup for this request.
|
|
27
|
+
*/
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
}
|
|
30
|
+
interface SlackInteractiveControllerOptions {
|
|
31
|
+
store?: SlackInteractiveRequestStore;
|
|
32
|
+
/**
|
|
33
|
+
* Stable namespace for default Slack action IDs. Use this when installing
|
|
34
|
+
* multiple interactive controllers in the same Slack app.
|
|
35
|
+
*
|
|
36
|
+
* @default "agent_slack"
|
|
37
|
+
*/
|
|
38
|
+
namespace?: string;
|
|
39
|
+
actionIds?: Partial<SlackInteractiveActionIds>;
|
|
40
|
+
/**
|
|
41
|
+
* Default timeout for local waiters and pending store records. This should
|
|
42
|
+
* usually match the agent-core approval/human-input timeout.
|
|
43
|
+
*
|
|
44
|
+
* @default 300000
|
|
45
|
+
*/
|
|
46
|
+
requestTimeoutMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Called on every successful Slack resolution after the local waiter, if
|
|
49
|
+
* present, is resolved. Use this to fan out decisions to agent-server or
|
|
50
|
+
* another runtime that owns the turn.
|
|
51
|
+
*/
|
|
52
|
+
onResolve?: (requestId: string, resolution: SlackInteractiveResolution) => void | Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Authorization hook for approving/responding to pending requests.
|
|
55
|
+
*
|
|
56
|
+
* Defaults to the original Slack requester only. Return `true` for delegated
|
|
57
|
+
* approvers, channel owners, or admin policy checks.
|
|
58
|
+
*/
|
|
59
|
+
authorize?: (record: SlackInteractiveRequestRecord, actor: SlackInteractiveActor) => boolean | Promise<boolean>;
|
|
60
|
+
}
|
|
61
|
+
interface SlackInteractiveController {
|
|
62
|
+
readonly actionIds: SlackInteractiveActionIds;
|
|
63
|
+
readonly store: SlackInteractiveRequestStore;
|
|
64
|
+
approval: {
|
|
65
|
+
onRequest(request: ApprovalRequest, options?: SlackInteractiveRequestWaitOptions): Promise<ApprovalResolution>;
|
|
66
|
+
};
|
|
67
|
+
humanInput: {
|
|
68
|
+
onRequest(request: HumanInputRequest, options?: SlackInteractiveRequestWaitOptions): Promise<HumanInputResponse>;
|
|
69
|
+
};
|
|
70
|
+
/** Reject one pending in-process waiter and delete its pending store record. */
|
|
71
|
+
cancel(requestId: string, reason?: string): Promise<boolean>;
|
|
72
|
+
/** Shutdown helper: cancel every pending request created by this controller. */
|
|
73
|
+
cancelAll(reason?: string): Promise<void>;
|
|
74
|
+
handleInteractiveRequest(context: SlackInteractiveRequestContext): Promise<boolean>;
|
|
75
|
+
install(app: App): void;
|
|
76
|
+
}
|
|
77
|
+
type SlackInteractivePendingWaiter = {
|
|
78
|
+
resolve: (resolution: SlackInteractiveResolution) => void;
|
|
79
|
+
reject: (error: Error) => void;
|
|
80
|
+
cleanup: () => void;
|
|
81
|
+
};
|
|
82
|
+
interface SlackInteractivePostedMessage {
|
|
83
|
+
text: string;
|
|
84
|
+
blocks: unknown[];
|
|
85
|
+
ref: SlackInteractiveMessageRef;
|
|
86
|
+
}
|
|
87
|
+
|
|
9
88
|
declare function createSlackInteractiveController(options?: SlackInteractiveControllerOptions): SlackInteractiveController;
|
|
10
89
|
|
|
11
|
-
export { SlackInteractiveController, SlackInteractiveControllerOptions, createSlackInteractiveController };
|
|
90
|
+
export { type SlackInteractiveApprovalRequest, type SlackInteractiveController, type SlackInteractiveControllerOptions, type SlackInteractiveHumanInputRequest, type SlackInteractivePendingWaiter, type SlackInteractivePostedMessage, type SlackInteractiveRequestWaitOptions, type SlackInteractiveResolution, createSlackInteractiveController };
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,15 +1,126 @@
|
|
|
1
1
|
export { D as DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY, S as SlackContextFragmentMiddlewareOptions, a as SlackContextFragmentPayload, b as SlackContextFragmentResolver, c as SlackContextFragmentResolverContext, d as createSlackContextFragmentMiddleware } from '../context-fragments-CQEDcjYR.js';
|
|
2
|
-
import { AgentEvent } from '@cuylabs/agent-core';
|
|
2
|
+
import { AgentEvent, ApprovalEvent, AgentTurnSource } from '@cuylabs/agent-core';
|
|
3
3
|
import { SlackResponseSink } from '@cuylabs/channel-slack/responses';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { S as SlackApprovalRequest, a as SlackEventInteractiveRequestHandler, b as SlackHumanInputRequest, c as SlackInteractiveRequest, d as SlackInteractiveRequestBaseContext, e as SlackInteractiveRequestContext, f as SlackInteractiveRequestHandler } from '../interactive-BigrPKnu.js';
|
|
4
|
+
import { SlackFinalResponseArtifactPublisher, SlackFinalResponseArtifactDeliveryMode, SlackFinalResponseArtifactContext, SlackFinalResponseArtifactResult, SlackTurnEvent, SlackEventBridgeOptions as SlackEventBridgeOptions$1, SlackTurnSource } from '@cuylabs/channel-slack/runtime';
|
|
5
|
+
import { a as SlackEventInteractiveRequestHandler } from '../interactive-BigrPKnu.js';
|
|
6
|
+
export { S as SlackApprovalRequest, b as SlackHumanInputRequest, c as SlackInteractiveRequest, d as SlackInteractiveRequestBaseContext, e as SlackInteractiveRequestContext, f as SlackInteractiveRequestHandler } from '../interactive-BigrPKnu.js';
|
|
8
7
|
import '@cuylabs/channel-slack/core';
|
|
9
|
-
import '../artifacts/index.js';
|
|
10
|
-
import '@cuylabs/channel-slack/artifacts';
|
|
11
8
|
import '@cuylabs/channel-slack/interactive';
|
|
12
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Event-bridge configuration. The bridge is mode-aware (progressive,
|
|
12
|
+
* accumulate, chat-stream) and these options control formatting, status
|
|
13
|
+
* propagation, interactive-request handling, and chat-stream finalization.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
type HumanInputEvent = Extract<AgentEvent, {
|
|
17
|
+
type: "human-input-request";
|
|
18
|
+
}>["request"];
|
|
19
|
+
type ToolStartEvent = Extract<AgentEvent, {
|
|
20
|
+
type: "tool-start";
|
|
21
|
+
}>;
|
|
22
|
+
type ToolResultEvent = Extract<AgentEvent, {
|
|
23
|
+
type: "tool-result";
|
|
24
|
+
}>;
|
|
25
|
+
interface SlackEventBridgeOptions {
|
|
26
|
+
showReasoning: boolean;
|
|
27
|
+
/** Render root-agent tool rows/status updates. */
|
|
28
|
+
showToolUsage: boolean;
|
|
29
|
+
/** Render subagent child tool rows in the parent Slack task timeline. */
|
|
30
|
+
showSubagentToolUsage: boolean;
|
|
31
|
+
/** Include full subagent completion output in the subagent task row. */
|
|
32
|
+
showSubagentResultInTask: boolean;
|
|
33
|
+
formatToolTitle?: (toolName: string) => string;
|
|
34
|
+
formatToolUpdate: (toolName: string) => string;
|
|
35
|
+
formatToolDetails?: (event: ToolStartEvent) => string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Format the completed tool output shown in Slack task rows.
|
|
38
|
+
*
|
|
39
|
+
* Return `undefined` to use the default generic formatter. Return `null` to
|
|
40
|
+
* intentionally omit task-row output for this tool result.
|
|
41
|
+
*/
|
|
42
|
+
formatToolResultOutput?: (event: ToolResultEvent) => string | null | undefined;
|
|
43
|
+
formatToolError: (toolName: string, error: string) => string;
|
|
44
|
+
formatReasoningUpdate: () => string;
|
|
45
|
+
formatMessageText: (text: string) => string;
|
|
46
|
+
streamingMode: "progressive" | "accumulate" | "chat-stream";
|
|
47
|
+
progressiveUpdateThreshold: number;
|
|
48
|
+
progressiveUpdateIntervalMs: number;
|
|
49
|
+
chatStreamBufferSize: number;
|
|
50
|
+
/**
|
|
51
|
+
* Maximum number of Slack task-update chunks the bridge will append to a
|
|
52
|
+
* single chat stream. Task rows are a bounded UI projection, not a durable
|
|
53
|
+
* event log.
|
|
54
|
+
*/
|
|
55
|
+
maxTaskUpdates: number;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum cumulative characters from task titles/details/output that the
|
|
58
|
+
* bridge will append to one chat stream.
|
|
59
|
+
*/
|
|
60
|
+
maxTaskUpdateTextChars: number;
|
|
61
|
+
/**
|
|
62
|
+
* Maximum characters for a single task details/output field.
|
|
63
|
+
*/
|
|
64
|
+
maxTaskUpdateFieldChars: number;
|
|
65
|
+
interactiveMode: "message-and-error" | "ignore";
|
|
66
|
+
handleInteractiveRequest?: SlackEventInteractiveRequestHandler;
|
|
67
|
+
formatApprovalRequired: (request: ApprovalEvent) => string;
|
|
68
|
+
formatHumanInputRequired: (request: HumanInputEvent) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Optional hook called whenever the bridge's status label changes — used by
|
|
71
|
+
* the assistant bridge to update the assistant pane's status line via
|
|
72
|
+
* `assistant.threads.setStatus`. Errors are swallowed by the caller.
|
|
73
|
+
*/
|
|
74
|
+
onStatusChange?: (label: string, event: AgentEvent | undefined) => void | Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Optional final-args passthrough for `chatStream.stop(...)`. When the
|
|
77
|
+
* bridge stops the chat stream on `complete`, these args (e.g. final
|
|
78
|
+
* `blocks` for a feedback widget) are merged into the `stop` call. The
|
|
79
|
+
* existing `markdown_text` final-text fallback always wins on text fields.
|
|
80
|
+
*/
|
|
81
|
+
chatStreamFinalArgs?: {
|
|
82
|
+
blocks?: unknown[];
|
|
83
|
+
} & Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Optional post-processing hook for publishing a rich artifact from the final
|
|
86
|
+
* accumulated response, such as a Slack Canvas for long answers.
|
|
87
|
+
*/
|
|
88
|
+
publishFinalResponseArtifact?: SlackFinalResponseArtifactPublisher;
|
|
89
|
+
/**
|
|
90
|
+
* Controls whether artifact publication is additive or becomes the primary
|
|
91
|
+
* final-answer surface.
|
|
92
|
+
*
|
|
93
|
+
* - `supplemental`: finalize the Slack text normally, then publish artifact.
|
|
94
|
+
* - `replace`: publish artifact first and use a compact Slack final message.
|
|
95
|
+
*
|
|
96
|
+
* @default "supplemental"
|
|
97
|
+
*/
|
|
98
|
+
finalResponseArtifactMode?: SlackFinalResponseArtifactDeliveryMode;
|
|
99
|
+
/**
|
|
100
|
+
* When replacement mode is active, continue streaming text up to this many
|
|
101
|
+
* raw characters, then suppress further text deltas and publish the full
|
|
102
|
+
* answer as an artifact at completion. This preserves normal short-answer
|
|
103
|
+
* streaming without flooding Slack for long answers.
|
|
104
|
+
*
|
|
105
|
+
* @default 4000
|
|
106
|
+
*/
|
|
107
|
+
finalResponseArtifactStreamThreshold?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Notice appended when replacement mode suppresses the remaining text stream.
|
|
110
|
+
*/
|
|
111
|
+
formatFinalResponseArtifactContinuationNotice?: (context: Pick<SlackFinalResponseArtifactContext, "text" | "formattedText">) => string;
|
|
112
|
+
/**
|
|
113
|
+
* Final compact message used when an artifact replaces the full Slack text.
|
|
114
|
+
*/
|
|
115
|
+
formatFinalResponseArtifactMessage?: (result: SlackFinalResponseArtifactResult, context: SlackFinalResponseArtifactContext) => string;
|
|
116
|
+
/**
|
|
117
|
+
* Called when `publishFinalResponseArtifact` throws. Errors from this hook
|
|
118
|
+
* are swallowed so artifact publication cannot break a completed turn.
|
|
119
|
+
*/
|
|
120
|
+
onFinalResponseArtifactError?: (error: unknown, context: SlackFinalResponseArtifactContext) => void | Promise<void>;
|
|
121
|
+
}
|
|
122
|
+
declare function resolveSlackEventBridgeOptions(partial: Partial<SlackEventBridgeOptions>): SlackEventBridgeOptions;
|
|
123
|
+
|
|
13
124
|
/**
|
|
14
125
|
* Agent Core compatibility bridge.
|
|
15
126
|
*
|
|
@@ -57,4 +168,6 @@ declare class UnsupportedSlackInteractiveRequestError extends Error {
|
|
|
57
168
|
constructor(kind: "approval" | "human-input", requestId: string, message: string);
|
|
58
169
|
}
|
|
59
170
|
|
|
60
|
-
|
|
171
|
+
declare function adaptAgentTurnSourceToSlackTurnSource(source: AgentTurnSource): SlackTurnSource;
|
|
172
|
+
|
|
173
|
+
export { type SlackEventBridgeOptions, SlackEventInteractiveRequestHandler, UnsupportedSlackInteractiveRequestError, adaptAgentTurnSourceToSlackTurnSource, bridgeAgentEventsToSlack, mapAgentEventToSlackTurnEvent, mapAgentSlackEventBridgeOptionsToRuntimeOptions, resolveSlackEventBridgeOptions };
|
package/dist/shared/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
3
|
-
createSlackContextFragmentMiddleware
|
|
4
|
-
} from "../chunk-A2PLAVW6.js";
|
|
5
|
-
import {
|
|
6
3
|
UnsupportedSlackInteractiveRequestError,
|
|
4
|
+
adaptAgentTurnSourceToSlackTurnSource,
|
|
7
5
|
bridgeAgentEventsToSlack,
|
|
6
|
+
createSlackContextFragmentMiddleware,
|
|
8
7
|
mapAgentEventToSlackTurnEvent,
|
|
9
8
|
mapAgentSlackEventBridgeOptionsToRuntimeOptions,
|
|
10
9
|
resolveSlackEventBridgeOptions
|
|
11
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-U6RC4SXN.js";
|
|
12
11
|
export {
|
|
13
12
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
14
13
|
UnsupportedSlackInteractiveRequestError,
|
|
14
|
+
adaptAgentTurnSourceToSlackTurnSource,
|
|
15
15
|
bridgeAgentEventsToSlack,
|
|
16
16
|
createSlackContextFragmentMiddleware,
|
|
17
17
|
mapAgentEventToSlackTurnEvent,
|
package/docs/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Final Response Artifacts
|
|
2
2
|
|
|
3
|
-
Final response artifacts let a Slack host publish a rich surface from
|
|
4
|
-
completed
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Final response artifacts let a Slack host publish a rich surface from a
|
|
4
|
+
completed Slack turn response. The built-in publisher creates a Slack Canvas
|
|
5
|
+
for long answers and can fall back to a text file when Canvas publication is
|
|
6
|
+
unavailable.
|
|
7
7
|
|
|
8
8
|
```typescript
|
|
9
|
-
import {
|
|
9
|
+
import { mountSlackApp } from "@cuylabs/channel-slack/app";
|
|
10
|
+
import { createSlackFinalResponseArtifactPublisher } from "@cuylabs/channel-slack/artifacts";
|
|
11
|
+
import { adaptAgentTurnSourceToSlackTurnSource } from "@cuylabs/channel-slack-agent-core";
|
|
10
12
|
|
|
11
13
|
const publishFinalResponseArtifact = createSlackFinalResponseArtifactPublisher({
|
|
12
14
|
minCharacters: 4000,
|
|
@@ -14,8 +16,8 @@ const publishFinalResponseArtifact = createSlackFinalResponseArtifactPublisher({
|
|
|
14
16
|
fallback: "file",
|
|
15
17
|
});
|
|
16
18
|
|
|
17
|
-
await
|
|
18
|
-
source,
|
|
19
|
+
await mountSlackApp({
|
|
20
|
+
source: adaptAgentTurnSourceToSlackTurnSource(agent),
|
|
19
21
|
publishFinalResponseArtifact,
|
|
20
22
|
finalResponseArtifactMode: "replace",
|
|
21
23
|
finalResponseArtifactStreamThreshold: 4000,
|
|
@@ -19,6 +19,8 @@ Core. Return `undefined` to use the default formatter. Return `null` to omit the
|
|
|
19
19
|
completed task output intentionally.
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
+
import { createSlackChannelAdapter } from "@cuylabs/channel-slack/adapter";
|
|
23
|
+
|
|
22
24
|
createSlackChannelAdapter({
|
|
23
25
|
source,
|
|
24
26
|
streamingMode: "chat-stream",
|