alemonjs 2.1.83 → 2.1.85

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 (235) hide show
  1. package/lib/{app → application}/define-children.js +2 -1
  2. package/lib/{app → application/format}/message-api.d.ts +2 -2
  3. package/lib/{app → application/format}/message-api.js +12 -4
  4. package/lib/{app → application/format}/message-format-old.d.ts +1 -1
  5. package/lib/{app → application/format}/message-format.d.ts +1 -2
  6. package/lib/{app → application/format}/message-format.js +0 -2
  7. package/lib/{app/hook-use → application/hooks}/announce.js +4 -3
  8. package/lib/{app/hook-use → application/hooks}/channel.js +4 -3
  9. package/lib/{app/hook-use → application/hooks}/client.d.ts +1 -1
  10. package/lib/{app/hook-use → application/hooks}/client.js +4 -11
  11. package/lib/{app/hook-use → application/hooks}/common.d.ts +7 -7
  12. package/lib/{app/hook-use → application/hooks}/common.js +9 -8
  13. package/lib/{app/hook-use → application/hooks}/event.js +1 -1
  14. package/lib/{app/hook-use → application/hooks}/guild.js +4 -3
  15. package/lib/{app/hook-use → application/hooks}/history.js +4 -3
  16. package/lib/{app/hook-use → application/hooks}/me.js +12 -7
  17. package/lib/{app/hook-use → application/hooks}/media.d.ts +3 -3
  18. package/lib/{app/hook-use → application/hooks}/media.js +4 -3
  19. package/lib/{app/hook-use → application/hooks}/member.js +4 -3
  20. package/lib/{app/hook-use → application/hooks}/mention.js +4 -3
  21. package/lib/{app/hook-use → application/hooks}/message.js +6 -5
  22. package/lib/{app/hook-use → application/hooks}/permission.js +4 -3
  23. package/lib/{app/hook-use → application/hooks}/reaction.js +4 -3
  24. package/lib/{app/hook-use → application/hooks}/request.js +12 -7
  25. package/lib/{app/hook-use → application/hooks}/role.js +4 -3
  26. package/lib/{app/hook-use → application/hooks}/subscribe.js +4 -4
  27. package/lib/{app/hook-use → application/hooks}/user.js +12 -7
  28. package/lib/application/index.d.ts +29 -0
  29. package/lib/application/index.js +58 -0
  30. package/lib/{app → application}/router/dsl.d.ts +1 -1
  31. package/lib/{app → application}/router/dsl.js +14 -10
  32. package/lib/{cbp → application/runtime/cbp}/connects/client.d.ts +1 -1
  33. package/lib/{cbp → application/runtime/cbp}/connects/client.js +43 -50
  34. package/lib/application/runtime/cbp/index.d.ts +3 -0
  35. package/lib/application/runtime/cbp/index.js +3 -0
  36. package/lib/application/runtime/cbp/processor/actions.d.ts +3 -0
  37. package/lib/application/runtime/cbp/processor/actions.js +58 -0
  38. package/lib/application/runtime/cbp/processor/api.d.ts +3 -0
  39. package/lib/application/runtime/cbp/processor/api.js +58 -0
  40. package/lib/application/runtime/cbp/processor/request-registry.d.ts +8 -0
  41. package/lib/application/runtime/cbp/processor/request-registry.js +6 -0
  42. package/lib/application/runtime/client-runtime.d.ts +1 -0
  43. package/lib/application/runtime/client-runtime.js +95 -0
  44. package/lib/{app → application/runtime}/event-error.d.ts +1 -1
  45. package/lib/{app → application/runtime}/event-error.js +1 -1
  46. package/lib/{app → application/runtime}/event-group.d.ts +1 -1
  47. package/lib/{app → application/runtime}/event-middleware.d.ts +1 -1
  48. package/lib/{app → application/runtime}/event-middleware.js +1 -1
  49. package/lib/{app → application/runtime}/event-processor-callHandler.d.ts +1 -1
  50. package/lib/{app → application/runtime}/event-processor-callHandler.js +8 -1
  51. package/lib/{app → application/runtime}/event-processor-cycle.d.ts +1 -1
  52. package/lib/{app → application/runtime}/event-processor-cycleFiles.d.ts +1 -1
  53. package/lib/{app → application/runtime}/event-processor-cycleFiles.js +2 -2
  54. package/lib/{app → application/runtime}/event-processor-cycleRoute.d.ts +1 -1
  55. package/lib/{app → application/runtime}/event-processor-cycleRoute.js +9 -2
  56. package/lib/{app → application/runtime}/event-processor-event.d.ts +1 -1
  57. package/lib/{app → application/runtime}/event-processor-middleware.d.ts +1 -1
  58. package/lib/{app → application/runtime}/event-processor-subscribe.d.ts +1 -1
  59. package/lib/{app → application/runtime}/event-processor-subscribe.js +9 -2
  60. package/lib/{app → application/runtime}/event-processor.d.ts +1 -1
  61. package/lib/{app → application/runtime}/event-processor.js +4 -3
  62. package/lib/{app → application/runtime}/event-response.d.ts +1 -1
  63. package/lib/{app → application/runtime}/event-utils.d.ts +1 -1
  64. package/lib/{app → application/runtime}/event-utils.js +2 -2
  65. package/lib/{app → application/runtime}/hook-event-context.d.ts +2 -2
  66. package/lib/{app → application/runtime}/hook-event-context.js +2 -2
  67. package/lib/application/runtime/http/index.d.ts +4 -0
  68. package/lib/application/runtime/http/index.js +4 -0
  69. package/lib/application/runtime/http/routers/hello.html.d.ts +4 -0
  70. package/lib/application/runtime/http/routers/hello.html.js +363 -0
  71. package/lib/{server → application/runtime/http}/routers/router.js +265 -179
  72. package/lib/{server → application/runtime/http}/routers/utils.d.ts +1 -1
  73. package/lib/{server → application/runtime/http}/routers/utils.js +22 -8
  74. package/lib/{server/main.js → application/runtime/http-server.js} +2 -6
  75. package/lib/{app → application/runtime}/lifecycle-callbacks.d.ts +1 -1
  76. package/lib/{app → application/runtime}/lifecycle-callbacks.js +2 -7
  77. package/lib/{app/load_modules → application/runtime/load-modules}/load.js +2 -2
  78. package/lib/{app/load_modules → application/runtime/load-modules}/loadChild.js +14 -5
  79. package/lib/{app → application/runtime}/schedule-store.d.ts +1 -1
  80. package/lib/{app → application/runtime}/schedule-store.js +1 -1
  81. package/lib/{app → application/runtime}/store.d.ts +14 -19
  82. package/lib/{app → application/runtime}/store.js +8 -103
  83. package/lib/application/schedule.d.ts +17 -0
  84. package/lib/{app/api → application}/schedule.js +1 -1
  85. package/lib/client.d.ts +1 -1
  86. package/lib/client.js +1 -117
  87. package/lib/common/cbp/constants.d.ts +11 -0
  88. package/lib/common/cbp/constants.js +13 -0
  89. package/lib/{cbp/connects/connect.js → common/cbp/heartbeat.js} +3 -6
  90. package/lib/common/cbp/normalize.d.ts +16 -0
  91. package/lib/common/cbp/normalize.js +324 -0
  92. package/lib/common/cbp/runtime.d.ts +2 -0
  93. package/lib/common/cbp/runtime.js +10 -0
  94. package/lib/common/cbp/typings.d.ts +159 -0
  95. package/lib/{cbp/connects/base.js → common/cbp/ws-connector.js} +7 -9
  96. package/lib/{core → common}/config.d.ts +2 -2
  97. package/lib/{core → common}/config.js +5 -4
  98. package/lib/common/identity.d.ts +11 -0
  99. package/lib/common/identity.js +34 -0
  100. package/lib/common/index.d.ts +15 -0
  101. package/lib/common/index.js +14 -0
  102. package/lib/common/logger.d.ts +6 -0
  103. package/lib/common/logger.js +99 -0
  104. package/lib/{core → common}/react.js +22 -3
  105. package/lib/common/result.d.ts +7 -0
  106. package/lib/common/result.js +19 -0
  107. package/lib/{core → common}/utils.d.ts +3 -18
  108. package/lib/{core → common}/utils.js +6 -49
  109. package/lib/{core → common}/variable.js +1 -1
  110. package/lib/core/cbp/index.d.ts +1 -0
  111. package/lib/core/cbp/index.js +1 -0
  112. package/lib/core/cbp/processor/config.d.ts +8 -0
  113. package/lib/core/cbp/processor/config.js +29 -0
  114. package/lib/{cbp → core/cbp}/routers/hello.html.js +1 -1
  115. package/lib/{cbp → core/cbp}/server/main.js +57 -35
  116. package/lib/{cbp → core/cbp}/server/testone.d.ts +1 -1
  117. package/lib/{cbp → core/cbp}/server/testone.js +8 -2
  118. package/lib/core/index.d.ts +1 -3
  119. package/lib/core/index.js +1 -3
  120. package/lib/core/process/index.d.ts +3 -0
  121. package/lib/{process → core/process}/index.js +0 -1
  122. package/lib/{process → core/process}/ipc-bridge.js +16 -2
  123. package/lib/{process → core/process}/module.js +13 -4
  124. package/lib/{process → core/process}/platform.js +12 -3
  125. package/lib/core/start.d.ts +2 -0
  126. package/lib/core/start.js +76 -0
  127. package/lib/global.d.ts +4 -3
  128. package/lib/index.d.ts +10 -2
  129. package/lib/index.js +74 -54
  130. package/lib/main.d.ts +1 -2
  131. package/lib/main.js +1 -76
  132. package/lib/{cbp/connects/platform.d.ts → platform/cbp-platform.d.ts} +2 -2
  133. package/lib/{cbp/connects/platform.js → platform/cbp-platform.js} +52 -75
  134. package/lib/{app → platform}/define-platform.js +2 -0
  135. package/lib/platform/event-value.d.ts +7 -0
  136. package/lib/platform/event-value.js +5 -0
  137. package/lib/platform/index.d.ts +5 -0
  138. package/lib/platform/index.js +5 -0
  139. package/lib/types/actions.d.ts +20 -1
  140. package/lib/types/apis.d.ts +2 -1
  141. package/lib/types/client/index.d.ts +1 -1
  142. package/lib/types/cycle/index.d.ts +1 -1
  143. package/lib/types/event/index.d.ts +1 -1
  144. package/lib/types/subscribe/index.d.ts +1 -1
  145. package/package.json +22 -1
  146. package/lib/app/api/schedule.d.ts +0 -17
  147. package/lib/app/index.d.ts +0 -25
  148. package/lib/app/index.js +0 -47
  149. package/lib/cbp/index.d.ts +0 -3
  150. package/lib/cbp/index.js +0 -3
  151. package/lib/cbp/processor/actions.d.ts +0 -3
  152. package/lib/cbp/processor/actions.js +0 -48
  153. package/lib/cbp/processor/api.d.ts +0 -3
  154. package/lib/cbp/processor/api.js +0 -48
  155. package/lib/cbp/processor/config.d.ts +0 -29
  156. package/lib/cbp/processor/config.js +0 -52
  157. package/lib/cbp/typings.d.ts +0 -20
  158. package/lib/process/index.d.ts +0 -4
  159. package/lib/server/routers/hello.html.d.ts +0 -2
  160. package/lib/server/routers/hello.html.js +0 -31
  161. /package/lib/{app → application}/define-children.d.ts +0 -0
  162. /package/lib/{app → application}/define-middleware.d.ts +0 -0
  163. /package/lib/{app → application}/define-middleware.js +0 -0
  164. /package/lib/{app → application}/define-response.d.ts +0 -0
  165. /package/lib/{app → application}/define-response.js +0 -0
  166. /package/lib/{app → application}/define-router.d.ts +0 -0
  167. /package/lib/{app → application}/define-router.js +0 -0
  168. /package/lib/{app → application}/expose.d.ts +0 -0
  169. /package/lib/{app → application}/expose.js +0 -0
  170. /package/lib/{app → application/format}/message-format-old.js +0 -0
  171. /package/lib/{app/hook-use → application/hooks}/announce.d.ts +0 -0
  172. /package/lib/{app/hook-use → application/hooks}/channel.d.ts +0 -0
  173. /package/lib/{app/hook-use → application/hooks}/event.d.ts +0 -0
  174. /package/lib/{app/hook-use → application/hooks}/guild.d.ts +0 -0
  175. /package/lib/{app/hook-use → application/hooks}/history.d.ts +0 -0
  176. /package/lib/{app/hook-use → application/hooks}/index.d.ts +0 -0
  177. /package/lib/{app/hook-use → application/hooks}/index.js +0 -0
  178. /package/lib/{app/hook-use → application/hooks}/me.d.ts +0 -0
  179. /package/lib/{app/hook-use → application/hooks}/member.d.ts +0 -0
  180. /package/lib/{app/hook-use → application/hooks}/mention.d.ts +0 -0
  181. /package/lib/{app/hook-use → application/hooks}/message.d.ts +0 -0
  182. /package/lib/{app/hook-use → application/hooks}/permission.d.ts +0 -0
  183. /package/lib/{app/hook-use → application/hooks}/reaction.d.ts +0 -0
  184. /package/lib/{app/hook-use → application/hooks}/request.d.ts +0 -0
  185. /package/lib/{app/hook-use → application/hooks}/role.d.ts +0 -0
  186. /package/lib/{app/hook-use → application/hooks}/route.d.ts +0 -0
  187. /package/lib/{app/hook-use → application/hooks}/route.js +0 -0
  188. /package/lib/{app/hook-use → application/hooks}/subscribe.d.ts +0 -0
  189. /package/lib/{app/hook-use → application/hooks}/user.d.ts +0 -0
  190. /package/lib/{app → application}/router/fallback.d.ts +0 -0
  191. /package/lib/{app → application}/router/fallback.js +0 -0
  192. /package/lib/{app → application}/router/main.d.ts +0 -0
  193. /package/lib/{app → application}/router/main.js +0 -0
  194. /package/lib/{app → application}/router/parser.d.ts +0 -0
  195. /package/lib/{app → application}/router/parser.js +0 -0
  196. /package/lib/{app → application}/router/types.d.ts +0 -0
  197. /package/lib/{app → application}/router/types.js +0 -0
  198. /package/lib/{app → application}/router/validator.d.ts +0 -0
  199. /package/lib/{app → application}/router/validator.js +0 -0
  200. /package/lib/{cbp → application/runtime/cbp}/processor/transport.d.ts +0 -0
  201. /package/lib/{cbp → application/runtime/cbp}/processor/transport.js +0 -0
  202. /package/lib/{app → application/runtime}/event-group.js +0 -0
  203. /package/lib/{app → application/runtime}/event-processor-cycle.js +0 -0
  204. /package/lib/{app → application/runtime}/event-processor-event.js +0 -0
  205. /package/lib/{app → application/runtime}/event-processor-middleware.js +0 -0
  206. /package/lib/{app → application/runtime}/event-response.js +0 -0
  207. /package/lib/{server → application/runtime/http}/routers/middleware.d.ts +0 -0
  208. /package/lib/{server → application/runtime/http}/routers/middleware.js +0 -0
  209. /package/lib/{cbp → application/runtime/http}/routers/router.d.ts +0 -0
  210. /package/lib/{server/main.d.ts → application/runtime/http-server.d.ts} +0 -0
  211. /package/lib/{app/load_modules → application/runtime/load-modules}/index.d.ts +0 -0
  212. /package/lib/{app/load_modules → application/runtime/load-modules}/index.js +0 -0
  213. /package/lib/{app/load_modules → application/runtime/load-modules}/load.d.ts +0 -0
  214. /package/lib/{app/load_modules → application/runtime/load-modules}/loadChild.d.ts +0 -0
  215. /package/lib/{app/config.d.ts → application/runtime/subscribe-status.d.ts} +0 -0
  216. /package/lib/{app/config.js → application/runtime/subscribe-status.js} +0 -0
  217. /package/lib/{app → common}/SinglyLinkedList.d.ts +0 -0
  218. /package/lib/{app → common}/SinglyLinkedList.js +0 -0
  219. /package/lib/{cbp/connects/connect.d.ts → common/cbp/heartbeat.d.ts} +0 -0
  220. /package/lib/{cbp → common/cbp}/typings.js +0 -0
  221. /package/lib/{cbp/connects/base.d.ts → common/cbp/ws-connector.d.ts} +0 -0
  222. /package/lib/{process → common}/direct-channel.d.ts +0 -0
  223. /package/lib/{process → common}/direct-channel.js +0 -0
  224. /package/lib/{core → common}/react.d.ts +0 -0
  225. /package/lib/{core → common}/variable.d.ts +0 -0
  226. /package/lib/{cbp → core/cbp}/routers/hello.html.d.ts +0 -0
  227. /package/lib/{server → core/cbp}/routers/router.d.ts +0 -0
  228. /package/lib/{cbp → core/cbp}/routers/router.js +0 -0
  229. /package/lib/{cbp → core/cbp}/server/main.d.ts +0 -0
  230. /package/lib/{process → core/process}/ipc-bridge.d.ts +0 -0
  231. /package/lib/{process → core/process}/module.d.ts +0 -0
  232. /package/lib/{process → core/process}/platform.d.ts +0 -0
  233. /package/lib/{app → platform}/define-platform.d.ts +0 -0
  234. /package/lib/{app → platform}/event-format.d.ts +0 -0
  235. /package/lib/{app → platform}/event-format.js +0 -0
