@cuylabs/channel-slack-agent-core 0.1.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/LICENSE +201 -0
- package/README.md +80 -0
- package/dist/adapter-Cmd2C90g.d.ts +31 -0
- package/dist/adapter.d.ts +23 -0
- package/dist/adapter.js +13 -0
- package/dist/app-surface.d.ts +71 -0
- package/dist/app-surface.js +12 -0
- package/dist/app.d.ts +54 -0
- package/dist/app.js +14 -0
- package/dist/assistant.d.ts +19 -0
- package/dist/assistant.js +16 -0
- package/dist/bolt.d.ts +8 -0
- package/dist/bolt.js +10 -0
- package/dist/chunk-2SUAW6MV.js +12 -0
- package/dist/chunk-645NNJIM.js +12 -0
- package/dist/chunk-ANIZ5NT4.js +12 -0
- package/dist/chunk-BFUPAJON.js +662 -0
- package/dist/chunk-CYEBGC6G.js +77 -0
- package/dist/chunk-DHPD4XH5.js +827 -0
- package/dist/chunk-FDRQOG7Q.js +471 -0
- package/dist/chunk-GNXWTKQ6.js +48 -0
- package/dist/chunk-HFT2FXJP.js +12 -0
- package/dist/chunk-I2KLQ2HA.js +22 -0
- package/dist/chunk-IWUYIAY5.js +69 -0
- package/dist/chunk-IXY3BXU5.js +689 -0
- package/dist/chunk-JMLB7A2V.js +85 -0
- package/dist/chunk-K2E6A377.js +12 -0
- package/dist/chunk-M64Z6TYL.js +198 -0
- package/dist/chunk-NDVXBI7Z.js +12 -0
- package/dist/chunk-NIPAN4KA.js +76 -0
- package/dist/chunk-PX4RGO3N.js +12 -0
- package/dist/chunk-RFHXERNL.js +27 -0
- package/dist/chunk-VHGV66M7.js +12 -0
- package/dist/chunk-WO4BJMF3.js +82 -0
- package/dist/diagnostics.d.ts +1 -0
- package/dist/diagnostics.js +10 -0
- package/dist/express-assistant.d.ts +102 -0
- package/dist/express-assistant.js +12 -0
- package/dist/express.d.ts +98 -0
- package/dist/express.js +11 -0
- package/dist/feedback.d.ts +1 -0
- package/dist/feedback.js +10 -0
- package/dist/history.d.ts +1 -0
- package/dist/history.js +10 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +202 -0
- package/dist/interactive-o_NZb-Xg.d.ts +47 -0
- package/dist/interactive.d.ts +30 -0
- package/dist/interactive.js +25 -0
- package/dist/mcp.d.ts +84 -0
- package/dist/mcp.js +9 -0
- package/dist/options-C7OYeNR-.d.ts +71 -0
- package/dist/options-Uf-qmQKN.d.ts +263 -0
- package/dist/policy.d.ts +1 -0
- package/dist/policy.js +10 -0
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +10 -0
- package/dist/shared.d.ts +129 -0
- package/dist/shared.js +20 -0
- package/dist/socket.d.ts +137 -0
- package/dist/socket.js +16 -0
- package/dist/targets.d.ts +1 -0
- package/dist/targets.js +10 -0
- package/dist/types-BqRzb_Cd.d.ts +346 -0
- package/dist/types-Crpil4kb.d.ts +136 -0
- package/dist/users.d.ts +1 -0
- package/dist/users.js +10 -0
- package/package.json +169 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installSlackAgentAppSurface
|
|
3
|
+
} from "./chunk-M64Z6TYL.js";
|
|
4
|
+
import {
|
|
5
|
+
bolt_exports
|
|
6
|
+
} from "./chunk-ANIZ5NT4.js";
|
|
7
|
+
|
|
8
|
+
// src/app.ts
|
|
9
|
+
async function mountSlackAgentApp(options) {
|
|
10
|
+
const {
|
|
11
|
+
botToken,
|
|
12
|
+
signingSecret,
|
|
13
|
+
auth,
|
|
14
|
+
path,
|
|
15
|
+
processBeforeResponse,
|
|
16
|
+
signatureVerification,
|
|
17
|
+
boltAppOptions,
|
|
18
|
+
receiverOptions,
|
|
19
|
+
port: portOption,
|
|
20
|
+
host,
|
|
21
|
+
app: providedApp,
|
|
22
|
+
...surfaceOptions
|
|
23
|
+
} = options;
|
|
24
|
+
const {
|
|
25
|
+
boltApp,
|
|
26
|
+
receiver,
|
|
27
|
+
app: expressApp,
|
|
28
|
+
authMode,
|
|
29
|
+
routePath
|
|
30
|
+
} = await (0, bolt_exports.createSlackBoltApp)({
|
|
31
|
+
signingSecret,
|
|
32
|
+
path,
|
|
33
|
+
botToken,
|
|
34
|
+
auth,
|
|
35
|
+
app: providedApp,
|
|
36
|
+
processBeforeResponse,
|
|
37
|
+
signatureVerification,
|
|
38
|
+
boltAppOptions,
|
|
39
|
+
receiverOptions
|
|
40
|
+
});
|
|
41
|
+
const { bridge } = installSlackAgentAppSurface(boltApp, surfaceOptions);
|
|
42
|
+
expressApp.use(
|
|
43
|
+
receiver.router
|
|
44
|
+
);
|
|
45
|
+
const port = portOption === void 0 ? resolvePort(process.env.PORT) : portOption;
|
|
46
|
+
let server;
|
|
47
|
+
if (!providedApp && port !== null) {
|
|
48
|
+
const onListen = () => {
|
|
49
|
+
process.stdout.write(
|
|
50
|
+
`Slack agent app listening on port ${port} at ${routePath}
|
|
51
|
+
`
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
server = host ? expressApp.listen(port, host, onListen) : expressApp.listen(port, onListen);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
app: expressApp,
|
|
58
|
+
boltApp,
|
|
59
|
+
receiver,
|
|
60
|
+
authMode,
|
|
61
|
+
routePath,
|
|
62
|
+
bridge,
|
|
63
|
+
...server ? { server } : {}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function resolvePort(port) {
|
|
67
|
+
if (!port) return 3e3;
|
|
68
|
+
const parsed = Number(port);
|
|
69
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
70
|
+
throw new Error(`Invalid PORT value: ${port}`);
|
|
71
|
+
}
|
|
72
|
+
return parsed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
mountSlackAgentApp
|
|
77
|
+
};
|