@downcity/plugins 1.0.216 → 1.0.236

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
@@ -8,8 +8,8 @@
8
8
 
9
9
  import path from "node:path";
10
10
  import type { ShipTaskStatus } from "./types/Task.js";
11
- import type { AgentContext } from "@downcity/agent";
12
- import type { PluginRunContext } from "@downcity/agent";
11
+ import type { PluginContext } from "@downcity/agent";
12
+ import type { PluginExecutionContext } from "@downcity/agent";
13
13
  import type { JsonValue } from "@downcity/agent";
14
14
  import {
15
15
  deriveTaskIdFromTitle,
@@ -95,10 +95,10 @@ function buildDefaultTaskBody(): string {
95
95
 
96
96
 
97
97
  export async function listTaskDefinitions(params: {
98
- projectRoot: string;
98
+ project_root: string;
99
99
  status?: ShipTaskStatus;
100
100
  }): Promise<TaskListResponse> {
101
- const root = path.resolve(params.projectRoot);
101
+ const root = path.resolve(params.project_root);
102
102
  const normalizedStatus = normalizeTaskStatus(params.status);
103
103
 
104
104
  const tasks = await listTasks(root);
@@ -116,7 +116,7 @@ export async function listTaskDefinitions(params: {
116
116
  : {}),
117
117
  when: task.when,
118
118
  status: task.status,
119
- sessionId: task.sessionId,
119
+ session_id: task.session_id,
120
120
  kind: task.kind || "agent",
121
121
  ...(task.kind === "agent" ? { review: Boolean(task.review) } : {}),
122
122
  taskMdPath: task.taskMdPath,
@@ -126,10 +126,10 @@ export async function listTaskDefinitions(params: {
126
126
  }
127
127
 
128
128
  export async function createTaskDefinition(params: {
129
- projectRoot: string;
129
+ project_root: string;
130
130
  request: TaskCreateRequest;
131
131
  }): Promise<TaskCreateResponse> {
132
- const root = path.resolve(params.projectRoot);
132
+ const root = path.resolve(params.project_root);
133
133
  const req = params.request;
134
134
 
135
135
  const title = String(req.title || "").trim();
@@ -146,12 +146,12 @@ export async function createTaskDefinition(params: {
146
146
  };
147
147
  }
148
148
  const whenNormalized = normalizeTaskWhen(String(req.when || "@manual").trim() || "@manual");
149
- const sessionId = String(req.sessionId || "").trim();
149
+ const session_id = String(req.session_id || "").trim();
150
150
  const kind = normalizeTaskKind(req.kind);
151
151
 
152
152
  if (!title) return { success: false, error: "Missing title" };
153
153
  if (!description) return { success: false, error: "Missing description" };
154
- if (!sessionId) return { success: false, error: "Missing sessionId" };
154
+ if (!session_id) return { success: false, error: "Missing session_id" };
155
155
  if (!whenNormalized.ok) return { success: false, error: whenNormalized.error };
156
156
 
157
157
  const status = resolveTaskStatus(req.status, "enabled");
@@ -178,13 +178,13 @@ export async function createTaskDefinition(params: {
178
178
  try {
179
179
  const written = await writeTask({
180
180
  taskId: targetTaskId,
181
- projectRoot: root,
181
+ project_root: root,
182
182
  overwrite: Boolean(req.overwrite) || Boolean(duplicated),
183
183
  frontmatter: {
184
184
  title,
185
185
  description,
186
186
  when: whenNormalized.value,
187
- sessionId,
187
+ session_id,
188
188
  kind,
189
189
  ...(kind === "agent" && req.review === true ? { review: true } : {}),
190
190
  status,
@@ -206,15 +206,15 @@ export async function createTaskDefinition(params: {
206
206
  }
207
207
 
208
208
  export async function updateTaskDefinition(params: {
209
- projectRoot: string;
209
+ project_root: string;
210
210
  request: TaskUpdateRequest;
211
211
  }): Promise<TaskUpdateResponse> {
212
- const root = path.resolve(params.projectRoot);
212
+ const root = path.resolve(params.project_root);
213
213
  const req = params.request;
214
214
  const title = String(req.title || "").trim();
215
215
  let taskId = "";
216
216
  try {
217
- taskId = await resolveTaskIdByTitle({ projectRoot: root, title });
217
+ taskId = await resolveTaskIdByTitle({ project_root: root, title });
218
218
  } catch (error) {
219
219
  return { success: false, error: String(error) };
220
220
  }
@@ -229,7 +229,7 @@ export async function updateTaskDefinition(params: {
229
229
 
230
230
  try {
231
231
  const current = await readTask({
232
- projectRoot: root,
232
+ project_root: root,
233
233
  taskId,
234
234
  });
235
235
 
@@ -260,9 +260,9 @@ export async function updateTaskDefinition(params: {
260
260
  const whenNormalized = normalizeTaskWhen(whenInput);
261
261
  if (!whenNormalized.ok) return { success: false, error: whenNormalized.error };
262
262
 
263
- const sessionId =
264
- typeof req.sessionId === "string" ? req.sessionId.trim() : current.frontmatter.sessionId;
265
- if (!sessionId) return { success: false, error: "sessionId cannot be empty" };
263
+ const session_id =
264
+ typeof req.session_id === "string" ? req.session_id.trim() : current.frontmatter.session_id;
265
+ if (!session_id) return { success: false, error: "session_id cannot be empty" };
266
266
  const kind = normalizeTaskKind(
267
267
  req.kind === undefined ? current.frontmatter.kind : req.kind,
268
268
  );
@@ -291,14 +291,14 @@ export async function updateTaskDefinition(params: {
291
291
  : current.body;
292
292
 
293
293
  const written = await writeTask({
294
- projectRoot: root,
294
+ project_root: root,
295
295
  taskId,
296
296
  overwrite: true,
297
297
  frontmatter: {
298
298
  title: nextTitle,
299
299
  description,
300
300
  when: whenNormalized.value,
301
- sessionId,
301
+ session_id,
302
302
  kind,
303
303
  ...(kind === "agent" && review ? { review: true } : {}),
304
304
  status,
@@ -320,16 +320,16 @@ export async function updateTaskDefinition(params: {
320
320
  }
321
321
 
322
322
  export async function runTaskDefinition(params: {
323
- context: AgentContext;
324
- projectRoot: string;
323
+ context: PluginContext;
324
+ project_root: string;
325
325
  request: TaskRunRequest;
326
- run_context?: PluginRunContext;
326
+ execution_context?: PluginExecutionContext;
327
327
  }): Promise<TaskRunResponse> {
328
- const root = path.resolve(params.projectRoot);
328
+ const root = path.resolve(params.project_root);
329
329
  const title = String(params.request.title || "").trim();
330
330
  let taskId = "";
331
331
  try {
332
- taskId = await resolveTaskIdByTitle({ projectRoot: root, title });
332
+ taskId = await resolveTaskIdByTitle({ project_root: root, title });
333
333
  } catch (error) {
334
334
  return { success: false, error: String(error) };
335
335
  }
@@ -343,7 +343,7 @@ export async function runTaskDefinition(params: {
343
343
  // 关键点(中文):run 改为“异步受理”,先做存在性校验,再后台执行。
344
344
  await readTask({
345
345
  taskId,
346
- projectRoot: root,
346
+ project_root: root,
347
347
  });
348
348
 
349
349
  params.context.logger.info(
@@ -358,15 +358,15 @@ export async function runTaskDefinition(params: {
358
358
  const executionId = `${taskId}:${Date.now()}`;
359
359
  void runTaskNow({
360
360
  context: params.context,
361
- projectRoot: root,
361
+ project_root: root,
362
362
  taskId,
363
363
  trigger,
364
364
  executionId,
365
- ...(params.run_context?.agentEnv
366
- ? { agent_env: { ...params.run_context.agentEnv } }
365
+ ...(params.execution_context?.workspace_env
366
+ ? { workspace_env: { ...params.execution_context.workspace_env } }
367
367
  : {}),
368
- ...(params.run_context?.agentSystems
369
- ? { agent_systems: [...params.run_context.agentSystems] }
368
+ ...(params.execution_context?.agent_systems
369
+ ? { agent_systems: [...params.execution_context.agent_systems] }
370
370
  : {}),
371
371
  })
372
372
  .then((result) => {
@@ -417,14 +417,14 @@ export async function runTaskDefinition(params: {
417
417
  }
418
418
 
419
419
  export async function setTaskStatus(params: {
420
- projectRoot: string;
420
+ project_root: string;
421
421
  request: TaskSetStatusRequest;
422
422
  }): Promise<TaskSetStatusResponse> {
423
- const root = path.resolve(params.projectRoot);
423
+ const root = path.resolve(params.project_root);
424
424
  const title = String(params.request.title || "").trim();
425
425
  let taskId = "";
426
426
  try {
427
- taskId = await resolveTaskIdByTitle({ projectRoot: root, title });
427
+ taskId = await resolveTaskIdByTitle({ project_root: root, title });
428
428
  } catch (error) {
429
429
  return { success: false, error: String(error) };
430
430
  }
@@ -439,12 +439,12 @@ export async function setTaskStatus(params: {
439
439
 
440
440
  try {
441
441
  const task = await readTask({
442
- projectRoot: root,
442
+ project_root: root,
443
443
  taskId,
444
444
  });
445
445
 
446
446
  await writeTask({
447
- projectRoot: root,
447
+ project_root: root,
448
448
  taskId,
449
449
  overwrite: true,
450
450
  frontmatter: {
@@ -468,21 +468,21 @@ export async function setTaskStatus(params: {
468
468
  }
469
469
 
470
470
  export async function deleteTaskDefinition(params: {
471
- projectRoot: string;
471
+ project_root: string;
472
472
  request: TaskDeleteRequest;
473
473
  }): Promise<TaskDeleteResponse> {
474
- const root = path.resolve(params.projectRoot);
474
+ const root = path.resolve(params.project_root);
475
475
  const title = String(params.request.title || "").trim();
476
476
  let taskId = "";
477
477
  try {
478
- taskId = await resolveTaskIdByTitle({ projectRoot: root, title });
478
+ taskId = await resolveTaskIdByTitle({ project_root: root, title });
479
479
  } catch (error) {
480
480
  return { success: false, error: String(error) };
481
481
  }
482
482
 
483
483
  try {
484
484
  const deleted = await deleteTask({
485
- projectRoot: root,
485
+ project_root: root,
486
486
  taskId,
487
487
  });
488
488
  return {
@@ -4,6 +4,6 @@
4
4
  */
5
5
 
6
6
  // Source: src/task/PROMPT.ts.txt
7
- const TEXT_MODULE_CONTENT = "# Task Plugin\n\nYou can use the `task` plugin to manage task definitions, execution, scheduling, and status control.\n\n## Task Model\n\nEach task is defined in `./.downcity/task/<title>/task.md` and contains:\n- frontmatter for structured fields\n- body for the task instructions\n\nCore frontmatter fields:\n- `title`: unique task identifier\n- `description`: task description\n- `when`: trigger condition, supporting `@manual`, cron, or `time:<ISO8601-with-timezone>`\n- `sessionId`: task execution session\n- `status`: `enabled|paused|disabled`\n- `kind`: `agent|script`, defaulting to `agent`\n\nEach execution creates a run directory:\n- `./.downcity/task/<title>/<timestamp>/`\n\nCommon artifacts:\n- `input.md`\n- `output.md`: final output body for this run\n- `result.md`: execution summary\n- `run.json`\n- `run-progress.json`\n- `dialogue.md` / `dialogue.json`: multi-turn agent dialogue\n- `error.md`: failure details\n\n## Execution Kinds\n\n1. `kind=agent`\n- Sends the task body to an agent for execution.\n- Completes in a single turn by default. Simulated multi-turn review is enabled only when frontmatter explicitly sets `review: true`.\n- Suitable for research, analysis, and report generation.\n\n2. `kind=script`\n- Treats the body as a shell script.\n- The body must be non-empty and executable as a script.\n\n## Available Actions\n\n- `list`\n- `create`\n- `run`\n- `delete`\n- `update`\n- `status`\n- `enable`\n- `disable`\n\n## Action Examples\n\n- `plugin_call({ plugin: \"task\", action: \"list\", payload: { status } })`\n- `plugin_call({ plugin: \"task\", action: \"create\", payload: { title, description, sessionId, when, kind, status } })`\n- `plugin_call({ plugin: \"task\", action: \"run\", payload: { title, reason } })`\n- `plugin_call({ plugin: \"task\", action: \"update\", payload: { title, description, when, status, sessionId } })`\n- `plugin_call({ plugin: \"task\", action: \"delete\", payload: { title } })`\n\n## Key Constraints\n\n- `title` is unique. `create` deduplicates only by exact `title`.\n- After `when=time:...` triggers, the task is automatically set to `paused` and falls back to `when=@manual`.\n- `run` is accepted asynchronously. It returns `accepted=true`, `message`, and `executionId` immediately. Treat this as \"the task has entered background execution; the result will be sent automatically through the chat plugin runtime, and the current flow does not need to block.\"\n- If `run` returns `accepted=true`:\n - Do not manually forward task output to the user again.\n - Do not actively poll the run directory, `run-progress.json`, or `output.md`.\n - Inspect the run directory only when the user explicitly asks to debug, view artifacts, or confirm execution details.\n- Agent tasks only need to produce valid output by default. They should send to an external channel only when the task body explicitly requires it.\n\n## Designing The Task Body\n\n### Recommended Agent Task Structure\n\nThe body should include at least these headings:\n\n```md\n# Task Goal\n\n- What final result this task must deliver.\n\n# Background And Input\n\n- Data sources, scope, constraints, and reference materials.\n\n# Execution Steps\n\n1. What to do first.\n2. What to do next.\n3. Where key intermediate artifacts should be written.\n\n# Output Requirements\n\n- What format the final result must use.\n- Whether a table, JSON, or Markdown is required.\n- What content must not be included.\n\n# Trigger And Status Recommendation\n\n- Why this task is suitable for `@manual`, cron, or `time:...`.\n- Whether it should currently be `paused` or `enabled`.\n\n# Notes\n\n- Risks, boundaries, and things not to do.\n```\n\n### Agent Task Body Writing Constraints\n\n- The task body must read like a delivery contract, so another executor can run it directly without relying on the current chat context.\n- `# Task Goal` must clearly state the final deliverable. Do not write vague goals such as \"take a look\", \"research this\", or \"handle this\".\n- `# Background And Input` must specify sources, scope, objects, time range, and constraints. Do not assume the executor can see the original chat context.\n- `# Execution Steps` should describe the task workflow, not task-management actions. Do not write \"first check whether a task with the same name exists\", \"then create a task\", or \"then trigger the task\".\n- `# Output Requirements` must clearly specify the final artifact's format, structure, tone, length, and excluded content.\n- Explicitly state that the final assistant message will be written directly to `output.md` and sent to the user. Therefore, the final answer must be exactly the deliverable content.\n- Content-generation tasks such as daily reports, reminders, morning briefings, summaries, and reports must explicitly require \"the final output is the deliverable body itself\". Do not let the executor output process notes.\n- If the task result should be sent to the user, the body should require \"output send-ready message content\" instead of asking the executor to explain what it has sent.\n- Unless truly needed, do not ask the executor to repeat the task title, sessionId, execution time, status, or other metadata in the body.\n- Constraints in the body must be executable and checkable. Avoid weak phrases such as \"appropriately\", \"as much as possible\", or \"depending on the situation\".\n- Do not put task creation, task update, task status lookup, or same-title existence checks into the body. Those belong to the task plugin, not to the task deliverable.\n\n### Forbidden Agent Task Body Patterns\n\n- Do not write the body in chat-reply style, for example:\n - \"I will help you...\"\n - \"First, let me...\"\n - \"I will check first...\"\n - \"I see there is already a task with the same name...\"\n- Do not write the body as task-management instructions, for example:\n - \"If the task exists, update it; otherwise create it.\"\n - \"First list, then run.\"\n - \"Tell the user that the task has started when done.\"\n- Do not write the body as a status-report template, for example:\n - \"Task status summary\"\n - \"Sent / completed / updated\"\n - \"Current task configuration\"\n- Do not describe only actions without describing the deliverable, for example:\n - \"Go collect some materials.\"\n - \"Generate some content and see.\"\n - \"Report back after finishing.\"\n- Do not use references that depend on the current context, for example:\n - \"Do what was said above.\"\n - \"Continue the previous one.\"\n - \"Send this out.\"\n\n### How To Judge Whether The Body Is Good\n\n- If you can copy the task body alone to another agent and it can still understand the goal, input, steps, and deliverable, the body is valid.\n- If deleting the output section leaves only \"go do something\" style instructions, the body is invalid.\n- If the body looks more like instructions for creating or updating a task than instructions for executing the task, the layering is wrong and the body must be rewritten.\n- If the body naturally encourages the executor to output process notes instead of the final artifact, the `# Output Requirements` section is not strong enough and must add explicit prohibitions.\n\n### Recommended Script Task Structure\n\n- The body must be a pure shell script. Do not mix in explanatory natural language.\n- Start with comments that describe the script's purpose, input dependencies, and failure conditions when possible.\n- Keep output stable so it can be sent directly as the final result.\n- If files need to be generated, write them to the run directory or to an explicit project path.\n\n### Output Design Principles\n\n- When a task completes, the system automatically sends the final result body back to the chat bound to `sessionId` through the chat plugin runtime's `send`.\n- The current implementation uses the simplest rule: the final assistant message is treated directly as the final result body and written to `output.md`.\n- Therefore, the \"Output Requirements\" section must be written for the final user, not only for developers.\n- For user-facing agent tasks, the body should require \"the final assistant message directly outputs the deliverable itself\". Do not let the executor explain how it created, checked, updated, triggered, or sent the task.\n- For content-generation tasks such as daily reports, reminders, morning briefings, and summaries, the final output should be exactly that content. It should not include process language such as \"I will handle this\", \"task sent\", or \"task status summary\".\n- By default, do not ask the executor to call chat plugin send actions again. The system handles final-result delivery.\n- Explicitly require chat plugin actions only for cross-conversation sending, additional CCs, multi-channel notifications, or similar cases.\n\n### Choosing `when` And `status`\n\n- A task is created as `status=enabled` by default. Set `paused` explicitly only when it is still a draft, likely to fail, or needs human confirmation.\n- For verified stable tasks that need automatic execution, use cron with `status=enabled`.\n- For a clear one-time execution, use `time:<ISO time with timezone>`. After execution, the system automatically falls back to `@manual` and `paused`.\n- If the user only wants to save it for later, do not enable scheduling directly.\n\n## Body Templates\n\n### Agent Template\n\n```md\n# Task Goal\n\n- Produce a final result that can be sent directly to the user.\n\n# Background And Input\n\n- Add context, files, links, scope, and assumptions here.\n\n# Execution Steps\n\n1. Understand the task goal and completion criteria.\n2. Collect necessary information and execute the task.\n3. Write key intermediate artifacts to the run directory.\n4. Output the final result body.\n\n# Output Requirements\n\n- The final assistant message is the final result. Do not include long logs.\n- The final assistant message must output the deliverable itself. Do not output task-management process, sending process, or status reports.\n- Do not use meta language such as \"I will help you...\", \"First, let me...\", or \"sent\".\n- By default, do not call the chat plugin send action again.\n\n# Trigger And Status Recommendation\n\n- Enable by default after creation. If this is only a draft or waiting for human confirmation, set it to `paused`.\n\n# Notes\n\n- Call chat plugin send actions only when cross-conversation or additional notifications are explicitly needed.\n```\n\n### Script Template\n\n```bash\n# Task goal: state in one sentence what the script should do\n# Input dependencies: list environment variables, files, and command dependencies\n# Failure conditions: list cases that should exit 1\n\nset -euo pipefail\n\n# 1. Prepare input\n\n# 2. Execute main logic\n\n# 3. Output final result. This output will be sent directly to the user.\n```\n\n## Recommendations\n\n- Run `list` before `create` or `update`.\n- Keep simple content-generation tasks single-turn by default. Set `review: true` only when you truly need \"draft, review, revise\".\n- Keep script task bodies as pure scripts, without redundant natural-language explanation.\n- If the user only wants to save something for later, create it as `paused`; otherwise keep the default enabled state.\n- The task body must describe what the final result should look like, not only say \"go do this and see\".\n- For content-generation tasks, explicitly require \"the final assistant message can only be the finished content body\" so the executor does not mistake process notes for the final result.\n";
7
+ const TEXT_MODULE_CONTENT = "# Task Plugin\n\nYou can use the `task` plugin to manage task definitions, execution, scheduling, and status control.\n\n## Task Model\n\nEach task is defined in `./.downcity/task/<title>/task.md` and contains:\n- frontmatter for structured fields\n- body for the task instructions\n\nCore frontmatter fields:\n- `title`: unique task identifier\n- `description`: task description\n- `when`: trigger condition, supporting `@manual`, cron, or `time:<ISO8601-with-timezone>`\n- `session_id`: task execution session\n- `status`: `enabled|paused|disabled`\n- `kind`: `agent|script`, defaulting to `agent`\n\nEach execution creates a run directory:\n- `./.downcity/task/<title>/<timestamp>/`\n\nCommon artifacts:\n- `input.md`\n- `output.md`: final output body for this run\n- `result.md`: execution summary\n- `run.json`\n- `run-progress.json`\n- `dialogue.md` / `dialogue.json`: multi-turn agent dialogue\n- `error.md`: failure details\n\n## Execution Kinds\n\n1. `kind=agent`\n- Sends the task body to an agent for execution.\n- Completes in a single turn by default. Simulated multi-turn review is enabled only when frontmatter explicitly sets `review: true`.\n- Suitable for research, analysis, and report generation.\n\n2. `kind=script`\n- Treats the body as a shell script.\n- The body must be non-empty and executable as a script.\n\n## Available Actions\n\n- `list`\n- `create`\n- `run`\n- `delete`\n- `update`\n- `status`\n- `enable`\n- `disable`\n\n## Action Examples\n\n- `plugin_call({ plugin: \"task\", action: \"list\", payload: { status } })`\n- `plugin_call({ plugin: \"task\", action: \"create\", payload: { title, description, session_id, when, kind, status } })`\n- `plugin_call({ plugin: \"task\", action: \"run\", payload: { title, reason } })`\n- `plugin_call({ plugin: \"task\", action: \"update\", payload: { title, description, when, status, session_id } })`\n- `plugin_call({ plugin: \"task\", action: \"delete\", payload: { title } })`\n\n## Key Constraints\n\n- `title` is unique. `create` deduplicates only by exact `title`.\n- After `when=time:...` triggers, the task is automatically set to `paused` and falls back to `when=@manual`.\n- `run` is accepted asynchronously. It returns `accepted=true`, `message`, and `executionId` immediately. Treat this as \"the task has entered background execution; the result will be sent automatically through the chat plugin runtime, and the current flow does not need to block.\"\n- If `run` returns `accepted=true`:\n - Do not manually forward task output to the user again.\n - Do not actively poll the run directory, `run-progress.json`, or `output.md`.\n - Inspect the run directory only when the user explicitly asks to debug, view artifacts, or confirm execution details.\n- Agent tasks only need to produce valid output by default. They should send to an external channel only when the task body explicitly requires it.\n\n## Designing The Task Body\n\n### Recommended Agent Task Structure\n\nThe body should include at least these headings:\n\n```md\n# Task Goal\n\n- What final result this task must deliver.\n\n# Background And Input\n\n- Data sources, scope, constraints, and reference materials.\n\n# Execution Steps\n\n1. What to do first.\n2. What to do next.\n3. Where key intermediate artifacts should be written.\n\n# Output Requirements\n\n- What format the final result must use.\n- Whether a table, JSON, or Markdown is required.\n- What content must not be included.\n\n# Trigger And Status Recommendation\n\n- Why this task is suitable for `@manual`, cron, or `time:...`.\n- Whether it should currently be `paused` or `enabled`.\n\n# Notes\n\n- Risks, boundaries, and things not to do.\n```\n\n### Agent Task Body Writing Constraints\n\n- The task body must read like a delivery contract, so another executor can run it directly without relying on the current chat context.\n- `# Task Goal` must clearly state the final deliverable. Do not write vague goals such as \"take a look\", \"research this\", or \"handle this\".\n- `# Background And Input` must specify sources, scope, objects, time range, and constraints. Do not assume the executor can see the original chat context.\n- `# Execution Steps` should describe the task workflow, not task-management actions. Do not write \"first check whether a task with the same name exists\", \"then create a task\", or \"then trigger the task\".\n- `# Output Requirements` must clearly specify the final artifact's format, structure, tone, length, and excluded content.\n- Explicitly state that the final assistant message will be written directly to `output.md` and sent to the user. Therefore, the final answer must be exactly the deliverable content.\n- Content-generation tasks such as daily reports, reminders, morning briefings, summaries, and reports must explicitly require \"the final output is the deliverable body itself\". Do not let the executor output process notes.\n- If the task result should be sent to the user, the body should require \"output send-ready message content\" instead of asking the executor to explain what it has sent.\n- Unless truly needed, do not ask the executor to repeat the task title, session_id, execution time, status, or other metadata in the body.\n- Constraints in the body must be executable and checkable. Avoid weak phrases such as \"appropriately\", \"as much as possible\", or \"depending on the situation\".\n- Do not put task creation, task update, task status lookup, or same-title existence checks into the body. Those belong to the task plugin, not to the task deliverable.\n\n### Forbidden Agent Task Body Patterns\n\n- Do not write the body in chat-reply style, for example:\n - \"I will help you...\"\n - \"First, let me...\"\n - \"I will check first...\"\n - \"I see there is already a task with the same name...\"\n- Do not write the body as task-management instructions, for example:\n - \"If the task exists, update it; otherwise create it.\"\n - \"First list, then run.\"\n - \"Tell the user that the task has started when done.\"\n- Do not write the body as a status-report template, for example:\n - \"Task status summary\"\n - \"Sent / completed / updated\"\n - \"Current task configuration\"\n- Do not describe only actions without describing the deliverable, for example:\n - \"Go collect some materials.\"\n - \"Generate some content and see.\"\n - \"Report back after finishing.\"\n- Do not use references that depend on the current context, for example:\n - \"Do what was said above.\"\n - \"Continue the previous one.\"\n - \"Send this out.\"\n\n### How To Judge Whether The Body Is Good\n\n- If you can copy the task body alone to another agent and it can still understand the goal, input, steps, and deliverable, the body is valid.\n- If deleting the output section leaves only \"go do something\" style instructions, the body is invalid.\n- If the body looks more like instructions for creating or updating a task than instructions for executing the task, the layering is wrong and the body must be rewritten.\n- If the body naturally encourages the executor to output process notes instead of the final artifact, the `# Output Requirements` section is not strong enough and must add explicit prohibitions.\n\n### Recommended Script Task Structure\n\n- The body must be a pure shell script. Do not mix in explanatory natural language.\n- Start with comments that describe the script's purpose, input dependencies, and failure conditions when possible.\n- Keep output stable so it can be sent directly as the final result.\n- If files need to be generated, write them to the run directory or to an explicit project path.\n\n### Output Design Principles\n\n- When a task completes, the system automatically sends the final result body back to the chat bound to `session_id` through the chat plugin runtime's `send`.\n- The current implementation uses the simplest rule: the final assistant message is treated directly as the final result body and written to `output.md`.\n- Therefore, the \"Output Requirements\" section must be written for the final user, not only for developers.\n- For user-facing agent tasks, the body should require \"the final assistant message directly outputs the deliverable itself\". Do not let the executor explain how it created, checked, updated, triggered, or sent the task.\n- For content-generation tasks such as daily reports, reminders, morning briefings, and summaries, the final output should be exactly that content. It should not include process language such as \"I will handle this\", \"task sent\", or \"task status summary\".\n- By default, do not ask the executor to call chat plugin send actions again. The system handles final-result delivery.\n- Explicitly require chat plugin actions only for cross-conversation sending, additional CCs, multi-channel notifications, or similar cases.\n\n### Choosing `when` And `status`\n\n- A task is created as `status=enabled` by default. Set `paused` explicitly only when it is still a draft, likely to fail, or needs human confirmation.\n- For verified stable tasks that need automatic execution, use cron with `status=enabled`.\n- For a clear one-time execution, use `time:<ISO time with timezone>`. After execution, the system automatically falls back to `@manual` and `paused`.\n- If the user only wants to save it for later, do not enable scheduling directly.\n\n## Body Templates\n\n### Agent Template\n\n```md\n# Task Goal\n\n- Produce a final result that can be sent directly to the user.\n\n# Background And Input\n\n- Add context, files, links, scope, and assumptions here.\n\n# Execution Steps\n\n1. Understand the task goal and completion criteria.\n2. Collect necessary information and execute the task.\n3. Write key intermediate artifacts to the run directory.\n4. Output the final result body.\n\n# Output Requirements\n\n- The final assistant message is the final result. Do not include long logs.\n- The final assistant message must output the deliverable itself. Do not output task-management process, sending process, or status reports.\n- Do not use meta language such as \"I will help you...\", \"First, let me...\", or \"sent\".\n- By default, do not call the chat plugin send action again.\n\n# Trigger And Status Recommendation\n\n- Enable by default after creation. If this is only a draft or waiting for human confirmation, set it to `paused`.\n\n# Notes\n\n- Call chat plugin send actions only when cross-conversation or additional notifications are explicitly needed.\n```\n\n### Script Template\n\n```bash\n# Task goal: state in one sentence what the script should do\n# Input dependencies: list environment variables, files, and command dependencies\n# Failure conditions: list cases that should exit 1\n\nset -euo pipefail\n\n# 1. Prepare input\n\n# 2. Execute main logic\n\n# 3. Output final result. This output will be sent directly to the user.\n```\n\n## Recommendations\n\n- Run `list` before `create` or `update`.\n- Keep simple content-generation tasks single-turn by default. Set `review: true` only when you truly need \"draft, review, revise\".\n- Keep script task bodies as pure scripts, without redundant natural-language explanation.\n- If the user only wants to save something for later, create it as `paused`; otherwise keep the default enabled state.\n- The task body must describe what the final result should look like, not only say \"go do this and see\".\n- For content-generation tasks, explicitly require \"the final assistant message can only be the finished content body\" so the executor does not mistake process notes for the final result.\n";
8
8
 
9
9
  export default TEXT_MODULE_CONTENT;
@@ -6,7 +6,7 @@
6
6
  * - cron 调度执行器由宿主注入,task runtime 不依赖具体实现。
7
7
  */
8
8
 
9
- import type { AgentContext } from "@downcity/agent";
9
+ import type { PluginContext } from "@downcity/agent";
10
10
  import {
11
11
  isTaskWhenManual,
12
12
  resolveTaskWhenCronExpression,
@@ -23,7 +23,7 @@ function formatTaskLogMessage(message: string): string {
23
23
  }
24
24
 
25
25
  export async function registerTaskCronJobs(params: {
26
- context: AgentContext;
26
+ context: PluginContext;
27
27
  engine: TaskCronEngine;
28
28
  /**
29
29
  * cron 表达式使用的 IANA 时区。
@@ -36,7 +36,7 @@ export async function registerTaskCronJobs(params: {
36
36
  }): Promise<{ tasksFound: number; jobsScheduled: number }> {
37
37
  const context = params.context;
38
38
  const logger = context.logger;
39
- const tasks = await listTasks(context.rootPath);
39
+ const tasks = await listTasks(context.workspace_path);
40
40
  const runtimeTimezone = params.timezone;
41
41
 
42
42
  let jobsScheduled = 0;
@@ -49,7 +49,7 @@ export async function registerTaskCronJobs(params: {
49
49
  try {
50
50
  const task = await readTask({
51
51
  taskId: item.taskId,
52
- projectRoot: context.rootPath,
52
+ project_root: context.workspace_path,
53
53
  });
54
54
  latestWhen = task.frontmatter.when;
55
55
  } catch {}
@@ -78,7 +78,7 @@ export async function registerTaskCronJobs(params: {
78
78
  // 关键点(中文):触发瞬间复查最新 task.md,避免 status/when 变更后仍沿用旧注册状态。
79
79
  const latest = await readTask({
80
80
  taskId,
81
- projectRoot: context.rootPath,
81
+ project_root: context.workspace_path,
82
82
  });
83
83
  if (String(latest.frontmatter.status).toLowerCase() !== "enabled") {
84
84
  return;
@@ -91,7 +91,7 @@ export async function registerTaskCronJobs(params: {
91
91
  const result = await runTaskNow({
92
92
  context,
93
93
  taskId,
94
- projectRoot: context.rootPath,
94
+ project_root: context.workspace_path,
95
95
  trigger: { type: "cron" },
96
96
  });
97
97
 
@@ -166,7 +166,7 @@ export async function registerTaskCronJobs(params: {
166
166
  try {
167
167
  const latest = await readTask({
168
168
  taskId,
169
- projectRoot: context.rootPath,
169
+ project_root: context.workspace_path,
170
170
  });
171
171
  if (String(latest.frontmatter.status).toLowerCase() !== "enabled") return;
172
172
  const latestPlannedMs = resolveTaskWhenOneShotMs(latest.frontmatter.when);
@@ -177,7 +177,7 @@ export async function registerTaskCronJobs(params: {
177
177
  const result = await runTaskNow({
178
178
  context,
179
179
  taskId,
180
- projectRoot: context.rootPath,
180
+ project_root: context.workspace_path,
181
181
  trigger: { type: "time" },
182
182
  });
183
183
 
@@ -206,10 +206,10 @@ export async function registerTaskCronJobs(params: {
206
206
  try {
207
207
  const latest = await readTask({
208
208
  taskId,
209
- projectRoot: context.rootPath,
209
+ project_root: context.workspace_path,
210
210
  });
211
211
  await writeTask({
212
- projectRoot: context.rootPath,
212
+ project_root: context.workspace_path,
213
213
  taskId,
214
214
  overwrite: true,
215
215
  frontmatter: {
@@ -7,9 +7,9 @@
7
7
  * - 当前文件只保留实例骨架与 lifecycle,不再依赖旧的模块级单例。
8
8
  */
9
9
 
10
- import { BasePlugin } from "@downcity/agent";
10
+ import { BasePlugin, create_action } from "@downcity/agent";
11
11
  import type { PluginActions } from "@downcity/agent";
12
- import type { AgentContext } from "@downcity/agent";
12
+ import type { PluginContext } from "@downcity/agent";
13
13
  import type {
14
14
  TaskCronRegisterResult,
15
15
  TaskSchedulerReloadResult,
@@ -24,7 +24,7 @@ import {
24
24
  reloadTaskSchedulerAfterMutation,
25
25
  } from "@/task/runtime/TaskActionExecution.js";
26
26
  import { TASK_PLUGIN_PROMPT } from "@/task/runtime/TaskPluginSystem.js";
27
- import { resolveRuntimeTimezone } from "@downcity/agent";
27
+ import { resolve_runtime_timezone } from "@downcity/agent";
28
28
 
29
29
  const TASK_LOG_PREFIX = "[TASK]";
30
30
 
@@ -78,10 +78,31 @@ export class TaskPlugin extends BasePlugin {
78
78
  super();
79
79
  this.options = options || {};
80
80
 
81
- this.actions = createTaskPluginActions({
82
- reloadSchedulerAfterMutation: async (params) =>
83
- this.reloadSchedulerAfterMutation(params),
84
- });
81
+ this.actions = {
82
+ ...createTaskPluginActions({
83
+ reloadSchedulerAfterMutation: async (params) =>
84
+ this.reloadSchedulerAfterMutation(params),
85
+ }),
86
+ reload: create_action({
87
+ description: "Reload the task scheduler from persisted tasks.",
88
+ execute: async ({ context }) => {
89
+ const result = await this.restartCronRuntime(context);
90
+ context.logger.info(
91
+ formatTaskLogMessage(
92
+ `Task cron trigger reloaded (tasks=${result.tasksFound}, jobs=${result.jobsScheduled})`,
93
+ ),
94
+ );
95
+ return {
96
+ success: true,
97
+ message: "task scheduler reloaded",
98
+ data: {
99
+ tasks_found: result.tasksFound,
100
+ jobs_scheduled: result.jobsScheduled,
101
+ },
102
+ };
103
+ },
104
+ }),
105
+ };
85
106
 
86
107
  this.lifecycle = {
87
108
  start: async (context) => {
@@ -98,25 +119,6 @@ export class TaskPlugin extends BasePlugin {
98
119
  if (!stopped) return;
99
120
  context.logger.info(formatTaskLogMessage("Task cron trigger stopped"));
100
121
  },
101
- command: async ({ context, command }) => {
102
- if (command !== "reschedule" && command !== "reload") {
103
- return {
104
- success: false,
105
- message: `Unknown task command: ${command}`,
106
- };
107
- }
108
-
109
- const result = await this.restartCronRuntime(context);
110
- context.logger.info(
111
- formatTaskLogMessage(
112
- `Task cron trigger reloaded (tasks=${result.tasksFound}, jobs=${result.jobsScheduled})`,
113
- ),
114
- );
115
- return {
116
- success: true,
117
- message: "task scheduler reloaded",
118
- };
119
- },
120
122
  };
121
123
  }
122
124
 
@@ -124,7 +126,7 @@ export class TaskPlugin extends BasePlugin {
124
126
  * 启动当前实例的 cron runtime。
125
127
  */
126
128
  async startCronRuntime(
127
- context: AgentContext,
129
+ context: PluginContext,
128
130
  ): Promise<TaskCronRegisterResult | null> {
129
131
  if (this.cronEngine) return null;
130
132
 
@@ -155,7 +157,7 @@ export class TaskPlugin extends BasePlugin {
155
157
  * 重启当前实例的 cron runtime。
156
158
  */
157
159
  async restartCronRuntime(
158
- context: AgentContext,
160
+ context: PluginContext,
159
161
  ): Promise<TaskCronRegisterResult> {
160
162
  await this.stopCronRuntime();
161
163
  const started = await this.startCronRuntime(context);
@@ -171,7 +173,7 @@ export class TaskPlugin extends BasePlugin {
171
173
  * 任务定义变更后重载 scheduler。
172
174
  */
173
175
  private async reloadSchedulerAfterMutation(params: {
174
- context: AgentContext;
176
+ context: PluginContext;
175
177
  action: "create" | "update" | "delete" | "status";
176
178
  title: string;
177
179
  }): Promise<TaskSchedulerReloadResult> {
@@ -187,6 +189,6 @@ export class TaskPlugin extends BasePlugin {
187
189
  * 解析当前 task cron 使用的时区。
188
190
  */
189
191
  private resolveTimezone(): string {
190
- return String(this.options.timezone || "").trim() || resolveRuntimeTimezone();
192
+ return String(this.options.timezone || "").trim() || resolve_runtime_timezone();
191
193
  }
192
194
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - `task.md` 使用 YAML frontmatter + markdown 正文
6
- * - frontmatter 必须包含:title/when/description/sessionId/status
6
+ * - frontmatter 必须包含:title/when/description/session_id/status
7
7
  * - `when` 统一承载触发语义:`@manual` / cron / `time:<ISO8601-with-timezone>`
8
8
  */
9
9
 
@@ -26,7 +26,7 @@ const REQUIRED_FIELDS: Array<keyof ShipTaskFrontmatterV1> = [
26
26
  "title",
27
27
  "when",
28
28
  "description",
29
- "sessionId",
29
+ "session_id",
30
30
  "status",
31
31
  ];
32
32
 
@@ -213,9 +213,9 @@ export function parseTaskMarkdown(params: {
213
213
  taskId: string;
214
214
  markdown: string;
215
215
  taskMdPath: string;
216
- projectRoot: string;
216
+ project_root: string;
217
217
  }): { ok: true; task: ShipTaskDefinitionV1 } | { ok: false; error: string } {
218
- const { taskId, markdown, taskMdPath, projectRoot } = params;
218
+ const { taskId, markdown, taskMdPath, project_root } = params;
219
219
  const text = String(markdown ?? "");
220
220
  const { frontMatterYaml, body } = parseFrontMatter(text);
221
221
 
@@ -277,8 +277,8 @@ export function parseTaskMarkdown(params: {
277
277
  }
278
278
 
279
279
  const kind = normalizeTaskKind(meta.kind);
280
- const bodyText = String(body ?? "").trim();
281
- if (kind === "script" && !bodyText) {
280
+ const body_text = String(body ?? "").trim();
281
+ if (kind === "script" && !body_text) {
282
282
  return { ok: false, error: "script task body cannot be empty" };
283
283
  }
284
284
 
@@ -286,14 +286,14 @@ export function parseTaskMarkdown(params: {
286
286
  title: rawTitle,
287
287
  when: whenNormalized.value,
288
288
  description: String(meta.description).trim(),
289
- sessionId: String(meta.sessionId).trim(),
289
+ session_id: String(meta.session_id).trim(),
290
290
  kind,
291
291
  ...(kind === "agent" && normalizeTaskReview(meta.review) === true ? { review: true } : {}),
292
292
  status,
293
293
  };
294
294
 
295
295
  const relTaskMdPath = path
296
- .relative(projectRoot, taskMdPath)
296
+ .relative(project_root, taskMdPath)
297
297
  .split(path.sep)
298
298
  .join("/");
299
299
 
@@ -322,8 +322,8 @@ export function buildTaskMarkdown(params: {
322
322
  }
323
323
 
324
324
  const kind = normalizeTaskKind(frontmatter.kind);
325
- const bodyText = String(body ?? "").trim();
326
- if (kind === "script" && !bodyText) {
325
+ const body_text = String(body ?? "").trim();
326
+ if (kind === "script" && !body_text) {
327
327
  throw new Error("script task body cannot be empty");
328
328
  }
329
329
 
@@ -331,7 +331,7 @@ export function buildTaskMarkdown(params: {
331
331
  title: String(frontmatter.title || "").trim(),
332
332
  when: whenNormalized.value,
333
333
  description: String(frontmatter.description || "").trim(),
334
- sessionId: String(frontmatter.sessionId || "").trim(),
334
+ session_id: String(frontmatter.session_id || "").trim(),
335
335
  kind,
336
336
  ...(kind === "agent" ? { review: Boolean(frontmatter.review) } : {}),
337
337
  status: String(frontmatter.status || "").trim(),
@@ -342,6 +342,6 @@ export function buildTaskMarkdown(params: {
342
342
  noRefs: true,
343
343
  });
344
344
 
345
- const bodyWithTrailingLf = bodyText ? bodyText + "\n" : "";
345
+ const bodyWithTrailingLf = body_text ? body_text + "\n" : "";
346
346
  return `---\n${yamlText}---\n\n${bodyWithTrailingLf}`;
347
347
  }
@@ -6,7 +6,7 @@
6
6
  * - definition: `./.downcity/task/<taskId>/task.md`
7
7
  * - run dir: `./.downcity/task/<taskId>/<timestamp>/`
8
8
  *
9
- * 同时定义“task run sessionId”格式,用于把 Agent 的 session 映射到 run 目录:
9
+ * 同时定义“task run session_id”格式,用于把 Agent 的 session 映射到 run 目录:
10
10
  * - `task-run:<taskId>:<timestamp>`
11
11
  */
12
12
 
@@ -59,16 +59,16 @@ export function normalizeTaskId(input: string): string {
59
59
  return id;
60
60
  }
61
61
 
62
- export function getTaskRootDir(projectRoot: string): string {
63
- return path.join(String(projectRoot || "").trim(), ".downcity", "task");
62
+ export function getTaskRootDir(project_root: string): string {
63
+ return path.join(String(project_root || "").trim(), ".downcity", "task");
64
64
  }
65
65
 
66
- export function getTaskDir(projectRoot: string, taskId: string): string {
67
- return path.join(getTaskRootDir(projectRoot), normalizeTaskId(taskId));
66
+ export function getTaskDir(project_root: string, taskId: string): string {
67
+ return path.join(getTaskRootDir(project_root), normalizeTaskId(taskId));
68
68
  }
69
69
 
70
- export function getTaskMdPath(projectRoot: string, taskId: string): string {
71
- return path.join(getTaskDir(projectRoot, taskId), "task.md");
70
+ export function getTaskMdPath(project_root: string, taskId: string): string {
71
+ return path.join(getTaskDir(project_root, taskId), "task.md");
72
72
  }
73
73
 
74
74
  export function formatTaskRunTimestamp(date: Date = new Date()): string {
@@ -85,13 +85,13 @@ export function formatTaskRunTimestamp(date: Date = new Date()): string {
85
85
  }
86
86
 
87
87
  export function getTaskRunDir(
88
- projectRoot: string,
88
+ project_root: string,
89
89
  taskId: string,
90
90
  timestamp: string,
91
91
  ): string {
92
92
  const ts = String(timestamp || "").trim();
93
93
  if (!ts) throw new Error("timestamp is required");
94
- return path.join(getTaskDir(projectRoot, taskId), ts);
94
+ return path.join(getTaskDir(project_root, taskId), ts);
95
95
  }
96
96
 
97
97
  export function createTaskRunSessionId(taskId: string, timestamp: string): string {
@@ -102,9 +102,9 @@ export function createTaskRunSessionId(taskId: string, timestamp: string): strin
102
102
  }
103
103
 
104
104
  export function parseTaskRunSessionId(
105
- sessionId: string,
105
+ session_id: string,
106
106
  ): { taskId: string; timestamp: string } | null {
107
- const key = String(sessionId || "").trim();
107
+ const key = String(session_id || "").trim();
108
108
  if (!key) return null;
109
109
  const m = key.match(/^task-run:([^:]+):(.+)$/);
110
110
  if (!m) return null;