@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
@@ -222,7 +222,7 @@ export async function writeTaskRunInputArtifact(
222
222
  `- title: ${params.task.frontmatter.title}`,
223
223
  `- when: \`${params.task.frontmatter.when}\``,
224
224
  `- status: \`${params.task.frontmatter.status}\``,
225
- `- sessionId: \`${params.task.frontmatter.sessionId}\``,
225
+ `- session_id: \`${params.task.frontmatter.session_id}\``,
226
226
  `- kind: \`${params.taskKind}\``,
227
227
  ...(params.taskKind === "agent"
228
228
  ? [`- review: \`${String(params.reviewEnabled)}\``]
@@ -274,7 +274,7 @@ function buildDialogueLines(params: WriteTaskRunArtifactsParams): string[] {
274
274
  lines.push("```");
275
275
  lines.push("");
276
276
  if (round.executorAssistantMessageSnapshot) {
277
- lines.push("### Executor raw assistantMessage snapshot");
277
+ lines.push("### Executor result text snapshot");
278
278
  lines.push("");
279
279
  lines.push("```json");
280
280
  lines.push(round.executorAssistantMessageSnapshot);
@@ -321,7 +321,7 @@ function buildDialogueLines(params: WriteTaskRunArtifactsParams): string[] {
321
321
  }
322
322
  if (round.userSimulatorAssistantMessageSnapshot) {
323
323
  lines.push("");
324
- lines.push("raw assistantMessage snapshot:");
324
+ lines.push("result text snapshot:");
325
325
  lines.push("```json");
326
326
  lines.push(round.userSimulatorAssistantMessageSnapshot);
327
327
  lines.push("```");
@@ -461,7 +461,7 @@ export async function writeTaskRunArtifacts(
461
461
  taskId: params.task.taskId,
462
462
  timestamp: params.timestamp,
463
463
  executionId: params.executionId,
464
- sessionId: params.task.frontmatter.sessionId,
464
+ session_id: params.task.frontmatter.session_id,
465
465
  trigger: params.trigger,
466
466
  status: params.status,
467
467
  executionStatus: params.executionStatus,
@@ -7,7 +7,7 @@
7
7
  * - 回发失败只记录日志,不影响 task run 自身状态。
8
8
  */
9
9
 
10
- import type { AgentContext } from "@downcity/agent";
10
+ import type { PluginContext } from "@downcity/agent";
11
11
  import type { ShipTaskDefinitionV1 } from "@/task/types/Task.js";
12
12
 
13
13
  function resolveTaskFinalText(params: {
@@ -35,15 +35,15 @@ function resolveTaskFinalText(params: {
35
35
  * 通过 chat plugin runtime 发送 task 最终结果。
36
36
  */
37
37
  export async function dispatchTaskRunCompletionToChat(params: {
38
- context: AgentContext;
38
+ context: PluginContext;
39
39
  task: ShipTaskDefinitionV1;
40
40
  executionId: string;
41
41
  outputText: string;
42
42
  errorText: string;
43
43
  resultErrors: string[];
44
44
  }): Promise<void> {
45
- const sessionId = String(params.task.frontmatter.sessionId || "").trim();
46
- if (!sessionId) return;
45
+ const session_id = String(params.task.frontmatter.session_id || "").trim();
46
+ if (!session_id) return;
47
47
 
48
48
  const finalText = resolveTaskFinalText({
49
49
  outputText: params.outputText,
@@ -53,19 +53,19 @@ export async function dispatchTaskRunCompletionToChat(params: {
53
53
  if (!finalText) return;
54
54
 
55
55
  try {
56
- const sent = await params.context.plugins.runAction({
56
+ const sent = await params.context.plugins.run_action({
57
57
  plugin: "chat",
58
58
  action: "send",
59
59
  payload: {
60
- chatKey: sessionId,
60
+ chat_key: session_id,
61
61
  text: finalText,
62
- replyToMessage: true,
62
+ reply_to_message: true,
63
63
  },
64
64
  });
65
65
  if (!sent.success) {
66
66
  params.context.logger.warn("[TASK] Task completion chat send failed", {
67
67
  taskId: params.task.taskId,
68
- sessionId,
68
+ session_id,
69
69
  executionId: params.executionId,
70
70
  error: sent.error || "chat send failed",
71
71
  });
@@ -73,7 +73,7 @@ export async function dispatchTaskRunCompletionToChat(params: {
73
73
  } catch (error) {
74
74
  params.context.logger.warn("[TASK] Task completion chat send failed", {
75
75
  taskId: params.task.taskId,
76
- sessionId,
76
+ session_id,
77
77
  executionId: params.executionId,
78
78
  error: String(error),
79
79
  });
@@ -75,7 +75,7 @@ export function createRunProgressWriter(params: {
75
75
  phase: current.phase,
76
76
  message: current.message,
77
77
  startedAt: params.startedAt,
78
- updatedAt: now,
78
+ updated_at: now,
79
79
  ...(typeof current.endedAt === "number" ? { endedAt: current.endedAt } : {}),
80
80
  ...(current.runStatus ? { runStatus: current.runStatus } : {}),
81
81
  ...(current.executionStatus ? { executionStatus: current.executionStatus } : {}),
@@ -8,10 +8,12 @@
8
8
 
9
9
  import path from "node:path";
10
10
  import fs from "fs-extra";
11
- import type { AgentContext } from "@downcity/agent";
12
- import type { SessionRunResult } from "@downcity/agent";
13
- import type { SessionRunContext } from "@downcity/agent";
11
+ import type { PluginContext } from "@downcity/agent";
12
+ import type { SessionTurnExecutionResult } from "@downcity/agent";
13
+ import type { SessionTurnContext } from "@downcity/agent";
14
+ import { create_session_turn_context } from "@downcity/agent";
14
15
  import type { JsonObject } from "@downcity/agent";
16
+ import { SessionAssistantOutputAdapter } from "@downcity/agent";
15
17
  import type {
16
18
  ChatSendOutputPick,
17
19
  ScriptExecutionResult,
@@ -63,21 +65,6 @@ export function tryExtractJsonObject(text: string): JsonObject | null {
63
65
  return null;
64
66
  }
65
67
 
66
- function extractTextFromAssistantMessageParts(parts: unknown): string {
67
- if (!Array.isArray(parts)) return "";
68
- const texts: string[] = [];
69
- for (const part of parts) {
70
- if (!part || typeof part !== "object") continue;
71
- const p = part as { type?: unknown; text?: unknown };
72
- if (p.type !== "text" && p.type !== "input_text") continue;
73
- if (typeof p.text !== "string") continue;
74
- const value = p.text.trim();
75
- if (!value) continue;
76
- texts.push(value);
77
- }
78
- return texts.join("\n").trim();
79
- }
80
-
81
68
  /**
82
69
  * 从 assistant 输出中提取 task 的最终结果文本。
83
70
  *
@@ -87,12 +74,10 @@ function extractTextFromAssistantMessageParts(parts: unknown): string {
87
74
  * - task 的过程内容保留在 `messages.jsonl / dialogue.md`;`output.md` 只记录最后 assistant 文本。
88
75
  */
89
76
  export function pickAgentOutput(
90
- assistantMessage: SessionRunResult["assistantMessage"],
77
+ text: string,
91
78
  ): ChatSendOutputPick {
92
79
  return {
93
- text: extractTextFromAssistantMessageParts(
94
- (assistantMessage as { parts?: unknown } | null)?.parts,
95
- ),
80
+ text: String(text || "").trim(),
96
81
  delivered: false,
97
82
  };
98
83
  }
@@ -223,16 +208,16 @@ export function buildUserSimulatorQuery(params: {
223
208
  */
224
209
  export async function runAgentRound(params: {
225
210
  taskSessionRuntime: TaskSessionRuntimePort;
226
- sessionId: string;
211
+ session_id: string;
227
212
  taskId: string;
228
213
  query: string;
229
214
  actorId: string;
230
215
  actorName: string;
231
- }): Promise<{ outputText: string; delivered: boolean; rawResult: SessionRunResult }> {
216
+ }): Promise<{ outputText: string; delivered: boolean; rawResult: SessionTurnExecutionResult }> {
232
217
  try {
233
218
  await appendTaskRoundUserMessage({
234
219
  taskSessionRuntime: params.taskSessionRuntime,
235
- sessionId: params.sessionId,
220
+ session_id: params.session_id,
236
221
  taskId: params.taskId,
237
222
  query: params.query,
238
223
  actorId: params.actorId,
@@ -242,13 +227,30 @@ export async function runAgentRound(params: {
242
227
  // ignore
243
228
  }
244
229
 
245
- const result = await params.taskSessionRuntime
246
- .getExecutor(params.sessionId)
247
- .run({
230
+ const turn_id = `task:${params.taskId}:${params.actorId}:${Date.now()}`;
231
+ const assistant_output = new SessionAssistantOutputAdapter({
232
+ turn_id,
233
+ messages: params.taskSessionRuntime.get_messages(params.session_id),
234
+ });
235
+ const turn_context = create_task_turn_context(
236
+ params.session_id,
237
+ turn_id,
238
+ assistant_output,
239
+ );
240
+ let result: SessionTurnExecutionResult;
241
+ try {
242
+ result = await params.taskSessionRuntime.get_executor(params.session_id).execute({
248
243
  query: params.query,
249
- runContext: create_task_run_context(params.sessionId),
244
+ turn_context,
250
245
  });
251
- const outputPick = pickAgentOutput(result.assistantMessage);
246
+ await assistant_output.finish({
247
+ status: result.success ? "completed" : "failed",
248
+ ...(result.error ? { error: result.error } : {}),
249
+ });
250
+ } finally {
251
+ await turn_context.lifecycle.dispose();
252
+ }
253
+ const outputPick = pickAgentOutput(result.text);
252
254
 
253
255
  if (!result.success) {
254
256
  const reason = outputPick.text || "agent run returned success=false";
@@ -270,9 +272,9 @@ export async function runAgentRound(params: {
270
272
  * 执行 script 类型任务。
271
273
  */
272
274
  export async function runScriptTask(params: {
273
- context: AgentContext;
275
+ context: PluginContext;
274
276
  runDirAbs: string;
275
- sessionId: string;
277
+ session_id: string;
276
278
  scriptBody: string;
277
279
  }): Promise<ScriptExecutionResult> {
278
280
  const body = String(params.scriptBody || "");
@@ -283,7 +285,7 @@ export async function runScriptTask(params: {
283
285
 
284
286
  const childEnv: NodeJS.ProcessEnv = {
285
287
  ...process.env,
286
- DC_SESSION_ID: params.sessionId,
288
+ DC_SESSION_ID: params.session_id,
287
289
  };
288
290
  stripTaskSecretEnv(childEnv);
289
291
  const shell = params.context.shell;
@@ -291,7 +293,7 @@ export async function runScriptTask(params: {
291
293
  throw new Error("Script task execution requires Agent to be configured with a Shell.");
292
294
  }
293
295
  const execResult = await shell.run_safe_command({
294
- execution_id: `task-script:${params.sessionId}`,
296
+ execution_id: `task-script:${params.session_id}`,
295
297
  execution_dir: params.runDirAbs,
296
298
  cmd: `sh "${scriptAbs.replace(/(["\\$`])/g, "\\$1")}"`,
297
299
  cwd: params.runDirAbs,
@@ -309,15 +311,18 @@ export async function runScriptTask(params: {
309
311
  }
310
312
 
311
313
  /**
312
- * 创建 task runner 的显式 session run context
314
+ * 创建 task runner 的显式 Session Turn Context
313
315
  */
314
- function create_task_run_context(session_id: string): SessionRunContext {
315
- return {
316
- sessionId: session_id,
317
- injectedUserMessages: [],
318
- deferredPersistedUserMessages: [],
319
- pendingAssistantFileParts: [],
320
- };
316
+ function create_task_turn_context(
317
+ session_id: string,
318
+ turn_id: string,
319
+ assistant_output: SessionAssistantOutputAdapter,
320
+ ): SessionTurnContext {
321
+ return create_session_turn_context({
322
+ session_id: session_id,
323
+ turn_id,
324
+ assistant_output,
325
+ });
321
326
  }
322
327
 
323
328
  /**
@@ -6,7 +6,7 @@
6
6
  * - 这里集中处理 script 执行、结果校验与进度更新,Runner 主链只消费归一化结果。
7
7
  */
8
8
 
9
- import type { AgentContext } from "@downcity/agent";
9
+ import type { PluginContext } from "@downcity/agent";
10
10
  import type {
11
11
  ShipTaskRunExecutionStatusV1,
12
12
  ShipTaskRunResultStatusV1,
@@ -23,15 +23,15 @@ export interface RunScriptTaskBranchParams {
23
23
  /**
24
24
  * 当前 Agent 执行上下文。
25
25
  */
26
- context: AgentContext;
26
+ context: PluginContext;
27
27
  /**
28
28
  * 当前 run 目录绝对路径。
29
29
  */
30
30
  runDirAbs: string;
31
31
  /**
32
- * script 任务绑定的 sessionId
32
+ * script 任务绑定的 session_id
33
33
  */
34
- sessionId: string;
34
+ session_id: string;
35
35
  /**
36
36
  * script 正文。
37
37
  */
@@ -111,7 +111,7 @@ export async function runScriptTaskBranch(
111
111
  const scriptResult = await runScriptTask({
112
112
  context: params.context,
113
113
  runDirAbs: params.runDirAbs,
114
- sessionId: params.sessionId,
114
+ session_id: params.session_id,
115
115
  scriptBody: params.scriptBody,
116
116
  });
117
117
  outputText = scriptResult.outputText;
@@ -10,13 +10,13 @@
10
10
 
11
11
  import path from "node:path";
12
12
  import type { LanguageModel, Tool } from "ai";
13
- import type { AgentContext } from "@downcity/agent";
13
+ import type { PluginContext } from "@downcity/agent";
14
14
  import { Executor } from "@downcity/agent";
15
- import type { SessionRunResult } from "@downcity/agent";
15
+ import type { SessionTurnExecutionResult } from "@downcity/agent";
16
16
  import type { TaskSessionRuntimePort } from "@/task/runtime/TaskRunnerTypes.js";
17
17
  import {
18
18
  DefaultSessionComposer,
19
- JsonlSessionMessageStore,
19
+ create_session_message_store,
20
20
  SessionMessages,
21
21
  } from "@downcity/agent";
22
22
  import { DefaultSessionSystemComposer } from "@downcity/agent";
@@ -31,7 +31,7 @@ import type {
31
31
  */
32
32
  export async function appendTaskRoundUserMessage(params: {
33
33
  taskSessionRuntime: TaskSessionRuntimePort;
34
- sessionId: string;
34
+ session_id: string;
35
35
  taskId: string;
36
36
  query: string;
37
37
  actorId: string;
@@ -39,7 +39,7 @@ export async function appendTaskRoundUserMessage(params: {
39
39
  }): Promise<void> {
40
40
  const text = String(params.query || "").trim();
41
41
  if (!text) return;
42
- const messages = params.taskSessionRuntime.get_messages(params.sessionId);
42
+ const messages = params.taskSessionRuntime.get_messages(params.session_id);
43
43
  await messages.append_user_message({
44
44
  turn_id:
45
45
  `task:${params.taskId}:${params.actorId}:${Date.now()}`,
@@ -61,13 +61,13 @@ export async function appendTaskRoundUserMessage(params: {
61
61
  * - task runner 自己维护独立 history,不复用原 session 的消息落盘。
62
62
  */
63
63
  export function createTaskSessionRuntimePort(params: {
64
- context: AgentContext;
64
+ context: PluginContext;
65
65
  model: LanguageModel;
66
66
  runDirAbs: string;
67
67
  runSessionId: string;
68
68
  userSimulatorSessionId: string;
69
69
  /** 当前 task 显式继承的 Agent env 快照。 */
70
- agent_env?: Readonly<Record<string, string>>;
70
+ workspace_env?: Readonly<Record<string, string>>;
71
71
  /** 当前 task 显式继承的 Agent instruction 快照。 */
72
72
  agent_systems?: readonly string[];
73
73
  }): TaskSessionRuntimePort {
@@ -78,16 +78,16 @@ export function createTaskSessionRuntimePort(params: {
78
78
  runSessionId,
79
79
  userSimulatorSessionId,
80
80
  } = params;
81
- const effective_env = params.agent_env
82
- ? { ...params.agent_env }
83
- : { ...context.env };
81
+ const effective_env = params.workspace_env
82
+ ? { ...params.workspace_env }
83
+ : { ...context.workspace_env };
84
84
  const effective_systems = params.agent_systems
85
85
  ? [...params.agent_systems]
86
- : [...context.systems];
86
+ : [...context.instructions];
87
87
  const systemComposer = new DefaultSessionSystemComposer({
88
- projectRoot: context.rootPath,
89
- getStaticSystemPrompts: () => [...effective_systems],
90
- getContext: () => context,
88
+ project_root: context.workspace_path,
89
+ get_static_system_prompts: () => [...effective_systems],
90
+ get_context: () => context,
91
91
  profile: "task",
92
92
  });
93
93
  const messages_by_session_id = new Map<string, SessionMessages>();
@@ -105,7 +105,7 @@ export function createTaskSessionRuntimePort(params: {
105
105
 
106
106
  const key = String(session_id || "").trim();
107
107
  if (!key) {
108
- throw new Error("TaskSessionRuntimePort requires a non-empty sessionId");
108
+ throw new Error("TaskSessionRuntimePort requires a non-empty session_id");
109
109
  }
110
110
  const runMessagesDirPath =
111
111
  key === runSessionId
@@ -117,7 +117,8 @@ export function createTaskSessionRuntimePort(params: {
117
117
  const messages_dir_path = runMessagesDirPath || path.join(runDirAbs, key);
118
118
  const created = new SessionMessages({
119
119
  session_id: key,
120
- store: new JsonlSessionMessageStore({
120
+ store: create_session_message_store({
121
+ files: context.files,
121
122
  session_id: key,
122
123
  file_path: path.join(messages_dir_path, "active.jsonl"),
123
124
  assistant_message_file_path: path.join(
@@ -137,14 +138,7 @@ export function createTaskSessionRuntimePort(params: {
137
138
  const composed = await super.compose(input);
138
139
  return {
139
140
  ...composed,
140
- system: await systemComposer.resolve({
141
- sessionId: input.session.session_id,
142
- agentEnv: input.state.env,
143
- agentSystems: input.state.systems,
144
- injectedUserMessages: [],
145
- deferredPersistedUserMessages: [],
146
- pendingAssistantFileParts: [],
147
- }),
141
+ system: await systemComposer.resolve(input),
148
142
  system_blocks: undefined,
149
143
  };
150
144
  }
@@ -154,10 +148,10 @@ export function createTaskSessionRuntimePort(params: {
154
148
  get_messages(session_id: string): SessionMessages {
155
149
  return resolve_task_messages(session_id);
156
150
  },
157
- getExecutor(sessionId: string): SessionExecutor {
158
- const key = String(sessionId || "").trim();
151
+ get_executor(session_id: string): SessionExecutor {
152
+ const key = String(session_id || "").trim();
159
153
  if (!key) {
160
- throw new Error("TaskSessionRuntimePort.getExecutor requires a non-empty sessionId");
154
+ throw new Error("TaskSessionRuntimePort.get_executor requires a non-empty session_id");
161
155
  }
162
156
  const existing = runtimesBySessionId.get(key);
163
157
  if (existing) return existing;
@@ -165,13 +159,13 @@ export function createTaskSessionRuntimePort(params: {
165
159
  const messages = resolve_task_messages(key);
166
160
  const composer = new TaskSessionComposer();
167
161
  const created = new Executor({
168
- sessionId: key,
162
+ session_id: key,
169
163
  composer,
170
- get_compose_input: async (run_context, retry_count) => ({
164
+ get_compose_input: async (turn_context, retry_count) => ({
171
165
  session: {
172
166
  agent_id: "task",
173
167
  session_id: key,
174
- project_root: context.rootPath,
168
+ project_root: context.workspace_path,
175
169
  created_at: created_at_by_session_id.get(key) || Date.now(),
176
170
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC",
177
171
  },
@@ -186,17 +180,38 @@ export function createTaskSessionRuntimePort(params: {
186
180
  },
187
181
  history: await messages.context_snapshot(),
188
182
  turn: {
189
- ...(run_context.turnId ? { turn_id: run_context.turnId } : {}),
183
+ ...(turn_context?.session.turn_id
184
+ ? { turn_id: turn_context.session.turn_id }
185
+ : {}),
190
186
  retry_count,
191
187
  },
192
188
  }),
193
- commit_compaction: async (plan) => {
194
- await messages.compact_active({
195
- through_sequence: plan.through_sequence,
196
- summary: plan.summary,
197
- });
189
+ compact_history: async () => {
190
+ try {
191
+ const plan = await composer.compact({
192
+ session: {
193
+ agent_id: "task",
194
+ session_id: key,
195
+ project_root: context.workspace_path,
196
+ created_at: created_at_by_session_id.get(key) || Date.now(),
197
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC",
198
+ },
199
+ model,
200
+ history: await messages.context_snapshot(),
201
+ });
202
+ if (!plan) {
203
+ return { compacted: false, reason: "nothing_to_compact" };
204
+ }
205
+ await messages.compact_active({
206
+ through_sequence: plan.through_sequence,
207
+ summary: plan.summary,
208
+ });
209
+ return { compacted: true };
210
+ } catch {
211
+ return { compacted: false, reason: "compact_failed" };
212
+ }
198
213
  },
199
- getModel: () => model,
214
+ get_model: () => model,
200
215
  logger: context.logger,
201
216
  });
202
217
  runtimesBySessionId.set(key, created);
@@ -208,18 +223,15 @@ export function createTaskSessionRuntimePort(params: {
208
223
  /**
209
224
  * 把 task session 的 assistant 消息落盘到对应 run context history Store。
210
225
  */
211
- export async function appendTaskAssistantMessage(params: {
226
+ export async function appendTaskDeferredMessages(params: {
212
227
  taskSessionRuntime: TaskSessionRuntimePort;
213
- sessionId: string;
228
+ session_id: string;
214
229
  taskId: string;
215
- rawResult: SessionRunResult;
230
+ rawResult: SessionTurnExecutionResult;
216
231
  }): Promise<void> {
217
- const { taskSessionRuntime, sessionId, rawResult } = params;
218
- const messages = taskSessionRuntime.get_messages(sessionId);
219
- if (rawResult.assistantMessage) {
220
- await messages.append_record(rawResult.assistantMessage);
221
- }
222
- const deferredUserMessages = rawResult.deferredPersistedUserMessages || [];
232
+ const { taskSessionRuntime, session_id, rawResult } = params;
233
+ const messages = taskSessionRuntime.get_messages(session_id);
234
+ const deferredUserMessages = rawResult.deferred_persisted_user_messages || [];
223
235
  for (const deferred of deferredUserMessages) {
224
236
  await messages.append_record(deferred);
225
237
  }
@@ -123,7 +123,7 @@ export type DialogueRoundRecord = {
123
123
  */
124
124
  executorDelivered: boolean;
125
125
  /**
126
- * 执行器 assistantMessage 的调试快照。
126
+ * 执行器最终文本的调试快照。
127
127
  */
128
128
  executorAssistantMessageSnapshot?: string;
129
129
  /**
@@ -143,7 +143,7 @@ export type DialogueRoundRecord = {
143
143
  */
144
144
  userSimulatorOutput?: string;
145
145
  /**
146
- * 模拟用户 assistantMessage 的调试快照。
146
+ * 模拟用户最终文本的调试快照。
147
147
  */
148
148
  userSimulatorAssistantMessageSnapshot?: string;
149
149
  /**
@@ -175,11 +175,11 @@ export type ScriptExecutionResult = {
175
175
  */
176
176
  export type TaskSessionRuntimePort = {
177
177
  /**
178
- * 获取指定 sessionId 对应的 Session 执行端口。
178
+ * 获取指定 session_id 对应的 Session 执行端口。
179
179
  */
180
- getExecutor(sessionId: string): SessionExecutor;
180
+ get_executor(session_id: string): SessionExecutor;
181
181
  /**
182
- * 获取指定 sessionId 对应的 canonical Session Messages。
182
+ * 获取指定 session_id 对应的 canonical Session Messages。
183
183
  */
184
184
  get_messages(session_id: string): SessionMessages;
185
185
  };
@@ -16,8 +16,8 @@ export type ShipTaskFrontmatterV1 = {
16
16
  when: string;
17
17
  /** 任务描述(给执行器的意图说明) */
18
18
  description: string;
19
- /** 任务执行会话标识(sessionId) */
20
- sessionId: string;
19
+ /** 任务执行会话标识(session_id) */
20
+ session_id: string;
21
21
  /** 任务执行类型(agent=交给 agent 执行;script=直接执行 task 正文脚本) */
22
22
  kind?: ShipTaskKind;
23
23
  /** 是否启用 review 多轮复核(仅 `kind=agent` 生效;默认 false,false 时单轮执行) */
@@ -100,7 +100,7 @@ export type ShipTaskRunProgressV1 = {
100
100
  /** 开始时间(ms) */
101
101
  startedAt: number;
102
102
  /** 最近更新时间(ms) */
103
- updatedAt: number;
103
+ updated_at: number;
104
104
  /** 结束时间(ms,完成后可选) */
105
105
  endedAt?: number;
106
106
  /** 最终 run 状态(完成后可选) */
@@ -127,7 +127,7 @@ export type ShipTaskRunMetaV1 = {
127
127
  /** 本次执行唯一 ID */
128
128
  executionId: string;
129
129
  /** 任务执行会话标识 */
130
- sessionId: string;
130
+ session_id: string;
131
131
  /** 触发来源 */
132
132
  trigger: ShipTaskRunTriggerV1;
133
133
  /** 最终状态(综合执行阶段 + 结果校验) */
@@ -22,7 +22,7 @@ export type TaskCreateRequest = {
22
22
  /** 任务描述。 */
23
23
  description: string;
24
24
  /** 任务会话标识。 */
25
- sessionId: string;
25
+ session_id: string;
26
26
  /** 任务执行类型。 */
27
27
  kind?: ShipTaskKind;
28
28
  /** 是否启用 review 多轮复核。 */
@@ -62,7 +62,7 @@ export type TaskUpdateRequest = {
62
62
  /** 新任务描述。 */
63
63
  description?: string;
64
64
  /** 新会话标识。 */
65
- sessionId?: string;
65
+ session_id?: string;
66
66
  /** 新任务执行类型。 */
67
67
  kind?: ShipTaskKind;
68
68
  /** 是否启用 review 多轮复核。 */
@@ -96,7 +96,7 @@ export type TaskListItemView = {
96
96
  /** 当前是否正在执行。 */
97
97
  running?: boolean;
98
98
  /** 任务会话标识。 */
99
- sessionId: string;
99
+ session_id: string;
100
100
  /** 任务执行类型。 */
101
101
  kind?: ShipTaskKind;
102
102
  /** 是否启用 review 多轮复核。 */
package/src/web/Plugin.ts CHANGED
@@ -9,9 +9,9 @@
9
9
  */
10
10
 
11
11
  import { BasePlugin } from "@downcity/agent";
12
- import { createAction } from "@downcity/agent";
12
+ import { create_action } from "@downcity/agent";
13
13
  import { z } from "zod";
14
- import type { AgentContext } from "@downcity/agent";
14
+ import type { PluginContext } from "@downcity/agent";
15
15
  import type { JsonObject, JsonValue, PluginActionResult } from "@downcity/agent";
16
16
  import { WEB_PLUGIN_PROMPT } from "@/web/WebPromptAssets.js";
17
17
  import { render_web_install_prompt } from "@/web/runtime/Prompt.js";
@@ -79,7 +79,7 @@ export class WebPlugin extends BasePlugin {
79
79
  * WebPlugin 对外 action。
80
80
  */
81
81
  readonly actions = {
82
- [WEB_PLUGIN_ACTIONS.install]: createAction({
82
+ [WEB_PLUGIN_ACTIONS.install]: create_action({
83
83
  description:
84
84
  "Return instructions for installing web-related Skills and CLIs. This action does not install anything.",
85
85
  input_schema: {
@@ -117,7 +117,7 @@ export class WebPlugin extends BasePlugin {
117
117
  .option("--target <target>", "web-access、agent-browser 或 all")
118
118
  .option("--scope <scope>", "agent-browser CLI 安装位置:user 或 project");
119
119
  },
120
- mapInput({ opts }): JsonObject {
120
+ map_input({ opts }): JsonObject {
121
121
  return {
122
122
  ...(get_install_target_opt(opts)
123
123
  ? { target: get_install_target_opt(opts) }
@@ -145,7 +145,7 @@ export class WebPlugin extends BasePlugin {
145
145
  /**
146
146
  * 注入联网方法论提示词。
147
147
  */
148
- system(_context: AgentContext): string {
148
+ system(_context: PluginContext): string {
149
149
  return WEB_PLUGIN_PROMPT;
150
150
  }
151
151
  }