@cuylabs/channel-slack-agent-core 0.8.0 → 0.9.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 +4 -2
- package/dist/adapter/index.d.ts +6 -5
- package/dist/adapter/index.js +2 -2
- package/dist/{adapter-B3CI611y.d.ts → adapter-vbqtraAr.d.ts} +1 -1
- package/dist/app-surface.d.ts +6 -5
- package/dist/app-surface.js +4 -4
- package/dist/app.d.ts +6 -5
- package/dist/app.js +5 -5
- package/dist/assistant/index.d.ts +5 -4
- package/dist/assistant/index.js +2 -2
- package/dist/{chunk-TCNJY7QA.js → chunk-D4CSEAIF.js} +1 -1
- package/dist/{chunk-7YZWCSML.js → chunk-FJP6ZFUB.js} +1 -1
- package/dist/{chunk-6T6N4MRK.js → chunk-GKZRDNEB.js} +2 -2
- package/dist/{chunk-YSDFYHPC.js → chunk-HHXAXSG6.js} +2 -2
- package/dist/{chunk-2R7B7NJR.js → chunk-JU5R6JZG.js} +1 -1
- package/dist/{chunk-236WN6JD.js → chunk-KAEZPS3U.js} +1 -1
- package/dist/chunk-OP27SSZU.js +409 -0
- package/dist/{chunk-FQWFB54C.js → chunk-XA7U3GRN.js} +1 -1
- package/dist/express-assistant.d.ts +4 -3
- package/dist/express-assistant.js +3 -3
- package/dist/express.d.ts +5 -4
- package/dist/express.js +3 -3
- package/dist/history/index.d.ts +6 -5
- package/dist/index.d.ts +11 -10
- package/dist/index.js +10 -34
- package/dist/interactive/index.d.ts +5 -65
- package/dist/interactive/index.js +3 -27
- package/dist/interactive-BigrPKnu.d.ts +30 -0
- package/dist/{options-C7-VXmhD.d.ts → options-ByNm2o89.d.ts} +2 -2
- package/dist/{options-BcDReOJv.d.ts → options-CGUfVStV.d.ts} +1 -1
- package/dist/shared/index.d.ts +7 -76
- package/dist/shared/index.js +1 -1
- package/dist/socket.d.ts +6 -5
- package/dist/socket.js +5 -5
- package/dist/{types-CRWzJB5G.d.ts → types-BeGPexio.d.ts} +2 -2
- package/dist/{types-Crpil4kb.d.ts → types-Bz4OYEAV.d.ts} +6 -55
- package/docs/concepts/interactive-requests.md +7 -7
- package/docs/reference/boundary.md +5 -3
- package/docs/reference/exports.md +18 -18
- package/package.json +2 -2
- package/dist/chunk-X7ILLZZP.js +0 -1046
- package/dist/interactive-o_NZb-Xg.d.ts +0 -47
- /package/dist/{chunk-TMADMHBN.js → chunk-VBGQD6JT.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mountSlackAssistantAgent
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JU5R6JZG.js";
|
|
4
|
+
import "./chunk-FJP6ZFUB.js";
|
|
5
5
|
import "./chunk-ELR6MQD7.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-VBGQD6JT.js";
|
|
7
7
|
export {
|
|
8
8
|
mountSlackAssistantAgent
|
|
9
9
|
};
|
package/dist/express.d.ts
CHANGED
|
@@ -2,15 +2,16 @@ import * as _slack_bolt from '@slack/bolt';
|
|
|
2
2
|
import { Server } from 'node:http';
|
|
3
3
|
import { AgentTurnSource } from '@cuylabs/agent-core';
|
|
4
4
|
import { Application } from 'express';
|
|
5
|
-
import { c as createSlackChannelAdapter } from './adapter-
|
|
6
|
-
import { a as SlackChannelOptions } from './types-
|
|
5
|
+
import { c as createSlackChannelAdapter } from './adapter-vbqtraAr.js';
|
|
6
|
+
import { a as SlackChannelOptions } from './types-BeGPexio.js';
|
|
7
7
|
import { CreateSlackBoltAppOptions } from '@cuylabs/channel-slack/transports/http';
|
|
8
8
|
import { SlackDirectAuthOptions, SlackDirectAuthMode } from '@cuylabs/channel-slack/auth';
|
|
9
9
|
import '@cuylabs/channel-slack/core';
|
|
10
|
-
import './options-
|
|
10
|
+
import './options-CGUfVStV.js';
|
|
11
11
|
import './artifacts/index.js';
|
|
12
12
|
import '@cuylabs/channel-slack/artifacts';
|
|
13
|
-
import './interactive-
|
|
13
|
+
import './interactive-BigrPKnu.js';
|
|
14
|
+
import '@cuylabs/channel-slack/interactive';
|
|
14
15
|
|
|
15
16
|
interface MountSlackAgentOptions extends Omit<SlackChannelOptions, "agent" | "source">, Omit<CreateSlackBoltAppOptions, "app" | "path" | "botToken" | "signingSecret" | "auth"> {
|
|
16
17
|
/**
|
package/dist/express.js
CHANGED
package/dist/history/index.d.ts
CHANGED
|
@@ -4,16 +4,17 @@ import { MountSlackAgentAppTurnRequestContext } from '../app-surface.js';
|
|
|
4
4
|
import { a as SlackContextFragmentPayload } from '../context-fragments-CQEDcjYR.js';
|
|
5
5
|
import '@slack/bolt';
|
|
6
6
|
import '@slack/web-api';
|
|
7
|
-
import '../options-
|
|
7
|
+
import '../options-ByNm2o89.js';
|
|
8
8
|
import '@cuylabs/channel-slack/core';
|
|
9
|
-
import '../interactive-
|
|
10
|
-
import '
|
|
9
|
+
import '../interactive-BigrPKnu.js';
|
|
10
|
+
import '@cuylabs/channel-slack/interactive';
|
|
11
|
+
import '../options-CGUfVStV.js';
|
|
11
12
|
import '../artifacts/index.js';
|
|
12
13
|
import '@cuylabs/channel-slack/artifacts';
|
|
13
14
|
import '@cuylabs/channel-slack/feedback';
|
|
14
15
|
import '@cuylabs/channel-slack/assistant';
|
|
15
|
-
import '../types-
|
|
16
|
-
import '../types-
|
|
16
|
+
import '../types-BeGPexio.js';
|
|
17
|
+
import '../types-Bz4OYEAV.js';
|
|
17
18
|
import '../types-CiwGU6zC.js';
|
|
18
19
|
import '@cuylabs/channel-slack/views';
|
|
19
20
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +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 {
|
|
3
|
-
export { S as SlackEventBridgeOptions, r as resolveSlackEventBridgeOptions } from './options-
|
|
4
|
-
export { S as SlackApprovalRequest, a as SlackEventInteractiveRequestHandler, b as SlackHumanInputRequest, c as
|
|
5
|
-
export { c as createSlackChannelAdapter } from './adapter-
|
|
6
|
-
export { S as SlackChannelAdapter, a as SlackChannelOptions, b as SlackSessionStrategy, c as SlackStreamingMode, d as SlackToolStartEvent } from './types-
|
|
2
|
+
export { UnsupportedSlackInteractiveRequestError, bridgeAgentEventsToSlack } from './shared/index.js';
|
|
3
|
+
export { S as SlackEventBridgeOptions, r as resolveSlackEventBridgeOptions } from './options-CGUfVStV.js';
|
|
4
|
+
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
7
|
export { SlackSessionMap, createSlackSessionMap } from './adapter/index.js';
|
|
8
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-
|
|
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
10
|
export { ParsedAssistantUserMessage, createSlackAssistantThreadContextStore, parseSlackMessageActivityFromMessageEvent } from '@cuylabs/channel-slack/assistant';
|
|
11
11
|
export { CreateSlackFinalResponseArtifactPublisherOptions, SlackFinalResponseArtifactContext, SlackFinalResponseArtifactDeliveryMode, SlackFinalResponseArtifactPublisher, SlackFinalResponseArtifactResult, SlackFinalResponseArtifactValueResolver, createSlackFinalResponseArtifactPublisher } from './artifacts/index.js';
|
|
12
12
|
export { LoadSlackAgentTurnHistoryContextOptions, SlackAgentTurnHistoryContextResult, SlackAgentTurnHistoryOptions, SlackAgentTurnHistoryProfileResolver, emptySlackAgentTurnHistoryContextResult, loadSlackAgentTurnHistoryContext } from './history/index.js';
|
|
13
|
-
export { S as
|
|
14
|
-
export {
|
|
13
|
+
export { S as SlackInteractiveApprovalRequest, a as SlackInteractiveController, b as SlackInteractiveControllerOptions, c as SlackInteractiveHumanInputRequest, d as SlackInteractivePendingWaiter, e as SlackInteractivePostedMessage, f as SlackInteractiveRequestWaitOptions, g as SlackInteractiveResolution } from './types-Bz4OYEAV.js';
|
|
14
|
+
export { createSlackInteractiveController } from './interactive/index.js';
|
|
15
15
|
export { createSlackAgentViewWorkflowController } from './views/index.js';
|
|
16
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';
|
|
17
17
|
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';
|
|
@@ -23,12 +23,13 @@ export { CreateSlackMcpServerConfigOptions, SLACK_MCP_URL, createSlackMcpServerC
|
|
|
23
23
|
export { MountSlackAgentAppTurnRequestContext } from './app-surface.js';
|
|
24
24
|
import '@cuylabs/agent-core';
|
|
25
25
|
import '@cuylabs/channel-slack/core';
|
|
26
|
-
import '@cuylabs/channel-slack/
|
|
26
|
+
import '@cuylabs/channel-slack/responses';
|
|
27
|
+
import '@cuylabs/channel-slack/interactive';
|
|
27
28
|
import '@slack/bolt';
|
|
28
29
|
import '@slack/web-api';
|
|
29
30
|
import '@cuylabs/channel-slack/feedback';
|
|
31
|
+
import '@cuylabs/channel-slack/artifacts';
|
|
30
32
|
import '@cuylabs/channel-slack/history';
|
|
31
|
-
import '@slack/types';
|
|
32
33
|
import '@cuylabs/channel-slack/views';
|
|
33
34
|
import '@cuylabs/agent-core/dispatch';
|
|
34
35
|
import 'node:http';
|
package/dist/index.js
CHANGED
|
@@ -6,20 +6,8 @@ import {
|
|
|
6
6
|
loadSlackAgentTurnHistoryContext
|
|
7
7
|
} from "./chunk-P7PFQ3SQ.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
buildHumanInputRequestMessage,
|
|
12
|
-
buildResolvedMessage,
|
|
13
|
-
cloneRecord,
|
|
14
|
-
createInMemorySlackInteractiveRequestStore,
|
|
15
|
-
createPostgresSlackInteractiveRequestStore,
|
|
16
|
-
createSlackInteractiveController,
|
|
17
|
-
decodeActionValue,
|
|
18
|
-
encodeActionValue,
|
|
19
|
-
initializePostgresSlackInteractiveRequestStore,
|
|
20
|
-
nowIso,
|
|
21
|
-
prunePostgresSlackInteractiveRequestStore
|
|
22
|
-
} from "./chunk-X7ILLZZP.js";
|
|
9
|
+
createSlackInteractiveController
|
|
10
|
+
} from "./chunk-OP27SSZU.js";
|
|
23
11
|
import {
|
|
24
12
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
25
13
|
createSlackContextFragmentMiddleware
|
|
@@ -50,13 +38,13 @@ import {
|
|
|
50
38
|
} from "./chunk-C7CHMYV6.js";
|
|
51
39
|
import {
|
|
52
40
|
mountSlackAgentApp
|
|
53
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-KAEZPS3U.js";
|
|
54
42
|
import {
|
|
55
43
|
mountSlackAssistantAgent
|
|
56
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-JU5R6JZG.js";
|
|
57
45
|
import {
|
|
58
46
|
mountSlackAgent
|
|
59
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-D4CSEAIF.js";
|
|
60
48
|
import {
|
|
61
49
|
SLACK_MCP_URL,
|
|
62
50
|
createSlackMcpServerConfig
|
|
@@ -64,37 +52,30 @@ import {
|
|
|
64
52
|
import {
|
|
65
53
|
mountSlackAgentAppSocket,
|
|
66
54
|
mountSlackAssistantAgentSocket
|
|
67
|
-
} from "./chunk-
|
|
68
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-HHXAXSG6.js";
|
|
56
|
+
import "./chunk-GKZRDNEB.js";
|
|
69
57
|
import {
|
|
70
58
|
createSlackAssistantBridge,
|
|
71
59
|
createSlackAssistantThreadContextStore,
|
|
72
60
|
parseSlackMessageActivityFromMessageEvent,
|
|
73
61
|
resolveAssistantSessionId
|
|
74
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-FJP6ZFUB.js";
|
|
75
63
|
import "./chunk-ELR6MQD7.js";
|
|
76
64
|
import {
|
|
77
65
|
createSlackChannelAdapter,
|
|
78
66
|
createSlackSessionMap
|
|
79
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-XA7U3GRN.js";
|
|
80
68
|
import {
|
|
81
69
|
UnsupportedSlackInteractiveRequestError,
|
|
82
70
|
bridgeAgentEventsToSlack,
|
|
83
71
|
resolveSlackEventBridgeOptions
|
|
84
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-VBGQD6JT.js";
|
|
85
73
|
export {
|
|
86
74
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
87
75
|
SLACK_MCP_URL,
|
|
88
76
|
UnsupportedSlackInteractiveRequestError,
|
|
89
77
|
bridgeAgentEventsToSlack,
|
|
90
|
-
buildApprovalRequestMessage,
|
|
91
|
-
buildHumanInputModal,
|
|
92
|
-
buildHumanInputRequestMessage,
|
|
93
|
-
buildResolvedMessage,
|
|
94
|
-
cloneRecord,
|
|
95
78
|
coalesceSlackAgentEvents,
|
|
96
|
-
createInMemorySlackInteractiveRequestStore,
|
|
97
|
-
createPostgresSlackInteractiveRequestStore,
|
|
98
79
|
createSlackAgentViewWorkflowController,
|
|
99
80
|
createSlackAssistantBridge,
|
|
100
81
|
createSlackAssistantThreadContextStore,
|
|
@@ -105,13 +86,10 @@ export {
|
|
|
105
86
|
createSlackMcpServerConfig,
|
|
106
87
|
createSlackSessionMap,
|
|
107
88
|
createSlackSubagentCompletionNotifier,
|
|
108
|
-
decodeActionValue,
|
|
109
89
|
emptySlackAgentTurnHistoryContextResult,
|
|
110
|
-
encodeActionValue,
|
|
111
90
|
extractSlackAgentViewStateValues,
|
|
112
91
|
formatDefaultSlackSubagentCompletionMessage,
|
|
113
92
|
immediateSlackTextResponse,
|
|
114
|
-
initializePostgresSlackInteractiveRequestStore,
|
|
115
93
|
inspectSlackTurnStatusVisibility,
|
|
116
94
|
isAbortLikeError,
|
|
117
95
|
isRunningAgentTurnError,
|
|
@@ -125,9 +103,7 @@ export {
|
|
|
125
103
|
mountSlackAgentAppSocket,
|
|
126
104
|
mountSlackAssistantAgent,
|
|
127
105
|
mountSlackAssistantAgentSocket,
|
|
128
|
-
nowIso,
|
|
129
106
|
parseSlackMessageActivityFromMessageEvent,
|
|
130
|
-
prunePostgresSlackInteractiveRequestStore,
|
|
131
107
|
readSlackAgentViewStateValue,
|
|
132
108
|
recordSlackTurnActivity,
|
|
133
109
|
resolveAssistantSessionId,
|
|
@@ -1,71 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { View } from '@slack/types';
|
|
1
|
+
import { b as SlackInteractiveControllerOptions, a as SlackInteractiveController } from '../types-Bz4OYEAV.js';
|
|
2
|
+
export { S as SlackInteractiveApprovalRequest, c as SlackInteractiveHumanInputRequest, d as SlackInteractivePendingWaiter, e as SlackInteractivePostedMessage, f as SlackInteractiveRequestWaitOptions, g as SlackInteractiveResolution } from '../types-Bz4OYEAV.js';
|
|
4
3
|
import '@cuylabs/agent-core';
|
|
4
|
+
import '@cuylabs/channel-slack/interactive';
|
|
5
5
|
import '@slack/bolt';
|
|
6
|
-
import '../interactive-
|
|
6
|
+
import '../interactive-BigrPKnu.js';
|
|
7
7
|
import '@cuylabs/channel-slack/core';
|
|
8
8
|
|
|
9
|
-
declare function createInMemorySlackInteractiveRequestStore(): SlackInteractiveRequestStore;
|
|
10
|
-
declare function nowIso(): string;
|
|
11
|
-
declare function cloneRecord(record: SlackInteractiveRequestRecord): SlackInteractiveRequestRecord;
|
|
12
|
-
|
|
13
|
-
interface SlackInteractivePostgresClient {
|
|
14
|
-
end?: () => Promise<void>;
|
|
15
|
-
query<T = unknown>(sql: string, values?: readonly unknown[]): Promise<{
|
|
16
|
-
rows: T[];
|
|
17
|
-
rowCount?: number | null;
|
|
18
|
-
}>;
|
|
19
|
-
}
|
|
20
|
-
interface PostgresSlackInteractiveRequestStoreOptions {
|
|
21
|
-
client?: SlackInteractivePostgresClient;
|
|
22
|
-
connectionString?: string;
|
|
23
|
-
ensureSchema?: boolean;
|
|
24
|
-
onPruneError?: (error: unknown) => void;
|
|
25
|
-
pruneBatchSize?: number;
|
|
26
|
-
pruneIntervalMs?: number;
|
|
27
|
-
retentionMs?: number;
|
|
28
|
-
schema?: string;
|
|
29
|
-
tableName?: string;
|
|
30
|
-
}
|
|
31
|
-
interface PostgresSlackInteractiveRequestStore extends SlackInteractiveRequestStore {
|
|
32
|
-
close(): Promise<void>;
|
|
33
|
-
prune(): Promise<PostgresSlackInteractiveRequestPruneResult>;
|
|
34
|
-
}
|
|
35
|
-
interface PostgresSlackInteractiveRequestPruneResult {
|
|
36
|
-
deleted: number;
|
|
37
|
-
}
|
|
38
|
-
declare function createPostgresSlackInteractiveRequestStore({ client, connectionString, ensureSchema, onPruneError, pruneBatchSize, pruneIntervalMs, retentionMs, schema, tableName, }: PostgresSlackInteractiveRequestStoreOptions): PostgresSlackInteractiveRequestStore;
|
|
39
|
-
declare function initializePostgresSlackInteractiveRequestStore({ client, ensureSchema, schema, tableName, }: {
|
|
40
|
-
client: SlackInteractivePostgresClient;
|
|
41
|
-
ensureSchema?: boolean;
|
|
42
|
-
schema?: string;
|
|
43
|
-
tableName?: string;
|
|
44
|
-
}): Promise<void>;
|
|
45
|
-
declare function prunePostgresSlackInteractiveRequestStore({ client, pruneBatchSize, retentionMs, schema, tableName, }: {
|
|
46
|
-
client: SlackInteractivePostgresClient;
|
|
47
|
-
pruneBatchSize?: number;
|
|
48
|
-
retentionMs?: number;
|
|
49
|
-
schema?: string;
|
|
50
|
-
tableName?: string;
|
|
51
|
-
}): Promise<PostgresSlackInteractiveRequestPruneResult>;
|
|
52
|
-
|
|
53
|
-
declare function buildApprovalRequestMessage(request: SlackInteractiveApprovalRequest, actionIds: SlackInteractiveActionIds): {
|
|
54
|
-
text: string;
|
|
55
|
-
blocks: unknown[];
|
|
56
|
-
};
|
|
57
|
-
declare function buildHumanInputRequestMessage(request: SlackInteractiveHumanInputRequest, actionIds: SlackInteractiveActionIds): {
|
|
58
|
-
text: string;
|
|
59
|
-
blocks: unknown[];
|
|
60
|
-
};
|
|
61
|
-
declare function buildResolvedMessage(label: string, resolution: SlackInteractiveResolution): {
|
|
62
|
-
text: string;
|
|
63
|
-
blocks: unknown[];
|
|
64
|
-
};
|
|
65
|
-
declare function buildHumanInputModal(request: SlackInteractiveHumanInputRequest, actionIds: SlackInteractiveActionIds): View;
|
|
66
|
-
declare function encodeActionValue(payload: Record<string, unknown>): string;
|
|
67
|
-
declare function decodeActionValue(value: unknown): Record<string, unknown>;
|
|
68
|
-
|
|
69
9
|
declare function createSlackInteractiveController(options?: SlackInteractiveControllerOptions): SlackInteractiveController;
|
|
70
10
|
|
|
71
|
-
export {
|
|
11
|
+
export { SlackInteractiveController, SlackInteractiveControllerOptions, createSlackInteractiveController };
|
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
buildHumanInputRequestMessage,
|
|
5
|
-
buildResolvedMessage,
|
|
6
|
-
cloneRecord,
|
|
7
|
-
createInMemorySlackInteractiveRequestStore,
|
|
8
|
-
createPostgresSlackInteractiveRequestStore,
|
|
9
|
-
createSlackInteractiveController,
|
|
10
|
-
decodeActionValue,
|
|
11
|
-
encodeActionValue,
|
|
12
|
-
initializePostgresSlackInteractiveRequestStore,
|
|
13
|
-
nowIso,
|
|
14
|
-
prunePostgresSlackInteractiveRequestStore
|
|
15
|
-
} from "../chunk-X7ILLZZP.js";
|
|
2
|
+
createSlackInteractiveController
|
|
3
|
+
} from "../chunk-OP27SSZU.js";
|
|
16
4
|
export {
|
|
17
|
-
|
|
18
|
-
buildHumanInputModal,
|
|
19
|
-
buildHumanInputRequestMessage,
|
|
20
|
-
buildResolvedMessage,
|
|
21
|
-
cloneRecord,
|
|
22
|
-
createInMemorySlackInteractiveRequestStore,
|
|
23
|
-
createPostgresSlackInteractiveRequestStore,
|
|
24
|
-
createSlackInteractiveController,
|
|
25
|
-
decodeActionValue,
|
|
26
|
-
encodeActionValue,
|
|
27
|
-
initializePostgresSlackInteractiveRequestStore,
|
|
28
|
-
nowIso,
|
|
29
|
-
prunePostgresSlackInteractiveRequestStore
|
|
5
|
+
createSlackInteractiveController
|
|
30
6
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AgentEvent } from '@cuylabs/agent-core';
|
|
2
|
+
import { SlackInteractiveRequestBaseContext as SlackInteractiveRequestBaseContext$1, SlackInteractiveRequestContext as SlackInteractiveRequestContext$1 } from '@cuylabs/channel-slack/interactive';
|
|
3
|
+
import { SlackActivityInfo, SlackUserIdentity } from '@cuylabs/channel-slack/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Agent Core interactive request contracts for the Slack event bridge.
|
|
7
|
+
*
|
|
8
|
+
* Generic Slack message/responder primitives live in `@cuylabs/channel-slack`.
|
|
9
|
+
* This module narrows the request payloads to Agent Core events.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
type SlackApprovalRequest = Extract<AgentEvent, {
|
|
13
|
+
type: "approval-request";
|
|
14
|
+
}>["request"];
|
|
15
|
+
type SlackHumanInputRequest = Extract<AgentEvent, {
|
|
16
|
+
type: "human-input-request";
|
|
17
|
+
}>["request"];
|
|
18
|
+
type SlackInteractiveRequest = SlackApprovalRequest | SlackHumanInputRequest;
|
|
19
|
+
interface SlackInteractiveRequestBaseContext extends Omit<SlackInteractiveRequestBaseContext$1, "request"> {
|
|
20
|
+
request: SlackInteractiveRequest;
|
|
21
|
+
}
|
|
22
|
+
interface SlackInteractiveRequestContext extends Omit<SlackInteractiveRequestContext$1, "request"> {
|
|
23
|
+
slackActivity: SlackActivityInfo;
|
|
24
|
+
user: SlackUserIdentity;
|
|
25
|
+
request: SlackInteractiveRequest;
|
|
26
|
+
}
|
|
27
|
+
type SlackInteractiveRequestHandler = (context: SlackInteractiveRequestContext) => boolean | void | Promise<boolean | void>;
|
|
28
|
+
type SlackEventInteractiveRequestHandler = (context: SlackInteractiveRequestBaseContext) => boolean | void | Promise<boolean | void>;
|
|
29
|
+
|
|
30
|
+
export type { SlackApprovalRequest as S, SlackEventInteractiveRequestHandler as a, SlackHumanInputRequest as b, SlackInteractiveRequest as c, SlackInteractiveRequestBaseContext as d, SlackInteractiveRequestContext as e, SlackInteractiveRequestHandler as f };
|
|
@@ -2,8 +2,8 @@ import { AgentTurnSource, AgentEvent, Logger } from '@cuylabs/agent-core';
|
|
|
2
2
|
import { AssistantUserMessageMiddleware, AssistantThreadStartedMiddleware, Assistant, App } from '@slack/bolt';
|
|
3
3
|
import { WebClient } from '@slack/web-api';
|
|
4
4
|
import { SlackAuthContext, SlackAssistantThreadContext, SlackAssistantUtilities, SlackTurnPreparation, SlackAssistantTaskDisplayMode, SlackAssistantStatusUpdate, SlackAssistantSuggestedPrompts, SlackChatStreamStartArgs, SlackMessageFormattingOptions } from '@cuylabs/channel-slack/core';
|
|
5
|
-
import {
|
|
6
|
-
import { S as SlackEventBridgeOptions } from './options-
|
|
5
|
+
import { f as SlackInteractiveRequestHandler } from './interactive-BigrPKnu.js';
|
|
6
|
+
import { S as SlackEventBridgeOptions } from './options-CGUfVStV.js';
|
|
7
7
|
import { SlackFeedbackBlockOptions, SlackFeedbackHandler } from '@cuylabs/channel-slack/feedback';
|
|
8
8
|
import { ParsedAssistantUserMessage } from '@cuylabs/channel-slack/assistant';
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentEvent, ApprovalEvent } from '@cuylabs/agent-core';
|
|
2
2
|
import { SlackFinalResponseArtifactPublisher, SlackFinalResponseArtifactDeliveryMode, SlackFinalResponseArtifactContext, SlackFinalResponseArtifactResult } from './artifacts/index.js';
|
|
3
|
-
import { a as SlackEventInteractiveRequestHandler } from './interactive-
|
|
3
|
+
import { a as SlackEventInteractiveRequestHandler } from './interactive-BigrPKnu.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Event-bridge configuration. The bridge is mode-aware (progressive,
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,82 +1,13 @@
|
|
|
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
2
|
import { AgentEvent } from '@cuylabs/agent-core';
|
|
3
|
-
import { S as SlackEventBridgeOptions } from '../options-
|
|
4
|
-
export { r as resolveSlackEventBridgeOptions } from '../options-
|
|
5
|
-
import {
|
|
6
|
-
export { S as SlackApprovalRequest, a as SlackEventInteractiveRequestHandler, b as SlackHumanInputRequest, c as
|
|
3
|
+
import { S as SlackEventBridgeOptions } from '../options-CGUfVStV.js';
|
|
4
|
+
export { r as resolveSlackEventBridgeOptions } from '../options-CGUfVStV.js';
|
|
5
|
+
import { SlackResponseSink } from '@cuylabs/channel-slack/responses';
|
|
6
|
+
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';
|
|
7
7
|
import '@cuylabs/channel-slack/core';
|
|
8
8
|
import '../artifacts/index.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Slack response-sink contracts consumed by the event bridge.
|
|
12
|
-
*
|
|
13
|
-
* The adapter constructs a `SlackResponseSink` from the Bolt `say` function
|
|
14
|
-
* and `WebClient` instance available in each handler. Keeping the sink
|
|
15
|
-
* interface separate makes the bridge testable without a live Slack
|
|
16
|
-
* connection.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
type SlackStreamTaskStatus = "pending" | "in_progress" | "complete" | "error";
|
|
20
|
-
type SlackStreamChunk = {
|
|
21
|
-
type: "markdown_text";
|
|
22
|
-
text: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: "plan_update";
|
|
25
|
-
title: string;
|
|
26
|
-
} | {
|
|
27
|
-
type: "task_update";
|
|
28
|
-
id: string;
|
|
29
|
-
title: string;
|
|
30
|
-
status: SlackStreamTaskStatus;
|
|
31
|
-
details?: string;
|
|
32
|
-
output?: string;
|
|
33
|
-
};
|
|
34
|
-
interface SlackChatStream {
|
|
35
|
-
append(args: {
|
|
36
|
-
markdown_text?: string;
|
|
37
|
-
chunks?: SlackStreamChunk[];
|
|
38
|
-
}): Promise<unknown>;
|
|
39
|
-
stop(args?: {
|
|
40
|
-
markdown_text?: string;
|
|
41
|
-
chunks?: SlackStreamChunk[];
|
|
42
|
-
}): Promise<unknown>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Minimal Slack posting interface consumed by the event bridge.
|
|
46
|
-
*/
|
|
47
|
-
interface SlackArtifactPublicationTarget {
|
|
48
|
-
channelId: string;
|
|
49
|
-
threadTs?: string;
|
|
50
|
-
}
|
|
51
|
-
interface SlackResponseSink {
|
|
52
|
-
/**
|
|
53
|
-
* Slack Web API surface used by optional artifact publishers.
|
|
54
|
-
*/
|
|
55
|
-
artifactClient?: SlackArtifactClient;
|
|
56
|
-
/**
|
|
57
|
-
* Channel/thread target used by optional artifact publishers.
|
|
58
|
-
*/
|
|
59
|
-
artifactTarget?: SlackArtifactPublicationTarget;
|
|
60
|
-
/**
|
|
61
|
-
* Post a new message to the channel / thread.
|
|
62
|
-
* Returns the channel ID and message timestamp needed for updates.
|
|
63
|
-
*/
|
|
64
|
-
postMessage(text: string): Promise<{
|
|
65
|
-
channel: string;
|
|
66
|
-
ts: string;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Update an existing message by channel + ts.
|
|
70
|
-
*/
|
|
71
|
-
updateMessage(channel: string, ts: string, text: string): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Create a native Slack chat stream. Required when `streamingMode` is
|
|
74
|
-
* `"chat-stream"`.
|
|
75
|
-
*/
|
|
76
|
-
createChatStream?(options: {
|
|
77
|
-
bufferSize: number;
|
|
78
|
-
}): SlackChatStream;
|
|
79
|
-
}
|
|
9
|
+
import '@cuylabs/channel-slack/artifacts';
|
|
10
|
+
import '@cuylabs/channel-slack/interactive';
|
|
80
11
|
|
|
81
12
|
/**
|
|
82
13
|
* Event bridge — maps an agent-core `AgentEvent` stream to a Slack
|
|
@@ -114,4 +45,4 @@ declare class UnsupportedSlackInteractiveRequestError extends Error {
|
|
|
114
45
|
constructor(kind: "approval" | "human-input", requestId: string, message: string);
|
|
115
46
|
}
|
|
116
47
|
|
|
117
|
-
export {
|
|
48
|
+
export { SlackEventBridgeOptions, UnsupportedSlackInteractiveRequestError, bridgeAgentEventsToSlack };
|
package/dist/shared/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
UnsupportedSlackInteractiveRequestError,
|
|
7
7
|
bridgeAgentEventsToSlack,
|
|
8
8
|
resolveSlackEventBridgeOptions
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-VBGQD6JT.js";
|
|
10
10
|
export {
|
|
11
11
|
DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY,
|
|
12
12
|
UnsupportedSlackInteractiveRequestError,
|
package/dist/socket.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { App } from '@slack/bolt';
|
|
2
2
|
import { CreateSlackSocketBoltAppOptions } from '@cuylabs/channel-slack/transports/socket';
|
|
3
3
|
import { SlackDirectAuthOptions, SlackDirectAuthMode } from '@cuylabs/channel-slack/auth';
|
|
4
|
-
import { S as SlackAssistantBridge, C as CreateSlackAssistantBridgeOptions, d as SlackAssistantFeedbackConfig } from './options-
|
|
4
|
+
import { S as SlackAssistantBridge, C as CreateSlackAssistantBridgeOptions, d as SlackAssistantFeedbackConfig } from './options-ByNm2o89.js';
|
|
5
5
|
import { SlackAgentAppSurfaceOptions } from './app-surface.js';
|
|
6
6
|
import { SlackFeedbackHandler } from '@cuylabs/channel-slack/feedback';
|
|
7
7
|
import '@cuylabs/agent-core';
|
|
8
8
|
import '@slack/web-api';
|
|
9
9
|
import '@cuylabs/channel-slack/core';
|
|
10
|
-
import './interactive-
|
|
11
|
-
import '
|
|
10
|
+
import './interactive-BigrPKnu.js';
|
|
11
|
+
import '@cuylabs/channel-slack/interactive';
|
|
12
|
+
import './options-CGUfVStV.js';
|
|
12
13
|
import './artifacts/index.js';
|
|
13
14
|
import '@cuylabs/channel-slack/artifacts';
|
|
14
15
|
import '@cuylabs/channel-slack/assistant';
|
|
15
|
-
import './types-
|
|
16
|
-
import './types-
|
|
16
|
+
import './types-BeGPexio.js';
|
|
17
|
+
import './types-Bz4OYEAV.js';
|
|
17
18
|
import './types-CiwGU6zC.js';
|
|
18
19
|
import '@cuylabs/channel-slack/views';
|
|
19
20
|
|
package/dist/socket.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mountSlackAgentAppSocket,
|
|
3
3
|
mountSlackAssistantAgentSocket
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-HHXAXSG6.js";
|
|
5
|
+
import "./chunk-GKZRDNEB.js";
|
|
6
|
+
import "./chunk-FJP6ZFUB.js";
|
|
7
7
|
import "./chunk-ELR6MQD7.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-XA7U3GRN.js";
|
|
9
|
+
import "./chunk-VBGQD6JT.js";
|
|
10
10
|
export {
|
|
11
11
|
mountSlackAgentAppSocket,
|
|
12
12
|
mountSlackAssistantAgentSocket
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Agent, AgentTurnSource, AgentEvent, ApprovalEvent, Logger } from '@cuylabs/agent-core';
|
|
2
2
|
import { SlackActivityInfo, SlackTurnRequestContext, SlackAssistantStatusUpdate, SlackChatStreamStartArgs, SlackUserIdentity, SlackTurnPreparation } from '@cuylabs/channel-slack/core';
|
|
3
|
-
import { S as SlackEventBridgeOptions } from './options-
|
|
4
|
-
import {
|
|
3
|
+
import { S as SlackEventBridgeOptions } from './options-CGUfVStV.js';
|
|
4
|
+
import { f as SlackInteractiveRequestHandler } from './interactive-BigrPKnu.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Channel-options + adapter contract for the direct Slack adapter
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
2
3
|
import { App } from '@slack/bolt';
|
|
3
|
-
import {
|
|
4
|
+
import { e as SlackInteractiveRequestContext } from './interactive-BigrPKnu.js';
|
|
4
5
|
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type SlackInteractiveHumanInputRequest = SlackHumanInputRequest & Partial<Pick<HumanInputRequest, "sessionId" | "timestamp" | "toolCallId">>;
|
|
8
|
-
type SlackInteractiveStoredRequest = SlackInteractiveApprovalRequest | SlackInteractiveHumanInputRequest;
|
|
6
|
+
type SlackInteractiveApprovalRequest = ApprovalRequest;
|
|
7
|
+
type SlackInteractiveHumanInputRequest = SlackInteractiveHumanInputRequest$1 & Partial<Pick<HumanInputRequest, "sessionId" | "timestamp" | "toolCallId">>;
|
|
9
8
|
type SlackInteractiveResolution = {
|
|
10
9
|
kind: "approval";
|
|
11
10
|
action: ApprovalAction;
|
|
@@ -15,54 +14,6 @@ type SlackInteractiveResolution = {
|
|
|
15
14
|
kind: "human-input";
|
|
16
15
|
response: HumanInputResponse;
|
|
17
16
|
};
|
|
18
|
-
interface SlackInteractiveMessageTarget {
|
|
19
|
-
channel: string;
|
|
20
|
-
ts: string;
|
|
21
|
-
threadTs?: string;
|
|
22
|
-
userId: string;
|
|
23
|
-
teamId?: string;
|
|
24
|
-
}
|
|
25
|
-
interface SlackInteractiveRequestRecord {
|
|
26
|
-
id: string;
|
|
27
|
-
kind: SlackInteractiveResolution["kind"];
|
|
28
|
-
request: SlackInteractiveStoredRequest;
|
|
29
|
-
status: SlackInteractiveRequestStatus;
|
|
30
|
-
createdAt: string;
|
|
31
|
-
updatedAt: string;
|
|
32
|
-
target?: SlackInteractiveMessageTarget;
|
|
33
|
-
resolution?: SlackInteractiveResolution;
|
|
34
|
-
}
|
|
35
|
-
interface SlackInteractiveRequestStore {
|
|
36
|
-
get(requestId: string): Promise<SlackInteractiveRequestRecord | undefined>;
|
|
37
|
-
upsert(record: SlackInteractiveRequestRecord): Promise<SlackInteractiveRequestRecord>;
|
|
38
|
-
/**
|
|
39
|
-
* Attach the Slack message target for an already-upserted request.
|
|
40
|
-
*
|
|
41
|
-
* Implementations should return `undefined` when the request does not exist;
|
|
42
|
-
* callers must upsert before attaching a target.
|
|
43
|
-
*/
|
|
44
|
-
attachTarget(requestId: string, target: SlackInteractiveMessageTarget): Promise<SlackInteractiveRequestRecord | undefined>;
|
|
45
|
-
/**
|
|
46
|
-
* Mark a request resolved. Implementations must be idempotent: resolving an
|
|
47
|
-
* already-resolved request should return the existing record without
|
|
48
|
-
* overwriting the original resolution.
|
|
49
|
-
*/
|
|
50
|
-
resolve(requestId: string, resolution: SlackInteractiveResolution): Promise<SlackInteractiveRequestRecord | undefined>;
|
|
51
|
-
delete(requestId: string): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
interface SlackInteractiveActionIds {
|
|
54
|
-
approvalAllow: string;
|
|
55
|
-
approvalDeny: string;
|
|
56
|
-
approvalRemember: string;
|
|
57
|
-
humanConfirm: string;
|
|
58
|
-
humanDeny: string;
|
|
59
|
-
humanOpen: string;
|
|
60
|
-
humanSubmit: string;
|
|
61
|
-
}
|
|
62
|
-
interface SlackInteractiveActor {
|
|
63
|
-
userId: string;
|
|
64
|
-
teamId?: string;
|
|
65
|
-
}
|
|
66
17
|
interface SlackInteractiveRequestWaitOptions {
|
|
67
18
|
/**
|
|
68
19
|
* Abort waiting for this request. The controller removes its local waiter and
|
|
@@ -133,4 +84,4 @@ interface SlackInteractivePostedMessage {
|
|
|
133
84
|
ref: SlackInteractiveMessageRef;
|
|
134
85
|
}
|
|
135
86
|
|
|
136
|
-
export type {
|
|
87
|
+
export type { SlackInteractiveApprovalRequest as S, SlackInteractiveController as a, SlackInteractiveControllerOptions as b, SlackInteractiveHumanInputRequest as c, SlackInteractivePendingWaiter as d, SlackInteractivePostedMessage as e, SlackInteractiveRequestWaitOptions as f, SlackInteractiveResolution as g };
|