@cuylabs/channel-slack 0.1.0 → 0.2.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 +5 -5
- package/dist/bolt.d.ts +5 -14
- package/dist/bolt.js +1 -10
- package/dist/history.d.ts +11 -6
- package/docs/reference/channel-slack-boundary.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# @cuylabs/channel-slack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Slack channel primitives for AI agents.
|
|
4
4
|
|
|
5
5
|
This package contains reusable Slack mechanics: activity parsing, message
|
|
6
6
|
formatting, message admission policy, supplemental history, visibility filters,
|
|
7
7
|
Socket Mode runtime guards, OAuth installation storage, setup inspection, and
|
|
8
8
|
Slack API helpers. It intentionally does not create or run an agent.
|
|
9
9
|
|
|
10
|
-
It is not an agent runtime adapter.
|
|
11
|
-
|
|
10
|
+
It is not an agent runtime adapter. Use `@cuylabs/channel-slack-agent-core` for
|
|
11
|
+
the runtime-specific adapter. See
|
|
12
12
|
[Channel Slack Boundary](docs/reference/channel-slack-boundary.md) for the
|
|
13
13
|
package boundary.
|
|
14
14
|
|
|
@@ -32,7 +32,7 @@ surface they need.
|
|
|
32
32
|
|
|
33
33
|
| Import | Use for |
|
|
34
34
|
| --- | --- |
|
|
35
|
-
| `@cuylabs/channel-slack/core` |
|
|
35
|
+
| `@cuylabs/channel-slack/core` | Activity parsing, formatting, sessions, turn context, shared types |
|
|
36
36
|
| `@cuylabs/channel-slack/policy` | Message admission, duplicate suppression, mentioned-thread state |
|
|
37
37
|
| `@cuylabs/channel-slack/history` | Slack history reading, prompt shaping, supplemental-history visibility |
|
|
38
38
|
| `@cuylabs/channel-slack/bolt` | Bolt app factories, auth options, Socket Mode runtime helpers, installation stores |
|
|
@@ -132,7 +132,7 @@ See [Setup Requirements](docs/concepts/setup-requirements.md).
|
|
|
132
132
|
```text
|
|
133
133
|
src/
|
|
134
134
|
core.ts public core entrypoint
|
|
135
|
-
shared/
|
|
135
|
+
shared/ types, parsing, formatting, turn helpers
|
|
136
136
|
assistant/ Slack Assistant API helpers
|
|
137
137
|
bolt/ Bolt app/auth/runtime helpers
|
|
138
138
|
diagnostics/ token and scope inspection
|
package/dist/bolt.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Application } from 'express';
|
|
2
|
-
import { AppOptions, ExpressReceiverOptions, App, ExpressReceiver, SocketModeReceiverOptions } from '@slack/bolt';
|
|
2
|
+
import { AppOptions, ExpressReceiverOptions, App, ExpressReceiver, SocketModeReceiverOptions, Logger as Logger$1 } from '@slack/bolt';
|
|
3
|
+
export { LogLevel as SlackSdkLogLevel, Logger as SlackSdkLogger } from '@slack/bolt';
|
|
3
4
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
5
|
import { L as Logger } from './logging-Bl3HfcC8.js';
|
|
5
6
|
|
|
@@ -261,16 +262,6 @@ interface SlackSocketModeProcessLock {
|
|
|
261
262
|
}
|
|
262
263
|
declare function acquireSlackSocketModeProcessLock({ appSlug, appToken, enabled, lockDir, logger, }: SlackSocketModeProcessLockOptions): SlackSocketModeProcessLock | undefined;
|
|
263
264
|
|
|
264
|
-
type SlackSdkLogLevel = "debug" | "info" | "warn" | "error";
|
|
265
|
-
interface SlackSdkLogger {
|
|
266
|
-
debug(...msg: unknown[]): void;
|
|
267
|
-
error(...msg: unknown[]): void;
|
|
268
|
-
getLevel(): SlackSdkLogLevel;
|
|
269
|
-
info(...msg: unknown[]): void;
|
|
270
|
-
setLevel(nextLevel: SlackSdkLogLevel): void;
|
|
271
|
-
setName(nextName: string): void;
|
|
272
|
-
warn(...msg: unknown[]): void;
|
|
273
|
-
}
|
|
274
265
|
type SlackSocketModeRuntimePolicy = "single-instance" | "external-coordination";
|
|
275
266
|
interface SlackSocketModeReceiverRuntimeOptions {
|
|
276
267
|
autoReconnectEnabled?: boolean;
|
|
@@ -297,7 +288,7 @@ interface SlackSocketModeRuntimeOptions {
|
|
|
297
288
|
}
|
|
298
289
|
interface SlackSocketModeRuntime {
|
|
299
290
|
boltAppOptions: {
|
|
300
|
-
logger:
|
|
291
|
+
logger: Logger$1;
|
|
301
292
|
};
|
|
302
293
|
close(): void;
|
|
303
294
|
socketModeReceiverOptions: SlackSocketModeReceiverRuntimeOptions;
|
|
@@ -317,7 +308,7 @@ declare function createSlackSdkLogger({ level, logger, restartGuard, }: {
|
|
|
317
308
|
level: "debug" | "info" | "warn" | "error";
|
|
318
309
|
logger?: Logger;
|
|
319
310
|
restartGuard?: SlackSocketModeRestartGuard;
|
|
320
|
-
}):
|
|
311
|
+
}): Logger$1;
|
|
321
312
|
declare function redactSlackSocketModeLogValue(value: unknown, depth?: number): unknown;
|
|
322
313
|
|
|
323
314
|
declare class InMemorySlackInstallationStore implements SlackInstallationStore {
|
|
@@ -341,4 +332,4 @@ declare class JsonFileSlackInstallationStore implements SlackInstallationStore {
|
|
|
341
332
|
declare function createJsonFileSlackInstallationStore(filePath: string): SlackInstallationStore;
|
|
342
333
|
declare function getSlackInstallationKey(input: SlackInstallation | SlackInstallationQuery): string;
|
|
343
334
|
|
|
344
|
-
export { type CreateSlackBoltAppOptions, type CreateSlackBoltAppResult, type CreateSlackSocketBoltAppOptions, type CreateSlackSocketBoltAppResult, InMemorySlackInstallationStore, JsonFileSlackInstallationStore, type SlackAuthorizeFn, type SlackAuthorizeResult, type SlackAuthorizeSource, type SlackCustomAuthorizeAuthOptions, type SlackDirectAuthMode, type SlackDirectAuthOptions, type SlackInstallation, type SlackInstallationQuery, type SlackInstallationStore, type SlackOAuthAuthOptions, type SlackOAuthCallbackOptions, type SlackOAuthError, type SlackOAuthInstallPathOptions, type
|
|
335
|
+
export { type CreateSlackBoltAppOptions, type CreateSlackBoltAppResult, type CreateSlackSocketBoltAppOptions, type CreateSlackSocketBoltAppResult, InMemorySlackInstallationStore, JsonFileSlackInstallationStore, type SlackAuthorizeFn, type SlackAuthorizeResult, type SlackAuthorizeSource, type SlackCustomAuthorizeAuthOptions, type SlackDirectAuthMode, type SlackDirectAuthOptions, type SlackInstallation, type SlackInstallationQuery, type SlackInstallationStore, type SlackOAuthAuthOptions, type SlackOAuthCallbackOptions, type SlackOAuthError, type SlackOAuthInstallPathOptions, type SlackSingleWorkspaceAuthOptions, type SlackSocketModeProcessLock, type SlackSocketModeProcessLockOptions, type SlackSocketModeReceiverRuntimeOptions, type SlackSocketModeRestartGuard, type SlackSocketModeRuntime, type SlackSocketModeRuntimeOptions, type SlackSocketModeRuntimePolicy, type SlackStateStore, acquireSlackSocketModeProcessLock, createInMemorySlackInstallationStore, createJsonFileSlackInstallationStore, createSlackBoltApp, createSlackSdkLogger, createSlackSocketBoltApp, createSlackSocketModeRestartGuard, createSlackSocketModeRuntime, getSlackInstallationKey, redactSlackSocketModeLogValue };
|
package/dist/bolt.js
CHANGED
|
@@ -516,16 +516,7 @@ function createSlackSdkLogger({
|
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
function toSlackLogLevel(level) {
|
|
519
|
-
|
|
520
|
-
case "debug":
|
|
521
|
-
return "debug";
|
|
522
|
-
case "warn":
|
|
523
|
-
return "warn";
|
|
524
|
-
case "error":
|
|
525
|
-
return "error";
|
|
526
|
-
case "info":
|
|
527
|
-
return "info";
|
|
528
|
-
}
|
|
519
|
+
return level;
|
|
529
520
|
}
|
|
530
521
|
function formatSlackLogArgs(args) {
|
|
531
522
|
return args.map(formatSlackLogArg).join(" ");
|
package/dist/history.d.ts
CHANGED
|
@@ -2,16 +2,21 @@ import { S as SlackActivityInfo } from './activity-ByrD9Ftr.js';
|
|
|
2
2
|
import { ConversationsHistoryResponse, ConversationsRepliesResponse, WebClient } from '@slack/web-api';
|
|
3
3
|
import { L as Logger } from './logging-Bl3HfcC8.js';
|
|
4
4
|
|
|
5
|
+
type SlackContextFragmentRole = "system" | "user";
|
|
6
|
+
type SlackContextFragmentPlacement = "before-history" | "after-latest-user" | "after-history";
|
|
7
|
+
type SlackContextFragmentLifetime = "turn" | "session";
|
|
8
|
+
type SlackContextFragmentBudgetBehavior = "required" | "droppable";
|
|
9
|
+
type SlackContextFragmentKind = "environment" | "runtime" | "session" | "memory" | "instruction" | "hook" | (string & {});
|
|
5
10
|
interface SlackContextFragmentPayload {
|
|
6
11
|
content: string;
|
|
7
|
-
budgetBehavior?:
|
|
12
|
+
budgetBehavior?: SlackContextFragmentBudgetBehavior;
|
|
8
13
|
dedupeKey?: string;
|
|
9
|
-
kind?:
|
|
10
|
-
lifetime?:
|
|
14
|
+
kind?: SlackContextFragmentKind;
|
|
15
|
+
lifetime?: SlackContextFragmentLifetime;
|
|
11
16
|
maxChars?: number;
|
|
12
17
|
metadata?: Record<string, unknown>;
|
|
13
|
-
placement?:
|
|
14
|
-
role?:
|
|
18
|
+
placement?: SlackContextFragmentPlacement;
|
|
19
|
+
role?: SlackContextFragmentRole;
|
|
15
20
|
source?: string;
|
|
16
21
|
title?: string;
|
|
17
22
|
}
|
|
@@ -263,4 +268,4 @@ declare function createSlackSupplementalHistoryPolicy({ logger, sessionTranscrip
|
|
|
263
268
|
sessionTranscript?: SlackSessionTranscriptInspector;
|
|
264
269
|
}): SlackSupplementalHistoryPolicy;
|
|
265
270
|
|
|
266
|
-
export { type CreateSlackSupplementalHistoryVisibilityPolicyOptions, type FormatSlackHistoryForPromptOptions, type LoadSlackTurnHistoryContextOptions, type ReadSlackChannelHistoryOptions, type ReadSlackThreadHistoryOptions, type SlackAssistantSurfaceThreadRootNormalization, type SlackAssistantSurfaceThreadRootNormalizationContext, type SlackHistoryAuthorFormatter, type SlackHistoryAuthorResolutionErrorContext, type SlackHistoryAuthorResolver, type SlackHistoryAuthorResolverContext, type SlackHistoryContextSource, type SlackHistoryMessage, type SlackHistoryMessageRole, type SlackHistoryPage, type SlackHistoryReaderClient, type SlackHistoryUnavailable, type SlackSessionTranscriptInspector, type SlackSupplementalHistoryInclusionDecision, type SlackSupplementalHistoryInclusionReason, type SlackSupplementalHistoryInclusionSource, type SlackSupplementalHistoryPolicy, type SlackSupplementalHistoryPolicyRequest, type SlackSupplementalHistoryVisibilityContext, type SlackSupplementalHistoryVisibilityDecision, type SlackSupplementalHistoryVisibilityErrorContext, type SlackSupplementalHistoryVisibilityMode, type SlackSupplementalHistoryVisibilityPolicy, type SlackTurnHistoryContextResult, createSlackSupplementalHistoryPolicy, createSlackSupplementalHistoryVisibilityPolicy, formatSlackHistoryForPrompt, loadSlackTurnHistoryContext, readSlackChannelHistory, readSlackThreadHistory };
|
|
271
|
+
export { type CreateSlackSupplementalHistoryVisibilityPolicyOptions, type FormatSlackHistoryForPromptOptions, type LoadSlackTurnHistoryContextOptions, type ReadSlackChannelHistoryOptions, type ReadSlackThreadHistoryOptions, type SlackAssistantSurfaceThreadRootNormalization, type SlackAssistantSurfaceThreadRootNormalizationContext, type SlackContextFragmentBudgetBehavior, type SlackContextFragmentKind, type SlackContextFragmentLifetime, type SlackContextFragmentPayload, type SlackContextFragmentPlacement, type SlackContextFragmentRole, type SlackHistoryAuthorFormatter, type SlackHistoryAuthorResolutionErrorContext, type SlackHistoryAuthorResolver, type SlackHistoryAuthorResolverContext, type SlackHistoryContextSource, type SlackHistoryMessage, type SlackHistoryMessageRole, type SlackHistoryPage, type SlackHistoryReaderClient, type SlackHistoryUnavailable, type SlackSessionTranscriptInspector, type SlackSupplementalHistoryInclusionDecision, type SlackSupplementalHistoryInclusionReason, type SlackSupplementalHistoryInclusionSource, type SlackSupplementalHistoryPolicy, type SlackSupplementalHistoryPolicyRequest, type SlackSupplementalHistoryVisibilityContext, type SlackSupplementalHistoryVisibilityDecision, type SlackSupplementalHistoryVisibilityErrorContext, type SlackSupplementalHistoryVisibilityMode, type SlackSupplementalHistoryVisibilityPolicy, type SlackTurnHistoryContextResult, createSlackSupplementalHistoryPolicy, createSlackSupplementalHistoryVisibilityPolicy, formatSlackHistoryForPrompt, loadSlackTurnHistoryContext, readSlackChannelHistory, readSlackThreadHistory };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Channel Slack Boundary
|
|
2
2
|
|
|
3
|
-
`@cuylabs/channel-slack` is the
|
|
3
|
+
`@cuylabs/channel-slack` is the reusable Slack mechanics package. It parses
|
|
4
4
|
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
|
|
9
|
-
composes this package with
|
|
10
|
-
|
|
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.
|
|
11
11
|
|
|
12
12
|
## In This Package
|
|
13
13
|
|