@@ -0,0 +1,76 @@
1
+ import { getConfig } from '../common/config.js';
2
+ import { cbpServer } from './cbp/server/main.js';
3
+ import { filePrefixCommon, defaultPlatformCommonPrefix } from '../common/variable.js';
4
+ import { startPlatformAdapterWithFallback } from './process/platform.js';
5
+ import { startModuleAdapter } from './process/module.js';
6
+ import { generateSocketPath } from '../common/direct-channel.js';
7
+
8
+ const createOptionsByKey = (options, key, defaultValue) => {
9
+ const cfg = getConfig();
10
+ const curValue = options?.[key] ?? cfg.argv?.[key];
11
+ const value = curValue ?? cfg.value?.[key] ?? defaultValue;
12
+ return value;
13
+ };
14
+ const startPlatform = (options) => {
15
+ const platform = createOptionsByKey(options, 'platform', '');
16
+ const login = createOptionsByKey(options, 'login', '');
17
+ if (!platform && !login) {
18
+ global.__sandbox = true;
19
+ return;
20
+ }
21
+ void startPlatformAdapterWithFallback();
22
+ };
23
+ const startClient = (options) => {
24
+ process.env.input = createOptionsByKey(options, 'input', '');
25
+ process.env.output = createOptionsByKey(options, 'output', '');
26
+ process.env.is_full_receive = String(createOptionsByKey(options, 'is_full_receive', true));
27
+ process.env.port = String(createOptionsByKey(options, 'port', '') || '');
28
+ process.env.url = createOptionsByKey(options, 'url', '');
29
+ startModuleAdapter();
30
+ };
31
+ const start = (options = {}) => {
32
+ if (typeof options === 'string') {
33
+ options = { input: options };
34
+ }
35
+ global.__options = options;
36
+ const port = createOptionsByKey(options, 'port', '');
37
+ const serverPort = createOptionsByKey(options, 'serverPort', '');
38
+ const platform = createOptionsByKey(options, 'platform', '');
39
+ const login = createOptionsByKey(options, 'login', '');
40
+ if (platform) {
41
+ const reg = filePrefixCommon;
42
+ if (reg.test(platform)) {
43
+ process.env.platform = platform;
44
+ process.env.login = platform.replace(reg, '');
45
+ }
46
+ else {
47
+ process.env.platform = platform;
48
+ process.env.login = platform;
49
+ }
50
+ }
51
+ else if (login) {
52
+ process.env.platform = `${defaultPlatformCommonPrefix}${login}`;
53
+ process.env.login = login;
54
+ }
55
+ process.env.port = port ? String(port) : '';
56
+ process.env.serverPort = serverPort;
57
+ if (port) {
58
+ cbpServer(port, () => {
59
+ const httpURL = `http://127.0.0.1:${port}`;
60
+ const wsURL = `ws://127.0.0.1:${port}`;
61
+ logger.info(`[CBP-Server] ${httpURL}`);
62
+ logger.info(`[CBP-Server] ${wsURL}]`);
63
+ startClient(options);
64
+ startPlatform(options);
65
+ });
66
+ }
67
+ else {
68
+ const sockPath = generateSocketPath();
69
+ process.env.__ALEMON_DIRECT_SOCK = sockPath;
70
+ logger.info('[Direct-IPC] 平台↔客户端直连');
71
+ startClient(options);
72
+ startPlatform(options);
73
+ }
74
+ };
75
+
76
+ export { start };
package/lib/global.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import type { DefineChildrenFunc, OnResponseReversalFunc, OnMiddlewareReversalFunc, OnSelectsFunc, OnDataFormatFunc, OnResponseReversalFuncBack, OnGroupFunc, OnMiddlewareReversalFuncBack, DefineResponseFunc, defineMiddlewareFunc, StoreChildrenApp, StateSubscribeMap, SubscribeKeysMap, LoggerUtils, ResponseState, StartOptions } from './types';
2
- import WebSocket, { Server } from 'ws';
3
- import { IncomingMessage } from 'http';
2
+ import { type Server } from 'ws';
3
+ import type WebSocket from 'ws';
4
+ import type { IncomingMessage } from 'http';
4
5
  import type KoaRouter from 'koa-router';
