@cuylabs/channel-slack 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.
Files changed (62) hide show
  1. package/README.md +25 -136
  2. package/dist/app-home.d.ts +23 -0
  3. package/dist/app-home.js +35 -0
  4. package/dist/artifacts/index.d.ts +135 -0
  5. package/dist/artifacts/index.js +299 -0
  6. package/dist/{assistant.d.ts → assistant/index.d.ts} +1 -1
  7. package/dist/{assistant.js → assistant/index.js} +2 -2
  8. package/dist/auth/index.d.ts +56 -0
  9. package/dist/auth/index.js +168 -0
  10. package/dist/{chunk-IDVDMJ5U.js → chunk-6JSGIVQH.js} +110 -3
  11. package/dist/chunk-6WHFQUYQ.js +54 -0
  12. package/dist/{bolt.js → chunk-73QXT7MA.js} +25 -320
  13. package/dist/{chunk-CMR6B76C.js → chunk-DNVSH7H5.js} +407 -1
  14. package/dist/chunk-QJYCHWN6.js +76 -0
  15. package/dist/chunk-S3SWPYXJ.js +81 -0
  16. package/dist/{chunk-JZG4IETE.js → chunk-X4WBBBYM.js} +0 -52
  17. package/dist/core.js +5 -3
  18. package/dist/diagnostics/index.d.ts +71 -0
  19. package/dist/{diagnostics.js → diagnostics/index.js} +5 -1
  20. package/dist/entrypoints/index.d.ts +120 -0
  21. package/dist/entrypoints/index.js +132 -0
  22. package/dist/{history.d.ts → history/index.d.ts} +2 -2
  23. package/dist/{history.js → history/index.js} +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +28 -15
  26. package/dist/{policy.d.ts → policy/index.d.ts} +103 -2
  27. package/dist/{policy.js → policy/index.js} +13 -1
  28. package/dist/runtime-BNBHOZSQ.d.ts +53 -0
  29. package/dist/{setup.d.ts → setup/index.d.ts} +30 -3
  30. package/dist/{setup.js → setup/index.js} +134 -3
  31. package/dist/transports/http/index.d.ts +68 -0
  32. package/dist/transports/http/index.js +8 -0
  33. package/dist/transports/index.d.ts +8 -0
  34. package/dist/transports/index.js +24 -0
  35. package/dist/transports/socket/index.d.ts +94 -0
  36. package/dist/transports/socket/index.js +19 -0
  37. package/dist/types-B9NfCVrk.d.ts +141 -0
  38. package/docs/README.md +31 -0
  39. package/docs/concepts/activity.md +3 -3
  40. package/docs/concepts/artifacts.md +56 -0
  41. package/docs/concepts/entrypoints.md +73 -0
  42. package/docs/concepts/setup-requirements.md +23 -0
  43. package/docs/concepts/{bolt-runtime.md → transport-runtime.md} +9 -4
  44. package/docs/recipes/generate-slack-manifest.md +16 -0
  45. package/docs/recipes/publish-artifact.md +45 -0
  46. package/docs/recipes/slash-command-and-shortcut.md +51 -0
  47. package/docs/recipes/socket-mode-app.md +1 -1
  48. package/docs/reference/channel-slack-boundary.md +10 -6
  49. package/docs/reference/exports.md +7 -2
  50. package/docs/reference/source-layout.md +35 -0
  51. package/package.json +63 -39
  52. package/dist/bolt.d.ts +0 -364
  53. package/dist/chunk-NE57BLLU.js +0 -0
  54. package/dist/diagnostics.d.ts +0 -22
  55. package/dist/shared.d.ts +0 -2
  56. package/dist/shared.js +0 -43
  57. /package/dist/{feedback.d.ts → feedback/index.d.ts} +0 -0
  58. /package/dist/{feedback.js → feedback/index.js} +0 -0
  59. /package/dist/{targets.d.ts → targets/index.d.ts} +0 -0
  60. /package/dist/{targets.js → targets/index.js} +0 -0
  61. /package/dist/{users.d.ts → users/index.d.ts} +0 -0
  62. /package/dist/{users.js → users/index.js} +0 -0
