@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
package/README.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @cuylabs/channel-slack-agent-core
|
|
2
2
|
|
|
3
|
-
Slack adapter for `@cuylabs/agent-core`, built on
|
|
4
|
-
|
|
3
|
+
Slack adapter for `@cuylabs/agent-core`, built on
|
|
4
|
+
`@cuylabs/channel-slack`.
|
|
5
5
|
|
|
6
|
-
Use this package when
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
requests.
|
|
6
|
+
Use this package when an Agent Core application needs ready-to-mount Slack
|
|
7
|
+
surfaces for Express Events API, Socket Mode, Slack Assistant, app mentions,
|
|
8
|
+
DMs, feedback, approvals, or human input.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Generic Slack mechanics such as parsing, policy, history, setup, auth, targets,
|
|
11
|
+
users, entrypoints, artifacts, and transports live in `@cuylabs/channel-slack`.
|
|
13
12
|
|
|
14
13
|
## Install
|
|
15
14
|
|
|
@@ -23,29 +22,9 @@ Install Slack peer dependencies for the surfaces you use:
|
|
|
23
22
|
npm install @slack/bolt @slack/web-api express
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
##
|
|
25
|
+
## Quick Start
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| Import | Use for |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| `@cuylabs/channel-slack-agent-core/adapter` | Classic app mention, DM, and passive channel-message adapter |
|
|
33
|
-
| `@cuylabs/channel-slack-agent-core/assistant` | Slack Assistant bridge and lifecycle handlers |
|
|
34
|
-
| `@cuylabs/channel-slack-agent-core/express` | Express Events API mounting for classic Slack surfaces |
|
|
35
|
-
| `@cuylabs/channel-slack-agent-core/express-assistant` | Express Events API mounting for Slack Assistant |
|
|
36
|
-
| `@cuylabs/channel-slack-agent-core/socket` | Socket Mode mounting helpers |
|
|
37
|
-
| `@cuylabs/channel-slack-agent-core/interactive` | Agent-core approval and human-input binding for Slack |
|
|
38
|
-
| `@cuylabs/channel-slack-agent-core/shared` | Agent-core context fragments and event bridge plus Slack core primitives |
|
|
39
|
-
| `@cuylabs/channel-slack-agent-core/bolt` | Re-exported Bolt helpers from `@cuylabs/channel-slack/bolt` |
|
|
40
|
-
| `@cuylabs/channel-slack-agent-core/history` | Re-exported history helpers from `@cuylabs/channel-slack/history` |
|
|
41
|
-
| `@cuylabs/channel-slack-agent-core/policy` | Re-exported message policy helpers from `@cuylabs/channel-slack/policy` |
|
|
42
|
-
|
|
43
|
-
The package root re-exports the full adapter surface for compatibility and
|
|
44
|
-
convenience. Reusable Slack mechanics continue to live in
|
|
45
|
-
`@cuylabs/channel-slack`; this package only adds the `@cuylabs/agent-core`
|
|
46
|
-
binding.
|
|
47
|
-
|
|
48
|
-
## Socket Mode
|
|
27
|
+
Socket Mode:
|
|
49
28
|
|
|
50
29
|
```typescript
|
|
51
30
|
import { mountSlackAssistantAgentSocket } from "@cuylabs/channel-slack-agent-core";
|
|
@@ -57,7 +36,7 @@ await mountSlackAssistantAgentSocket({
|
|
|
57
36
|
});
|
|
58
37
|
```
|
|
59
38
|
|
|
60
|
-
|
|
39
|
+
Express Events API:
|
|
61
40
|
|
|
62
41
|
```typescript
|
|
63
42
|
import { mountSlackAgent } from "@cuylabs/channel-slack-agent-core";
|
|
@@ -68,13 +47,8 @@ await mountSlackAgent(agent, {
|
|
|
68
47
|
});
|
|
69
48
|
```
|
|
70
49
|
|
|
71
|
-
##
|
|
72
|
-
|
|
73
|
-
This package owns only the `@cuylabs/agent-core` binding:
|
|
74
|
-
|
|
75
|
-
- mapping Slack turns to `AgentTurnSource.chat(...)`
|
|
76
|
-
- creating agent-core scopes and context fragments
|
|
77
|
-
- converting `AgentEvent` streams to Slack messages or chat streams
|
|
78
|
-
- handling agent-core approval and human-input requests in Slack
|
|
50
|
+
## Documentation
|
|
79
51
|
|
|
80
|
-
|
|
52
|
+
- [Package boundary](docs/reference/boundary.md)
|
|
53
|
+
- [Exports and peer expectations](docs/reference/exports.md)
|
|
54
|
+
- [Docs index](docs/README.md)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { c as createSlackChannelAdapter } from '
|
|
2
|
-
import { a as SlackChannelOptions } from '
|
|
3
|
-
export { S as SlackChannelAdapter, b as SlackSessionStrategy, c as SlackStreamingMode, d as SlackToolStartEvent } from '
|
|
1
|
+
export { c as createSlackChannelAdapter } from '../adapter-Cmd2C90g.js';
|
|
2
|
+
import { a as SlackChannelOptions } from '../types-BqRzb_Cd.js';
|
|
3
|
+
export { S as SlackChannelAdapter, b as SlackSessionStrategy, c as SlackStreamingMode, d as SlackToolStartEvent } from '../types-BqRzb_Cd.js';
|
|
4
4
|
import { SlackActivityInfo } from '@cuylabs/channel-slack/core';
|
|
5
|
-
export { resolveThreadAwareSlackSessionId } from '@cuylabs/channel-slack/core';
|
|
6
5
|
import '@cuylabs/agent-core';
|
|
7
|
-
import '
|
|
6
|
+
import '../interactive-o_NZb-Xg.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Session mapping — Slack activity info to agent-core session IDs.
|
package/dist/app-surface.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installSlackAgentAppSurface
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-DHPD4XH5.js";
|
|
9
|
-
import "./chunk-I2KLQ2HA.js";
|
|
3
|
+
} from "./chunk-P7KK5GQG.js";
|
|
4
|
+
import "./chunk-ZDVD46RT.js";
|
|
5
|
+
import "./chunk-ELR6MQD7.js";
|
|
6
|
+
import "./chunk-TIQGJ52F.js";
|
|
7
|
+
import "./chunk-NOVWLAVP.js";
|
|
10
8
|
export {
|
|
11
9
|
installSlackAgentAppSurface
|
|
12
10
|
};
|
package/dist/app.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Server } from 'node:http';
|
|
2
2
|
import { Application } from 'express';
|
|
3
3
|
import { App, ExpressReceiver } from '@slack/bolt';
|
|
4
|
-
import { CreateSlackBoltAppOptions
|
|
4
|
+
import { CreateSlackBoltAppOptions } from '@cuylabs/channel-slack/transports/http';
|
|
5
|
+
import { SlackDirectAuthOptions, SlackDirectAuthMode } from '@cuylabs/channel-slack/auth';
|
|
5
6
|
import { SlackAgentAppSurfaceOptions } from './app-surface.js';
|
|
6
7
|
export { MountSlackAgentAppTurnRequestContext } from './app-surface.js';
|
|
7
8
|
import { S as SlackAssistantBridge } from './options-Uf-qmQKN.js';
|
package/dist/app.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mountSlackAgentApp
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-DHPD4XH5.js";
|
|
10
|
-
import "./chunk-ANIZ5NT4.js";
|
|
11
|
-
import "./chunk-I2KLQ2HA.js";
|
|
3
|
+
} from "./chunk-FNT4TXNQ.js";
|
|
4
|
+
import "./chunk-P7KK5GQG.js";
|
|
5
|
+
import "./chunk-ZDVD46RT.js";
|
|
6
|
+
import "./chunk-ELR6MQD7.js";
|
|
7
|
+
import "./chunk-TIQGJ52F.js";
|
|
8
|
+
import "./chunk-NOVWLAVP.js";
|
|
12
9
|
export {
|
|
13
10
|
mountSlackAgentApp
|
|
14
11
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as CreateSlackAssistantBridgeOptions, S as SlackAssistantBridge } from '
|
|
2
|
-
export { A as AssistantLifecycleArgs, a as AssistantThreadStartedArgs, M as MaybePromise, b as SlackAssistantFeedbackConfig, c as SlackAssistantSessionStrategy, d as SlackAssistantStatusContext, e as SlackAssistantThreadContextStoreLike, f as SlackAssistantThreadStartedContext, g as SlackAssistantTurnPreparation, h as SlackAssistantUserMessageContext, r as resolveAssistantSessionId } from '
|
|
1
|
+
import { C as CreateSlackAssistantBridgeOptions, S as SlackAssistantBridge } from '../options-Uf-qmQKN.js';
|
|
2
|
+
export { A as AssistantLifecycleArgs, a as AssistantThreadStartedArgs, M as MaybePromise, b as SlackAssistantFeedbackConfig, c as SlackAssistantSessionStrategy, d as SlackAssistantStatusContext, e as SlackAssistantThreadContextStoreLike, f as SlackAssistantThreadStartedContext, g as SlackAssistantTurnPreparation, h as SlackAssistantUserMessageContext, r as resolveAssistantSessionId } from '../options-Uf-qmQKN.js';
|
|
3
3
|
export { ParsedAssistantUserMessage, createSlackAssistantThreadContextStore, parseSlackMessageActivityFromMessageEvent } from '@cuylabs/channel-slack/assistant';
|
|
4
4
|
import '@cuylabs/agent-core';
|
|
5
5
|
import '@slack/bolt';
|
|
6
6
|
import '@slack/web-api';
|
|
7
7
|
import '@cuylabs/channel-slack/core';
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
8
|
+
import '../interactive-o_NZb-Xg.js';
|
|
9
|
+
import '../options-C7OYeNR-.js';
|
|
10
10
|
import '@cuylabs/channel-slack/feedback';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -3,11 +3,9 @@ import {
|
|
|
3
3
|
createSlackAssistantThreadContextStore,
|
|
4
4
|
parseSlackMessageActivityFromMessageEvent,
|
|
5
5
|
resolveAssistantSessionId
|
|
6
|
-
} from "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "./chunk-DHPD4XH5.js";
|
|
10
|
-
import "./chunk-I2KLQ2HA.js";
|
|
6
|
+
} from "../chunk-ZDVD46RT.js";
|
|
7
|
+
import "../chunk-ELR6MQD7.js";
|
|
8
|
+
import "../chunk-NOVWLAVP.js";
|
|
11
9
|
export {
|
|
12
10
|
createSlackAssistantBridge,
|
|
13
11
|
createSlackAssistantThreadContextStore,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSlackAssistantBridge
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
bolt_exports
|
|
6
|
-
} from "./chunk-ANIZ5NT4.js";
|
|
3
|
+
} from "./chunk-ZDVD46RT.js";
|
|
7
4
|
|
|
8
5
|
// src/express-assistant.ts
|
|
6
|
+
import {
|
|
7
|
+
createSlackBoltApp
|
|
8
|
+
} from "@cuylabs/channel-slack/transports/http";
|
|
9
9
|
async function mountSlackAssistantAgent(options) {
|
|
10
10
|
const {
|
|
11
11
|
botToken,
|
|
@@ -29,7 +29,7 @@ async function mountSlackAssistantAgent(options) {
|
|
|
29
29
|
app: expressApp,
|
|
30
30
|
authMode,
|
|
31
31
|
routePath
|
|
32
|
-
} = await
|
|
32
|
+
} = await createSlackBoltApp({
|
|
33
33
|
signingSecret,
|
|
34
34
|
path,
|
|
35
35
|
botToken,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// src/shared/context-fragments.ts
|
|
1
2
|
import {
|
|
2
3
|
currentSlackTurnContext
|
|
3
|
-
} from "
|
|
4
|
-
|
|
5
|
-
// src/shared/context-fragments.ts
|
|
4
|
+
} from "@cuylabs/channel-slack/core";
|
|
6
5
|
var DEFAULT_SLACK_CONTEXT_FRAGMENT_KEY = "slackContextFragment";
|
|
7
6
|
function isRecord(value) {
|
|
8
7
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|