@downcity/plugins 1.0.215 → 1.0.233

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 (702) hide show
  1. package/bin/chat/Action.d.ts +51 -51
  2. package/bin/chat/Action.d.ts.map +1 -1
  3. package/bin/chat/Action.js +109 -108
  4. package/bin/chat/Action.js.map +1 -1
  5. package/bin/chat/ChatPlugin.d.ts +7 -7
  6. package/bin/chat/ChatPlugin.d.ts.map +1 -1
  7. package/bin/chat/ChatPlugin.js +4 -4
  8. package/bin/chat/ChatPlugin.js.map +1 -1
  9. package/bin/chat/Index.d.ts +3 -0
  10. package/bin/chat/Index.d.ts.map +1 -1
  11. package/bin/chat/Index.js +1 -0
  12. package/bin/chat/Index.js.map +1 -1
  13. package/bin/chat/PROMPT.direct.d.ts +1 -1
  14. package/bin/chat/PROMPT.direct.d.ts.map +1 -1
  15. package/bin/chat/PROMPT.direct.js +1 -1
  16. package/bin/chat/PROMPT.direct.js.map +1 -1
  17. package/bin/chat/access/ChatAccessActions.js +6 -6
  18. package/bin/chat/access/ChatAccessActions.js.map +1 -1
  19. package/bin/chat/access/ChatAccessRuntime.d.ts +4 -4
  20. package/bin/chat/access/ChatAccessRuntime.d.ts.map +1 -1
  21. package/bin/chat/access/ChatAccessRuntime.js +1 -1
  22. package/bin/chat/access/ChatAccessRuntime.js.map +1 -1
  23. package/bin/chat/access/ChatAccessStore.js +5 -5
  24. package/bin/chat/access/ChatAccessStore.js.map +1 -1
  25. package/bin/chat/channels/BaseChatChannel.d.ts +17 -17
  26. package/bin/chat/channels/BaseChatChannel.d.ts.map +1 -1
  27. package/bin/chat/channels/BaseChatChannel.js +19 -19
  28. package/bin/chat/channels/BaseChatChannel.js.map +1 -1
  29. package/bin/chat/channels/BaseChatChannelQueue.d.ts +6 -6
  30. package/bin/chat/channels/BaseChatChannelQueue.d.ts.map +1 -1
  31. package/bin/chat/channels/BaseChatChannelQueue.js +32 -32
  32. package/bin/chat/channels/BaseChatChannelQueue.js.map +1 -1
  33. package/bin/chat/channels/BaseChatChannelSupport.d.ts +14 -14
  34. package/bin/chat/channels/BaseChatChannelSupport.d.ts.map +1 -1
  35. package/bin/chat/channels/BaseChatChannelSupport.js +13 -13
  36. package/bin/chat/channels/BaseChatChannelSupport.js.map +1 -1
  37. package/bin/chat/channels/RuntimeChannel.d.ts +23 -28
  38. package/bin/chat/channels/RuntimeChannel.d.ts.map +1 -1
  39. package/bin/chat/channels/RuntimeChannel.js +39 -57
  40. package/bin/chat/channels/RuntimeChannel.js.map +1 -1
  41. package/bin/chat/channels/feishu/Feishu.d.ts +7 -7
  42. package/bin/chat/channels/feishu/Feishu.d.ts.map +1 -1
  43. package/bin/chat/channels/feishu/Feishu.js +31 -31
  44. package/bin/chat/channels/feishu/Feishu.js.map +1 -1
  45. package/bin/chat/channels/feishu/FeishuInbound.js +3 -3
  46. package/bin/chat/channels/feishu/FeishuInbound.js.map +1 -1
  47. package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts +10 -10
  48. package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -1
  49. package/bin/chat/channels/feishu/FeishuMessageHandler.js +17 -17
  50. package/bin/chat/channels/feishu/FeishuMessageHandler.js.map +1 -1
  51. package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts +6 -6
  52. package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -1
  53. package/bin/chat/channels/feishu/FeishuPlatformClient.js +9 -9
  54. package/bin/chat/channels/feishu/FeishuPlatformClient.js.map +1 -1
  55. package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts +1 -1
  56. package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts.map +1 -1
  57. package/bin/chat/channels/feishu/FeishuPlatformLookup.js +6 -6
  58. package/bin/chat/channels/feishu/FeishuPlatformLookup.js.map +1 -1
  59. package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts +2 -2
  60. package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts.map +1 -1
  61. package/bin/chat/channels/feishu/FeishuPlatformMessaging.js +7 -7
  62. package/bin/chat/channels/feishu/FeishuPlatformMessaging.js.map +1 -1
  63. package/bin/chat/channels/feishu/InboundAttachment.d.ts +1 -1
  64. package/bin/chat/channels/feishu/InboundAttachment.d.ts.map +1 -1
  65. package/bin/chat/channels/feishu/InboundAttachment.js +5 -5
  66. package/bin/chat/channels/feishu/InboundAttachment.js.map +1 -1
  67. package/bin/chat/channels/feishu/PostMessage.js +8 -8
  68. package/bin/chat/channels/feishu/PostMessage.js.map +1 -1
  69. package/bin/chat/channels/feishu/ReplyContext.d.ts +1 -1
  70. package/bin/chat/channels/feishu/ReplyContext.d.ts.map +1 -1
  71. package/bin/chat/channels/feishu/ReplyContext.js +2 -2
  72. package/bin/chat/channels/feishu/ReplyContext.js.map +1 -1
  73. package/bin/chat/channels/feishu/Shared.js +3 -3
  74. package/bin/chat/channels/feishu/Shared.js.map +1 -1
  75. package/bin/chat/channels/qq/PROMPT.direct.d.ts +1 -1
  76. package/bin/chat/channels/qq/PROMPT.direct.d.ts.map +1 -1
  77. package/bin/chat/channels/qq/PROMPT.direct.js +1 -1
  78. package/bin/chat/channels/qq/PROMPT.direct.js.map +1 -1
  79. package/bin/chat/channels/qq/QQ.d.ts +3 -3
  80. package/bin/chat/channels/qq/QQ.d.ts.map +1 -1
  81. package/bin/chat/channels/qq/QQ.js +20 -20
  82. package/bin/chat/channels/qq/QQ.js.map +1 -1
  83. package/bin/chat/channels/qq/QQEventCapture.d.ts +1 -1
  84. package/bin/chat/channels/qq/QQEventCapture.d.ts.map +1 -1
  85. package/bin/chat/channels/qq/QQEventCapture.js +3 -3
  86. package/bin/chat/channels/qq/QQEventCapture.js.map +1 -1
  87. package/bin/chat/channels/qq/QQGatewayAuth.d.ts +1 -1
  88. package/bin/chat/channels/qq/QQGatewayAuth.d.ts.map +1 -1
  89. package/bin/chat/channels/qq/QQGatewayClient.d.ts +2 -2
  90. package/bin/chat/channels/qq/QQGatewayClient.d.ts.map +1 -1
  91. package/bin/chat/channels/qq/QQGatewayClient.js +11 -11
  92. package/bin/chat/channels/qq/QQGatewayClient.js.map +1 -1
  93. package/bin/chat/channels/qq/QQGatewayConnection.d.ts +1 -1
  94. package/bin/chat/channels/qq/QQGatewayConnection.d.ts.map +1 -1
  95. package/bin/chat/channels/qq/QQGatewaySend.d.ts +2 -2
  96. package/bin/chat/channels/qq/QQGatewaySend.d.ts.map +1 -1
  97. package/bin/chat/channels/qq/QQGatewaySend.js +3 -3
  98. package/bin/chat/channels/qq/QQGatewaySend.js.map +1 -1
  99. package/bin/chat/channels/qq/QQInbound.js +5 -5
  100. package/bin/chat/channels/qq/QQInbound.js.map +1 -1
  101. package/bin/chat/channels/qq/QQInboundDedupe.d.ts +2 -2
  102. package/bin/chat/channels/qq/QQInboundDedupe.d.ts.map +1 -1
  103. package/bin/chat/channels/qq/QQInboundDedupe.js +5 -5
  104. package/bin/chat/channels/qq/QQInboundDedupe.js.map +1 -1
  105. package/bin/chat/channels/qq/QQMessageHandler.d.ts +9 -9
  106. package/bin/chat/channels/qq/QQMessageHandler.d.ts.map +1 -1
  107. package/bin/chat/channels/qq/QQMessageHandler.js +34 -34
  108. package/bin/chat/channels/qq/QQMessageHandler.js.map +1 -1
  109. package/bin/chat/channels/qq/QQSendSupport.js +2 -2
  110. package/bin/chat/channels/qq/QQSendSupport.js.map +1 -1
  111. package/bin/chat/channels/qq/QQSupport.d.ts +5 -5
  112. package/bin/chat/channels/qq/QQSupport.d.ts.map +1 -1
  113. package/bin/chat/channels/qq/QQSupport.js +5 -5
  114. package/bin/chat/channels/qq/QQSupport.js.map +1 -1
  115. package/bin/chat/channels/qq/types/QqChannel.d.ts +1 -1
  116. package/bin/chat/channels/qq/types/QqChannel.d.ts.map +1 -1
  117. package/bin/chat/channels/telegram/ApiClient.d.ts +2 -2
  118. package/bin/chat/channels/telegram/ApiClient.d.ts.map +1 -1
  119. package/bin/chat/channels/telegram/ApiClient.js +6 -6
  120. package/bin/chat/channels/telegram/ApiClient.js.map +1 -1
  121. package/bin/chat/channels/telegram/Bot.d.ts +4 -4
  122. package/bin/chat/channels/telegram/Bot.d.ts.map +1 -1
  123. package/bin/chat/channels/telegram/Bot.js +14 -14
  124. package/bin/chat/channels/telegram/Bot.js.map +1 -1
  125. package/bin/chat/channels/telegram/BotInfo.js +1 -1
  126. package/bin/chat/channels/telegram/BotInfo.js.map +1 -1
  127. package/bin/chat/channels/telegram/ReplyContext.js +3 -3
  128. package/bin/chat/channels/telegram/ReplyContext.js.map +1 -1
  129. package/bin/chat/channels/telegram/Shared.js +3 -3
  130. package/bin/chat/channels/telegram/Shared.js.map +1 -1
  131. package/bin/chat/channels/telegram/StateStore.d.ts +1 -1
  132. package/bin/chat/channels/telegram/StateStore.d.ts.map +1 -1
  133. package/bin/chat/channels/telegram/StateStore.js +2 -2
  134. package/bin/chat/channels/telegram/StateStore.js.map +1 -1
  135. package/bin/chat/channels/telegram/TelegramInbound.d.ts +3 -3
  136. package/bin/chat/channels/telegram/TelegramInbound.d.ts.map +1 -1
  137. package/bin/chat/channels/telegram/TelegramInbound.js +4 -4
  138. package/bin/chat/channels/telegram/TelegramInbound.js.map +1 -1
  139. package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts +8 -8
  140. package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -1
  141. package/bin/chat/channels/telegram/TelegramMessageHandler.js +25 -25
  142. package/bin/chat/channels/telegram/TelegramMessageHandler.js.map +1 -1
  143. package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts +2 -2
  144. package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts.map +1 -1
  145. package/bin/chat/channels/telegram/TelegramPendingUpdates.js +7 -7
  146. package/bin/chat/channels/telegram/TelegramPendingUpdates.js.map +1 -1
  147. package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts +4 -4
  148. package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -1
  149. package/bin/chat/channels/telegram/TelegramPlatformClient.js +7 -7
  150. package/bin/chat/channels/telegram/TelegramPlatformClient.js.map +1 -1
  151. package/bin/chat/config/ChatPluginConfig.d.ts +67 -0
  152. package/bin/chat/config/ChatPluginConfig.d.ts.map +1 -0
  153. package/bin/chat/config/ChatPluginConfig.js +237 -0
  154. package/bin/chat/config/ChatPluginConfig.js.map +1 -0
  155. package/bin/chat/runtime/ChannelContextStore.d.ts +21 -21
  156. package/bin/chat/runtime/ChannelContextStore.d.ts.map +1 -1
  157. package/bin/chat/runtime/ChannelContextStore.js +74 -74
  158. package/bin/chat/runtime/ChannelContextStore.js.map +1 -1
  159. package/bin/chat/runtime/ChatActionExecution.d.ts +23 -23
  160. package/bin/chat/runtime/ChatActionExecution.d.ts.map +1 -1
  161. package/bin/chat/runtime/ChatActionExecution.js +70 -70
  162. package/bin/chat/runtime/ChatActionExecution.js.map +1 -1
  163. package/bin/chat/runtime/ChatActionInput.js +19 -19
  164. package/bin/chat/runtime/ChatActionInput.js.map +1 -1
  165. package/bin/chat/runtime/ChatChannelActions.d.ts +4 -4
  166. package/bin/chat/runtime/ChatChannelActions.d.ts.map +1 -1
  167. package/bin/chat/runtime/ChatChannelConfig.d.ts +4 -4
  168. package/bin/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
  169. package/bin/chat/runtime/ChatChannelConfig.js +9 -9
  170. package/bin/chat/runtime/ChatChannelConfig.js.map +1 -1
  171. package/bin/chat/runtime/ChatChannelCore.d.ts +11 -12
  172. package/bin/chat/runtime/ChatChannelCore.d.ts.map +1 -1
  173. package/bin/chat/runtime/ChatChannelCore.js +5 -17
  174. package/bin/chat/runtime/ChatChannelCore.js.map +1 -1
  175. package/bin/chat/runtime/ChatChannelLifecycle.d.ts +3 -3
  176. package/bin/chat/runtime/ChatChannelLifecycle.d.ts.map +1 -1
  177. package/bin/chat/runtime/ChatChannelLifecycle.js +5 -5
  178. package/bin/chat/runtime/ChatChannelLifecycle.js.map +1 -1
  179. package/bin/chat/runtime/ChatHistoryStore.d.ts +11 -11
  180. package/bin/chat/runtime/ChatHistoryStore.d.ts.map +1 -1
  181. package/bin/chat/runtime/ChatHistoryStore.js +26 -26
  182. package/bin/chat/runtime/ChatHistoryStore.js.map +1 -1
  183. package/bin/chat/runtime/ChatIngressStore.d.ts +4 -4
  184. package/bin/chat/runtime/ChatIngressStore.d.ts.map +1 -1
  185. package/bin/chat/runtime/ChatIngressStore.js +2 -2
  186. package/bin/chat/runtime/ChatIngressStore.js.map +1 -1
  187. package/bin/chat/runtime/ChatMetaStore.d.ts +19 -19
  188. package/bin/chat/runtime/ChatMetaStore.d.ts.map +1 -1
  189. package/bin/chat/runtime/ChatMetaStore.js +27 -27
  190. package/bin/chat/runtime/ChatMetaStore.js.map +1 -1
  191. package/bin/chat/runtime/ChatPluginActionRegistry.d.ts.map +1 -1
  192. package/bin/chat/runtime/ChatPluginActionRegistry.js +53 -59
  193. package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -1
  194. package/bin/chat/runtime/ChatPluginSystem.d.ts +4 -4
  195. package/bin/chat/runtime/ChatPluginSystem.d.ts.map +1 -1
  196. package/bin/chat/runtime/ChatPluginSystem.js +5 -5
  197. package/bin/chat/runtime/ChatPluginSystem.js.map +1 -1
  198. package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts +6 -6
  199. package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts.map +1 -1
  200. package/bin/chat/runtime/ChatQueueReplyDispatch.js +41 -41
  201. package/bin/chat/runtime/ChatQueueReplyDispatch.js.map +1 -1
  202. package/bin/chat/runtime/ChatQueueStore.d.ts +3 -3
  203. package/bin/chat/runtime/ChatQueueStore.d.ts.map +1 -1
  204. package/bin/chat/runtime/ChatQueueStore.js +2 -2
  205. package/bin/chat/runtime/ChatQueueStore.js.map +1 -1
  206. package/bin/chat/runtime/ChatQueueWorker.d.ts +2 -2
  207. package/bin/chat/runtime/ChatQueueWorker.d.ts.map +1 -1
  208. package/bin/chat/runtime/ChatQueueWorker.js +30 -32
  209. package/bin/chat/runtime/ChatQueueWorker.js.map +1 -1
  210. package/bin/chat/runtime/ChatQueueWorkerSupport.d.ts +1 -1
  211. package/bin/chat/runtime/ChatQueueWorkerSupport.js +15 -15
  212. package/bin/chat/runtime/ChatQueueWorkerSupport.js.map +1 -1
  213. package/bin/chat/runtime/ChatSendActionInput.js +51 -51
  214. package/bin/chat/runtime/ChatSendActionInput.js.map +1 -1
  215. package/bin/chat/runtime/ChatSendMetadata.d.ts +1 -1
  216. package/bin/chat/runtime/ChatSendMetadata.js +12 -12
  217. package/bin/chat/runtime/ChatSendMetadata.js.map +1 -1
  218. package/bin/chat/runtime/ChatSendRegistry.d.ts +1 -1
  219. package/bin/chat/runtime/ChatSessionDelete.d.ts +7 -7
  220. package/bin/chat/runtime/ChatSessionDelete.d.ts.map +1 -1
  221. package/bin/chat/runtime/ChatSessionDelete.js +15 -15
  222. package/bin/chat/runtime/ChatSessionDelete.js.map +1 -1
  223. package/bin/chat/runtime/ChatStorage.d.ts +1 -1
  224. package/bin/chat/runtime/ChatStorage.js +3 -3
  225. package/bin/chat/runtime/ChatStorage.js.map +1 -1
  226. package/bin/chat/runtime/ChatkeySend.d.ts +21 -21
  227. package/bin/chat/runtime/ChatkeySend.d.ts.map +1 -1
  228. package/bin/chat/runtime/ChatkeySend.js +33 -33
  229. package/bin/chat/runtime/ChatkeySend.js.map +1 -1
  230. package/bin/chat/runtime/DirectDispatchParser.d.ts +2 -2
  231. package/bin/chat/runtime/DirectDispatchParser.js +20 -20
  232. package/bin/chat/runtime/DirectDispatchParser.js.map +1 -1
  233. package/bin/chat/runtime/EnqueueDispatch.d.ts +3 -3
  234. package/bin/chat/runtime/EnqueueDispatch.d.ts.map +1 -1
  235. package/bin/chat/runtime/InboundAugment.d.ts +3 -3
  236. package/bin/chat/runtime/InboundAugment.d.ts.map +1 -1
  237. package/bin/chat/runtime/InboundAugment.js +6 -6
  238. package/bin/chat/runtime/InboundAugment.js.map +1 -1
  239. package/bin/chat/runtime/QueuedUserMessage.js +5 -5
  240. package/bin/chat/runtime/QueuedUserMessage.js.map +1 -1
  241. package/bin/chat/runtime/ReplyContextFormatter.js +7 -7
  242. package/bin/chat/runtime/ReplyContextFormatter.js.map +1 -1
  243. package/bin/chat/runtime/ReplyDispatch.d.ts +7 -7
  244. package/bin/chat/runtime/ReplyDispatch.d.ts.map +1 -1
  245. package/bin/chat/runtime/ReplyDispatch.js +3 -3
  246. package/bin/chat/runtime/ReplyDispatch.js.map +1 -1
  247. package/bin/chat/runtime/SystemPrompt.d.ts +4 -4
  248. package/bin/chat/runtime/SystemPrompt.d.ts.map +1 -1
  249. package/bin/chat/runtime/SystemPrompt.js +10 -10
  250. package/bin/chat/runtime/SystemPrompt.js.map +1 -1
  251. package/bin/chat/types/ChannelContext.d.ts +11 -11
  252. package/bin/chat/types/ChannelContext.d.ts.map +1 -1
  253. package/bin/chat/types/ChannelContext.js +2 -2
  254. package/bin/chat/types/ChatCommand.d.ts +31 -31
  255. package/bin/chat/types/ChatCommand.d.ts.map +1 -1
  256. package/bin/chat/types/ChatDispatcher.d.ts +3 -3
  257. package/bin/chat/types/ChatDispatcher.d.ts.map +1 -1
  258. package/bin/chat/types/ChatHistory.d.ts +2 -2
  259. package/bin/chat/types/ChatHistory.d.ts.map +1 -1
  260. package/bin/chat/types/ChatMeta.d.ts +4 -4
  261. package/bin/chat/types/ChatMeta.d.ts.map +1 -1
  262. package/bin/chat/types/ChatMeta.js +1 -1
  263. package/bin/chat/types/ChatPlugin.d.ts +9 -9
  264. package/bin/chat/types/ChatPlugin.d.ts.map +1 -1
  265. package/bin/chat/types/ChatPluginActionPayload.d.ts +13 -13
  266. package/bin/chat/types/ChatPluginActionPayload.d.ts.map +1 -1
  267. package/bin/chat/types/ChatPluginOptions.d.ts +6 -6
  268. package/bin/chat/types/ChatPluginOptions.d.ts.map +1 -1
  269. package/bin/chat/types/ChatPluginResource.d.ts +68 -0
  270. package/bin/chat/types/ChatPluginResource.d.ts.map +1 -0
  271. package/bin/chat/types/ChatPluginResource.js +10 -0
  272. package/bin/chat/types/ChatPluginResource.js.map +1 -0
  273. package/bin/chat/types/ChatPromptContext.d.ts +8 -8
  274. package/bin/chat/types/ChatPromptContext.d.ts.map +1 -1
  275. package/bin/chat/types/ChatQueue.d.ts +2 -2
  276. package/bin/chat/types/ChatQueue.d.ts.map +1 -1
  277. package/bin/chat/types/ChatQueueWorker.d.ts +3 -3
  278. package/bin/chat/types/ChatQueueWorker.d.ts.map +1 -1
  279. package/bin/chat/types/ChatRuntimeAccount.d.ts +39 -0
  280. package/bin/chat/types/ChatRuntimeAccount.d.ts.map +1 -0
  281. package/bin/chat/types/ChatRuntimeAccount.js +10 -0
  282. package/bin/chat/types/ChatRuntimeAccount.js.map +1 -0
  283. package/bin/chat/types/DirectDispatch.d.ts +13 -13
  284. package/bin/chat/types/DirectDispatch.d.ts.map +1 -1
  285. package/bin/chat/types/DirectDispatch.js +1 -1
  286. package/bin/chat/types/FeishuInboundAttachment.d.ts +1 -1
  287. package/bin/chat/types/FeishuInboundAttachment.d.ts.map +1 -1
  288. package/bin/chat/types/QqInboundDedupe.d.ts +1 -1
  289. package/bin/chat/types/QqInboundDedupe.d.ts.map +1 -1
  290. package/bin/chat/types/ReplyContext.d.ts +1 -1
  291. package/bin/chat/types/ReplyContext.d.ts.map +1 -1
  292. package/bin/chat.d.ts +4 -3
  293. package/bin/chat.d.ts.map +1 -1
  294. package/bin/chat.js +2 -2
  295. package/bin/chat.js.map +1 -1
  296. package/bin/contact/Action.d.ts +11 -11
  297. package/bin/contact/Action.d.ts.map +1 -1
  298. package/bin/contact/Action.js +27 -27
  299. package/bin/contact/Action.js.map +1 -1
  300. package/bin/contact/ContactPlugin.js +33 -33
  301. package/bin/contact/ContactPlugin.js.map +1 -1
  302. package/bin/contact/runtime/ChatRuntime.d.ts +2 -2
  303. package/bin/contact/runtime/ChatRuntime.d.ts.map +1 -1
  304. package/bin/contact/runtime/ChatRuntime.js +8 -23
  305. package/bin/contact/runtime/ChatRuntime.js.map +1 -1
  306. package/bin/contact/runtime/ContactStore.d.ts +8 -8
  307. package/bin/contact/runtime/ContactStore.d.ts.map +1 -1
  308. package/bin/contact/runtime/ContactStore.js +24 -24
  309. package/bin/contact/runtime/ContactStore.js.map +1 -1
  310. package/bin/contact/runtime/InboxStore.d.ts +6 -6
  311. package/bin/contact/runtime/InboxStore.d.ts.map +1 -1
  312. package/bin/contact/runtime/InboxStore.js +16 -16
  313. package/bin/contact/runtime/InboxStore.js.map +1 -1
  314. package/bin/contact/runtime/LinkApproval.js +17 -17
  315. package/bin/contact/runtime/LinkApproval.js.map +1 -1
  316. package/bin/contact/runtime/LinkCode.d.ts +1 -1
  317. package/bin/contact/runtime/LinkCode.d.ts.map +1 -1
  318. package/bin/contact/runtime/LinkCode.js +6 -6
  319. package/bin/contact/runtime/LinkCode.js.map +1 -1
  320. package/bin/contact/runtime/LinkStore.d.ts +2 -2
  321. package/bin/contact/runtime/LinkStore.d.ts.map +1 -1
  322. package/bin/contact/runtime/LinkStore.js +7 -7
  323. package/bin/contact/runtime/LinkStore.js.map +1 -1
  324. package/bin/contact/runtime/Paths.d.ts +14 -14
  325. package/bin/contact/runtime/Paths.d.ts.map +1 -1
  326. package/bin/contact/runtime/Paths.js +28 -28
  327. package/bin/contact/runtime/Paths.js.map +1 -1
  328. package/bin/contact/runtime/RemoteClient.d.ts +1 -1
  329. package/bin/contact/runtime/RemoteClient.js +18 -18
  330. package/bin/contact/runtime/RemoteClient.js.map +1 -1
  331. package/bin/contact/runtime/ShareBundle.d.ts +3 -3
  332. package/bin/contact/runtime/ShareBundle.d.ts.map +1 -1
  333. package/bin/contact/runtime/ShareBundle.js +5 -5
  334. package/bin/contact/runtime/ShareBundle.js.map +1 -1
  335. package/bin/contact/types/Contact.d.ts +2 -2
  336. package/bin/contact/types/Contact.d.ts.map +1 -1
  337. package/bin/contact/types/ContactApproval.d.ts +2 -2
  338. package/bin/contact/types/ContactApproval.d.ts.map +1 -1
  339. package/bin/contact/types/ContactChat.d.ts +1 -1
  340. package/bin/contact/types/ContactChat.d.ts.map +1 -1
  341. package/bin/contact/types/ContactLink.d.ts +4 -4
  342. package/bin/contact/types/ContactLink.d.ts.map +1 -1
  343. package/bin/image/ImagePlugin.d.ts +3 -3
  344. package/bin/image/ImagePlugin.d.ts.map +1 -1
  345. package/bin/image/ImagePlugin.js +25 -10
  346. package/bin/image/ImagePlugin.js.map +1 -1
  347. package/bin/image/types/ImagePlugin.d.ts +3 -3
  348. package/bin/image/types/ImagePlugin.d.ts.map +1 -1
  349. package/bin/image/types/ImagePlugin.js +1 -1
  350. package/bin/memory/Action.d.ts +7 -7
  351. package/bin/memory/Action.d.ts.map +1 -1
  352. package/bin/memory/Action.js +11 -11
  353. package/bin/memory/Action.js.map +1 -1
  354. package/bin/memory/MemoryPlugin.d.ts +3 -3
  355. package/bin/memory/MemoryPlugin.d.ts.map +1 -1
  356. package/bin/memory/MemoryPlugin.js +21 -21
  357. package/bin/memory/MemoryPlugin.js.map +1 -1
  358. package/bin/memory/runtime/Search.d.ts +3 -3
  359. package/bin/memory/runtime/Search.d.ts.map +1 -1
  360. package/bin/memory/runtime/Search.js +2 -2
  361. package/bin/memory/runtime/Search.js.map +1 -1
  362. package/bin/memory/runtime/Store.d.ts +2 -2
  363. package/bin/memory/runtime/Store.d.ts.map +1 -1
  364. package/bin/memory/runtime/Store.js +1 -1
  365. package/bin/memory/runtime/Store.js.map +1 -1
  366. package/bin/memory/runtime/SystemProvider.d.ts +3 -3
  367. package/bin/memory/runtime/SystemProvider.d.ts.map +1 -1
  368. package/bin/memory/runtime/SystemProvider.js +1 -1
  369. package/bin/memory/runtime/SystemProvider.js.map +1 -1
  370. package/bin/memory/runtime/Writer.d.ts +8 -8
  371. package/bin/memory/runtime/Writer.d.ts.map +1 -1
  372. package/bin/memory/runtime/Writer.js +14 -14
  373. package/bin/memory/runtime/Writer.js.map +1 -1
  374. package/bin/memory/types/Memory.d.ts +3 -3
  375. package/bin/memory/types/Memory.d.ts.map +1 -1
  376. package/bin/skill/Action.d.ts +4 -4
  377. package/bin/skill/Action.d.ts.map +1 -1
  378. package/bin/skill/Action.js +9 -9
  379. package/bin/skill/Action.js.map +1 -1
  380. package/bin/skill/Plugin.js +16 -16
  381. package/bin/skill/Plugin.js.map +1 -1
  382. package/bin/skill/runtime/Discovery.d.ts +2 -2
  383. package/bin/skill/runtime/Discovery.d.ts.map +1 -1
  384. package/bin/skill/runtime/Discovery.js +3 -3
  385. package/bin/skill/runtime/Discovery.js.map +1 -1
  386. package/bin/skill/runtime/Paths.d.ts +1 -1
  387. package/bin/skill/runtime/Paths.d.ts.map +1 -1
  388. package/bin/skill/runtime/Paths.js +6 -6
  389. package/bin/skill/runtime/Paths.js.map +1 -1
  390. package/bin/skill/runtime/Store.d.ts +3 -3
  391. package/bin/skill/runtime/Store.d.ts.map +1 -1
  392. package/bin/skill/runtime/Store.js +19 -19
  393. package/bin/skill/runtime/Store.js.map +1 -1
  394. package/bin/skill/runtime/SystemProvider.d.ts +2 -2
  395. package/bin/skill/runtime/SystemProvider.d.ts.map +1 -1
  396. package/bin/skill/runtime/SystemProvider.js +4 -4
  397. package/bin/skill/runtime/SystemProvider.js.map +1 -1
  398. package/bin/skill/runtime/Types.d.ts +3 -3
  399. package/bin/skill/runtime/Types.d.ts.map +1 -1
  400. package/bin/sound/Plugin.d.ts +5 -5
  401. package/bin/sound/Plugin.d.ts.map +1 -1
  402. package/bin/sound/Plugin.js +23 -11
  403. package/bin/sound/Plugin.js.map +1 -1
  404. package/bin/task/Action.d.ts +10 -10
  405. package/bin/task/Action.d.ts.map +1 -1
  406. package/bin/task/Action.js +31 -31
  407. package/bin/task/Action.js.map +1 -1
  408. package/bin/task/PROMPT.d.ts +1 -1
  409. package/bin/task/PROMPT.d.ts.map +1 -1
  410. package/bin/task/PROMPT.js +1 -1
  411. package/bin/task/PROMPT.js.map +1 -1
  412. package/bin/task/Scheduler.d.ts +2 -2
  413. package/bin/task/Scheduler.d.ts.map +1 -1
  414. package/bin/task/Scheduler.js +8 -8
  415. package/bin/task/Scheduler.js.map +1 -1
  416. package/bin/task/TaskPlugin.d.ts +3 -3
  417. package/bin/task/TaskPlugin.d.ts.map +1 -1
  418. package/bin/task/TaskPlugin.js +23 -20
  419. package/bin/task/TaskPlugin.js.map +1 -1
  420. package/bin/task/runtime/Model.d.ts +2 -2
  421. package/bin/task/runtime/Model.d.ts.map +1 -1
  422. package/bin/task/runtime/Model.js +11 -11
  423. package/bin/task/runtime/Model.js.map +1 -1
  424. package/bin/task/runtime/Paths.d.ts +6 -6
  425. package/bin/task/runtime/Paths.d.ts.map +1 -1
  426. package/bin/task/runtime/Paths.js +11 -11
  427. package/bin/task/runtime/Paths.js.map +1 -1
  428. package/bin/task/runtime/Runner.d.ts +4 -4
  429. package/bin/task/runtime/Runner.d.ts.map +1 -1
  430. package/bin/task/runtime/Runner.js +17 -17
  431. package/bin/task/runtime/Runner.js.map +1 -1
  432. package/bin/task/runtime/Store.d.ts +7 -7
  433. package/bin/task/runtime/Store.d.ts.map +1 -1
  434. package/bin/task/runtime/Store.js +15 -15
  435. package/bin/task/runtime/Store.js.map +1 -1
  436. package/bin/task/runtime/TaskActionExecution.d.ts +12 -12
  437. package/bin/task/runtime/TaskActionExecution.d.ts.map +1 -1
  438. package/bin/task/runtime/TaskActionExecution.js +7 -7
  439. package/bin/task/runtime/TaskActionExecution.js.map +1 -1
  440. package/bin/task/runtime/TaskActionInput.js +10 -10
  441. package/bin/task/runtime/TaskActionInput.js.map +1 -1
  442. package/bin/task/runtime/TaskPluginActionRegistry.js +26 -26
  443. package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -1
  444. package/bin/task/runtime/TaskRunArtifacts.js +4 -4
  445. package/bin/task/runtime/TaskRunArtifacts.js.map +1 -1
  446. package/bin/task/runtime/TaskRunChatDispatch.d.ts +2 -2
  447. package/bin/task/runtime/TaskRunChatDispatch.d.ts.map +1 -1
  448. package/bin/task/runtime/TaskRunChatDispatch.js +7 -7
  449. package/bin/task/runtime/TaskRunChatDispatch.js.map +1 -1
  450. package/bin/task/runtime/TaskRunnerProgress.js +1 -1
  451. package/bin/task/runtime/TaskRunnerProgress.js.map +1 -1
  452. package/bin/task/runtime/TaskRunnerRound.d.ts +7 -7
  453. package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -1
  454. package/bin/task/runtime/TaskRunnerRound.js +34 -38
  455. package/bin/task/runtime/TaskRunnerRound.js.map +1 -1
  456. package/bin/task/runtime/TaskRunnerScript.d.ts +4 -4
  457. package/bin/task/runtime/TaskRunnerScript.d.ts.map +1 -1
  458. package/bin/task/runtime/TaskRunnerScript.js +1 -1
  459. package/bin/task/runtime/TaskRunnerScript.js.map +1 -1
  460. package/bin/task/runtime/TaskRunnerSession.d.ts +8 -8
  461. package/bin/task/runtime/TaskRunnerSession.d.ts.map +1 -1
  462. package/bin/task/runtime/TaskRunnerSession.js +52 -39
  463. package/bin/task/runtime/TaskRunnerSession.js.map +1 -1
  464. package/bin/task/runtime/TaskRunnerTypes.d.ts +5 -5
  465. package/bin/task/runtime/TaskRunnerTypes.d.ts.map +1 -1
  466. package/bin/task/types/Task.d.ts +4 -4
  467. package/bin/task/types/Task.d.ts.map +1 -1
  468. package/bin/task/types/TaskCommand.d.ts +3 -3
  469. package/bin/task/types/TaskCommand.d.ts.map +1 -1
  470. package/bin/web/Plugin.d.ts +2 -2
  471. package/bin/web/Plugin.d.ts.map +1 -1
  472. package/bin/web/Plugin.js +3 -3
  473. package/bin/web/Plugin.js.map +1 -1
  474. package/bin/workboard/Plugin.d.ts.map +1 -1
  475. package/bin/workboard/Plugin.js +6 -7
  476. package/bin/workboard/Plugin.js.map +1 -1
  477. package/bin/workboard/runtime/Collector.d.ts +2 -2
  478. package/bin/workboard/runtime/Collector.d.ts.map +1 -1
  479. package/bin/workboard/runtime/Collector.js +4 -4
  480. package/bin/workboard/runtime/Collector.js.map +1 -1
  481. package/bin/workboard/runtime/Normalizer.d.ts +3 -3
  482. package/bin/workboard/runtime/Normalizer.d.ts.map +1 -1
  483. package/bin/workboard/runtime/Normalizer.js +11 -11
  484. package/bin/workboard/runtime/Normalizer.js.map +1 -1
  485. package/bin/workboard/runtime/SessionSummary.d.ts +5 -5
  486. package/bin/workboard/runtime/SessionSummary.d.ts.map +1 -1
  487. package/bin/workboard/runtime/SessionSummary.js +4 -4
  488. package/bin/workboard/runtime/SessionSummary.js.map +1 -1
  489. package/bin/workboard/runtime/Store.d.ts +5 -5
  490. package/bin/workboard/runtime/Store.d.ts.map +1 -1
  491. package/bin/workboard/runtime/Store.js.map +1 -1
  492. package/bin/workboard/types/Workboard.d.ts +2 -2
  493. package/bin/workboard/types/Workboard.d.ts.map +1 -1
  494. package/bin/workboard/types/Workboard.js +1 -1
  495. package/package.json +3 -3
  496. package/scripts/chat-access.test.mjs +2 -2
  497. package/scripts/chat-channel-config.test.mjs +25 -3
  498. package/scripts/chat-storage.test.mjs +7 -7
  499. package/scripts/skill-plugin.test.mjs +4 -4
  500. package/scripts/sound-plugin.test.mjs +12 -8
  501. package/scripts/web-plugin.test.mjs +4 -4
  502. package/src/chat/Action.ts +154 -153
  503. package/src/chat/ChatPlugin.ts +12 -12
  504. package/src/chat/Index.ts +12 -0
  505. package/src/chat/PROMPT.direct.ts +1 -1
  506. package/src/chat/access/ChatAccessActions.ts +6 -6
  507. package/src/chat/access/ChatAccessRuntime.ts +5 -5
  508. package/src/chat/access/ChatAccessStore.ts +5 -5
  509. package/src/chat/channels/BaseChatChannel.ts +32 -32
  510. package/src/chat/channels/BaseChatChannelQueue.ts +38 -38
  511. package/src/chat/channels/BaseChatChannelSupport.ts +25 -25
  512. package/src/chat/channels/RuntimeChannel.ts +53 -74
  513. package/src/chat/channels/feishu/Feishu.ts +35 -35
  514. package/src/chat/channels/feishu/FeishuInbound.ts +3 -3
  515. package/src/chat/channels/feishu/FeishuMessageHandler.ts +29 -29
  516. package/src/chat/channels/feishu/FeishuPlatformClient.ts +15 -15
  517. package/src/chat/channels/feishu/FeishuPlatformLookup.ts +7 -7
  518. package/src/chat/channels/feishu/FeishuPlatformMessaging.ts +7 -7
  519. package/src/chat/channels/feishu/InboundAttachment.ts +6 -6
  520. package/src/chat/channels/feishu/PostMessage.ts +8 -8
  521. package/src/chat/channels/feishu/ReplyContext.ts +3 -3
  522. package/src/chat/channels/feishu/Shared.ts +3 -3
  523. package/src/chat/channels/qq/PROMPT.direct.ts +1 -1
  524. package/src/chat/channels/qq/QQ.ts +26 -26
  525. package/src/chat/channels/qq/QQEventCapture.ts +3 -3
  526. package/src/chat/channels/qq/QQGatewayAuth.ts +1 -1
  527. package/src/chat/channels/qq/QQGatewayClient.ts +12 -12
  528. package/src/chat/channels/qq/QQGatewayConnection.ts +1 -1
  529. package/src/chat/channels/qq/QQGatewaySend.ts +6 -6
  530. package/src/chat/channels/qq/QQInbound.ts +5 -5
  531. package/src/chat/channels/qq/QQInboundDedupe.ts +6 -6
  532. package/src/chat/channels/qq/QQMessageHandler.ts +43 -43
  533. package/src/chat/channels/qq/QQSendSupport.ts +2 -2
  534. package/src/chat/channels/qq/QQSupport.ts +10 -10
  535. package/src/chat/channels/qq/types/QqChannel.ts +1 -1
  536. package/src/chat/channels/telegram/ApiClient.ts +7 -7
  537. package/src/chat/channels/telegram/Bot.ts +17 -17
  538. package/src/chat/channels/telegram/BotInfo.ts +1 -1
  539. package/src/chat/channels/telegram/ReplyContext.ts +3 -3
  540. package/src/chat/channels/telegram/Shared.ts +3 -3
  541. package/src/chat/channels/telegram/StateStore.ts +2 -2
  542. package/src/chat/channels/telegram/TelegramInbound.ts +4 -4
  543. package/src/chat/channels/telegram/TelegramMessageHandler.ts +35 -35
  544. package/src/chat/channels/telegram/TelegramPendingUpdates.ts +9 -9
  545. package/src/chat/channels/telegram/TelegramPlatformClient.ts +11 -11
  546. package/src/chat/config/ChatPluginConfig.ts +266 -0
  547. package/src/chat/runtime/ChannelContextStore.ts +88 -88
  548. package/src/chat/runtime/ChatActionExecution.ts +87 -87
  549. package/src/chat/runtime/ChatActionInput.ts +19 -19
  550. package/src/chat/runtime/ChatChannelActions.ts +4 -4
  551. package/src/chat/runtime/ChatChannelConfig.ts +14 -14
  552. package/src/chat/runtime/ChatChannelCore.ts +17 -26
  553. package/src/chat/runtime/ChatChannelLifecycle.ts +12 -12
  554. package/src/chat/runtime/ChatHistoryStore.ts +39 -39
  555. package/src/chat/runtime/ChatIngressStore.ts +6 -6
  556. package/src/chat/runtime/ChatMetaStore.ts +37 -37
  557. package/src/chat/runtime/ChatPluginActionRegistry.ts +56 -62
  558. package/src/chat/runtime/ChatPluginSystem.ts +9 -9
  559. package/src/chat/runtime/ChatQueueReplyDispatch.ts +47 -47
  560. package/src/chat/runtime/ChatQueueStore.ts +4 -4
  561. package/src/chat/runtime/ChatQueueWorker.ts +38 -44
  562. package/src/chat/runtime/ChatQueueWorkerSupport.ts +18 -18
  563. package/src/chat/runtime/ChatSendActionInput.ts +53 -53
  564. package/src/chat/runtime/ChatSendMetadata.ts +15 -15
  565. package/src/chat/runtime/ChatSendRegistry.ts +1 -1
  566. package/src/chat/runtime/ChatSessionDelete.ts +19 -19
  567. package/src/chat/runtime/ChatStorage.ts +3 -3
  568. package/src/chat/runtime/ChatkeySend.ts +43 -43
  569. package/src/chat/runtime/DirectDispatchParser.ts +21 -21
  570. package/src/chat/runtime/EnqueueDispatch.ts +3 -3
  571. package/src/chat/runtime/InboundAugment.ts +8 -8
  572. package/src/chat/runtime/QueuedUserMessage.ts +6 -6
  573. package/src/chat/runtime/ReplyContextFormatter.ts +6 -6
  574. package/src/chat/runtime/ReplyDispatch.ts +9 -9
  575. package/src/chat/runtime/SystemPrompt.ts +14 -14
  576. package/src/chat/types/ChannelContext.ts +11 -11
  577. package/src/chat/types/ChatCommand.ts +31 -31
  578. package/src/chat/types/ChatDispatcher.ts +3 -3
  579. package/src/chat/types/ChatHistory.ts +2 -2
  580. package/src/chat/types/ChatMeta.ts +4 -4
  581. package/src/chat/types/ChatPlugin.ts +9 -9
  582. package/src/chat/types/ChatPluginActionPayload.ts +13 -13
  583. package/src/chat/types/ChatPluginOptions.ts +6 -6
  584. package/src/chat/types/ChatPluginResource.ts +95 -0
  585. package/src/chat/types/ChatPromptContext.ts +8 -8
  586. package/src/chat/types/ChatQueue.ts +2 -2
  587. package/src/chat/types/ChatQueueWorker.ts +3 -3
  588. package/src/chat/types/ChatRuntimeAccount.ts +52 -0
  589. package/src/chat/types/DirectDispatch.ts +13 -13
  590. package/src/chat/types/FeishuInboundAttachment.ts +1 -1
  591. package/src/chat/types/QqInboundDedupe.ts +1 -1
  592. package/src/chat/types/ReplyContext.ts +1 -1
  593. package/src/chat.ts +13 -3
  594. package/src/contact/Action.ts +40 -40
  595. package/src/contact/ContactPlugin.ts +49 -49
  596. package/src/contact/runtime/ChatRuntime.ts +10 -26
  597. package/src/contact/runtime/ContactStore.ts +24 -24
  598. package/src/contact/runtime/InboxStore.ts +16 -16
  599. package/src/contact/runtime/LinkApproval.ts +19 -19
  600. package/src/contact/runtime/LinkCode.ts +7 -7
  601. package/src/contact/runtime/LinkStore.ts +7 -7
  602. package/src/contact/runtime/Paths.ts +28 -28
  603. package/src/contact/runtime/RemoteClient.ts +19 -19
  604. package/src/contact/runtime/ShareBundle.ts +8 -8
  605. package/src/contact/types/Contact.ts +2 -2
  606. package/src/contact/types/ContactApproval.ts +2 -2
  607. package/src/contact/types/ContactChat.ts +1 -1
  608. package/src/contact/types/ContactLink.ts +4 -4
  609. package/src/image/ImagePlugin.ts +32 -16
  610. package/src/image/types/ImagePlugin.ts +3 -3
  611. package/src/memory/Action.ts +18 -18
  612. package/src/memory/MemoryPlugin.ts +25 -25
  613. package/src/memory/runtime/Search.ts +6 -6
  614. package/src/memory/runtime/Store.ts +3 -3
  615. package/src/memory/runtime/SystemProvider.ts +4 -4
  616. package/src/memory/runtime/Writer.ts +24 -24
  617. package/src/memory/types/Memory.ts +3 -3
  618. package/src/skill/Action.ts +10 -10
  619. package/src/skill/Plugin.ts +16 -16
  620. package/src/skill/runtime/Discovery.ts +3 -3
  621. package/src/skill/runtime/Paths.ts +6 -6
  622. package/src/skill/runtime/Store.ts +19 -19
  623. package/src/skill/runtime/SystemProvider.ts +5 -5
  624. package/src/skill/runtime/Types.ts +3 -3
  625. package/src/sound/Plugin.ts +31 -18
  626. package/src/task/Action.ts +40 -40
  627. package/src/task/PROMPT.ts +1 -1
  628. package/src/task/Scheduler.ts +10 -10
  629. package/src/task/TaskPlugin.ts +32 -30
  630. package/src/task/runtime/Model.ts +12 -12
  631. package/src/task/runtime/Paths.ts +11 -11
  632. package/src/task/runtime/Runner.ts +21 -21
  633. package/src/task/runtime/Store.ts +21 -21
  634. package/src/task/runtime/TaskActionExecution.ts +19 -19
  635. package/src/task/runtime/TaskActionInput.ts +10 -10
  636. package/src/task/runtime/TaskPluginActionRegistry.ts +27 -27
  637. package/src/task/runtime/TaskRunArtifacts.ts +4 -4
  638. package/src/task/runtime/TaskRunChatDispatch.ts +9 -9
  639. package/src/task/runtime/TaskRunnerProgress.ts +1 -1
  640. package/src/task/runtime/TaskRunnerRound.ts +47 -42
  641. package/src/task/runtime/TaskRunnerScript.ts +5 -5
  642. package/src/task/runtime/TaskRunnerSession.ts +58 -46
  643. package/src/task/runtime/TaskRunnerTypes.ts +5 -5
  644. package/src/task/types/Task.ts +4 -4
  645. package/src/task/types/TaskCommand.ts +3 -3
  646. package/src/web/Plugin.ts +5 -5
  647. package/src/workboard/Plugin.ts +8 -9
  648. package/src/workboard/runtime/Collector.ts +6 -6
  649. package/src/workboard/runtime/Normalizer.ts +14 -14
  650. package/src/workboard/runtime/SessionSummary.ts +9 -9
  651. package/src/workboard/runtime/Store.ts +6 -6
  652. package/src/workboard/types/Workboard.ts +2 -2
  653. package/bin/chat/accounts/ChannelAccountManager.d.ts +0 -61
  654. package/bin/chat/accounts/ChannelAccountManager.d.ts.map +0 -1
  655. package/bin/chat/accounts/ChannelAccountManager.js +0 -264
  656. package/bin/chat/accounts/ChannelAccountManager.js.map +0 -1
  657. package/bin/chat/accounts/Crypto.d.ts +0 -20
  658. package/bin/chat/accounts/Crypto.d.ts.map +0 -1
  659. package/bin/chat/accounts/Crypto.js +0 -75
  660. package/bin/chat/accounts/Crypto.js.map +0 -1
  661. package/bin/chat/accounts/Store.d.ts +0 -38
  662. package/bin/chat/accounts/Store.d.ts.map +0 -1
  663. package/bin/chat/accounts/Store.js +0 -220
  664. package/bin/chat/accounts/Store.js.map +0 -1
  665. package/bin/chat/channels/Configuration.d.ts +0 -27
  666. package/bin/chat/channels/Configuration.d.ts.map +0 -1
  667. package/bin/chat/channels/Configuration.js +0 -19
  668. package/bin/chat/channels/Configuration.js.map +0 -1
  669. package/bin/chat/channels/ConfigurationRegistry.d.ts +0 -18
  670. package/bin/chat/channels/ConfigurationRegistry.d.ts.map +0 -1
  671. package/bin/chat/channels/ConfigurationRegistry.js +0 -31
  672. package/bin/chat/channels/ConfigurationRegistry.js.map +0 -1
  673. package/bin/chat/channels/feishu/Configuration.d.ts +0 -17
  674. package/bin/chat/channels/feishu/Configuration.d.ts.map +0 -1
  675. package/bin/chat/channels/feishu/Configuration.js +0 -59
  676. package/bin/chat/channels/feishu/Configuration.js.map +0 -1
  677. package/bin/chat/channels/qq/Configuration.d.ts +0 -17
  678. package/bin/chat/channels/qq/Configuration.d.ts.map +0 -1
  679. package/bin/chat/channels/qq/Configuration.js +0 -59
  680. package/bin/chat/channels/qq/Configuration.js.map +0 -1
  681. package/bin/chat/channels/telegram/Configuration.d.ts +0 -17
  682. package/bin/chat/channels/telegram/Configuration.d.ts.map +0 -1
  683. package/bin/chat/channels/telegram/Configuration.js +0 -59
  684. package/bin/chat/channels/telegram/Configuration.js.map +0 -1
  685. package/bin/chat/types/ChannelAccount.d.ts +0 -226
  686. package/bin/chat/types/ChannelAccount.d.ts.map +0 -1
  687. package/bin/chat/types/ChannelAccount.js +0 -9
  688. package/bin/chat/types/ChannelAccount.js.map +0 -1
  689. package/bin/chat/types/ChannelConfiguration.d.ts +0 -146
  690. package/bin/chat/types/ChannelConfiguration.d.ts.map +0 -1
  691. package/bin/chat/types/ChannelConfiguration.js +0 -9
  692. package/bin/chat/types/ChannelConfiguration.js.map +0 -1
  693. package/src/chat/accounts/ChannelAccountManager.ts +0 -314
  694. package/src/chat/accounts/Crypto.ts +0 -83
  695. package/src/chat/accounts/Store.ts +0 -287
  696. package/src/chat/channels/Configuration.ts +0 -35
  697. package/src/chat/channels/ConfigurationRegistry.ts +0 -43
  698. package/src/chat/channels/feishu/Configuration.ts +0 -65
  699. package/src/chat/channels/qq/Configuration.ts +0 -64
  700. package/src/chat/channels/telegram/Configuration.ts +0 -65
  701. package/src/chat/types/ChannelAccount.ts +0 -232
  702. package/src/chat/types/ChannelConfiguration.ts +0 -160