package/docs/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Channel Slack Docs
2
+
3
+ `@cuylabs/channel-slack` is the reusable Slack mechanics package. Start with
4
+ the package boundary, then use the reference and recipes for the feature surface
5
+ your adapter or application needs.
6
+
7
+ ## Reference
8
+
9
+ - [Package boundary](reference/channel-slack-boundary.md)
10
+ - [Exports and peer expectations](reference/exports.md)
11
+ - [Source layout](reference/source-layout.md)
12
+
13
+ ## Concepts
14
+
15
+ - [Activity parsing](concepts/activity.md)
16
+ - [Artifacts](concepts/artifacts.md)
17
+ - [Entrypoints](concepts/entrypoints.md)
18
+ - [Message policy](concepts/message-policy.md)
19
+ - [Setup requirements](concepts/setup-requirements.md)
20
+ - [Supplemental history](concepts/supplemental-history.md)
21
+ - [Transport runtime](concepts/transport-runtime.md)
22
+
23
+ ## Recipes
24
+
25
+ - [App mention handler](recipes/app-mention-handler.md)
26
+ - [Assistant thread handler](recipes/assistant-thread-handler.md)
27
+ - [Socket Mode app](recipes/socket-mode-app.md)
28
+ - [Slash command and shortcut handler](recipes/slash-command-and-shortcut.md)
29
+ - [Publish an artifact](recipes/publish-artifact.md)
30
+ - [Generate a Slack manifest](recipes/generate-slack-manifest.md)
31
+ - [History visibility filter](recipes/history-visibility.md)
@@ -1,8 +1,8 @@
1
1
  # Activity
2
2
 
3
- An activity is the normalized message shape an agent adapter receives from
4
- Slack. It is intentionally smaller than a raw Slack event and does not depend on
5
- Bolt.
3
+ An activity is the normalized Slack message shape an adapter or application can
4
+ map into its own runtime. It is intentionally smaller than a raw Slack event and
5
+ does not depend on Bolt.
6
6
 
