@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.
Files changed (68) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +80 -0
  3. package/dist/adapter-Cmd2C90g.d.ts +31 -0
  4. package/dist/adapter.d.ts +23 -0
  5. package/dist/adapter.js +13 -0
  6. package/dist/app-surface.d.ts +71 -0
  7. package/dist/app-surface.js +12 -0
  8. package/dist/app.d.ts +54 -0
  9. package/dist/app.js +14 -0
  10. package/dist/assistant.d.ts +19 -0
  11. package/dist/assistant.js +16 -0
  12. package/dist/bolt.d.ts +8 -0
  13. package/dist/bolt.js +10 -0
  14. package/dist/chunk-2SUAW6MV.js +12 -0
  15. package/dist/chunk-645NNJIM.js +12 -0
  16. package/dist/chunk-ANIZ5NT4.js +12 -0
  17. package/dist/chunk-BFUPAJON.js +662 -0
  18. package/dist/chunk-CYEBGC6G.js +77 -0
  19. package/dist/chunk-DHPD4XH5.js +827 -0
  20. package/dist/chunk-FDRQOG7Q.js +471 -0
  21. package/dist/chunk-GNXWTKQ6.js +48 -0
  22. package/dist/chunk-HFT2FXJP.js +12 -0
  23. package/dist/chunk-I2KLQ2HA.js +22 -0
  24. package/dist/chunk-IWUYIAY5.js +69 -0
  25. package/dist/chunk-IXY3BXU5.js +689 -0
  26. package/dist/chunk-JMLB7A2V.js +85 -0
  27. package/dist/chunk-K2E6A377.js +12 -0
  28. package/dist/chunk-M64Z6TYL.js +198 -0
  29. package/dist/chunk-NDVXBI7Z.js +12 -0
  30. package/dist/chunk-NIPAN4KA.js +76 -0
  31. package/dist/chunk-PX4RGO3N.js +12 -0
  32. package/dist/chunk-RFHXERNL.js +27 -0
  33. package/dist/chunk-VHGV66M7.js +12 -0
  34. package/dist/chunk-WO4BJMF3.js +82 -0
  35. package/dist/diagnostics.d.ts +1 -0
  36. package/dist/diagnostics.js +10 -0
  37. package/dist/express-assistant.d.ts +102 -0
  38. package/dist/express-assistant.js +12 -0
  39. package/dist/express.d.ts +98 -0
  40. package/dist/express.js +11 -0
  41. package/dist/feedback.d.ts +1 -0
  42. package/dist/feedback.js +10 -0
  43. package/dist/history.d.ts +1 -0
  44. package/dist/history.js +10 -0
  45. package/dist/index.d.ts +32 -0
  46. package/dist/index.js +202 -0
  47. package/dist/interactive-o_NZb-Xg.d.ts +47 -0
  48. package/dist/interactive.d.ts +30 -0
  49. package/dist/interactive.js +25 -0
  50. package/dist/mcp.d.ts +84 -0
  51. package/dist/mcp.js +9 -0
  52. package/dist/options-C7OYeNR-.d.ts +71 -0
  53. package/dist/options-Uf-qmQKN.d.ts +263 -0
  54. package/dist/policy.d.ts +1 -0
  55. package/dist/policy.js +10 -0
  56. package/dist/setup.d.ts +1 -0
  57. package/dist/setup.js +10 -0
  58. package/dist/shared.d.ts +129 -0
  59. package/dist/shared.js +20 -0
  60. package/dist/socket.d.ts +137 -0
  61. package/dist/socket.js +16 -0
  62. package/dist/targets.d.ts +1 -0
  63. package/dist/targets.js +10 -0
  64. package/dist/types-BqRzb_Cd.d.ts +346 -0
  65. package/dist/types-Crpil4kb.d.ts +136 -0
  66. package/dist/users.d.ts +1 -0
  67. package/dist/users.js +10 -0
  68. 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
+ };