@cuylabs/channel-slack-agent-core 0.5.0 → 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.
Files changed (72) hide show
  1. package/README.md +14 -40
  2. package/dist/{adapter.d.ts → adapter/index.d.ts} +4 -5
  3. package/dist/adapter/index.js +9 -0
  4. package/dist/app-surface.js +5 -7
  5. package/dist/app.d.ts +2 -1
  6. package/dist/app.js +6 -9
  7. package/dist/{assistant.d.ts → assistant/index.d.ts} +4 -4
  8. package/dist/{assistant.js → assistant/index.js} +3 -5
  9. package/dist/{chunk-JMLB7A2V.js → chunk-5NQYLOAW.js} +5 -5
  10. package/dist/{chunk-NIPAN4KA.js → chunk-A2PLAVW6.js} +2 -3
  11. package/dist/chunk-C7VSW4ZM.js +548 -0
  12. package/dist/chunk-ELR6MQD7.js +12 -0
  13. package/dist/{chunk-CYEBGC6G.js → chunk-FNT4TXNQ.js} +5 -5
  14. package/dist/{chunk-DHPD4XH5.js → chunk-NOVWLAVP.js} +1 -9
  15. package/dist/{chunk-M64Z6TYL.js → chunk-P7KK5GQG.js} +7 -6
  16. package/dist/chunk-P7PFQ3SQ.js +396 -0
  17. package/dist/{chunk-IWUYIAY5.js → chunk-QEJ7TAZJ.js} +5 -7
  18. package/dist/{chunk-FDRQOG7Q.js → chunk-TIQGJ52F.js} +13 -14
  19. package/dist/{chunk-WO4BJMF3.js → chunk-VCXPNQRB.js} +5 -5
  20. package/dist/{chunk-BFUPAJON.js → chunk-ZDVD46RT.js} +37 -37
  21. package/dist/context-fragments-CQEDcjYR.d.ts +30 -0
  22. package/dist/express-assistant.d.ts +2 -1
  23. package/dist/express-assistant.js +4 -7
  24. package/dist/express.d.ts +2 -1
  25. package/dist/express.js +3 -6
  26. package/dist/feedback/index.d.ts +1 -0
  27. package/dist/feedback/index.js +10 -0
  28. package/dist/history/index.d.ts +57 -0
  29. package/dist/history/index.js +8 -0
  30. package/dist/index.d.ts +14 -13
  31. package/dist/index.js +63 -160
  32. package/dist/{interactive.d.ts → interactive/index.d.ts} +3 -3
  33. package/dist/{interactive.js → interactive/index.js} +1 -2
  34. package/dist/mcp.js +0 -1
  35. package/dist/{shared.d.ts → shared/index.d.ts} +7 -33
  36. package/dist/{shared.js → shared/index.js} +2 -6
  37. package/dist/socket.d.ts +2 -1
  38. package/dist/socket.js +6 -9
  39. package/dist/source/index.d.ts +154 -0
  40. package/dist/source/index.js +38 -0
  41. package/docs/README.md +11 -0
  42. package/docs/reference/boundary.md +22 -0
  43. package/docs/reference/exports.md +24 -0
  44. package/package.json +27 -51
  45. package/dist/adapter.js +0 -13
  46. package/dist/bolt.d.ts +0 -8
  47. package/dist/bolt.js +0 -10
  48. package/dist/chunk-2SUAW6MV.js +0 -12
  49. package/dist/chunk-645NNJIM.js +0 -12
  50. package/dist/chunk-ANIZ5NT4.js +0 -12
  51. package/dist/chunk-GNXWTKQ6.js +0 -48
  52. package/dist/chunk-HFT2FXJP.js +0 -12
  53. package/dist/chunk-I2KLQ2HA.js +0 -22
  54. package/dist/chunk-K2E6A377.js +0 -12
  55. package/dist/chunk-NDVXBI7Z.js +0 -12
  56. package/dist/chunk-PX4RGO3N.js +0 -12
  57. package/dist/chunk-VHGV66M7.js +0 -12
  58. package/dist/diagnostics.d.ts +0 -1
  59. package/dist/diagnostics.js +0 -10
  60. package/dist/feedback.d.ts +0 -1
  61. package/dist/feedback.js +0 -10
  62. package/dist/history.d.ts +0 -1
  63. package/dist/history.js +0 -10
  64. package/dist/policy.d.ts +0 -1
  65. package/dist/policy.js +0 -10
  66. package/dist/setup.d.ts +0 -1
  67. package/dist/setup.js +0 -10
  68. package/dist/targets.d.ts +0 -1
  69. package/dist/targets.js +0 -10
  70. package/dist/users.d.ts +0 -1
  71. package/dist/users.js +0 -10
  72. /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 `@cuylabs/channel-slack`
4
- primitives.
3
+ Slack adapter for `@cuylabs/agent-core`, built on
4
+ `@cuylabs/channel-slack`.
5
5
 
6
- Use this package when your agent runtime is `@cuylabs/agent-core` and you want
7
- ready-to-mount Slack surfaces for Bolt, Express, Socket Mode, Slack Assistant,
8
- classic app mentions, DMs, and in-channel interactive approval or human-input
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
- Use `@cuylabs/channel-slack` directly when you want Slack parsing, policy,
12
- history, setup, auth, or formatting primitives for another agent runtime.
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
- ## Import Map
25
+ ## Quick Start
27
26
 
28
- Use feature-specific imports when you only need one adapter surface.
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
- ## Express Events API
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
- ## Boundary
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
- Reusable Slack mechanics live in `@cuylabs/channel-slack`.
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 './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';
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 './interactive-o_NZb-Xg.js';
6
+ import '../interactive-o_NZb-Xg.js';
8
7
 
9
8
  /**
10
9
  * Session mapping — Slack activity info to agent-core session IDs.
@@ -0,0 +1,9 @@
1
+ import {
2
+ createSlackChannelAdapter,
3
+ createSlackSessionMap
4
+ } from "../chunk-TIQGJ52F.js";
5
+ import "../chunk-NOVWLAVP.js";
6
+ export {
7
+ createSlackChannelAdapter,
8
+ createSlackSessionMap
9
+ };
@@ -1,12 +1,10 @@
1
1
  import {
2
2
  installSlackAgentAppSurface
3
- } from "./chunk-M64Z6TYL.js";
4
- import "./chunk-BFUPAJON.js";
5
- import "./chunk-VHGV66M7.js";
6
- import "./chunk-FDRQOG7Q.js";
7
- import "./chunk-GNXWTKQ6.js";
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, SlackDirectAuthOptions, SlackDirectAuthMode } from '@cuylabs/channel-slack/bolt';
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-CYEBGC6G.js";
4
- import "./chunk-M64Z6TYL.js";
5
- import "./chunk-BFUPAJON.js";
6
- import "./chunk-VHGV66M7.js";
7
- import "./chunk-FDRQOG7Q.js";
8
- import "./chunk-GNXWTKQ6.js";
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 './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';
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 './interactive-o_NZb-Xg.js';
9
- import './options-C7OYeNR-.js';
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 "./chunk-BFUPAJON.js";
7
- import "./chunk-VHGV66M7.js";
8
- import "./chunk-GNXWTKQ6.js";
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-BFUPAJON.js";
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 (0, bolt_exports.createSlackBoltApp)({
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 "./chunk-DHPD4XH5.js";
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);