@cuylabs/channel-slack-agent-core 0.5.1 → 0.6.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 +14 -40
- package/dist/{adapter.d.ts → adapter/index.d.ts} +4 -5
- package/dist/adapter/index.js +9 -0
- package/dist/app-surface.js +5 -7
- package/dist/app.d.ts +2 -1
- package/dist/app.js +6 -9
- package/dist/{assistant.d.ts → assistant/index.d.ts} +4 -4
- package/dist/{assistant.js → assistant/index.js} +3 -5
- package/dist/{chunk-JMLB7A2V.js → chunk-5NQYLOAW.js} +5 -5
- package/dist/{chunk-NIPAN4KA.js → chunk-A2PLAVW6.js} +2 -3
- package/dist/chunk-C7VSW4ZM.js +548 -0
- package/dist/chunk-ELR6MQD7.js +12 -0
- package/dist/{chunk-CYEBGC6G.js → chunk-FNT4TXNQ.js} +5 -5
- package/dist/{chunk-DHPD4XH5.js → chunk-NOVWLAVP.js} +1 -9
- package/dist/{chunk-M64Z6TYL.js → chunk-P7KK5GQG.js} +7 -6
- package/dist/chunk-P7PFQ3SQ.js +396 -0
- package/dist/{chunk-IWUYIAY5.js → chunk-QEJ7TAZJ.js} +5 -7
- package/dist/{chunk-FDRQOG7Q.js → chunk-TIQGJ52F.js} +13 -14
- package/dist/{chunk-WO4BJMF3.js → chunk-VCXPNQRB.js} +5 -5
- package/dist/{chunk-BFUPAJON.js → chunk-ZDVD46RT.js} +37 -37
- package/dist/context-fragments-CQEDcjYR.d.ts +30 -0
- package/dist/express-assistant.d.ts +2 -1
- package/dist/express-assistant.js +4 -7
- package/dist/express.d.ts +2 -1
- package/dist/express.js +3 -6
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.js +10 -0
- package/dist/history/index.d.ts +57 -0
- package/dist/history/index.js +8 -0
- package/dist/index.d.ts +14 -13
- package/dist/index.js +63 -160
- package/dist/{interactive.d.ts → interactive/index.d.ts} +3 -3
- package/dist/{interactive.js → interactive/index.js} +1 -2
- package/dist/mcp.js +0 -1
- package/dist/{shared.d.ts → shared/index.d.ts} +7 -33
- package/dist/{shared.js → shared/index.js} +2 -6
- package/dist/socket.d.ts +2 -1
- package/dist/socket.js +6 -9
- package/dist/source/index.d.ts +154 -0
- package/dist/source/index.js +38 -0
- package/docs/README.md +11 -0
- package/docs/reference/boundary.md +22 -0
- package/docs/reference/exports.md +24 -0
- package/package.json +27 -51
- package/dist/adapter.js +0 -13
- package/dist/bolt.d.ts +0 -8
- package/dist/bolt.js +0 -10
- package/dist/chunk-2SUAW6MV.js +0 -12
- package/dist/chunk-645NNJIM.js +0 -12
- package/dist/chunk-ANIZ5NT4.js +0 -12
- package/dist/chunk-GNXWTKQ6.js +0 -48
- package/dist/chunk-HFT2FXJP.js +0 -12
- package/dist/chunk-I2KLQ2HA.js +0 -22
- package/dist/chunk-K2E6A377.js +0 -12
- package/dist/chunk-NDVXBI7Z.js +0 -12
- package/dist/chunk-PX4RGO3N.js +0 -12
- package/dist/chunk-VHGV66M7.js +0 -12
- package/dist/diagnostics.d.ts +0 -1
- package/dist/diagnostics.js +0 -10
- package/dist/feedback.d.ts +0 -1
- package/dist/feedback.js +0 -10
- package/dist/history.d.ts +0 -1
- package/dist/history.js +0 -10
- package/dist/policy.d.ts +0 -1
- package/dist/policy.js +0 -10
- package/dist/setup.d.ts +0 -1
- package/dist/setup.js +0 -10
- package/dist/targets.d.ts +0 -1
- package/dist/targets.js +0 -10
- package/dist/users.d.ts +0 -1
- package/dist/users.js +0 -10
- /package/dist/{chunk-IXY3BXU5.js → chunk-J6CW2RGO.js} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { AgentEvent, Logger } from '@cuylabs/agent-core';
|
|
2
|
+
import { DispatchEventStore } from '@cuylabs/agent-core/dispatch';
|
|
3
|
+
import { SlackChannelType } from '@cuylabs/channel-slack/core';
|
|
4
|
+
|
|
5
|
+
interface SlackAgentEventQueueState {
|
|
6
|
+
deliveredSequences: Set<number>;
|
|
7
|
+
lastQueuedStatusByKey: Map<string, string>;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
turnId?: string;
|
|
10
|
+
}
|
|
11
|
+
interface SlackAgentEventQueue {
|
|
12
|
+
push(event: AgentEvent, coalesce?: (previous: AgentEvent, next: AgentEvent) => AgentEvent | undefined): void;
|
|
13
|
+
}
|
|
14
|
+
interface RouteSlackAgentEventOptions {
|
|
15
|
+
event: AgentEvent;
|
|
16
|
+
logger?: Pick<Logger, "debug">;
|
|
17
|
+
onRecord?: (event: AgentEvent, sequence?: number) => void;
|
|
18
|
+
queue: SlackAgentEventQueue;
|
|
19
|
+
sequence?: number;
|
|
20
|
+
state: SlackAgentEventQueueState;
|
|
21
|
+
}
|
|
22
|
+
declare function coalesceSlackAgentEvents(previous: AgentEvent, next: AgentEvent): AgentEvent | undefined;
|
|
23
|
+
declare function routeSlackAgentEvent({ event, logger, onRecord, queue, sequence, state, }: RouteSlackAgentEventOptions): boolean;
|
|
24
|
+
declare function shouldQueueSlackAgentEvent({ event, logger, sequence, state, }: {
|
|
25
|
+
event: AgentEvent;
|
|
26
|
+
logger?: Pick<Logger, "debug">;
|
|
27
|
+
sequence?: number;
|
|
28
|
+
state: SlackAgentEventQueueState;
|
|
29
|
+
}): boolean;
|
|
30
|
+
|
|
31
|
+
declare function immediateSlackTextResponse(text: string): AsyncGenerator<AgentEvent>;
|
|
32
|
+
declare function isSlackCancelMessage(message: string): boolean;
|
|
33
|
+
type SlackTypedApprovalAction = "allow" | "deny" | "remember";
|
|
34
|
+
declare function resolveSlackTypedApprovalAction(message: string): SlackTypedApprovalAction | undefined;
|
|
35
|
+
declare function isRunningAgentTurnError(error: unknown): boolean;
|
|
36
|
+
declare function isAbortLikeError(error: unknown): boolean;
|
|
37
|
+
|
|
38
|
+
type SlackTurnPhase = "starting" | "reasoning" | "tool-running" | "waiting-approval" | "waiting-input" | "streaming" | "completed" | "failed" | "cancelled";
|
|
39
|
+
interface SlackActiveToolCall {
|
|
40
|
+
startedAtMs: number;
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
toolName: string;
|
|
43
|
+
}
|
|
44
|
+
interface SlackTurnActivityState {
|
|
45
|
+
currentTool?: SlackActiveToolCall;
|
|
46
|
+
lastActivityAtMs: number;
|
|
47
|
+
phase: SlackTurnPhase;
|
|
48
|
+
}
|
|
49
|
+
interface SlackTurnStatusVisibilityState extends SlackTurnActivityState {
|
|
50
|
+
eventCounts: Record<string, number>;
|
|
51
|
+
firstEventAtMs?: number;
|
|
52
|
+
firstEventType?: string;
|
|
53
|
+
sessionId?: string;
|
|
54
|
+
startedAtMs: number;
|
|
55
|
+
statusWarningsSent: Set<string>;
|
|
56
|
+
turnId?: string;
|
|
57
|
+
}
|
|
58
|
+
interface SlackTurnStatusVisibilityOptions {
|
|
59
|
+
checkIntervalMs?: number;
|
|
60
|
+
toolStaleWarningMs?: number;
|
|
61
|
+
turnStaleWarningMs?: number;
|
|
62
|
+
}
|
|
63
|
+
interface ResolvedSlackTurnStatusVisibilityOptions {
|
|
64
|
+
checkIntervalMs: number;
|
|
65
|
+
toolStaleWarningMs: number;
|
|
66
|
+
turnStaleWarningMs: number;
|
|
67
|
+
}
|
|
68
|
+
interface SlackTurnStatusVisibilityWarning {
|
|
69
|
+
elapsedMs: number;
|
|
70
|
+
firstEventLatencyMs?: number;
|
|
71
|
+
firstEventType?: string;
|
|
72
|
+
id: string;
|
|
73
|
+
idleMs: number;
|
|
74
|
+
message: string;
|
|
75
|
+
phase: SlackTurnPhase;
|
|
76
|
+
receivedEventCount: number;
|
|
77
|
+
sessionId?: string;
|
|
78
|
+
staleBeforeFirstEvent: boolean;
|
|
79
|
+
thresholdMs: number;
|
|
80
|
+
toolCallId?: string;
|
|
81
|
+
toolName?: string;
|
|
82
|
+
turnId?: string;
|
|
83
|
+
type: "tool" | "turn";
|
|
84
|
+
}
|
|
85
|
+
interface InspectSlackTurnStatusVisibilityOptions {
|
|
86
|
+
formatToolStaleStatus?: (toolName: string) => string;
|
|
87
|
+
formatTurnStaleStatus?: (phase: SlackTurnPhase) => string;
|
|
88
|
+
nowMs?: number;
|
|
89
|
+
options: ResolvedSlackTurnStatusVisibilityOptions;
|
|
90
|
+
state: SlackTurnStatusVisibilityState;
|
|
91
|
+
}
|
|
92
|
+
declare function resolveSlackTurnStatusVisibilityOptions(options: SlackTurnStatusVisibilityOptions | undefined): ResolvedSlackTurnStatusVisibilityOptions;
|
|
93
|
+
declare function shouldInspectSlackTurnStatusVisibility(options: ResolvedSlackTurnStatusVisibilityOptions): boolean;
|
|
94
|
+
declare function recordSlackTurnActivity(state: SlackTurnActivityState, event: AgentEvent, nowMs?: number): void;
|
|
95
|
+
declare function inspectSlackTurnStatusVisibility({ formatToolStaleStatus, formatTurnStaleStatus, nowMs, options, state, }: InspectSlackTurnStatusVisibilityOptions): SlackTurnStatusVisibilityWarning | undefined;
|
|
96
|
+
declare function isSlackWaitingForHumanTurnPhase(phase: SlackTurnPhase): boolean;
|
|
97
|
+
declare function isSlackTerminalTurnPhase(phase: SlackTurnPhase): boolean;
|
|
98
|
+
|
|
99
|
+
type SlackSubagentStartedEvent = Extract<AgentEvent, {
|
|
100
|
+
type: "subagent-start";
|
|
101
|
+
}>;
|
|
102
|
+
type SlackSubagentTerminalEvent = Extract<AgentEvent, {
|
|
103
|
+
type: "subagent-complete" | "subagent-error";
|
|
104
|
+
}>;
|
|
105
|
+
interface SlackSubagentCompletionSlackContext {
|
|
106
|
+
channelId?: string;
|
|
107
|
+
channelType?: SlackChannelType;
|
|
108
|
+
messageTs?: string;
|
|
109
|
+
teamId?: string;
|
|
110
|
+
threadTs?: string;
|
|
111
|
+
}
|
|
112
|
+
interface SlackSubagentCompletionTurnContext {
|
|
113
|
+
sessionId: string;
|
|
114
|
+
slack?: SlackSubagentCompletionSlackContext;
|
|
115
|
+
turnId: string;
|
|
116
|
+
}
|
|
117
|
+
interface SlackSubagentCompletionMessage {
|
|
118
|
+
blocks?: unknown[];
|
|
119
|
+
channel: string;
|
|
120
|
+
text: string;
|
|
121
|
+
thread_ts?: string;
|
|
122
|
+
}
|
|
123
|
+
type SlackSubagentCompletionPoster = (message: SlackSubagentCompletionMessage) => Promise<void>;
|
|
124
|
+
interface SlackSubagentCompletionRun {
|
|
125
|
+
dispatchId: string;
|
|
126
|
+
role: string;
|
|
127
|
+
sessionId: string;
|
|
128
|
+
slack: Required<Pick<SlackSubagentCompletionSlackContext, "channelId" | "threadTs">> & Omit<SlackSubagentCompletionSlackContext, "channelId" | "threadTs">;
|
|
129
|
+
title: string;
|
|
130
|
+
turnId: string;
|
|
131
|
+
}
|
|
132
|
+
interface SlackSubagentCompletionMessageFormatterOptions {
|
|
133
|
+
event: SlackSubagentTerminalEvent;
|
|
134
|
+
run: SlackSubagentCompletionRun;
|
|
135
|
+
}
|
|
136
|
+
interface SlackSubagentCompletionNotifierOptions {
|
|
137
|
+
enabled?: boolean;
|
|
138
|
+
formatMessage?: (options: SlackSubagentCompletionMessageFormatterOptions) => SlackSubagentCompletionMessage;
|
|
139
|
+
logger?: Pick<Logger, "debug" | "info" | "warn">;
|
|
140
|
+
postMessage?: SlackSubagentCompletionPoster;
|
|
141
|
+
}
|
|
142
|
+
declare function createSlackSubagentCompletionNotifier({ enabled, formatMessage, logger, postMessage: initialPostMessage, }?: SlackSubagentCompletionNotifierOptions): {
|
|
143
|
+
clear(): void;
|
|
144
|
+
markResultDeliveredInline: (event: SlackSubagentTerminalEvent) => void;
|
|
145
|
+
markTurnDetached: (turnId: string) => void;
|
|
146
|
+
postDetachedCompletionsFromEventStore: (eventStore: DispatchEventStore) => Promise<void>;
|
|
147
|
+
postTerminalEvent: (event: SlackSubagentTerminalEvent) => Promise<void>;
|
|
148
|
+
setPostMessage(nextPostMessage: SlackSubagentCompletionPoster | undefined): void;
|
|
149
|
+
trackStartedRun: (turn: SlackSubagentCompletionTurnContext, event: SlackSubagentStartedEvent) => void;
|
|
150
|
+
};
|
|
151
|
+
declare function isSlackSubagentTerminalEvent(event: AgentEvent): event is SlackSubagentTerminalEvent;
|
|
152
|
+
declare function formatDefaultSlackSubagentCompletionMessage({ event, run, }: SlackSubagentCompletionMessageFormatterOptions): SlackSubagentCompletionMessage;
|
|
153
|
+
|
|
154
|
+
export { type InspectSlackTurnStatusVisibilityOptions, type ResolvedSlackTurnStatusVisibilityOptions, type RouteSlackAgentEventOptions, type SlackActiveToolCall, type SlackAgentEventQueue, type SlackAgentEventQueueState, type SlackSubagentCompletionMessage, type SlackSubagentCompletionMessageFormatterOptions, type SlackSubagentCompletionNotifierOptions, type SlackSubagentCompletionPoster, type SlackSubagentCompletionRun, type SlackSubagentCompletionSlackContext, type SlackSubagentCompletionTurnContext, type SlackTurnActivityState, type SlackTurnPhase, type SlackTurnStatusVisibilityOptions, type SlackTurnStatusVisibilityState, type SlackTurnStatusVisibilityWarning, type SlackTypedApprovalAction, coalesceSlackAgentEvents, createSlackSubagentCompletionNotifier, formatDefaultSlackSubagentCompletionMessage, immediateSlackTextResponse, inspectSlackTurnStatusVisibility, isAbortLikeError, isRunningAgentTurnError, isSlackCancelMessage, isSlackSubagentTerminalEvent, isSlackTerminalTurnPhase, isSlackWaitingForHumanTurnPhase, recordSlackTurnActivity, resolveSlackTurnStatusVisibilityOptions, resolveSlackTypedApprovalAction, routeSlackAgentEvent, shouldInspectSlackTurnStatusVisibility, shouldQueueSlackAgentEvent };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
coalesceSlackAgentEvents,
|
|
3
|
+
createSlackSubagentCompletionNotifier,
|
|
4
|
+
formatDefaultSlackSubagentCompletionMessage,
|
|
5
|
+
immediateSlackTextResponse,
|
|
6
|
+
inspectSlackTurnStatusVisibility,
|
|
7
|
+
isAbortLikeError,
|
|
8
|
+
isRunningAgentTurnError,
|
|
9
|
+
isSlackCancelMessage,
|
|
10
|
+
isSlackSubagentTerminalEvent,
|
|
11
|
+
isSlackTerminalTurnPhase,
|
|
12
|
+
isSlackWaitingForHumanTurnPhase,
|
|
13
|
+
recordSlackTurnActivity,
|
|
14
|
+
resolveSlackTurnStatusVisibilityOptions,
|
|
15
|
+
resolveSlackTypedApprovalAction,
|
|
16
|
+
routeSlackAgentEvent,
|
|
17
|
+
shouldInspectSlackTurnStatusVisibility,
|
|
18
|
+
shouldQueueSlackAgentEvent
|
|
19
|
+
} from "../chunk-C7VSW4ZM.js";
|
|
20
|
+
export {
|
|
21
|
+
coalesceSlackAgentEvents,
|
|
22
|
+
createSlackSubagentCompletionNotifier,
|
|
23
|
+
formatDefaultSlackSubagentCompletionMessage,
|
|
24
|
+
immediateSlackTextResponse,
|
|
25
|
+
inspectSlackTurnStatusVisibility,
|
|
26
|
+
isAbortLikeError,
|
|
27
|
+
isRunningAgentTurnError,
|
|
28
|
+
isSlackCancelMessage,
|
|
29
|
+
isSlackSubagentTerminalEvent,
|
|
30
|
+
isSlackTerminalTurnPhase,
|
|
31
|
+
isSlackWaitingForHumanTurnPhase,
|
|
32
|
+
recordSlackTurnActivity,
|
|
33
|
+
resolveSlackTurnStatusVisibilityOptions,
|
|
34
|
+
resolveSlackTypedApprovalAction,
|
|
35
|
+
routeSlackAgentEvent,
|
|
36
|
+
shouldInspectSlackTurnStatusVisibility,
|
|
37
|
+
shouldQueueSlackAgentEvent
|
|
38
|
+
};
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Channel Slack Agent Core Docs
|
|
2
|
+
|
|
3
|
+
`@cuylabs/channel-slack-agent-core` is the `@cuylabs/agent-core` runtime binding
|
|
4
|
+
for direct Slack traffic. It composes `@cuylabs/channel-slack` primitives with
|
|
5
|
+
Agent Core turn sources, event streams, scopes, context fragments, approvals,
|
|
6
|
+
and human-input requests.
|
|
7
|
+
|
|
8
|
+
## Reference
|
|
9
|
+
|
|
10
|
+
- [Package boundary](reference/boundary.md)
|
|
11
|
+
- [Exports and peer expectations](reference/exports.md)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Package Boundary
|
|
2
|
+
|
|
3
|
+
This package owns only the `@cuylabs/agent-core` Slack binding.
|
|
4
|
+
|
|
5
|
+
## In This Package
|
|
6
|
+
|
|
7
|
+
- Mapping Slack turns to `AgentTurnSource.chat(...)`.
|
|
8
|
+
- Creating Agent Core scopes and context fragments.
|
|
9
|
+
- Converting `AgentEvent` streams to Slack messages or chat streams.
|
|
10
|
+
- Mounting Agent Core sources on Express Events API and Socket Mode surfaces.
|
|
11
|
+
- Binding Slack Assistant lifecycle handlers to Agent Core turns.
|
|
12
|
+
- Handling Agent Core approval and human-input requests in Slack.
|
|
13
|
+
- Agent Core helpers for Slack history context fragments and source events.
|
|
14
|
+
|
|
15
|
+
## Outside This Package
|
|
16
|
+
|
|
17
|
+
- Generic Slack activity parsing, formatting, setup, auth, policy, history,
|
|
18
|
+
targets, users, entrypoints, artifacts, and transport factories.
|
|
19
|
+
- Product prompts, tools, audit policy, privacy rules, and deployment policy.
|
|
20
|
+
- Slack app configuration outside the reusable setup helpers.
|
|
21
|
+
|
|
22
|
+
Generic Slack mechanics live in `@cuylabs/channel-slack`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Exports
|
|
2
|
+
|
|
3
|
+
Use feature subpaths when you only need one adapter surface. Generic Slack
|
|
4
|
+
primitives should be imported from `@cuylabs/channel-slack` directly.
|
|
5
|
+
|
|
6
|
+
| Export | Depends on | Notes |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| `@cuylabs/channel-slack-agent-core` | `@cuylabs/agent-core`, selected Slack peers | Full adapter surface re-export |
|
|
9
|
+
| `@cuylabs/channel-slack-agent-core/adapter` | `@slack/bolt`, `@slack/web-api` types | Classic app mention, DM, and passive channel-message adapter |
|
|
10
|
+
| `@cuylabs/channel-slack-agent-core/app` | `@slack/bolt`, `@slack/web-api` | Direct app factory for mounted Slack surfaces |
|
|
11
|
+
| `@cuylabs/channel-slack-agent-core/app-surface` | `@slack/bolt`, `@slack/web-api` types | Shared surface installer for Assistant, mentions, DMs, feedback, and interactions |
|
|
12
|
+
| `@cuylabs/channel-slack-agent-core/assistant` | `@slack/bolt`, `@slack/web-api` types | Slack Assistant bridge and lifecycle handlers |
|
|
13
|
+
| `@cuylabs/channel-slack-agent-core/express` | `@slack/bolt`, `express` | Express Events API mounting for classic Slack surfaces |
|
|
14
|
+
| `@cuylabs/channel-slack-agent-core/express-assistant` | `@slack/bolt`, `express` | Express Events API mounting for Slack Assistant |
|
|
15
|
+
| `@cuylabs/channel-slack-agent-core/feedback` | `@slack/bolt`, `@slack/types` | Agent Core feedback binding helpers |
|
|
16
|
+
| `@cuylabs/channel-slack-agent-core/history` | `@slack/web-api`, `@cuylabs/agent-core` types | Agent Core turn history context fragment assembly |
|
|
17
|
+
| `@cuylabs/channel-slack-agent-core/interactive` | `@slack/bolt`, `@slack/types` | Agent Core approval and human-input binding for Slack |
|
|
18
|
+
| `@cuylabs/channel-slack-agent-core/mcp` | `@cuylabs/agent-core/mcp` types | Slack OAuth token bridge for Agent Core MCP setup |
|
|
19
|
+
| `@cuylabs/channel-slack-agent-core/shared` | `@cuylabs/agent-core` types | Context fragments, event bridge, and interactive request contracts |
|
|
20
|
+
| `@cuylabs/channel-slack-agent-core/socket` | `@slack/bolt` | Socket Mode mounting helpers |
|
|
21
|
+
| `@cuylabs/channel-slack-agent-core/source` | `@cuylabs/agent-core` types | Source event queue, response helpers, and status visibility helpers |
|
|
22
|
+
|
|
23
|
+
For generic Slack package exports, see
|
|
24
|
+
`@cuylabs/channel-slack/docs/reference/exports.md`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuylabs/channel-slack-agent-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Slack adapter for @cuylabs/agent-core built on @cuylabs/channel-slack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"./adapter": {
|
|
15
|
-
"types": "./dist/adapter.d.ts",
|
|
16
|
-
"import": "./dist/adapter.js",
|
|
17
|
-
"default": "./dist/adapter.js"
|
|
15
|
+
"types": "./dist/adapter/index.d.ts",
|
|
16
|
+
"import": "./dist/adapter/index.js",
|
|
17
|
+
"default": "./dist/adapter/index.js"
|
|
18
18
|
},
|
|
19
19
|
"./app": {
|
|
20
20
|
"types": "./dist/app.d.ts",
|
|
@@ -27,19 +27,9 @@
|
|
|
27
27
|
"default": "./dist/app-surface.js"
|
|
28
28
|
},
|
|
29
29
|
"./assistant": {
|
|
30
|
-
"types": "./dist/assistant.d.ts",
|
|
31
|
-
"import": "./dist/assistant.js",
|
|
32
|
-
"default": "./dist/assistant.js"
|
|
33
|
-
},
|
|
34
|
-
"./bolt": {
|
|
35
|
-
"types": "./dist/bolt.d.ts",
|
|
36
|
-
"import": "./dist/bolt.js",
|
|
37
|
-
"default": "./dist/bolt.js"
|
|
38
|
-
},
|
|
39
|
-
"./diagnostics": {
|
|
40
|
-
"types": "./dist/diagnostics.d.ts",
|
|
41
|
-
"import": "./dist/diagnostics.js",
|
|
42
|
-
"default": "./dist/diagnostics.js"
|
|
30
|
+
"types": "./dist/assistant/index.d.ts",
|
|
31
|
+
"import": "./dist/assistant/index.js",
|
|
32
|
+
"default": "./dist/assistant/index.js"
|
|
43
33
|
},
|
|
44
34
|
"./express": {
|
|
45
35
|
"types": "./dist/express.d.ts",
|
|
@@ -52,63 +42,49 @@
|
|
|
52
42
|
"default": "./dist/express-assistant.js"
|
|
53
43
|
},
|
|
54
44
|
"./feedback": {
|
|
55
|
-
"types": "./dist/feedback.d.ts",
|
|
56
|
-
"import": "./dist/feedback.js",
|
|
57
|
-
"default": "./dist/feedback.js"
|
|
45
|
+
"types": "./dist/feedback/index.d.ts",
|
|
46
|
+
"import": "./dist/feedback/index.js",
|
|
47
|
+
"default": "./dist/feedback/index.js"
|
|
58
48
|
},
|
|
59
49
|
"./history": {
|
|
60
|
-
"types": "./dist/history.d.ts",
|
|
61
|
-
"import": "./dist/history.js",
|
|
62
|
-
"default": "./dist/history.js"
|
|
50
|
+
"types": "./dist/history/index.d.ts",
|
|
51
|
+
"import": "./dist/history/index.js",
|
|
52
|
+
"default": "./dist/history/index.js"
|
|
63
53
|
},
|
|
64
54
|
"./interactive": {
|
|
65
|
-
"types": "./dist/interactive.d.ts",
|
|
66
|
-
"import": "./dist/interactive.js",
|
|
67
|
-
"default": "./dist/interactive.js"
|
|
55
|
+
"types": "./dist/interactive/index.d.ts",
|
|
56
|
+
"import": "./dist/interactive/index.js",
|
|
57
|
+
"default": "./dist/interactive/index.js"
|
|
68
58
|
},
|
|
69
59
|
"./mcp": {
|
|
70
60
|
"types": "./dist/mcp.d.ts",
|
|
71
61
|
"import": "./dist/mcp.js",
|
|
72
62
|
"default": "./dist/mcp.js"
|
|
73
63
|
},
|
|
74
|
-
"./policy": {
|
|
75
|
-
"types": "./dist/policy.d.ts",
|
|
76
|
-
"import": "./dist/policy.js",
|
|
77
|
-
"default": "./dist/policy.js"
|
|
78
|
-
},
|
|
79
|
-
"./setup": {
|
|
80
|
-
"types": "./dist/setup.d.ts",
|
|
81
|
-
"import": "./dist/setup.js",
|
|
82
|
-
"default": "./dist/setup.js"
|
|
83
|
-
},
|
|
84
64
|
"./shared": {
|
|
85
|
-
"types": "./dist/shared.d.ts",
|
|
86
|
-
"import": "./dist/shared.js",
|
|
87
|
-
"default": "./dist/shared.js"
|
|
65
|
+
"types": "./dist/shared/index.d.ts",
|
|
66
|
+
"import": "./dist/shared/index.js",
|
|
67
|
+
"default": "./dist/shared/index.js"
|
|
88
68
|
},
|
|
89
69
|
"./socket": {
|
|
90
70
|
"types": "./dist/socket.d.ts",
|
|
91
71
|
"import": "./dist/socket.js",
|
|
92
72
|
"default": "./dist/socket.js"
|
|
93
73
|
},
|
|
94
|
-
"./
|
|
95
|
-
"types": "./dist/
|
|
96
|
-
"import": "./dist/
|
|
97
|
-
"default": "./dist/
|
|
98
|
-
},
|
|
99
|
-
"./users": {
|
|
100
|
-
"types": "./dist/users.d.ts",
|
|
101
|
-
"import": "./dist/users.js",
|
|
102
|
-
"default": "./dist/users.js"
|
|
74
|
+
"./source": {
|
|
75
|
+
"types": "./dist/source/index.d.ts",
|
|
76
|
+
"import": "./dist/source/index.js",
|
|
77
|
+
"default": "./dist/source/index.js"
|
|
103
78
|
}
|
|
104
79
|
},
|
|
105
80
|
"files": [
|
|
106
81
|
"dist",
|
|
82
|
+
"docs",
|
|
107
83
|
"README.md"
|
|
108
84
|
],
|
|
109
85
|
"dependencies": {
|
|
110
86
|
"@cuylabs/agent-core": "^7.2.0",
|
|
111
|
-
"@cuylabs/channel-slack": "^0.
|
|
87
|
+
"@cuylabs/channel-slack": "^0.6.0"
|
|
112
88
|
},
|
|
113
89
|
"peerDependencies": {
|
|
114
90
|
"@slack/bolt": ">=4.7.3",
|
|
@@ -158,9 +134,9 @@
|
|
|
158
134
|
"node": ">=20"
|
|
159
135
|
},
|
|
160
136
|
"scripts": {
|
|
161
|
-
"build": "tsup src/index.ts src/shared.ts src/adapter.ts src/app.ts src/app-surface.ts src/assistant
|
|
137
|
+
"build": "tsup src/index.ts src/shared/index.ts src/adapter/index.ts src/app.ts src/app-surface.ts src/assistant/index.ts src/express.ts src/express-assistant.ts src/feedback/index.ts src/history/index.ts src/interactive/index.ts src/mcp.ts src/socket.ts src/source/index.ts --format esm --dts --clean",
|
|
162
138
|
"clean": "rm -rf dist",
|
|
163
|
-
"dev": "tsup src/index.ts src/shared.ts src/adapter.ts src/app.ts src/app-surface.ts src/assistant
|
|
139
|
+
"dev": "tsup src/index.ts src/shared/index.ts src/adapter/index.ts src/app.ts src/app-surface.ts src/assistant/index.ts src/express.ts src/express-assistant.ts src/feedback/index.ts src/history/index.ts src/interactive/index.ts src/mcp.ts src/socket.ts src/source/index.ts --format esm --dts --watch",
|
|
164
140
|
"lint": "eslint \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\" --max-warnings=0",
|
|
165
141
|
"test": "vitest run",
|
|
166
142
|
"test:watch": "vitest",
|
package/dist/adapter.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSlackChannelAdapter,
|
|
3
|
-
createSlackSessionMap,
|
|
4
|
-
resolveThreadAwareSlackSessionId
|
|
5
|
-
} from "./chunk-FDRQOG7Q.js";
|
|
6
|
-
import "./chunk-GNXWTKQ6.js";
|
|
7
|
-
import "./chunk-DHPD4XH5.js";
|
|
8
|
-
import "./chunk-I2KLQ2HA.js";
|
|
9
|
-
export {
|
|
10
|
-
createSlackChannelAdapter,
|
|
11
|
-
createSlackSessionMap,
|
|
12
|
-
resolveThreadAwareSlackSessionId
|
|
13
|
-
};
|
package/dist/bolt.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from '@cuylabs/channel-slack/bolt';
|
|
2
|
-
import '@cuylabs/channel-slack/diagnostics';
|
|
3
|
-
import '@cuylabs/channel-slack/feedback';
|
|
4
|
-
import '@cuylabs/channel-slack/history';
|
|
5
|
-
import '@cuylabs/channel-slack/policy';
|
|
6
|
-
import '@cuylabs/channel-slack/setup';
|
|
7
|
-
import '@cuylabs/channel-slack/targets';
|
|
8
|
-
import '@cuylabs/channel-slack/users';
|
package/dist/bolt.js
DELETED
package/dist/chunk-2SUAW6MV.js
DELETED
package/dist/chunk-645NNJIM.js
DELETED
package/dist/chunk-ANIZ5NT4.js
DELETED
package/dist/chunk-GNXWTKQ6.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// src/shared/formatting.ts
|
|
2
|
-
import {
|
|
3
|
-
markdownToSlackMrkdwn,
|
|
4
|
-
resolveSlackMessageFormatter
|
|
5
|
-
} from "@cuylabs/channel-slack/core";
|
|
6
|
-
|
|
7
|
-
// src/shared/activity/classify.ts
|
|
8
|
-
import {
|
|
9
|
-
isProcessableMessage,
|
|
10
|
-
resolveSlackChannelType,
|
|
11
|
-
stripLeadingMentions
|
|
12
|
-
} from "@cuylabs/channel-slack/core";
|
|
13
|
-
|
|
14
|
-
// src/shared/activity/identity.ts
|
|
15
|
-
import {
|
|
16
|
-
extractSlackAuthContext,
|
|
17
|
-
extractSlackUserIdentity
|
|
18
|
-
} from "@cuylabs/channel-slack/core";
|
|
19
|
-
|
|
20
|
-
// src/shared/activity/parse.ts
|
|
21
|
-
import {
|
|
22
|
-
extractSlackActionToken,
|
|
23
|
-
parseSlackMentionActivity,
|
|
24
|
-
parseSlackMessageActivity
|
|
25
|
-
} from "@cuylabs/channel-slack/core";
|
|
26
|
-
|
|
27
|
-
// src/shared/activity/text.ts
|
|
28
|
-
import {
|
|
29
|
-
extractSlackAttachmentsText,
|
|
30
|
-
extractSlackBlocksText,
|
|
31
|
-
extractSlackMessageText
|
|
32
|
-
} from "@cuylabs/channel-slack/core";
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
markdownToSlackMrkdwn,
|
|
36
|
-
resolveSlackMessageFormatter,
|
|
37
|
-
isProcessableMessage,
|
|
38
|
-
resolveSlackChannelType,
|
|
39
|
-
stripLeadingMentions,
|
|
40
|
-
extractSlackAuthContext,
|
|
41
|
-
extractSlackUserIdentity,
|
|
42
|
-
extractSlackActionToken,
|
|
43
|
-
parseSlackMentionActivity,
|
|
44
|
-
parseSlackMessageActivity,
|
|
45
|
-
extractSlackAttachmentsText,
|
|
46
|
-
extractSlackBlocksText,
|
|
47
|
-
extractSlackMessageText
|
|
48
|
-
};
|
package/dist/chunk-HFT2FXJP.js
DELETED
package/dist/chunk-I2KLQ2HA.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
__export,
|
|
21
|
-
__reExport
|
|
22
|
-
};
|
package/dist/chunk-K2E6A377.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__reExport
|
|
3
|
-
} from "./chunk-I2KLQ2HA.js";
|
|
4
|
-
|
|
5
|
-
// src/targets/index.ts
|
|
6
|
-
var targets_exports = {};
|
|
7
|
-
__reExport(targets_exports, targets_star);
|
|
8
|
-
import * as targets_star from "@cuylabs/channel-slack/targets";
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
targets_exports
|
|
12
|
-
};
|
package/dist/chunk-NDVXBI7Z.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__reExport
|
|
3
|
-
} from "./chunk-I2KLQ2HA.js";
|
|
4
|
-
|
|
5
|
-
// src/diagnostics/index.ts
|
|
6
|
-
var diagnostics_exports = {};
|
|
7
|
-
__reExport(diagnostics_exports, diagnostics_star);
|
|
8
|
-
import * as diagnostics_star from "@cuylabs/channel-slack/diagnostics";
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
diagnostics_exports
|
|
12
|
-
};
|
package/dist/chunk-PX4RGO3N.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__reExport
|
|
3
|
-
} from "./chunk-I2KLQ2HA.js";
|
|
4
|
-
|
|
5
|
-
// src/history/index.ts
|
|
6
|
-
var history_exports = {};
|
|
7
|
-
__reExport(history_exports, history_star);
|
|
8
|
-
import * as history_star from "@cuylabs/channel-slack/history";
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
history_exports
|
|
12
|
-
};
|
package/dist/chunk-VHGV66M7.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__reExport
|
|
3
|
-
} from "./chunk-I2KLQ2HA.js";
|
|
4
|
-
|
|
5
|
-
// src/feedback/index.ts
|
|
6
|
-
var feedback_exports = {};
|
|
7
|
-
__reExport(feedback_exports, feedback_star);
|
|
8
|
-
import * as feedback_star from "@cuylabs/channel-slack/feedback";
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
feedback_exports
|
|
12
|
-
};
|
package/dist/diagnostics.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@cuylabs/channel-slack/diagnostics';
|
package/dist/diagnostics.js
DELETED
package/dist/feedback.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@cuylabs/channel-slack/feedback';
|
package/dist/feedback.js
DELETED
package/dist/history.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@cuylabs/channel-slack/history';
|
package/dist/history.js
DELETED
package/dist/policy.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@cuylabs/channel-slack/policy';
|