@@ -2,11 +2,11 @@
2
2
  * Chat command services.
3
3
  *
4
4
  * 关键点(中文)
5
- * - chat 语义(chatKeysessionId 映射)统一收口在本模块
5
+ * - chat 语义(chat_keysession_id 映射)统一收口在本模块
6
6
  * - Session 运行上下文由 action 入口显式传入
7
7
  */
8
- import type { AgentContext } from "@downcity/agent";
9
- import type { PluginRunContext } from "@downcity/agent";
8
+ import type { PluginContext } from "@downcity/agent";
9
+ import type { PluginExecutionContext } from "@downcity/agent";
10
10
  import type { ChatDispatchAction } from "./types/ChatDispatcher.js";
11
11
  import type { ChatSessionSnapshot, ChatDeleteResponse, ChatReactResponse, ChatSendResponse } from "./types/ChatCommand.js";
12
12
  /**
@@ -14,40 +14,40 @@ import type { ChatSessionSnapshot, ChatDeleteResponse, ChatReactResponse, ChatSe
14
14
  *
15
15
  * 优先级(中文)
16
16
  * 1) 显式参数
17
- * 2) 显式 PluginRunContext
17
+ * 2) 显式 PluginExecutionContext
18
18
  * 3) 环境变量回退
19
19
  */