5
- import type { RuntimeAppRecord } from './app/store.js';
6
+ import type { RuntimeAppRecord } from './application/runtime/store.js';
6
7
  declare global {
7
8
  var __config: any;
8
9
  var __options: StartOptions;
package/lib/index.d.ts CHANGED
@@ -1,6 +1,14 @@
1
1
  export * from './types/index.js';
2
2
  export * from './global.js';
3
+ export * from './common/index.js';
3
4
  export * from './core/index.js';
4
- export * from './cbp/index.js';
5
- export * from './app/index.js';
5
+ export * from './platform/index.js';
6
+ export * from './application/index.js';
7
+ export { cbpServer } from './core/cbp/index.js';
8
+ export { Result } from './common/variable.js';
9
+ export { start } from './main.js';
6
10
  export * from './main.js';
11
+ export * as common from './common/index.js';
12
+ export * as core from './core/index.js';
13
+ export * as platform from './platform/index.js';
14
+ export * as application from './application/index.js';
package/lib/index.js CHANGED
@@ -1,55 +1,75 @@
1
1
  export { ActionsEventEnum } from './types/event/actions.js';
2
- export { ResultCode } from './core/variable.js';
3
- export { getConfig, getConfigValue, onWatchConfigValue } from './core/config.js';
4
- export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, matchIn, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey } from './core/utils.js';
5
- export { cbpClient } from './cbp/connects/client.js';
6
- export { cbpPlatform } from './cbp/connects/platform.js';
7
- export { cbpServer } from './cbp/server/main.js';
8
- export { ChildrenApp, Core, Logger, Middleware, MiddlewareRouter, MiddlewareTree, ProcessorEventAutoClearMap, ProcessorEventUserAutoClearMap, Response, ResponseMiddleware, ResponseRouter, ResponseTree, State, StateSubscribe, SubscribeList, bumpStoreVersion, clearRuntimeAppKoaRouters, core, disposeAllRuntimeApps, disposeRuntimeApp, getChildrenApp, getRuntimeApp, getRuntimeAppKoaRouters, getSubscribeList, hasRuntimeAppCapability, listChildrenApps, listRuntimeAppKoaRouters, listRuntimeApps, logger, registerRuntimeApp, setRuntimeAppKoaRouters, toRuntimeAppSnapshot, updateRuntimeAppCapabilities, updateRuntimeAppStatus } from './app/store.js';
9
- export { Expose, clearAllExpose, disposeExpose, registerExpose } from './app/expose.js';
10
- export { loadModels, run } from './app/load_modules/load.js';
11
- export { loadChildren, loadChildrenFile } from './app/load_modules/loadChild.js';
12
- export { defineChildren } from './app/define-children.js';
13
- export { definePlatform } from './app/define-platform.js';
14
- export { defineResponse } from './app/define-response.js';
15
- export { defineMiddleware } from './app/define-middleware.js';
16
- export { defineRouter, lazy, runHandler } from './app/define-router.js';
17
- export { FormatEvent, wrapEvent } from './app/event-format.js';
18
- export { onGroup } from './app/event-group.js';
19
- export { OnMiddleware, onMiddleware } from './app/event-middleware.js';
20
- export { OnProcessor, onProcessor } from './app/event-processor.js';
21
- export { OnResponse, onResponse } from './app/event-response.js';
22
- export { expendCycle } from './app/event-processor-cycle.js';
23
- export { expendEvent } from './app/event-processor-event.js';
24
- export { expendMiddleware } from './app/event-processor-middleware.js';
25
- export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './app/event-processor-subscribe.js';
26
- export { useAnnounce } from './app/hook-use/announce.js';
27
- export { useChannel } from './app/hook-use/channel.js';
28
- export { useClient } from './app/hook-use/client.js';
29
- export { useGuild } from './app/hook-use/guild.js';
30
- export { useHistory } from './app/hook-use/history.js';
31
- export { useMedia } from './app/hook-use/media.js';
32
- export { useMe } from './app/hook-use/me.js';
33
- export { useMember } from './app/hook-use/member.js';
34
- export { useMention } from './app/hook-use/mention.js';
35
- export { useMessage, useSend, useSends } from './app/hook-use/message.js';
36
- export { usePermission } from './app/hook-use/permission.js';
37
- export { useReaction } from './app/hook-use/reaction.js';
38
- export { useRequest } from './app/hook-use/request.js';
39
- export { useRole } from './app/hook-use/role.js';
40
- export { useRoute } from './app/hook-use/route.js';
41
- export { useUser } from './app/hook-use/user.js';
42
- export { useObserver, useSubscribe } from './app/hook-use/subscribe.js';
43
- export { createEvent, useEvent } from './app/hook-use/event.js';
44
- export { clearInterval, clearTimeout, listSchedule, pauseSchedule, resumeSchedule, setCron, setInterval, setTimeout } from './app/api/schedule.js';
45
- export { finishCurrentTrace, getCurrentAppName, getCurrentEvent, getCurrentNext, getCurrentPhase, markEventSendAttempt, markEventSendFailure, markEventSendSuccess, recordEventSendResults, withEventContext, withProcessorTrace } from './app/hook-event-context.js';
46
- export { registerAppDir, scheduleCancel, scheduleCancelAll, scheduleCancelByApp, scheduleCron, scheduleInterval, scheduleList, schedulePause, scheduleResume, scheduleTimeout, unregisterAppDir } from './app/schedule-store.js';
47
- export { createEventValue, createSelects, onSelects, onState, unChildren, unState, useState } from './app/event-utils.js';
48
- export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './app/message-api.js';
49
- export { Format, FormatButtonGroup, FormatMarkDown, FormatSelect } from './app/message-format.js';
50
- export { Router } from './app/router/dsl.js';
51
- export { checkFallbackHint } from './app/router/fallback.js';
52
- export { normalizeRoutePath, parseMessageText } from './app/router/parser.js';
53
- export { validateRouteArgs } from './app/router/validator.js';
54
- export { start } from './main.js';
55
- export { Attachment, Audio, BT, Button, Image, ImageFile, ImageURL, Link, MD, Markdown, MarkdownOriginal, Mention, Text, Video } from './app/message-format-old.js';
2
+ import * as index$1 from './common/index.js';
3
+ export { index$1 as common };
4
+ import * as index$2 from './core/index.js';
5
+ export { index$2 as core };
6
+ import * as index$3 from './platform/index.js';
7
+ export { index$3 as platform };
8
+ import * as index from './application/index.js';
9
+ export { index as application };
10
+ export { cbpServer } from './core/cbp/server/main.js';
11
+ export { EventMessageText, Fail, FailAuth, FailInternal, FailParams, Ok, Result, ResultCode, Warn, defaultLogin, defaultPlatformCommonPrefix, defaultPlatformPrefix, defaultPort, filePrefixCommon, fileSuffixMiddleware, fileSuffixResponse, processorMaxMapSize, processorRepeatedClearSize, processorRepeatedClearTimeMax, processorRepeatedClearTimeMin, processorRepeatedEventTime, processorRepeatedUserTime } from './common/variable.js';
12
+ export { start } from './core/start.js';
13
+ export { A, Body, Component, DOCTYPE, Div, H1, Head, Html, P, Style, Title, createElement, renderToString } from './common/react.js';
14
+ export { Attachment, Audio, BT, Button, Image, ImageFile, ImageURL, Link, MD, Markdown, MarkdownOriginal, Mention, Text, Video } from './application/format/message-format-old.js';
15
+ export { ChildrenApp, Core, Middleware, MiddlewareRouter, MiddlewareTree, ProcessorEventAutoClearMap, ProcessorEventUserAutoClearMap, Response, ResponseMiddleware, ResponseRouter, ResponseTree, State, StateSubscribe, SubscribeList, bumpStoreVersion, clearRuntimeAppKoaRouters, disposeAllRuntimeApps, disposeRuntimeApp, getChildrenApp, getRuntimeApp, getRuntimeAppKoaRouters, getSubscribeList, hasRuntimeAppCapability, listChildrenApps, listRuntimeAppKoaRouters, listRuntimeApps, registerRuntimeApp, setRuntimeAppKoaRouters, toRuntimeAppSnapshot, updateRuntimeAppCapabilities, updateRuntimeAppStatus } from './application/runtime/store.js';
16
+ export { DEVICE_ID_HEADER, FULL_RECEIVE_HEADER, HEARTBEAT_INTERVAL, USER_AGENT_HEADER, USER_AGENT_HEADER_VALUE_MAP, reconnectInterval, timeoutTime } from './common/cbp/constants.js';
17
+ export { Expose, clearAllExpose, disposeExpose, registerExpose } from './application/expose.js';
18
+ export { Format, FormatButtonGroup, FormatMarkDown, FormatSelect } from './application/format/message-format.js';
19
+ export { FormatEvent, wrapEvent } from './platform/event-format.js';
20
+ export { Logger, logger } from './common/logger.js';
21
+ export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './application/format/message-api.js';
22
+ export { OnMiddleware, onMiddleware } from './application/runtime/event-middleware.js';
23
+ export { OnProcessor, onProcessor } from './application/runtime/event-processor.js';
24
+ export { OnResponse, onResponse } from './application/runtime/event-response.js';
25
+ export { Router } from './application/router/dsl.js';
26
+ export { SinglyLinkedList } from './common/SinglyLinkedList.js';
27
+ export { cbpClient } from './application/runtime/cbp/connects/client.js';
28
+ export { cbpPlatform } from './platform/cbp-platform.js';
29
+ export { checkFallbackHint } from './application/router/fallback.js';
30
+ export { clearInterval, clearTimeout, listSchedule, pauseSchedule, resumeSchedule, setCron, setInterval, setTimeout } from './application/schedule.js';
31
+ export { createActionRequestEnvelope, createActionResponseEnvelope, createApiRequestEnvelope, createApiResponseEnvelope, createEventEnvelope, getNormalizedDeviceId, getNormalizedEventRouteId, isCBPEnvelope, isNormalizedActionRequest, isNormalizedApiRequest, normalizeInboundMessage, toLegacyActionData, toLegacyApiData } from './common/cbp/normalize.js';
32
+ export { createDirectClient, createDirectServer, generateSocketPath } from './common/direct-channel.js';
33
+ export { createEvent, useEvent } from './application/hooks/event.js';
34
+ export { createEventName, createHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, sanitizeForSerialization, showErrorModule, stringToNumber } from './common/utils.js';
35
+ export { createEventValue } from './platform/event-value.js';
36
+ export { createResult } from './common/result.js';
37
+ export { createSelects, onSelects, onState, unChildren, unState, useState } from './application/runtime/event-utils.js';
38
+ export { createUserHashKey, fastHash, isMaster, matchIn, useUserHashKey } from './common/identity.js';
39
+ export { createWSConnector } from './common/cbp/ws-connector.js';
40
+ export { defineChildren } from './application/define-children.js';
41
+ export { defineMiddleware } from './application/define-middleware.js';
42
+ export { definePlatform } from './platform/define-platform.js';
43
+ export { defineResponse } from './application/define-response.js';
44
+ export { defineRouter, lazy, runHandler } from './application/define-router.js';
45
+ export { deviceId, generateUniqueId } from './common/cbp/runtime.js';
46
+ export { expendCycle } from './application/runtime/event-processor-cycle.js';
47
+ export { expendEvent } from './application/runtime/event-processor-event.js';
48
+ export { expendMiddleware } from './application/runtime/event-processor-middleware.js';
49
+ export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './application/runtime/event-processor-subscribe.js';
50
+ export { finishCurrentTrace, getCurrentAppName, getCurrentEvent, getCurrentNext, getCurrentPhase, markEventSendAttempt, markEventSendFailure, markEventSendSuccess, recordEventSendResults, withEventContext, withProcessorTrace } from './application/runtime/hook-event-context.js';
51
+ export { getConfig, getConfigValue, onWatchConfigValue } from './common/config.js';
52
+ export { loadChildren, loadChildrenFile } from './application/runtime/load-modules/loadChild.js';
53
+ export { loadModels, run } from './application/runtime/load-modules/load.js';
54
+ export { normalizeRoutePath, parseMessageText } from './application/router/parser.js';
55
+ export { onGroup } from './application/runtime/event-group.js';
56
+ export { registerAppDir, scheduleCancel, scheduleCancelAll, scheduleCancelByApp, scheduleCron, scheduleInterval, scheduleList, schedulePause, scheduleResume, scheduleTimeout, unregisterAppDir } from './application/runtime/schedule-store.js';
57
+ export { useAnnounce } from './application/hooks/announce.js';
58
+ export { useChannel } from './application/hooks/channel.js';
59
+ export { useClient } from './application/hooks/client.js';
60
+ export { useGuild } from './application/hooks/guild.js';
61
+ export { useHeartbeat } from './common/cbp/heartbeat.js';
62
+ export { useHistory } from './application/hooks/history.js';
63
+ export { useMe } from './application/hooks/me.js';
64
+ export { useMedia } from './application/hooks/media.js';
65
+ export { useMember } from './application/hooks/member.js';
66
+ export { useMention } from './application/hooks/mention.js';
67
+ export { useMessage, useSend, useSends } from './application/hooks/message.js';
68
+ export { useObserver, useSubscribe } from './application/hooks/subscribe.js';
69
+ export { usePermission } from './application/hooks/permission.js';
70
+ export { useReaction } from './application/hooks/reaction.js';
71
+ export { useRequest } from './application/hooks/request.js';
72
+ export { useRole } from './application/hooks/role.js';
73
+ export { useRoute } from './application/hooks/route.js';
74
+ export { useUser } from './application/hooks/user.js';
75
+ export { validateRouteArgs, validateRouteArgsForCommand } from './application/router/validator.js';
package/lib/main.d.ts CHANGED
@@ -1,2 +1 @@
1
- import type { StartOptions } from './types';
2
- export declare const start: (options?: StartOptions | string) => void;
1
+ export { start } from './core/start.js';
package/lib/main.js CHANGED
@@ -1,76 +1 @@
1
- import { getConfig } from './core/config.js';
2
- import { cbpServer } from './cbp/server/main.js';
3
- import { filePrefixCommon, defaultPlatformCommonPrefix } from './core/variable.js';
4
- import { startPlatformAdapterWithFallback } from './process/platform.js';
5
- import { startModuleAdapter } from './process/module.js';
6
- import { generateSocketPath } from './process/direct-channel.js';
7
-
8
- const createOptionsByKey = (options, key, defaultValue) => {
9
- const cfg = getConfig();
10
- const curValue = options?.[key] ?? cfg.argv?.[key];
11
- const value = curValue ?? cfg.value?.[key] ?? defaultValue;
12
- return value;
13
- };
14
- const startPlatform = (options) => {
15
- const platform = createOptionsByKey(options, 'platform', '');
16
- const login = createOptionsByKey(options, 'login', '');
17
- if (!platform && !login) {
18
- global.__sandbox = true;
19
- return;
20
- }
21
- void startPlatformAdapterWithFallback();
22
- };
23
- const startClient = (options) => {
24
- process.env.input = createOptionsByKey(options, 'input', '');
25
- process.env.output = createOptionsByKey(options, 'output', '');
26
- process.env.is_full_receive = String(createOptionsByKey(options, 'is_full_receive', true));
27
- process.env.port = String(createOptionsByKey(options, 'port', '') || '');
28
- process.env.url = createOptionsByKey(options, 'url', '');
29
- startModuleAdapter();
30
- };
31
- const start = (options = {}) => {
32
- if (typeof options === 'string') {
33
- options = { input: options };
34
- }
35
- global.__options = options;
36
- const port = createOptionsByKey(options, 'port', '');
37
- const serverPort = createOptionsByKey(options, 'serverPort', '');
38
- const platform = createOptionsByKey(options, 'platform', '');
39
- const login = createOptionsByKey(options, 'login', '');
40
- if (platform) {
41
- const reg = filePrefixCommon;
42
- if (reg.test(platform)) {
43
- process.env.platform = platform;
44
- process.env.login = platform.replace(reg, '');
45
- }
46
- else {
47
- process.env.platform = platform;
48
- process.env.login = platform;
49
- }
50
- }
51
- else if (login) {
52
- process.env.platform = `${defaultPlatformCommonPrefix}${login}`;
53
- process.env.login = login;
54
- }
55
- process.env.port = port ? String(port) : '';
56
- process.env.serverPort = serverPort;
57
- if (port) {
58
- cbpServer(port, () => {
59
- const httpURL = `http://127.0.0.1:${port}`;
60
- const wsURL = `ws://127.0.0.1:${port}`;
61
- logger.info(`[CBP-Server] ${httpURL}`);
62
- logger.info(`[CBP-Server] ${wsURL}]`);
63
- startClient(options);
64
- startPlatform(options);
65
- });
66
- }
67
- else {
68
- const sockPath = generateSocketPath();
69
- process.env.__ALEMON_DIRECT_SOCK = sockPath;
70
- logger.info('[Direct-IPC] 平台↔客户端直连');
71
- startClient(options);
72
- startPlatform(options);
73
- }
74
- };
75
-
76
- export { start };
1
+ export { start } from './core/start.js';
@@ -1,5 +1,5 @@
1
- import type { EventsEnum } from '../../types';
2
- import type { ActionReplyFunc, ApiReplyFunc } from '../typings';
1
+ import type { ActionReplyFunc, ApiReplyFunc } from '../common/cbp/typings.js';
2
+ import type { EventsEnum } from '../types/index.js';
3
3
  export declare const cbpPlatform: (url?: string, options?: {
4
4
  open: () => void;
5
5
  }) => {
@@ -1,14 +1,38 @@
1
1
  import * as flattedJSON from 'flatted';
2
2
  import { WebSocket } from 'ws';
3
- import { deviceId } from '../processor/config.js';
4
- import { ResultCode } from '../../core/variable.js';
5
3
  import 'fs';
6
4
  import 'path';
7
5
  import 'yaml';
8
- import { sanitizeForSerialization } from '../../core/utils.js';
9
- import { createWSConnector } from './base.js';
10
- import { createDirectClient } from '../../process/direct-channel.js';
6
+ import '../common/logger.js';
7
+ import { ResultCode } from '../common/variable.js';
8
+ import { sanitizeForSerialization } from '../common/utils.js';
9
+ import { createDirectClient } from '../common/direct-channel.js';
10
+ import { deviceId } from '../common/cbp/runtime.js';
11
+ import { createWSConnector } from '../common/cbp/ws-connector.js';
12
+ import { createEventEnvelope, normalizeInboundMessage, isNormalizedApiRequest, toLegacyApiData, isNormalizedActionRequest, toLegacyActionData, createApiResponseEnvelope, createActionResponseEnvelope } from '../common/cbp/normalize.js';
11
13
 
14
+ const dispatchLegacyActionHandlers = (actionReplys, replyAction, input) => {
15
+ const normalized = normalizeInboundMessage(input);
16
+ if (!isNormalizedActionRequest(normalized)) {
17
+ return false;
18
+ }
19
+ const legacy = toLegacyActionData(normalized);
20
+ for (const cb of actionReplys) {
21
+ void cb(legacy, val => replyAction(legacy, val));
22
+ }
23
+ return true;
24
+ };
25
+ const dispatchLegacyApiHandlers = (apiReplys, replyApi, input) => {
26
+ const normalized = normalizeInboundMessage(input);
27
+ if (!isNormalizedApiRequest(normalized)) {
28
+ return false;
29
+ }
30
+ const legacy = toLegacyApiData(normalized);
31
+ for (const cb of apiReplys) {
32
+ void cb(legacy, val => replyApi(legacy, val));
33
+ }
34
+ return true;
35
+ };
12
36
  const cbpPlatformDirect = (sockPath, open) => {
13
37
  const actionReplys = [];
14
38
  const apiReplys = [];
@@ -17,28 +41,19 @@ const cbpPlatformDirect = (sockPath, open) => {
17
41
  const send = (data) => {
18
42
  data.DeviceId = deviceId;
19
43
  data.CreateAt = Date.now();
44
+ const envelope = createEventEnvelope(data);
20
45
  if (channel) {
21
- channel.send(data);
46
+ channel.send(envelope);
22
47
  }
23
48
  else {
24
- pendingQueue.push({ ...data });
49
+ pendingQueue.push(envelope);
25
50
  }
26
51
  };
27
52
  const replyAction = (data, payload) => {
28
- channel?.send({
29
- action: data.action,
30
- payload: payload,
31
- actionId: data.actionId,
32
- DeviceId: data.DeviceId
33
- });
53
+ channel?.send(createActionResponseEnvelope(data, payload));
34
54
  };
35
55
  const replyApi = (data, payload) => {
36
- channel?.send({
37
- action: data.action,
38
- apiId: data.apiId,
39
- DeviceId: data.DeviceId,
40
- payload: payload
41
- });
56
+ channel?.send(createApiResponseEnvelope(data, payload));
42
57
  };
43
58
  const onactions = (reply) => {
44
59
  actionReplys.push(reply);
@@ -47,16 +62,10 @@ const cbpPlatformDirect = (sockPath, open) => {
47
62
  apiReplys.push(reply);
48
63
  };
49
64
  createDirectClient(sockPath, (data) => {
50
- if (data?.apiId) {
51
- for (const cb of apiReplys) {
52
- void cb(data, val => replyApi(data, val));
53
- }
54
- }
55
- else if (data?.actionId) {
56
- for (const cb of actionReplys) {
57
- void cb(data, val => replyAction(data, val));
58
- }
65
+ if (dispatchLegacyApiHandlers(apiReplys, replyApi, data)) {
66
+ return;
59
67
  }
68
+ dispatchLegacyActionHandlers(actionReplys, replyAction, data);
60
69
  })
61
70
  .then(ch => {
62
71
  channel = ch;
@@ -88,19 +97,15 @@ const cbpPlatformIPC = (open, existingActionReplys, existingApiReplys) => {
88
97
  if (typeof process.send === 'function') {
89
98
  data.DeviceId = deviceId;
90
99
  data.CreateAt = Date.now();
91
- process.send({ type: 'ipc:data', data: sanitizeForSerialization(data) });
100
+ const envelope = createEventEnvelope(data);
101
+ process.send({ type: 'ipc:data', data: sanitizeForSerialization(envelope) });
92
102
  }
93
103
  };
94
104
  const replyAction = (data, payload) => {
95
105
  if (typeof process.send === 'function') {
96
106
  process.send({
97
107
  type: 'ipc:data',
98
- data: {
99
- action: data.action,
100
- payload: payload,
101
- actionId: data.actionId,
102
- DeviceId: data.DeviceId
103
- }
108
+ data: sanitizeForSerialization(createActionResponseEnvelope(data, payload))
104
109
  });
105
110
  }
106
111
  };
@@ -108,12 +113,7 @@ const cbpPlatformIPC = (open, existingActionReplys, existingApiReplys) => {
108
113
  if (typeof process.send === 'function') {
109
114
  process.send({
110
115
  type: 'ipc:data',
111
- data: {
112
- action: data.action,
113
- apiId: data.apiId,
114
- DeviceId: data.DeviceId,
115
- payload: payload
116
- }
116
+ data: sanitizeForSerialization(createApiResponseEnvelope(data, payload))
117
117
  });
118
118
  }
119
119
  };
@@ -127,17 +127,10 @@ const cbpPlatformIPC = (open, existingActionReplys, existingApiReplys) => {
127
127
  try {
128
128
  const msg = typeof message === 'string' ? JSON.parse(message) : message;
129
129
  if (msg?.type === 'ipc:data') {
130
- const data = msg.data;
131
- if (data?.apiId) {
132
- for (const cb of apiReplys) {
133
- void cb(data, val => replyApi(data, val));
134
- }
135
- }
136
- else if (data?.actionId) {
137
- for (const cb of actionReplys) {
138
- void cb(data, val => replyAction(data, val));
139
- }
130
+ if (dispatchLegacyApiHandlers(apiReplys, replyApi, msg.data)) {
131
+ return;
140
132
  }
133
+ dispatchLegacyActionHandlers(actionReplys, replyAction, msg.data);
141
134
  }
142
135
  }
143
136
  catch (error) {
@@ -188,29 +181,20 @@ const cbpPlatform = (url, options = {
188
181
  if (global.chatbotPlatform?.readyState === WebSocket.OPEN) {
189
182
  data.DeviceId = deviceId;
190
183
  data.CreateAt = Date.now();
191
- global.chatbotPlatform.send(flattedJSON.stringify(sanitizeForSerialization(data)));
184
+ const envelope = createEventEnvelope(data);
185
+ global.chatbotPlatform.send(flattedJSON.stringify(sanitizeForSerialization(envelope)));
192
186
  }
193
187
  };
194
188
  const actionReplys = [];
195
189
  const apiReplys = [];
196
190
  const replyAction = (data, payload) => {
197
191
  if (global.chatbotPlatform?.readyState === WebSocket.OPEN) {
198
- global.chatbotPlatform.send(flattedJSON.stringify({
199
- action: data.action,
200
- payload: payload,
201
- actionId: data.actionId,
202
- DeviceId: data.DeviceId
203
- }));
192
+ global.chatbotPlatform.send(flattedJSON.stringify(createActionResponseEnvelope(data, payload)));
204
193
  }
205
194
  };
206
195
  const replyApi = (data, payload) => {
207
196
  if (global.chatbotPlatform?.readyState === WebSocket.OPEN) {
208
- global.chatbotPlatform.send(flattedJSON.stringify({
209
- action: data.action,
210
- apiId: data.apiId,
211
- DeviceId: data.DeviceId,
212
- payload: payload
213
- }));
197
+ global.chatbotPlatform.send(flattedJSON.stringify(createApiResponseEnvelope(data, payload)));
214
198
  }
215
199
  };
216
200
  const onactions = (reply) => {
@@ -227,16 +211,10 @@ const cbpPlatform = (url, options = {
227
211
  onMessage: (messageStr) => {
228
212
  try {
229
213
  const data = flattedJSON.parse(messageStr);
230
- if (data.apiId) {
231
- for (const cb of apiReplys) {
232
- void cb(data, val => replyApi(data, val));
233
- }
234
- }
235
- else if (data.actionId) {
236
- for (const cb of actionReplys) {
237
- void cb(data, val => replyAction(data, val));
238
- }
214
+ if (dispatchLegacyApiHandlers(apiReplys, replyApi, data)) {
215
+ return;
239
216
  }
217
+ dispatchLegacyActionHandlers(actionReplys, replyAction, data);
240
218
  }
241
219
  catch (error) {
242
220
  logger.error({
@@ -247,12 +225,11 @@ const cbpPlatform = (url, options = {
247
225
  }
248
226
  }
249
227
  });
250
- const client = {
228
+ return {
251
229
  send,
252
230
  onactions,
253
231
  onapis
254
232
  };
255
- return client;
256
233
  };
257
234
 
258
235
  export { cbpPlatform };
@@ -1,3 +1,5 @@
1
+ import { logger } from '../common/logger.js';
2
+
1
3
  const definePlatform = (options) => {
2
4
  const platformName = options.name || process.env.platform || 'unknown';
3
5
  const mainProcess = () => {
@@ -0,0 +1,7 @@
1
+ type BaseMap = {
2
+ [key: string]: unknown;
3
+ };
4
+ export declare const createEventValue: <T extends keyof R, R extends BaseMap>(event: {
5
+ value: R[T];
6
+ }) => R[T];
7
+ export {};
@@ -0,0 +1,5 @@
1
+ const createEventValue = (event) => {
2
+ return event.value;
3
+ };
4
+
5
+ export { createEventValue };
@@ -0,0 +1,5 @@
1
+ export * from '../types/index.js';
2
+ export { definePlatform } from './define-platform.js';
3
+ export { cbpPlatform } from './cbp-platform.js';
4
+ export { FormatEvent, wrapEvent } from './event-format.js';
5
+ export { createEventValue } from './event-value.js';
@@ -0,0 +1,5 @@
1
+ export { ActionsEventEnum } from '../types/event/actions.js';
2
+ export { definePlatform } from './define-platform.js';
3
+ export { cbpPlatform } from './cbp-platform.js';
4
+ export { FormatEvent, wrapEvent } from './event-format.js';
5
+ export { createEventValue } from './event-value.js';