7
7
  ```typescript
8
8
  import { parseSlackMentionActivity } from "@cuylabs/channel-slack/core";
@@ -0,0 +1,56 @@
1
+ # Artifacts
2
+
3
+ Artifacts publish generated outputs to Slack without depending on any agent
4
+ runtime. The package accepts a structural Slack Web API client, so callers can
5
+ pass a real `WebClient`, a scoped client from a request handler, or a test
6
+ double with the methods they use.
7
+
8
+ ```typescript
9
+ import { publishSlackArtifact } from "@cuylabs/channel-slack/artifacts";
10
+
11
+ const publication = await publishSlackArtifact({
12
+ client,
13
+ channelId: activity.channelId,
14
+ threadTs: activity.threadTs ?? activity.messageTs,
15
+ artifact: {
16
+ kind: "text",
17
+ title: "Investigation summary",
18
+ summary: "Key findings from the thread.",
19
+ text: reportMarkdown,
20
+ },
21
+ });
22
+ ```
23
+
24
+ ## Artifact Kinds
25
+
26
+ - `text`: uploads text as a Slack file by default. Set `publishAs: "message"`
27
+ to post it as a Block Kit message instead.
28
+ - `file`: uploads binary or text data from `data` or `filePath`.
29
+ - `image`: uploads an image file and requires `altText`.
30
+ - `link`: posts a Block Kit message with a Slack-formatted link.
31
+ - `canvas`: creates or updates a Slack Canvas from Markdown.
32
+
33
+ ## Results
34
+
35
+ `publishSlackArtifact` returns a `SlackArtifactPublication` with:
36
+
37
+ - `method`: `message`, `file`, or `canvas`.
38
+ - the original `artifact`.
39
+ - the raw Slack API `response`.
40
+ - target metadata such as `channelId`, `threadTs`, `messageTs`, `fileId`, or
41
+ `canvasId` when Slack returns it.
42
+
43
+ ## Slack Client Surface
44
+
45
+ Only the method required by the selected artifact kind must exist:
46
+
47
+ - message/link artifacts use `client.chat.postMessage`.
48
+ - text/file/image file uploads use `client.files.uploadV2`.
49
+ - Canvas creation uses `client.conversations.canvases.create` for channel
50
+ canvases when available, or `client.canvases.create` otherwise.
51
+ - Canvas updates use `client.canvases.edit`.
52
+
53
+ ## Setup
54
+
55
+ The `artifacts` setup feature adds `chat:write` and `files:write`.
56
+ The `canvas-artifacts` setup feature adds `canvases:write`.
@@ -0,0 +1,73 @@
1
+ # Entrypoints
2
+
3
+ Entrypoints normalize Slack slash command and shortcut payloads into small
4
+ package contracts. They do not start a turn or choose a runtime request shape.
5
+
6
+ ```typescript
7
+ import { parseSlackSlashCommandEntrypoint } from "@cuylabs/channel-slack/entrypoints";
8
+
9
+ const entrypoint = parseSlackSlashCommandEntrypoint(payload);
10
+ ```
11
+
12
+ ## Slash Commands
13
+
14
+ `parseSlackSlashCommandEntrypoint` returns:
15
+
16
+ - `kind: "slash-command"`.
17
+ - `command`: the invoked slash command, such as `/ask`.
18
+ - `activity`: a `SlackActivityInfo` shape with channel, user, team, and text.
19
+ - optional Slack request metadata such as `triggerId`, `responseUrl`,
20
+ `channelName`, `teamDomain`, `appId`, and enterprise fields.
21
+
22
+ The parser treats the command text as the model-facing text. A host adapter can
23
+ map `entrypoint.activity.text` into its own runtime input while preserving the
24
+ Slack metadata for routing, logging, or response targets.
25
+
26
+ ## Shortcuts
27
+
28
+ Use `parseSlackShortcutEntrypoint` when one handler receives both global and
29
+ message shortcuts:
30
+
31
+ ```typescript
32
+ import { parseSlackShortcutEntrypoint } from "@cuylabs/channel-slack/entrypoints";
33
+
34
+ const entrypoint = parseSlackShortcutEntrypoint(payload);
35
+ ```
36
+
37
+ Global shortcuts return `kind: "global-shortcut"` and include trigger/user/team
38
+ metadata, but no selected message.
39
+
40
+ Message shortcuts return `kind: "message-shortcut"`, include the selected
41
+ message text, and also expose `activity` so a runtime adapter can treat the
42
+ selection as a Slack turn candidate.
43
+
44
+ ## Setup
45
+
46
+ Passing `slashCommands` or `shortcuts` to setup helpers automatically enables
47
+ the matching feature, the `commands` scope, and Slack interactivity settings.
48
+
49
+ ```typescript
50
+ import { createSlackAppManifest } from "@cuylabs/channel-slack/setup";
51
+
52
+ const manifest = createSlackAppManifest({
53
+ name: "My Agent",
54
+ preset: false,
55
+ transport: "http",
56
+ baseUrl: "https://agent.example.com",
57
+ slashCommands: [
58
+ {
59
+ command: "/ask",
60
+ description: "Ask the agent",
61
+ usage_hint: "summarize this thread",
62
+ },
63
+ ],
64
+ shortcuts: [
65
+ {
66
+ type: "message",
67
+ name: "Summarize message",
68
+ callback_id: "summarize_message",
69
+ description: "Summarize the selected Slack message",
70
+ },
71
+ ],
72
+ });
73
+ ```
@@ -19,6 +19,10 @@ const requirements = getSlackSetupRequirements({
19
19
  - `agent-app`: Assistant, app mentions, direct messages, and feedback.
20
20
 
21
21
  Pass `preset: false` and provide `features` when an app needs exact control.
22
+ Supplying `slashCommands` or `shortcuts` automatically enables the matching
23
+ feature and adds the Slack `commands` scope plus interactivity settings.
24
+ The `artifacts` feature adds `chat:write` and `files:write`; the
25
+ `canvas-artifacts` feature adds `canvases:write`.
22
26
 
23
27
  ## Features
24
28
 
@@ -32,12 +36,31 @@ Feature selections produce:
32
36
  Socket Mode.
33
37
  - environment variables needed by the chosen transport.
34
38
 
39
+ Common feature selections:
40
+
41
+ - `assistant`: Assistant view events, `assistant:write`, and `chat:write`.
42
+ - `app-mentions`: app mention event subscription and reply permission.
43
+ - `direct-messages`: DM message events and DM history/read scopes.
44
+ - `channel-messages`: passive channel/group message events and history scopes.
45
+ - `slash-commands`: `commands` scope and interactivity.
46
+ - `shortcuts`: `commands` scope and interactivity.
47
+ - `artifacts`: `chat:write` and `files:write`.
48
+ - `canvas-artifacts`: `canvases:write`.
49
+ - `history`: channel, group, DM, and MPIM history scopes.
50
+ - `feedback` and `interactivity`: `chat:write` plus interactivity.
51
+ - `user-profiles` and `user-emails`: Slack user profile scopes.
52
+ - `workspace-search`: Slack search scopes.
53
+
35
54
  ## Manifests
36
55
 
37
56
  `createSlackAppManifest` produces a Slack app manifest from the same
38
57
  requirements. `compareSlackAppManifest` checks an existing manifest-like object
39
58
  against requirements and returns path-level findings.
40
59
 
60
+ Pass `slashCommands` and `shortcuts` to include those manifest sections. For
61
+ HTTP transport, command and interactivity URLs are filled from `baseUrl` and
62
+ `eventsPath` unless a command defines its own `url`.
63
+
41
64
  ## Inspection
42
65
 
43
66
  `inspectSlackAppSetup` combines requirements with a live token inspection. It
@@ -1,7 +1,12 @@
1
- # Bolt Runtime
1
+ # Transport Runtime
2
2
 
3
- The Bolt helpers create Slack transports and auth wiring. They deliberately do
4
- not register handlers, own prompts, run agents, or choose deployment policy.
3
+ The transport helpers create Slack apps with Bolt auth wiring. They deliberately
4
+ do not register handlers, own prompts, run agents, or choose deployment policy.
5
+
6
+ Use transport-specific imports:
7
+
8
+ - `@cuylabs/channel-slack/transports/http`
9
+ - `@cuylabs/channel-slack/transports/socket`
5
10
 
6
11
  ## HTTP
7
12
 
@@ -41,7 +46,7 @@ Postgres advisory lock before starting the Socket Mode app:
41
46
  import {
42
47
  acquireSlackSocketModePostgresLock,
43
48
  createSlackSocketModeRuntime,
44
- } from "@cuylabs/channel-slack/bolt";
49
+ } from "@cuylabs/channel-slack/transports/socket";
45
50
 
46
51
  const postgresLock = await acquireSlackSocketModePostgresLock({
47
52
  appSlug: "my-agent",
@@ -9,6 +9,22 @@ const manifest = createSlackAppManifest({
9
9
  preset: "agent-app",
10
10
  transport: "socket",
11
11
  assistantDescription: "Ask the agent for help with workspace tasks.",
12
+ slashCommands: [
13
+ {
14
+ command: "/ask",
15
+ description: "Ask the agent",
16
+ usage_hint: "summarize this thread",
17
+ },
18
+ ],
19
+ shortcuts: [
20
+ {
21
+ type: "message",
22
+ name: "Summarize message",
23
+ callback_id: "summarize_message",
24
+ description: "Summarize the selected Slack message",
25
+ },
26
+ ],
27
+ features: ["artifacts", "canvas-artifacts"],
12
28
  });
13
29
 
14
30
  console.log(JSON.stringify(manifest, null, 2));
@@ -0,0 +1,45 @@
1
+ # Publish An Artifact
2
+
3
+ Use artifact helpers when a runtime produces a report, file, image, link, or
4
+ Canvas and the Slack adapter only needs to publish it.
5
+
6
+ ```typescript
7
+ import { publishSlackArtifact } from "@cuylabs/channel-slack/artifacts";
8
+
9
+ const result = await publishSlackArtifact({
10
+ client,
11
+ channelId: activity.channelId,
12
+ threadTs: activity.threadTs ?? activity.messageTs,
13
+ artifact: {
14
+ kind: "text",
15
+ title: "Launch summary",
16
+ summary: "Generated from the selected Slack thread.",
17
+ text: reportMarkdown,
18
+ },
19
+ });
20
+
21
+ logger.info("Slack artifact published", {
22
+ method: result.method,
23
+ fileId: result.fileId,
24
+ messageTs: result.messageTs,
25
+ canvasId: result.canvasId,
26
+ });
27
+ ```
28
+
29
+ To create a Canvas instead:
30
+
31
+ ```typescript
32
+ await publishSlackArtifact({
33
+ client,
34
+ channelId: activity.channelId,
35
+ artifact: {
36
+ kind: "canvas",
37
+ title: "Launch plan",
38
+ summary: "Generated plan",
39
+ markdown: canvasMarkdown,
40
+ },
41
+ });
42
+ ```
43
+
44
+ Enable the `artifacts` setup feature for files and messages. Enable
45
+ `canvas-artifacts` when publishing canvases.
@@ -0,0 +1,51 @@
1
+ # Slash Command And Shortcut Handler
2
+
3
+ Use entrypoint parsers to normalize Slack request payloads before handing them
4
+ to an application-owned runtime.
5
+
6
+ ```typescript
7
+ import {
8
+ parseSlackShortcutEntrypoint,
9
+ parseSlackSlashCommandEntrypoint,
10
+ } from "@cuylabs/channel-slack/entrypoints";
11
+
12
+ app.command("/ask", async ({ ack, body, client }) => {
13
+ await ack();
14
+
15
+ const entrypoint = parseSlackSlashCommandEntrypoint(body);
16
+ const answer = await runAgent({
17
+ input: entrypoint.activity.text,
18
+ slack: entrypoint.activity,
19
+ entrypoint,
20
+ });
21
+
22
+ await client.chat.postMessage({
23
+ channel: entrypoint.activity.channelId,
24
+ text: answer,
25
+ });
26
+ });
27
+
28
+ app.shortcut("summarize_message", async ({ ack, body, client }) => {
29
+ await ack();
30
+
31
+ const entrypoint = parseSlackShortcutEntrypoint(body);
32
+ if (entrypoint.kind !== "message-shortcut") return;
33
+
34
+ const answer = await runAgent({
35
+ input: entrypoint.selectedMessage.text,
36
+ slack: entrypoint.activity,
37
+ entrypoint,
38
+ });
39
+
40
+ await client.chat.postMessage({
41
+ channel: entrypoint.selectedMessage.channelId,
42
+ thread_ts:
43
+ entrypoint.selectedMessage.threadTs ??
44
+ entrypoint.selectedMessage.messageTs,
45
+ text: answer,
46
+ });
47
+ });
48
+ ```
49
+
50
+ For manifest setup, pass `slashCommands` and `shortcuts` to
51
+ `createSlackAppManifest`.
@@ -4,7 +4,7 @@
4
4
  import {
5
5
  createSlackSocketBoltApp,
6
6
  createSlackSocketModeRuntime,
7
- } from "@cuylabs/channel-slack/bolt";
7
+ } from "@cuylabs/channel-slack/transports/socket";
8
8
 
9
9
  const runtime = createSlackSocketModeRuntime({
10
10
  appSlug: "my-agent",
@@ -5,16 +5,19 @@ Slack events, formats Slack output, applies reusable admission and history
5
5
  policies, and provides Slack setup/runtime helpers. It does not create or run an
6
6
  agent.
7
7
 
8
- `@cuylabs/channel-slack-agent-core` is the agent-core runtime binding. It
9
- composes this package with runtime scopes, event streams, context fragments, and
10
- approval or human-input contracts.
8
+ Runtime-specific adapter packages compose these primitives with their own
9
+ runtime scopes, event streams, context fragments, and approval or human-input
10
+ contracts.
11
11
 
12
12
  ## In This Package
13
13
 
14
14
  - Slack activity parsing and text extraction.
15
+ - Slack slash command and shortcut entrypoint normalization.
16
+ - Slack artifact publishing contracts and helpers.
15
17
  - Markdown-to-Slack formatting.
16
18
  - Thread-aware session helpers.
17
- - Slack auth and installation store helpers.
19
+ - Slack auth and installation-store helpers.
20
+ - HTTP and Socket Mode Bolt transport helpers.
18
21
  - Socket Mode runtime guard, process lock, and optional Postgres advisory lock.
19
22
  - Setup requirements and manifest helpers.
20
23
  - Diagnostics.
@@ -29,6 +32,7 @@ approval or human-input contracts.
29
32
 
30
33
  - Agent runtime execution.
31
34
  - Agent-runtime scopes and context-fragment middleware.
35
+ - Runtime-specific mapping from Slack entrypoints into an agent turn.
32
36
  - Agent event stream rendering.
33
37
  - Agent-specific approval and human-input request contracts.
34
38
  - Product prompts, tools, audit policy, and deployment policy.
@@ -38,8 +42,8 @@ Those pieces belong in runtime-specific adapters or product applications.
38
42
  ## Behavior Notes
39
43
 
40
44
  - The root export is lightweight: `core`, `policy`, and `Logger`.
41
- - Peer-backed helpers live behind feature subpaths such as `bolt`, `history`,
42
- `setup`, `diagnostics`, and `users`.
45
+ - Peer-backed helpers live behind feature subpaths such as `transports`,
46
+ `app-home`, `history`, `setup`, `diagnostics`, and `users`.
43
47
  - Interactive request types are generic rather than derived from any
44
48
  agent-runtime event type.
45
49
  - Socket Mode logging uses this package's logger bridge rather than an agent
@@ -6,12 +6,17 @@ keep application code close to the package boundary it uses.
6
6
  | Export | Depends on | Notes |
7
7
  | ------------------------------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
8
8
  | `@cuylabs/channel-slack/core` | no Slack SDK runtime imports | Transport-neutral parsing, formatting, types, sessions, turn context |
9
- | `@cuylabs/channel-slack/shared` | no Slack SDK runtime imports | Compatibility alias for `core` |
10
9
  | `@cuylabs/channel-slack/policy` | `pg` only when using connection-string Postgres state | Message admission and in-memory/Postgres policy state |
11
10
  | `@cuylabs/channel-slack/history` | `@slack/web-api` types | History reader accepts a Slack WebClient or minimal conversations client |
12
- | `@cuylabs/channel-slack/bolt` | `@slack/bolt`, `express`; `pg` only when using connection-string Postgres locks | Bolt app factories and Socket Mode runtime helpers |
11
+ | `@cuylabs/channel-slack/app-home` | `@slack/bolt`, `@slack/types` | Slack App Home registration helper |
12
+ | `@cuylabs/channel-slack/artifacts` | no Slack SDK runtime imports; requires a Web API-like client at call time | Text, file, image, link, and Canvas artifact publishing |
13
+ | `@cuylabs/channel-slack/auth` | no Slack SDK runtime imports; `pg` is not required | Auth option types, auth resolution, OAuth installation stores |
14
+ | `@cuylabs/channel-slack/transports` | `@slack/bolt`, `express`; `pg` only when using connection-string Postgres locks | HTTP and Socket Mode transport helpers |
15
+ | `@cuylabs/channel-slack/transports/http` | `@slack/bolt`, `express` | HTTP Events API Bolt app factory |
16
+ | `@cuylabs/channel-slack/transports/socket` | `@slack/bolt`; `pg` only when using connection-string Postgres locks | Socket Mode app factory, runtime guard, process/Postgres locks |
13
17
  | `@cuylabs/channel-slack/setup` | diagnostics only when inspecting live tokens | Setup requirements and app manifest helpers |
14
18
  | `@cuylabs/channel-slack/diagnostics` | `@slack/web-api` | Token, auth, and scope inspection |
19
+ | `@cuylabs/channel-slack/entrypoints` | no Slack SDK runtime imports | Slash command and shortcut payload normalization |
15
20
  | `@cuylabs/channel-slack/users` | `@slack/web-api` when using default client | User profile lookup and mention enrichment |
16
21
  | `@cuylabs/channel-slack/targets` | no Slack SDK runtime imports unless resolving names through a client | Parse and resolve channel/user targets |
17
22
  | `@cuylabs/channel-slack/feedback` | `@slack/types` types | Feedback block and action helpers |
@@ -0,0 +1,35 @@
1
+ # Source Layout
2
+
3
+ The package is organized by Slack capability. Public imports should use package
4
+ exports such as `@cuylabs/channel-slack/core` or
5
+ `@cuylabs/channel-slack/transports/socket`; application code should not import
6
+ from `src`.
7
+
8
+ ```text
9
+ src/
10
+ core.ts public core entrypoint
11
+ shared/ types, parsing, formatting, turn helpers
12
+ assistant/ Slack Assistant API helpers
13
+ app-home.ts Slack App Home registration helper
14
+ artifacts/ text, file, image, link, and Canvas publishing
15
+ auth/ auth options, auth resolution, installation stores
16
+ diagnostics/ token and scope inspection
17
+ entrypoints/ slash command and shortcut normalization
18
+ feedback/ feedback blocks and action parsing
19
+ history/
20
+ context/ turn-history loading component
21
+ reader.ts Slack history API reader and prompt formatter
22
+ visibility-policy.ts model-visible history filters
23
+ inclusion-policy.ts direct-message supplemental-history inclusion policy
24
+ policy/
25
+ message/ message admission and state-store component
26
+ setup/ scopes, events, manifests, setup inspection
27
+ transports/
28
+ http/ HTTP Events API Bolt app factory
29
+ socket/ Socket Mode Bolt app factory, runtime, locks
30
+ targets/ channel/user target parsing and resolution
31
+ users/ profile lookup and mention enrichment
32
+ ```
33
+
34
+ For public export details and peer dependency expectations, see
35
+ [Exports](exports.md).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cuylabs/channel-slack",
3
- "version": "0.5.1",
4
- "description": "SDK-neutral Slack channel primitives for AI agents",
3
+ "version": "0.6.0",
4
+ "description": "Agent-runtime-agnostic Slack channel primitives for AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -12,14 +12,24 @@
12
12
  "default": "./dist/index.js"
13
13
  },
14
14
  "./assistant": {
15
- "types": "./dist/assistant.d.ts",
16
- "import": "./dist/assistant.js",
17
- "default": "./dist/assistant.js"
15
+ "types": "./dist/assistant/index.d.ts",
16
+ "import": "./dist/assistant/index.js",
17
+ "default": "./dist/assistant/index.js"
18
18
  },
19
- "./bolt": {
20
- "types": "./dist/bolt.d.ts",
21
- "import": "./dist/bolt.js",
22
- "default": "./dist/bolt.js"
19
+ "./app-home": {
20
+ "types": "./dist/app-home.d.ts",
21
+ "import": "./dist/app-home.js",
22
+ "default": "./dist/app-home.js"
23
+ },
24
+ "./artifacts": {
25
+ "types": "./dist/artifacts/index.d.ts",
26
+ "import": "./dist/artifacts/index.js",
27
+ "default": "./dist/artifacts/index.js"
28
+ },
29
+ "./auth": {
30
+ "types": "./dist/auth/index.d.ts",
31
+ "import": "./dist/auth/index.js",
32
+ "default": "./dist/auth/index.js"
23
33
  },
24
34
  "./core": {
25
35
  "types": "./dist/core.d.ts",
@@ -27,44 +37,59 @@
27
37
  "default": "./dist/core.js"
28
38
  },
29
39
  "./diagnostics": {
30
- "types": "./dist/diagnostics.d.ts",
31
- "import": "./dist/diagnostics.js",
32
- "default": "./dist/diagnostics.js"
40
+ "types": "./dist/diagnostics/index.d.ts",
41
+ "import": "./dist/diagnostics/index.js",
42
+ "default": "./dist/diagnostics/index.js"
43
+ },
44
+ "./entrypoints": {
45
+ "types": "./dist/entrypoints/index.d.ts",
46
+ "import": "./dist/entrypoints/index.js",
47
+ "default": "./dist/entrypoints/index.js"
33
48
  },
34
49
  "./feedback": {
35
- "types": "./dist/feedback.d.ts",
36
- "import": "./dist/feedback.js",
37
- "default": "./dist/feedback.js"
50
+ "types": "./dist/feedback/index.d.ts",
51
+ "import": "./dist/feedback/index.js",
52
+ "default": "./dist/feedback/index.js"
38
53
  },
39
54
  "./history": {
40
- "types": "./dist/history.d.ts",
41
- "import": "./dist/history.js",
42
- "default": "./dist/history.js"
55
+ "types": "./dist/history/index.d.ts",
56
+ "import": "./dist/history/index.js",
57
+ "default": "./dist/history/index.js"
43
58
  },
44
59
  "./policy": {
45
- "types": "./dist/policy.d.ts",
46
- "import": "./dist/policy.js",
47
- "default": "./dist/policy.js"
60
+ "types": "./dist/policy/index.d.ts",
61
+ "import": "./dist/policy/index.js",
62
+ "default": "./dist/policy/index.js"
48
63
  },
49
64
  "./setup": {
50
- "types": "./dist/setup.d.ts",
51
- "import": "./dist/setup.js",
52
- "default": "./dist/setup.js"
53
- },
54
- "./shared": {
55
- "types": "./dist/shared.d.ts",
56
- "import": "./dist/shared.js",
57
- "default": "./dist/shared.js"
65
+ "types": "./dist/setup/index.d.ts",
66
+ "import": "./dist/setup/index.js",
67
+ "default": "./dist/setup/index.js"
58
68
  },
59
69
  "./targets": {
60
- "types": "./dist/targets.d.ts",
61
- "import": "./dist/targets.js",
62
- "default": "./dist/targets.js"
70
+ "types": "./dist/targets/index.d.ts",
71
+ "import": "./dist/targets/index.js",
72
+ "default": "./dist/targets/index.js"
73
+ },
74
+ "./transports": {
75
+ "types": "./dist/transports/index.d.ts",
76
+ "import": "./dist/transports/index.js",
77
+ "default": "./dist/transports/index.js"
78
+ },
79
+ "./transports/http": {
80
+ "types": "./dist/transports/http/index.d.ts",
81
+ "import": "./dist/transports/http/index.js",
82
+ "default": "./dist/transports/http/index.js"
83
+ },
84
+ "./transports/socket": {
85
+ "types": "./dist/transports/socket/index.d.ts",
86
+ "import": "./dist/transports/socket/index.js",
87
+ "default": "./dist/transports/socket/index.js"
63
88
  },
64
89
  "./users": {
65
- "types": "./dist/users.d.ts",
66
- "import": "./dist/users.js",
67
- "default": "./dist/users.js"
90
+ "types": "./dist/users/index.d.ts",
91
+ "import": "./dist/users/index.js",
92
+ "default": "./dist/users/index.js"
68
93
  }
69
94
  },
70
95
  "files": [
@@ -108,8 +133,7 @@
108
133
  "agent",
109
134
  "slack",
110
135
  "channel",
111
- "adapter",
112
- "bolt"
136
+ "adapter"
113
137
  ],
114
138
  "license": "Apache-2.0",
115
139
  "publishConfig": {
@@ -119,9 +143,9 @@
119
143
  "node": ">=20"
120
144
  },
121
145
  "scripts": {
122
- "build": "tsup src/index.ts src/core.ts src/shared.ts src/assistant.ts src/bolt.ts src/diagnostics.ts src/feedback.ts src/history.ts src/policy.ts src/setup.ts src/targets.ts src/users.ts --format esm --dts --clean",
146
+ "build": "tsup src/index.ts src/app-home.ts src/artifacts/index.ts src/core.ts src/assistant/index.ts src/auth/index.ts src/diagnostics/index.ts src/entrypoints/index.ts src/feedback/index.ts src/history/index.ts src/policy/index.ts src/setup/index.ts src/targets/index.ts src/transports/index.ts src/transports/http/index.ts src/transports/socket/index.ts src/users/index.ts --format esm --dts --clean",
123
147
  "clean": "rm -rf dist",
124
- "dev": "tsup src/index.ts src/core.ts src/shared.ts src/assistant.ts src/bolt.ts src/diagnostics.ts src/feedback.ts src/history.ts src/policy.ts src/setup.ts src/targets.ts src/users.ts --format esm --dts --watch",
148
+ "dev": "tsup src/index.ts src/app-home.ts src/artifacts/index.ts src/core.ts src/assistant/index.ts src/auth/index.ts src/diagnostics/index.ts src/entrypoints/index.ts src/feedback/index.ts src/history/index.ts src/policy/index.ts src/setup/index.ts src/targets/index.ts src/transports/index.ts src/transports/http/index.ts src/transports/socket/index.ts src/users/index.ts --format esm --dts --watch",
125
149
  "lint": "eslint \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\" --max-warnings=0",
126
150
  "test": "vitest run",
127
151
  "test:watch": "vitest",