20
20
  export declare function resolveChatSessionSnapshot(input?: {
21
- sessionId?: string;
22
- chatKey?: string;
23
- context?: AgentContext;
24
- run_context?: PluginRunContext;
21
+ session_id?: string;
22
+ chat_key?: string;
23
+ context?: PluginContext;
24
+ execution_context?: PluginExecutionContext;
25
25
  }): ChatSessionSnapshot;
26
26
  /**
27
- * 将 sessionId 映射为可发送的 chatKey
27
+ * 将 session_id 映射为可发送的 chat_key
28
28
  *
29
29
  * 关键点(中文)
30
- * - 当前实现下:chat plugin runtime 内部把 sessionId 视作可发送 chatKey
31
- * - 不再依赖字符串规则推导(sessionId 可为随机值)。
30
+ * - 当前实现下:chat plugin runtime 内部把 session_id 视作可发送 chat_key
31
+ * - 不再依赖字符串规则推导(session_id 可为随机值)。
32
32
  */
33
- export declare function mapSessionIdToChatKey(sessionId?: string): string | undefined;
33
+ export declare function mapSessionIdToChatKey(session_id?: string): string | undefined;
34
34
  /**
35
- * 提取最终 sessionId
35
+ * 提取最终 session_id
36
36
  */
37
- export declare function resolveSessionId(input?: {
38
- sessionId?: string;
39
- chatKey?: string;
40
- context?: AgentContext;
41
- run_context?: PluginRunContext;
37
+ export declare function resolve_session_id(input?: {
38
+ session_id?: string;
39
+ chat_key?: string;
40
+ context?: PluginContext;
41
+ execution_context?: PluginExecutionContext;
42
42
  }): string | undefined;
43
43
  /**
44
- * 提取最终 chatKey(用于发送路径)。
44
+ * 提取最终 chat_key(用于发送路径)。
45
45
  */
46
46
  export declare function resolveChatKey(input?: {
47
- chatKey?: string;
48
- sessionId?: string;
49
- context?: AgentContext;
50
- run_context?: PluginRunContext;
47
+ chat_key?: string;
48
+ session_id?: string;
49
+ context?: PluginContext;
50
+ execution_context?: PluginExecutionContext;
51
51
  }): string | undefined;
52
52
  /**
53
53
  * 规范化 `chat send` 文本。
@@ -58,18 +58,18 @@ export declare function resolveChatKey(input?: {
58
58
  */
59
59
  export declare function normalizeChatSendText(raw: string): string;
60
60
  /**
61
- * 按 chatKey 发送文本。
61
+ * 按 chat_key 发送文本。
62
62
  *
63
63
  * 关键点(中文)
64
64
  * - chat plugin runtime 不关心具体平台;由 runtime sender 做 channel 分发。
65
65
  * - 返回统一结构,便于上层链路做可观测与错误汇总。
66
66
  */
67
67
  export declare function sendChatTextByChatKey(params: {
68
- context: AgentContext;
69
- chatKey: string;
68
+ context: PluginContext;
69
+ chat_key: string;
70
70
  text: string;
71
- delayMs?: number;
72
- sendAtMs?: number;
71
+ delay_ms?: number;
72
+ send_at_ms?: number;
73
73
  /**
74
74
  * 延迟发送是否异步调度(不阻塞当前调用)。
75
75
  *
@@ -78,54 +78,54 @@ export declare function sendChatTextByChatKey(params: {
78
78
  * - 默认 false,保持 CLI/API 的阻塞行为不变。
79
79
  */
80
80
  nonBlockingDelay?: boolean;
81
- replyToMessage?: boolean;
82
- messageId?: string;
83
- run_context?: PluginRunContext;
81
+ reply_to_message?: boolean;
82
+ message_id?: string;
83
+ execution_context?: PluginExecutionContext;
84
84
  }): Promise<ChatSendResponse>;
85
85
  /**
86
- * 按 chatKey 发送平台动作(typing/react)。
86
+ * 按 chat_key 发送平台动作(typing/react)。
87
87
  *
88
88
  * 关键点(中文)
89
- * - 动作分发与文本发送复用同一 chatKey 解析与 channel dispatcher。
89
+ * - 动作分发与文本发送复用同一 chat_key 解析与 channel dispatcher。
90
90
  */
91
91
  export declare function sendChatActionByChatKey(params: {
92
- context: AgentContext;
93
- chatKey: string;
92
+ context: PluginContext;
93
+ chat_key: string;
94
94
  action: ChatDispatchAction;
95
- messageId?: string;
95
+ message_id?: string;
96
96
  reactionEmoji?: string;
97
97
  reactionIsBig?: boolean;
98
98
  }): Promise<ChatReactResponse>;
99
99
  /**
100
- * 按 sessionId 发送文本。
100
+ * 按 session_id 发送文本。
101
101
  *
102
102
  * 关键点(中文)
103
- * - sessionId -> chatKey 映射关系只在 chat plugin runtime 内部维护。
103
+ * - session_id -> chat_key 映射关系只在 chat plugin runtime 内部维护。
104
104
  */
105
105
  export declare function sendChatTextBySessionId(params: {
106
- context: AgentContext;
107
- sessionId: string;
106
+ context: PluginContext;
107
+ session_id: string;
108
108
  text: string;
109
- delayMs?: number;
110
- sendAtMs?: number;
111
- replyToMessage?: boolean;
112
- messageId?: string;
109
+ delay_ms?: number;
110
+ send_at_ms?: number;
111
+ reply_to_message?: boolean;
112
+ message_id?: string;
113
113
  }): Promise<{
114
114
  success: boolean;
115
- sessionId: string;
115
+ session_id: string;
116
116
  error?: string;
117
117
  }>;
118
118
  /**
119
- * 按 chatKey/sessionId 彻底删除 chat 会话。
119
+ * 按 chat_key/session_id 彻底删除 chat 会话。
120
120
  *
121
121
  * 关键点(中文)
122
- * - chatKeysessionId 在 chat plugin runtime 内部等价使用。
122
+ * - chat_keysession_id 在 chat plugin runtime 内部等价使用。
123
123
  * - 删除包含:路由映射 + chat 审计目录 + session 目录 + 渠道状态清理。
124
124
  */
125
125
  export declare function deleteChatByChatKey(params: {
126
- context: AgentContext;
127
- chatKey?: string;
128
- sessionId?: string;
129
- run_context?: PluginRunContext;
126
+ context: PluginContext;
127
+ chat_key?: string;
128
+ session_id?: string;
129
+ execution_context?: PluginExecutionContext;
130
130
  }): Promise<ChatDeleteResponse>;
131
131
  //# sourceMappingURL=Action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/chat/Action.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AA2BhC;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,CAAC,EAAE;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,WAAW,CAAC,EAAE,gBAAgB,CAAC;C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本模块
5
+ * - chat 语义(chat_keysession_id 映射)统一收口在本模块
6
6
  * - Session 运行上下文由 action 入口显式传入
7
7
  */
8
8
  import { sendActionByChatKey, sendTextByChatKey, } from "./runtime/ChatkeySend.js";
@@ -37,15 +37,16 @@ function readEnvNumber(name) {
37
37
  *
38
38
  * 优先级(中文)
39
39
  * 1) 显式参数
40
- * 2) 显式 PluginRunContext
40
+ * 2) 显式 PluginExecutionContext
41
41
  * 3) 环境变量回退
42
42
  */
43
43
  export function resolveChatSessionSnapshot(input) {
44
- const run_context = input?.run_context;
45
- const explicitSessionId = String(input?.sessionId || "").trim();
46
- const explicitChatKey = String(input?.chatKey || "").trim();
47
- const requestSessionId = typeof run_context?.sessionId === "string" && run_context.sessionId.trim()
48
- ? run_context.sessionId.trim()
44
+ const execution_context = input?.execution_context;
45
+ const explicitSessionId = String(input?.session_id || "").trim();
46
+ const explicitChatKey = String(input?.chat_key || "").trim();
47
+ const requestSessionId = typeof execution_context?.session_id === "string" &&
48
+ execution_context.session_id.trim()
49
+ ? execution_context.session_id.trim()
49
50
  : undefined;
50
51
  const envSessionId = readEnvString("DC_SESSION_ID");
51
52
  const envChatKey = readEnvString("DC_CTX_CHAT_KEY");
@@ -55,75 +56,75 @@ export function resolveChatSessionSnapshot(input) {
55
56
  readEnvNumber("DC_CTX_MESSAGE_THREAD_ID");
56
57
  const chatType = readEnvString("DC_CTX_TARGET_TYPE") ||
57
58
  readEnvString("DC_CTX_CHAT_TYPE");
58
- const userId = readEnvString("DC_CTX_ACTOR_ID") ||
59
+ const user_id = readEnvString("DC_CTX_ACTOR_ID") ||
59
60
  readEnvString("DC_CTX_USER_ID");
60
- const messageId = readEnvString("DC_CTX_MESSAGE_ID");
61
- const sessionId = explicitSessionId ||
61
+ const message_id = readEnvString("DC_CTX_MESSAGE_ID");
62
+ const session_id = explicitSessionId ||
62
63
  requestSessionId ||
63
64
  envSessionId ||
64
65
  explicitChatKey ||
65
66
  envChatKey;
66
- const chatKey = explicitChatKey ||
67
- mapSessionIdToChatKey(sessionId) ||
67
+ const chat_key = explicitChatKey ||
68
+ mapSessionIdToChatKey(session_id) ||
68
69
  envChatKey;
69
70
  const snapshot = {
70
- ...(sessionId ? { sessionId } : {}),
71
- ...(chatKey ? { chatKey } : {}),
71
+ ...(session_id ? { session_id } : {}),
72
+ ...(chat_key ? { chat_key } : {}),
72
73
  channel,
73
74
  chatId,
74
75
  messageThreadId,
75
76
  chatType,
76
- userId,
77
- messageId,
77
+ user_id,
78
+ message_id,
78
79
  };
79
80
  return snapshot;
80
81
  }
81
82
  /**
82
- * 将 sessionId 映射为可发送的 chatKey
83
+ * 将 session_id 映射为可发送的 chat_key
83
84
  *
84
85
  * 关键点(中文)
85
- * - 当前实现下:chat plugin runtime 内部把 sessionId 视作可发送 chatKey
86
- * - 不再依赖字符串规则推导(sessionId 可为随机值)。
86
+ * - 当前实现下:chat plugin runtime 内部把 session_id 视作可发送 chat_key
87
+ * - 不再依赖字符串规则推导(session_id 可为随机值)。
87
88
  */
88
- export function mapSessionIdToChatKey(sessionId) {
89
- const key = String(sessionId || "").trim();
89
+ export function mapSessionIdToChatKey(session_id) {
90
+ const key = String(session_id || "").trim();
90
91
  if (!key)
91
92
  return undefined;
92
93
  return key;
93
94
  }
94
95
  /**
95
- * 提取最终 sessionId
96
+ * 提取最终 session_id
96
97
  */
97
- export function resolveSessionId(input) {
98
+ export function resolve_session_id(input) {
98
99
  const snapshot = resolveChatSessionSnapshot({
99
- sessionId: input?.sessionId,
100
- chatKey: input?.chatKey,
100
+ session_id: input?.session_id,
101
+ chat_key: input?.chat_key,
101
102
  context: input?.context,
102
- run_context: input?.run_context,
103
+ execution_context: input?.execution_context,
103
104
  });
104
- const key = String(snapshot.sessionId || "").trim();
105
+ const key = String(snapshot.session_id || "").trim();
105
106
  return key ? key : undefined;
106
107
  }
107
108
  /**
108
- * 提取最终 chatKey(用于发送路径)。
109
+ * 提取最终 chat_key(用于发送路径)。
109
110
  */
110
111
  export function resolveChatKey(input) {
111
112
  const snapshot = resolveChatSessionSnapshot({
112
- chatKey: input?.chatKey,
113
- sessionId: input?.sessionId,
113
+ chat_key: input?.chat_key,
114
+ session_id: input?.session_id,
114
115
  context: input?.context,
115
- run_context: input?.run_context,
116
+ execution_context: input?.execution_context,
116
117
  });
117
- const key = String(snapshot.chatKey || "").trim();
118
+ const key = String(snapshot.chat_key || "").trim();
118
119
  return key ? key : undefined;
119
120
  }
120
121
  /**
121
- * 解析当前发送应绑定的 reply messageId
122
+ * 解析当前发送应绑定的 reply message_id
122
123
  *
123
124
  * 关键点(中文)
124
- * - 只有显式 reply 且未手动传入 messageId 时才尝试补全。
125
- * - 仅在目标 chatKey 与当前显式请求上下文一致时,才复用 `DC_CTX_MESSAGE_ID`。
126
- * - 这样可把一次 run 固定到触发它的那条消息,避免处理中被后续新消息覆盖。
125
+ * - 只有显式 reply 且未手动传入 message_id 时才尝试补全。
126
+ * - 仅在目标 chat_key 与当前显式请求上下文一致时,才复用 `DC_CTX_MESSAGE_ID`。
127
+ * - 这样可把一次处理固定到触发它的那条消息,避免处理中被后续新消息覆盖。
127
128
  */
128
129
  function resolveReplyMessageIdForChatSend(params) {
129
130
  const explicitMessageId = typeof params.explicitMessageId === "string" && params.explicitMessageId.trim()
@@ -131,17 +132,17 @@ function resolveReplyMessageIdForChatSend(params) {
131
132
  : undefined;
132
133
  if (explicitMessageId)
133
134
  return explicitMessageId;
134
- if (params.replyToMessage !== true)
135
+ if (params.reply_to_message !== true)
135
136
  return undefined;
136
137
  const snapshot = resolveChatSessionSnapshot({
137
138
  context: params.context,
138
- run_context: params.run_context,
139
+ execution_context: params.execution_context,
139
140
  });
140
- const snapshotChatKey = String(snapshot.chatKey || "").trim();
141
- const snapshotMessageId = String(snapshot.messageId || "").trim();
141
+ const snapshotChatKey = String(snapshot.chat_key || "").trim();
142
+ const snapshotMessageId = String(snapshot.message_id || "").trim();
142
143
  if (!snapshotChatKey || !snapshotMessageId)
143
144
  return undefined;
144
- return snapshotChatKey === params.chatKey ? snapshotMessageId : undefined;
145
+ return snapshotChatKey === params.chat_key ? snapshotMessageId : undefined;
145
146
  }
146
147
  /**
147
148
  * 规范化 `chat send` 文本。
@@ -170,13 +171,13 @@ export function normalizeChatSendText(raw) {
170
171
  * 发送前延迟。
171
172
  *
172
173
  * 关键点(中文)
173
- * - 支持延迟毫秒(delayMs)或绝对时间(sendAtMs
174
+ * - 支持延迟毫秒(delay_ms)或绝对时间(send_at_ms
174
175
  * - 超长等待按分片 setTimeout,避免超出 Node 单次定时器上限
175
176
  */
176
177
  function resolveTargetWaitMs(params) {
177
- const delayMs = params.delayMs;
178
- const sendAtMs = params.sendAtMs;
179
- const rawWaitMs = typeof sendAtMs === "number" ? Math.max(0, sendAtMs - Date.now()) : delayMs;
178
+ const delay_ms = params.delay_ms;
179
+ const send_at_ms = params.send_at_ms;
180
+ const rawWaitMs = typeof send_at_ms === "number" ? Math.max(0, send_at_ms - Date.now()) : delay_ms;
180
181
  if (!Number.isFinite(rawWaitMs) || Number.isNaN(rawWaitMs) || rawWaitMs <= 0)
181
182
  return 0;
182
183
  return Math.trunc(rawWaitMs);
@@ -198,43 +199,43 @@ async function waitBeforeSend(params) {
198
199
  await waitByTimeoutChunks(resolveTargetWaitMs(params));
199
200
  }
200
201
  /**
201
- * 按 chatKey 发送文本。
202
+ * 按 chat_key 发送文本。
202
203
  *
203
204
  * 关键点(中文)
204
205
  * - chat plugin runtime 不关心具体平台;由 runtime sender 做 channel 分发。
205
206
  * - 返回统一结构,便于上层链路做可观测与错误汇总。
206
207
  */
207
208
  export async function sendChatTextByChatKey(params) {
208
- const chatKey = String(params.chatKey || "").trim();
209
+ const chat_key = String(params.chat_key || "").trim();
209
210
  const text = normalizeChatSendText(String(params.text ?? ""));
210
- const delayMs = typeof params.delayMs === "number" && Number.isFinite(params.delayMs)
211
- ? Math.max(0, Math.trunc(params.delayMs))
211
+ const delay_ms = typeof params.delay_ms === "number" && Number.isFinite(params.delay_ms)
212
+ ? Math.max(0, Math.trunc(params.delay_ms))
212
213
  : 0;
213
- const sendAtMs = typeof params.sendAtMs === "number" && Number.isFinite(params.sendAtMs)
214
- ? Math.max(0, Math.trunc(params.sendAtMs))
214
+ const send_at_ms = typeof params.send_at_ms === "number" && Number.isFinite(params.send_at_ms)
215
+ ? Math.max(0, Math.trunc(params.send_at_ms))
215
216
  : undefined;
216
- if (!chatKey) {
217
+ if (!chat_key) {
217
218
  return {
218
219
  success: false,
219
- error: "Missing chatKey",
220
+ error: "Missing chat_key",
220
221
  };
221
222
  }
222
- if (delayMs > 0 && typeof sendAtMs === "number") {
223
+ if (delay_ms > 0 && typeof send_at_ms === "number") {
223
224
  return {
224
225
  success: false,
225
- chatKey,
226
- error: "delayMs and sendAtMs cannot be used together",
226
+ chat_key,
227
+ error: "delay_ms and send_at_ms cannot be used together",
227
228
  };
228
229
  }
229
- const replyToMessage = params.replyToMessage === true;
230
- const messageId = resolveReplyMessageIdForChatSend({
230
+ const reply_to_message = params.reply_to_message === true;
231
+ const message_id = resolveReplyMessageIdForChatSend({
231
232
  context: params.context,
232
- chatKey,
233
- replyToMessage,
234
- explicitMessageId: params.messageId,
235
- run_context: params.run_context,
233
+ chat_key,
234
+ reply_to_message,
235
+ explicitMessageId: params.message_id,
236
+ execution_context: params.execution_context,
236
237
  });
237
- const targetWaitMs = resolveTargetWaitMs({ delayMs, sendAtMs });
238
+ const targetWaitMs = resolveTargetWaitMs({ delay_ms, send_at_ms });
238
239
  if (params.nonBlockingDelay === true && targetWaitMs > 0) {
239
240
  // 关键点(中文):异步调度延迟发送,让调用方可立即结束当前 run。
240
241
  void (async () => {
@@ -242,134 +243,134 @@ export async function sendChatTextByChatKey(params) {
242
243
  await waitByTimeoutChunks(targetWaitMs);
243
244
  const delayed = await sendTextByChatKey({
244
245
  context: params.context,
245
- chatKey,
246
+ chat_key,
246
247
  text,
247
- replyToMessage,
248
- ...(messageId ? { messageId } : {}),
248
+ reply_to_message,
249
+ ...(message_id ? { message_id } : {}),
249
250
  });
250
251
  if (!delayed.success) {
251
252
  params.context.logger.warn("Delayed chat send failed", {
252
- chatKey,
253
+ chat_key,
253
254
  error: delayed.error || "chat send failed",
254
255
  });
255
256
  }
256
257
  }
257
258
  catch (error) {
258
259
  params.context.logger.warn("Delayed chat send failed", {
259
- chatKey,
260
+ chat_key,
260
261
  error: String(error),
261
262
  });
262
263
  }
263
264
  })();
264
265
  return {
265
266
  success: true,
266
- chatKey,
267
+ chat_key,
267
268
  };
268
269
  }
269
- await waitBeforeSend({ delayMs, sendAtMs });
270
+ await waitBeforeSend({ delay_ms, send_at_ms });
270
271
  const result = await sendTextByChatKey({
271
272
  context: params.context,
272
- chatKey,
273
+ chat_key,
273
274
  text,
274
- replyToMessage,
275
- ...(messageId ? { messageId } : {}),
275
+ reply_to_message,
276
+ ...(message_id ? { message_id } : {}),
276
277
  });
277
278
  return {
278
279
  success: Boolean(result.success),
279
- chatKey,
280
+ chat_key,
280
281
  ...(result.success ? {} : { error: result.error || "chat send failed" }),
281
282
  };
282
283
  }
283
284
  /**
284
- * 按 chatKey 发送平台动作(typing/react)。
285
+ * 按 chat_key 发送平台动作(typing/react)。
285
286
  *
286
287
  * 关键点(中文)
287
- * - 动作分发与文本发送复用同一 chatKey 解析与 channel dispatcher。
288
+ * - 动作分发与文本发送复用同一 chat_key 解析与 channel dispatcher。
288
289
  */
289
290
  export async function sendChatActionByChatKey(params) {
290
- const chatKey = String(params.chatKey || "").trim();
291
- if (!chatKey) {
291
+ const chat_key = String(params.chat_key || "").trim();
292
+ if (!chat_key) {
292
293
  return {
293
294
  success: false,
294
- error: "Missing chatKey",
295
+ error: "Missing chat_key",
295
296
  };
296
297
  }
297
298
  const result = await sendActionByChatKey({
298
299
  context: params.context,
299
- chatKey,
300
+ chat_key,
300
301
  action: params.action,
301
- messageId: params.messageId,
302
+ message_id: params.message_id,
302
303
  reactionEmoji: params.reactionEmoji,
303
304
  reactionIsBig: params.reactionIsBig,
304
305
  });
305
- const messageId = String(params.messageId || "").trim();
306
+ const message_id = String(params.message_id || "").trim();
306
307
  return {
307
308
  success: Boolean(result.success),
308
- chatKey,
309
- ...(messageId ? { messageId } : {}),
309
+ chat_key,
310
+ ...(message_id ? { message_id } : {}),
310
311
  ...(result.success ? {} : { error: result.error || "chat action failed" }),
311
312
  };
312
313
  }
313
314
  /**
314
- * 按 sessionId 发送文本。
315
+ * 按 session_id 发送文本。
315
316
  *
316
317
  * 关键点(中文)
317
- * - sessionId -> chatKey 映射关系只在 chat plugin runtime 内部维护。
318
+ * - session_id -> chat_key 映射关系只在 chat plugin runtime 内部维护。
318
319
  */
319
320
  export async function sendChatTextBySessionId(params) {
320
- const sessionId = String(params.sessionId || "").trim();
321
- if (!sessionId) {
321
+ const session_id = String(params.session_id || "").trim();
322
+ if (!session_id) {
322
323
  return {
323
324
  success: false,
324
- sessionId: "",
325
- error: "Missing sessionId",
325
+ session_id: "",
326
+ error: "Missing session_id",
326
327
  };
327
328
  }
328
329
  const result = await sendChatTextByChatKey({
329
330
  context: params.context,
330
- chatKey: sessionId,
331
+ chat_key: session_id,
331
332
  text: params.text,
332
- delayMs: params.delayMs,
333
- sendAtMs: params.sendAtMs,
334
- replyToMessage: params.replyToMessage === true,
335
- ...(typeof params.messageId === "string" && params.messageId.trim()
336
- ? { messageId: params.messageId.trim() }
333
+ delay_ms: params.delay_ms,
334
+ send_at_ms: params.send_at_ms,
335
+ reply_to_message: params.reply_to_message === true,
336
+ ...(typeof params.message_id === "string" && params.message_id.trim()
337
+ ? { message_id: params.message_id.trim() }
337
338
  : {}),
338
339
  });
339
340
  return {
340
341
  success: Boolean(result.success),
341
- sessionId,
342
+ session_id,
342
343
  ...(result.success ? {} : { error: result.error || "chat send failed" }),
343
344
  };
344
345
  }
345
346
  /**
346
- * 按 chatKey/sessionId 彻底删除 chat 会话。
347
+ * 按 chat_key/session_id 彻底删除 chat 会话。
347
348
  *
348
349
  * 关键点(中文)
349
- * - chatKeysessionId 在 chat plugin runtime 内部等价使用。
350
+ * - chat_keysession_id 在 chat plugin runtime 内部等价使用。
350
351
  * - 删除包含:路由映射 + chat 审计目录 + session 目录 + 渠道状态清理。
351
352
  */
352
353
  export async function deleteChatByChatKey(params) {
353
- const chatKey = resolveChatKey({
354
+ const chat_key = resolveChatKey({
354
355
  context: params.context,
355
- chatKey: params.chatKey,
356
- sessionId: params.sessionId,
357
- run_context: params.run_context,
356
+ chat_key: params.chat_key,
357
+ session_id: params.session_id,
358
+ execution_context: params.execution_context,
358
359
  });
359
- const sessionId = String(chatKey || "").trim();
360
- if (!sessionId) {
360
+ const session_id = String(chat_key || "").trim();
361
+ if (!session_id) {
361
362
  return {
362
363
  success: false,
363
- error: "Missing chatKey/sessionId. Provide --chat-key or --session-id, or ensure DC_CTX_CHAT_KEY/DC_SESSION_ID is injected.",
364
+ error: "Missing chat_key/session_id. Provide --chat-key or --session-id, or ensure DC_CTX_CHAT_KEY/DC_SESSION_ID is injected.",
364
365
  };
365
366
  }
366
367
  const result = await deleteChatSessionById({
367
368
  context: params.context,
368
- sessionId,
369
+ session_id,
369
370
  });
370
371
  return {
371
372
  success: result.success,
372
- sessionId: result.sessionId,
373
+ session_id: result.session_id,
373
374
  deleted: result.deleted,
374
375
  removedMeta: result.removedMeta,
375
376
  removedChatDir: result.removedChatDir,