@downcity/plugins 1.0.4

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 (1312) hide show
  1. package/bin/BuiltinPlugins.d.ts +23 -0
  2. package/bin/BuiltinPlugins.d.ts.map +1 -0
  3. package/bin/BuiltinPlugins.js +42 -0
  4. package/bin/BuiltinPlugins.js.map +1 -0
  5. package/bin/asr/Config.d.ts +43 -0
  6. package/bin/asr/Config.d.ts.map +1 -0
  7. package/bin/asr/Config.js +107 -0
  8. package/bin/asr/Config.js.map +1 -0
  9. package/bin/asr/Dependency.d.ts +77 -0
  10. package/bin/asr/Dependency.d.ts.map +1 -0
  11. package/bin/asr/Dependency.js +238 -0
  12. package/bin/asr/Dependency.js.map +1 -0
  13. package/bin/asr/InboundAugment.d.ts +17 -0
  14. package/bin/asr/InboundAugment.d.ts.map +1 -0
  15. package/bin/asr/InboundAugment.js +47 -0
  16. package/bin/asr/InboundAugment.js.map +1 -0
  17. package/bin/asr/ModelCatalog.d.ts +29 -0
  18. package/bin/asr/ModelCatalog.d.ts.map +1 -0
  19. package/bin/asr/ModelCatalog.js +25 -0
  20. package/bin/asr/ModelCatalog.js.map +1 -0
  21. package/bin/asr/Plugin.d.ts +18 -0
  22. package/bin/asr/Plugin.d.ts.map +1 -0
  23. package/bin/asr/Plugin.js +481 -0
  24. package/bin/asr/Plugin.js.map +1 -0
  25. package/bin/auth/Plugin.d.ts +18 -0
  26. package/bin/auth/Plugin.d.ts.map +1 -0
  27. package/bin/auth/Plugin.js +190 -0
  28. package/bin/auth/Plugin.js.map +1 -0
  29. package/bin/auth/runtime/AuthorizationConfig.d.ts +41 -0
  30. package/bin/auth/runtime/AuthorizationConfig.d.ts.map +1 -0
  31. package/bin/auth/runtime/AuthorizationConfig.js +185 -0
  32. package/bin/auth/runtime/AuthorizationConfig.js.map +1 -0
  33. package/bin/auth/runtime/AuthorizationPolicy.d.ts +28 -0
  34. package/bin/auth/runtime/AuthorizationPolicy.d.ts.map +1 -0
  35. package/bin/auth/runtime/AuthorizationPolicy.js +124 -0
  36. package/bin/auth/runtime/AuthorizationPolicy.js.map +1 -0
  37. package/bin/auth/runtime/AuthorizationStore.d.ts +29 -0
  38. package/bin/auth/runtime/AuthorizationStore.d.ts.map +1 -0
  39. package/bin/auth/runtime/AuthorizationStore.js +179 -0
  40. package/bin/auth/runtime/AuthorizationStore.js.map +1 -0
  41. package/bin/auth/types/AuthPlugin.d.ts +407 -0
  42. package/bin/auth/types/AuthPlugin.d.ts.map +1 -0
  43. package/bin/auth/types/AuthPlugin.js +115 -0
  44. package/bin/auth/types/AuthPlugin.js.map +1 -0
  45. package/bin/chat/Action.d.ts +125 -0
  46. package/bin/chat/Action.d.ts.map +1 -0
  47. package/bin/chat/Action.js +376 -0
  48. package/bin/chat/Action.js.map +1 -0
  49. package/bin/chat/ChatPlugin.d.ts +89 -0
  50. package/bin/chat/ChatPlugin.d.ts.map +1 -0
  51. package/bin/chat/ChatPlugin.js +208 -0
  52. package/bin/chat/ChatPlugin.js.map +1 -0
  53. package/bin/chat/ChatPluginTypes.d.ts +122 -0
  54. package/bin/chat/ChatPluginTypes.d.ts.map +1 -0
  55. package/bin/chat/ChatPluginTypes.js +10 -0
  56. package/bin/chat/ChatPluginTypes.js.map +1 -0
  57. package/bin/chat/Index.d.ts +9 -0
  58. package/bin/chat/Index.d.ts.map +1 -0
  59. package/bin/chat/Index.js +9 -0
  60. package/bin/chat/Index.js.map +1 -0
  61. package/bin/chat/PROMPT.direct.d.ts +7 -0
  62. package/bin/chat/PROMPT.direct.d.ts.map +1 -0
  63. package/bin/chat/PROMPT.direct.js +8 -0
  64. package/bin/chat/PROMPT.direct.js.map +1 -0
  65. package/bin/chat/accounts/ChannelAccountManager.d.ts +61 -0
  66. package/bin/chat/accounts/ChannelAccountManager.d.ts.map +1 -0
  67. package/bin/chat/accounts/ChannelAccountManager.js +264 -0
  68. package/bin/chat/accounts/ChannelAccountManager.js.map +1 -0
  69. package/bin/chat/accounts/Crypto.d.ts +20 -0
  70. package/bin/chat/accounts/Crypto.d.ts.map +1 -0
  71. package/bin/chat/accounts/Crypto.js +75 -0
  72. package/bin/chat/accounts/Crypto.js.map +1 -0
  73. package/bin/chat/accounts/Store.d.ts +38 -0
  74. package/bin/chat/accounts/Store.d.ts.map +1 -0
  75. package/bin/chat/accounts/Store.js +220 -0
  76. package/bin/chat/accounts/Store.js.map +1 -0
  77. package/bin/chat/channels/BaseChatChannel.d.ts +201 -0
  78. package/bin/chat/channels/BaseChatChannel.d.ts.map +1 -0
  79. package/bin/chat/channels/BaseChatChannel.js +294 -0
  80. package/bin/chat/channels/BaseChatChannel.js.map +1 -0
  81. package/bin/chat/channels/BaseChatChannelQueue.d.ts +73 -0
  82. package/bin/chat/channels/BaseChatChannelQueue.d.ts.map +1 -0
  83. package/bin/chat/channels/BaseChatChannelQueue.js +237 -0
  84. package/bin/chat/channels/BaseChatChannelQueue.js.map +1 -0
  85. package/bin/chat/channels/BaseChatChannelSupport.d.ts +189 -0
  86. package/bin/chat/channels/BaseChatChannelSupport.d.ts.map +1 -0
  87. package/bin/chat/channels/BaseChatChannelSupport.js +141 -0
  88. package/bin/chat/channels/BaseChatChannelSupport.js.map +1 -0
  89. package/bin/chat/channels/BotInfoProvider.d.ts +18 -0
  90. package/bin/chat/channels/BotInfoProvider.d.ts.map +1 -0
  91. package/bin/chat/channels/BotInfoProvider.js +32 -0
  92. package/bin/chat/channels/BotInfoProvider.js.map +1 -0
  93. package/bin/chat/channels/Configuration.d.ts +27 -0
  94. package/bin/chat/channels/Configuration.d.ts.map +1 -0
  95. package/bin/chat/channels/Configuration.js +19 -0
  96. package/bin/chat/channels/Configuration.js.map +1 -0
  97. package/bin/chat/channels/ConfigurationRegistry.d.ts +18 -0
  98. package/bin/chat/channels/ConfigurationRegistry.d.ts.map +1 -0
  99. package/bin/chat/channels/ConfigurationRegistry.js +31 -0
  100. package/bin/chat/channels/ConfigurationRegistry.js.map +1 -0
  101. package/bin/chat/channels/feishu/BotInfo.d.ts +20 -0
  102. package/bin/chat/channels/feishu/BotInfo.d.ts.map +1 -0
  103. package/bin/chat/channels/feishu/BotInfo.js +147 -0
  104. package/bin/chat/channels/feishu/BotInfo.js.map +1 -0
  105. package/bin/chat/channels/feishu/Configuration.d.ts +17 -0
  106. package/bin/chat/channels/feishu/Configuration.d.ts.map +1 -0
  107. package/bin/chat/channels/feishu/Configuration.js +59 -0
  108. package/bin/chat/channels/feishu/Configuration.js.map +1 -0
  109. package/bin/chat/channels/feishu/Feishu.d.ts +116 -0
  110. package/bin/chat/channels/feishu/Feishu.d.ts.map +1 -0
  111. package/bin/chat/channels/feishu/Feishu.js +326 -0
  112. package/bin/chat/channels/feishu/Feishu.js.map +1 -0
  113. package/bin/chat/channels/feishu/FeishuInbound.d.ts +21 -0
  114. package/bin/chat/channels/feishu/FeishuInbound.d.ts.map +1 -0
  115. package/bin/chat/channels/feishu/FeishuInbound.js +43 -0
  116. package/bin/chat/channels/feishu/FeishuInbound.js.map +1 -0
  117. package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts +155 -0
  118. package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -0
  119. package/bin/chat/channels/feishu/FeishuMessageHandler.js +247 -0
  120. package/bin/chat/channels/feishu/FeishuMessageHandler.js.map +1 -0
  121. package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts +130 -0
  122. package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -0
  123. package/bin/chat/channels/feishu/FeishuPlatformClient.js +316 -0
  124. package/bin/chat/channels/feishu/FeishuPlatformClient.js.map +1 -0
  125. package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts +102 -0
  126. package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts.map +1 -0
  127. package/bin/chat/channels/feishu/FeishuPlatformLookup.js +299 -0
  128. package/bin/chat/channels/feishu/FeishuPlatformLookup.js.map +1 -0
  129. package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts +49 -0
  130. package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts.map +1 -0
  131. package/bin/chat/channels/feishu/FeishuPlatformMessaging.js +139 -0
  132. package/bin/chat/channels/feishu/FeishuPlatformMessaging.js.map +1 -0
  133. package/bin/chat/channels/feishu/InboundAttachment.d.ts +31 -0
  134. package/bin/chat/channels/feishu/InboundAttachment.d.ts.map +1 -0
  135. package/bin/chat/channels/feishu/InboundAttachment.js +222 -0
  136. package/bin/chat/channels/feishu/InboundAttachment.js.map +1 -0
  137. package/bin/chat/channels/feishu/PROMPT.direct.d.ts +7 -0
  138. package/bin/chat/channels/feishu/PROMPT.direct.d.ts.map +1 -0
  139. package/bin/chat/channels/feishu/PROMPT.direct.js +8 -0
  140. package/bin/chat/channels/feishu/PROMPT.direct.js.map +1 -0
  141. package/bin/chat/channels/feishu/PostMessage.d.ts +48 -0
  142. package/bin/chat/channels/feishu/PostMessage.d.ts.map +1 -0
  143. package/bin/chat/channels/feishu/PostMessage.js +413 -0
  144. package/bin/chat/channels/feishu/PostMessage.js.map +1 -0
  145. package/bin/chat/channels/feishu/ReplyContext.d.ts +18 -0
  146. package/bin/chat/channels/feishu/ReplyContext.d.ts.map +1 -0
  147. package/bin/chat/channels/feishu/ReplyContext.js +56 -0
  148. package/bin/chat/channels/feishu/ReplyContext.js.map +1 -0
  149. package/bin/chat/channels/feishu/Shared.d.ts +21 -0
  150. package/bin/chat/channels/feishu/Shared.d.ts.map +1 -0
  151. package/bin/chat/channels/feishu/Shared.js +69 -0
  152. package/bin/chat/channels/feishu/Shared.js.map +1 -0
  153. package/bin/chat/channels/feishu/types/FeishuChannel.d.ts +127 -0
  154. package/bin/chat/channels/feishu/types/FeishuChannel.d.ts.map +1 -0
  155. package/bin/chat/channels/feishu/types/FeishuChannel.js +9 -0
  156. package/bin/chat/channels/feishu/types/FeishuChannel.js.map +1 -0
  157. package/bin/chat/channels/qq/BotInfo.d.ts +19 -0
  158. package/bin/chat/channels/qq/BotInfo.d.ts.map +1 -0
  159. package/bin/chat/channels/qq/BotInfo.js +112 -0
  160. package/bin/chat/channels/qq/BotInfo.js.map +1 -0
  161. package/bin/chat/channels/qq/Configuration.d.ts +17 -0
  162. package/bin/chat/channels/qq/Configuration.d.ts.map +1 -0
  163. package/bin/chat/channels/qq/Configuration.js +59 -0
  164. package/bin/chat/channels/qq/Configuration.js.map +1 -0
  165. package/bin/chat/channels/qq/PROMPT.direct.d.ts +7 -0
  166. package/bin/chat/channels/qq/PROMPT.direct.d.ts.map +1 -0
  167. package/bin/chat/channels/qq/PROMPT.direct.js +8 -0
  168. package/bin/chat/channels/qq/PROMPT.direct.js.map +1 -0
  169. package/bin/chat/channels/qq/QQ.d.ts +92 -0
  170. package/bin/chat/channels/qq/QQ.d.ts.map +1 -0
  171. package/bin/chat/channels/qq/QQ.js +287 -0
  172. package/bin/chat/channels/qq/QQ.js.map +1 -0
  173. package/bin/chat/channels/qq/QQEventCapture.d.ts +22 -0
  174. package/bin/chat/channels/qq/QQEventCapture.d.ts.map +1 -0
  175. package/bin/chat/channels/qq/QQEventCapture.js +67 -0
  176. package/bin/chat/channels/qq/QQEventCapture.js.map +1 -0
  177. package/bin/chat/channels/qq/QQGatewayAuth.d.ts +119 -0
  178. package/bin/chat/channels/qq/QQGatewayAuth.d.ts.map +1 -0
  179. package/bin/chat/channels/qq/QQGatewayAuth.js +186 -0
  180. package/bin/chat/channels/qq/QQGatewayAuth.js.map +1 -0
  181. package/bin/chat/channels/qq/QQGatewayClient.d.ts +155 -0
  182. package/bin/chat/channels/qq/QQGatewayClient.d.ts.map +1 -0
  183. package/bin/chat/channels/qq/QQGatewayClient.js +381 -0
  184. package/bin/chat/channels/qq/QQGatewayClient.js.map +1 -0
  185. package/bin/chat/channels/qq/QQGatewayConnection.d.ts +65 -0
  186. package/bin/chat/channels/qq/QQGatewayConnection.d.ts.map +1 -0
  187. package/bin/chat/channels/qq/QQGatewayConnection.js +110 -0
  188. package/bin/chat/channels/qq/QQGatewayConnection.js.map +1 -0
  189. package/bin/chat/channels/qq/QQGatewayHeartbeat.d.ts +59 -0
  190. package/bin/chat/channels/qq/QQGatewayHeartbeat.d.ts.map +1 -0
  191. package/bin/chat/channels/qq/QQGatewayHeartbeat.js +58 -0
  192. package/bin/chat/channels/qq/QQGatewayHeartbeat.js.map +1 -0
  193. package/bin/chat/channels/qq/QQGatewayProtocol.d.ts +86 -0
  194. package/bin/chat/channels/qq/QQGatewayProtocol.d.ts.map +1 -0
  195. package/bin/chat/channels/qq/QQGatewayProtocol.js +93 -0
  196. package/bin/chat/channels/qq/QQGatewayProtocol.js.map +1 -0
  197. package/bin/chat/channels/qq/QQGatewaySend.d.ts +84 -0
  198. package/bin/chat/channels/qq/QQGatewaySend.d.ts.map +1 -0
  199. package/bin/chat/channels/qq/QQGatewaySend.js +120 -0
  200. package/bin/chat/channels/qq/QQGatewaySend.js.map +1 -0
  201. package/bin/chat/channels/qq/QQGatewaySupport.d.ts +39 -0
  202. package/bin/chat/channels/qq/QQGatewaySupport.d.ts.map +1 -0
  203. package/bin/chat/channels/qq/QQGatewaySupport.js +137 -0
  204. package/bin/chat/channels/qq/QQGatewaySupport.js.map +1 -0
  205. package/bin/chat/channels/qq/QQInbound.d.ts +47 -0
  206. package/bin/chat/channels/qq/QQInbound.d.ts.map +1 -0
  207. package/bin/chat/channels/qq/QQInbound.js +235 -0
  208. package/bin/chat/channels/qq/QQInbound.js.map +1 -0
  209. package/bin/chat/channels/qq/QQInboundDedupe.d.ts +48 -0
  210. package/bin/chat/channels/qq/QQInboundDedupe.d.ts.map +1 -0
  211. package/bin/chat/channels/qq/QQInboundDedupe.js +108 -0
  212. package/bin/chat/channels/qq/QQInboundDedupe.js.map +1 -0
  213. package/bin/chat/channels/qq/QQMessageHandler.d.ts +129 -0
  214. package/bin/chat/channels/qq/QQMessageHandler.d.ts.map +1 -0
  215. package/bin/chat/channels/qq/QQMessageHandler.js +284 -0
  216. package/bin/chat/channels/qq/QQMessageHandler.js.map +1 -0
  217. package/bin/chat/channels/qq/QQSendSupport.d.ts +20 -0
  218. package/bin/chat/channels/qq/QQSendSupport.d.ts.map +1 -0
  219. package/bin/chat/channels/qq/QQSendSupport.js +86 -0
  220. package/bin/chat/channels/qq/QQSendSupport.js.map +1 -0
  221. package/bin/chat/channels/qq/QQSupport.d.ts +102 -0
  222. package/bin/chat/channels/qq/QQSupport.d.ts.map +1 -0
  223. package/bin/chat/channels/qq/QQSupport.js +172 -0
  224. package/bin/chat/channels/qq/QQSupport.js.map +1 -0
  225. package/bin/chat/channels/qq/VoiceInput.d.ts +64 -0
  226. package/bin/chat/channels/qq/VoiceInput.d.ts.map +1 -0
  227. package/bin/chat/channels/qq/VoiceInput.js +299 -0
  228. package/bin/chat/channels/qq/VoiceInput.js.map +1 -0
  229. package/bin/chat/channels/qq/types/QqChannel.d.ts +485 -0
  230. package/bin/chat/channels/qq/types/QqChannel.d.ts.map +1 -0
  231. package/bin/chat/channels/qq/types/QqChannel.js +42 -0
  232. package/bin/chat/channels/qq/types/QqChannel.js.map +1 -0
  233. package/bin/chat/channels/qq/types/QqGatewaySupport.d.ts +82 -0
  234. package/bin/chat/channels/qq/types/QqGatewaySupport.d.ts.map +1 -0
  235. package/bin/chat/channels/qq/types/QqGatewaySupport.js +9 -0
  236. package/bin/chat/channels/qq/types/QqGatewaySupport.js.map +1 -0
  237. package/bin/chat/channels/telegram/ApiClient.d.ts +99 -0
  238. package/bin/chat/channels/telegram/ApiClient.d.ts.map +1 -0
  239. package/bin/chat/channels/telegram/ApiClient.js +306 -0
  240. package/bin/chat/channels/telegram/ApiClient.js.map +1 -0
  241. package/bin/chat/channels/telegram/Bot.d.ts +97 -0
  242. package/bin/chat/channels/telegram/Bot.d.ts.map +1 -0
  243. package/bin/chat/channels/telegram/Bot.js +246 -0
  244. package/bin/chat/channels/telegram/Bot.js.map +1 -0
  245. package/bin/chat/channels/telegram/BotInfo.d.ts +19 -0
  246. package/bin/chat/channels/telegram/BotInfo.d.ts.map +1 -0
  247. package/bin/chat/channels/telegram/BotInfo.js +71 -0
  248. package/bin/chat/channels/telegram/BotInfo.js.map +1 -0
  249. package/bin/chat/channels/telegram/Configuration.d.ts +17 -0
  250. package/bin/chat/channels/telegram/Configuration.d.ts.map +1 -0
  251. package/bin/chat/channels/telegram/Configuration.js +59 -0
  252. package/bin/chat/channels/telegram/Configuration.js.map +1 -0
  253. package/bin/chat/channels/telegram/Handlers.d.ts +42 -0
  254. package/bin/chat/channels/telegram/Handlers.d.ts.map +1 -0
  255. package/bin/chat/channels/telegram/Handlers.js +45 -0
  256. package/bin/chat/channels/telegram/Handlers.js.map +1 -0
  257. package/bin/chat/channels/telegram/PROMPT.direct.d.ts +7 -0
  258. package/bin/chat/channels/telegram/PROMPT.direct.d.ts.map +1 -0
  259. package/bin/chat/channels/telegram/PROMPT.direct.js +8 -0
  260. package/bin/chat/channels/telegram/PROMPT.direct.js.map +1 -0
  261. package/bin/chat/channels/telegram/ReplyContext.d.ts +14 -0
  262. package/bin/chat/channels/telegram/ReplyContext.d.ts.map +1 -0
  263. package/bin/chat/channels/telegram/ReplyContext.js +57 -0
  264. package/bin/chat/channels/telegram/ReplyContext.js.map +1 -0
  265. package/bin/chat/channels/telegram/Shared.d.ts +221 -0
  266. package/bin/chat/channels/telegram/Shared.d.ts.map +1 -0
  267. package/bin/chat/channels/telegram/Shared.js +171 -0
  268. package/bin/chat/channels/telegram/Shared.js.map +1 -0
  269. package/bin/chat/channels/telegram/StateStore.d.ts +27 -0
  270. package/bin/chat/channels/telegram/StateStore.d.ts.map +1 -0
  271. package/bin/chat/channels/telegram/StateStore.js +53 -0
  272. package/bin/chat/channels/telegram/StateStore.js.map +1 -0
  273. package/bin/chat/channels/telegram/TelegramInbound.d.ts +46 -0
  274. package/bin/chat/channels/telegram/TelegramInbound.d.ts.map +1 -0
  275. package/bin/chat/channels/telegram/TelegramInbound.js +148 -0
  276. package/bin/chat/channels/telegram/TelegramInbound.js.map +1 -0
  277. package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts +142 -0
  278. package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -0
  279. package/bin/chat/channels/telegram/TelegramMessageHandler.js +267 -0
  280. package/bin/chat/channels/telegram/TelegramMessageHandler.js.map +1 -0
  281. package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts +55 -0
  282. package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts.map +1 -0
  283. package/bin/chat/channels/telegram/TelegramPendingUpdates.js +125 -0
  284. package/bin/chat/channels/telegram/TelegramPendingUpdates.js.map +1 -0
  285. package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts +161 -0
  286. package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -0
  287. package/bin/chat/channels/telegram/TelegramPlatformClient.js +366 -0
  288. package/bin/chat/channels/telegram/TelegramPlatformClient.js.map +1 -0
  289. package/bin/chat/runtime/ChannelContextStore.d.ts +78 -0
  290. package/bin/chat/runtime/ChannelContextStore.d.ts.map +1 -0
  291. package/bin/chat/runtime/ChannelContextStore.js +336 -0
  292. package/bin/chat/runtime/ChannelContextStore.js.map +1 -0
  293. package/bin/chat/runtime/ChatActionExecution.d.ts +145 -0
  294. package/bin/chat/runtime/ChatActionExecution.d.ts.map +1 -0
  295. package/bin/chat/runtime/ChatActionExecution.js +287 -0
  296. package/bin/chat/runtime/ChatActionExecution.js.map +1 -0
  297. package/bin/chat/runtime/ChatActionInput.d.ts +22 -0
  298. package/bin/chat/runtime/ChatActionInput.d.ts.map +1 -0
  299. package/bin/chat/runtime/ChatActionInput.js +114 -0
  300. package/bin/chat/runtime/ChatActionInput.js.map +1 -0
  301. package/bin/chat/runtime/ChatActionInputSupport.d.ts +33 -0
  302. package/bin/chat/runtime/ChatActionInputSupport.d.ts.map +1 -0
  303. package/bin/chat/runtime/ChatActionInputSupport.js +66 -0
  304. package/bin/chat/runtime/ChatActionInputSupport.js.map +1 -0
  305. package/bin/chat/runtime/ChatChannelActions.d.ts +122 -0
  306. package/bin/chat/runtime/ChatChannelActions.d.ts.map +1 -0
  307. package/bin/chat/runtime/ChatChannelActions.js +231 -0
  308. package/bin/chat/runtime/ChatChannelActions.js.map +1 -0
  309. package/bin/chat/runtime/ChatChannelConfig.d.ts +61 -0
  310. package/bin/chat/runtime/ChatChannelConfig.d.ts.map +1 -0
  311. package/bin/chat/runtime/ChatChannelConfig.js +260 -0
  312. package/bin/chat/runtime/ChatChannelConfig.js.map +1 -0
  313. package/bin/chat/runtime/ChatChannelCore.d.ts +49 -0
  314. package/bin/chat/runtime/ChatChannelCore.d.ts.map +1 -0
  315. package/bin/chat/runtime/ChatChannelCore.js +109 -0
  316. package/bin/chat/runtime/ChatChannelCore.js.map +1 -0
  317. package/bin/chat/runtime/ChatChannelFacade.d.ts +12 -0
  318. package/bin/chat/runtime/ChatChannelFacade.d.ts.map +1 -0
  319. package/bin/chat/runtime/ChatChannelFacade.js +12 -0
  320. package/bin/chat/runtime/ChatChannelFacade.js.map +1 -0
  321. package/bin/chat/runtime/ChatChannelLifecycle.d.ts +28 -0
  322. package/bin/chat/runtime/ChatChannelLifecycle.d.ts.map +1 -0
  323. package/bin/chat/runtime/ChatChannelLifecycle.js +132 -0
  324. package/bin/chat/runtime/ChatChannelLifecycle.js.map +1 -0
  325. package/bin/chat/runtime/ChatHistoryStore.d.ts +72 -0
  326. package/bin/chat/runtime/ChatHistoryStore.d.ts.map +1 -0
  327. package/bin/chat/runtime/ChatHistoryStore.js +219 -0
  328. package/bin/chat/runtime/ChatHistoryStore.js.map +1 -0
  329. package/bin/chat/runtime/ChatIngressStore.d.ts +44 -0
  330. package/bin/chat/runtime/ChatIngressStore.d.ts.map +1 -0
  331. package/bin/chat/runtime/ChatIngressStore.js +51 -0
  332. package/bin/chat/runtime/ChatIngressStore.js.map +1 -0
  333. package/bin/chat/runtime/ChatMetaStore.d.ts +68 -0
  334. package/bin/chat/runtime/ChatMetaStore.d.ts.map +1 -0
  335. package/bin/chat/runtime/ChatMetaStore.js +143 -0
  336. package/bin/chat/runtime/ChatMetaStore.js.map +1 -0
  337. package/bin/chat/runtime/ChatPluginActionRegistry.d.ts +17 -0
  338. package/bin/chat/runtime/ChatPluginActionRegistry.d.ts.map +1 -0
  339. package/bin/chat/runtime/ChatPluginActionRegistry.js +304 -0
  340. package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -0
  341. package/bin/chat/runtime/ChatPluginActions.d.ts +5 -0
  342. package/bin/chat/runtime/ChatPluginActions.d.ts.map +1 -0
  343. package/bin/chat/runtime/ChatPluginActions.js +5 -0
  344. package/bin/chat/runtime/ChatPluginActions.js.map +1 -0
  345. package/bin/chat/runtime/ChatPluginSystem.d.ts +22 -0
  346. package/bin/chat/runtime/ChatPluginSystem.d.ts.map +1 -0
  347. package/bin/chat/runtime/ChatPluginSystem.js +44 -0
  348. package/bin/chat/runtime/ChatPluginSystem.js.map +1 -0
  349. package/bin/chat/runtime/ChatPromptAssets.d.ts +24 -0
  350. package/bin/chat/runtime/ChatPromptAssets.d.ts.map +1 -0
  351. package/bin/chat/runtime/ChatPromptAssets.js +28 -0
  352. package/bin/chat/runtime/ChatPromptAssets.js.map +1 -0
  353. package/bin/chat/runtime/ChatQueue.d.ts +40 -0
  354. package/bin/chat/runtime/ChatQueue.d.ts.map +1 -0
  355. package/bin/chat/runtime/ChatQueue.js +52 -0
  356. package/bin/chat/runtime/ChatQueue.js.map +1 -0
  357. package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts +31 -0
  358. package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts.map +1 -0
  359. package/bin/chat/runtime/ChatQueueReplyDispatch.js +168 -0
  360. package/bin/chat/runtime/ChatQueueReplyDispatch.js.map +1 -0
  361. package/bin/chat/runtime/ChatQueueStore.d.ts +85 -0
  362. package/bin/chat/runtime/ChatQueueStore.d.ts.map +1 -0
  363. package/bin/chat/runtime/ChatQueueStore.js +130 -0
  364. package/bin/chat/runtime/ChatQueueStore.js.map +1 -0
  365. package/bin/chat/runtime/ChatQueueWorker.d.ts +83 -0
  366. package/bin/chat/runtime/ChatQueueWorker.d.ts.map +1 -0
  367. package/bin/chat/runtime/ChatQueueWorker.js +406 -0
  368. package/bin/chat/runtime/ChatQueueWorker.js.map +1 -0
  369. package/bin/chat/runtime/ChatQueueWorkerSupport.d.ts +36 -0
  370. package/bin/chat/runtime/ChatQueueWorkerSupport.d.ts.map +1 -0
  371. package/bin/chat/runtime/ChatQueueWorkerSupport.js +101 -0
  372. package/bin/chat/runtime/ChatQueueWorkerSupport.js.map +1 -0
  373. package/bin/chat/runtime/ChatSendActionInput.d.ts +23 -0
  374. package/bin/chat/runtime/ChatSendActionInput.d.ts.map +1 -0
  375. package/bin/chat/runtime/ChatSendActionInput.js +205 -0
  376. package/bin/chat/runtime/ChatSendActionInput.js.map +1 -0
  377. package/bin/chat/runtime/ChatSendMetadata.d.ts +20 -0
  378. package/bin/chat/runtime/ChatSendMetadata.d.ts.map +1 -0
  379. package/bin/chat/runtime/ChatSendMetadata.js +130 -0
  380. package/bin/chat/runtime/ChatSendMetadata.js.map +1 -0
  381. package/bin/chat/runtime/ChatSendRegistry.d.ts +27 -0
  382. package/bin/chat/runtime/ChatSendRegistry.d.ts.map +1 -0
  383. package/bin/chat/runtime/ChatSendRegistry.js +26 -0
  384. package/bin/chat/runtime/ChatSendRegistry.js.map +1 -0
  385. package/bin/chat/runtime/ChatSession.d.ts +97 -0
  386. package/bin/chat/runtime/ChatSession.d.ts.map +1 -0
  387. package/bin/chat/runtime/ChatSession.js +84 -0
  388. package/bin/chat/runtime/ChatSession.js.map +1 -0
  389. package/bin/chat/runtime/ChatSessionContextComposer.d.ts +45 -0
  390. package/bin/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -0
  391. package/bin/chat/runtime/ChatSessionContextComposer.js +60 -0
  392. package/bin/chat/runtime/ChatSessionContextComposer.js.map +1 -0
  393. package/bin/chat/runtime/ChatSessionDelete.d.ts +29 -0
  394. package/bin/chat/runtime/ChatSessionDelete.d.ts.map +1 -0
  395. package/bin/chat/runtime/ChatSessionDelete.js +76 -0
  396. package/bin/chat/runtime/ChatSessionDelete.js.map +1 -0
  397. package/bin/chat/runtime/ChatSessionTypes.d.ts +30 -0
  398. package/bin/chat/runtime/ChatSessionTypes.d.ts.map +1 -0
  399. package/bin/chat/runtime/ChatSessionTypes.js +9 -0
  400. package/bin/chat/runtime/ChatSessionTypes.js.map +1 -0
  401. package/bin/chat/runtime/ChatkeySend.d.ts +67 -0
  402. package/bin/chat/runtime/ChatkeySend.d.ts.map +1 -0
  403. package/bin/chat/runtime/ChatkeySend.js +147 -0
  404. package/bin/chat/runtime/ChatkeySend.js.map +1 -0
  405. package/bin/chat/runtime/DirectDispatchParser.d.ts +22 -0
  406. package/bin/chat/runtime/DirectDispatchParser.d.ts.map +1 -0
  407. package/bin/chat/runtime/DirectDispatchParser.js +133 -0
  408. package/bin/chat/runtime/DirectDispatchParser.js.map +1 -0
  409. package/bin/chat/runtime/EnqueueDispatch.d.ts +24 -0
  410. package/bin/chat/runtime/EnqueueDispatch.d.ts.map +1 -0
  411. package/bin/chat/runtime/EnqueueDispatch.js +28 -0
  412. package/bin/chat/runtime/EnqueueDispatch.js.map +1 -0
  413. package/bin/chat/runtime/InboundAugment.d.ts +21 -0
  414. package/bin/chat/runtime/InboundAugment.d.ts.map +1 -0
  415. package/bin/chat/runtime/InboundAugment.js +50 -0
  416. package/bin/chat/runtime/InboundAugment.js.map +1 -0
  417. package/bin/chat/runtime/PluginDispatch.d.ts +43 -0
  418. package/bin/chat/runtime/PluginDispatch.d.ts.map +1 -0
  419. package/bin/chat/runtime/PluginDispatch.js +57 -0
  420. package/bin/chat/runtime/PluginDispatch.js.map +1 -0
  421. package/bin/chat/runtime/PluginPoints.d.ts +78 -0
  422. package/bin/chat/runtime/PluginPoints.d.ts.map +1 -0
  423. package/bin/chat/runtime/PluginPoints.js +78 -0
  424. package/bin/chat/runtime/PluginPoints.js.map +1 -0
  425. package/bin/chat/runtime/QueuedUserMessage.d.ts +20 -0
  426. package/bin/chat/runtime/QueuedUserMessage.d.ts.map +1 -0
  427. package/bin/chat/runtime/QueuedUserMessage.js +40 -0
  428. package/bin/chat/runtime/QueuedUserMessage.js.map +1 -0
  429. package/bin/chat/runtime/ReplyContextFormatter.d.ts +29 -0
  430. package/bin/chat/runtime/ReplyContextFormatter.d.ts.map +1 -0
  431. package/bin/chat/runtime/ReplyContextFormatter.js +74 -0
  432. package/bin/chat/runtime/ReplyContextFormatter.js.map +1 -0
  433. package/bin/chat/runtime/ReplyDispatch.d.ts +36 -0
  434. package/bin/chat/runtime/ReplyDispatch.d.ts.map +1 -0
  435. package/bin/chat/runtime/ReplyDispatch.js +51 -0
  436. package/bin/chat/runtime/ReplyDispatch.js.map +1 -0
  437. package/bin/chat/runtime/SystemPrompt.d.ts +26 -0
  438. package/bin/chat/runtime/SystemPrompt.d.ts.map +1 -0
  439. package/bin/chat/runtime/SystemPrompt.js +70 -0
  440. package/bin/chat/runtime/SystemPrompt.js.map +1 -0
  441. package/bin/chat/types/BotInfo.d.ts +97 -0
  442. package/bin/chat/types/BotInfo.d.ts.map +1 -0
  443. package/bin/chat/types/BotInfo.js +9 -0
  444. package/bin/chat/types/BotInfo.js.map +1 -0
  445. package/bin/chat/types/ChannelAccount.d.ts +226 -0
  446. package/bin/chat/types/ChannelAccount.d.ts.map +1 -0
  447. package/bin/chat/types/ChannelAccount.js +9 -0
  448. package/bin/chat/types/ChannelAccount.js.map +1 -0
  449. package/bin/chat/types/ChannelConfiguration.d.ts +146 -0
  450. package/bin/chat/types/ChannelConfiguration.d.ts.map +1 -0
  451. package/bin/chat/types/ChannelConfiguration.js +9 -0
  452. package/bin/chat/types/ChannelConfiguration.js.map +1 -0
  453. package/bin/chat/types/ChannelContext.d.ts +107 -0
  454. package/bin/chat/types/ChannelContext.d.ts.map +1 -0
  455. package/bin/chat/types/ChannelContext.js +9 -0
  456. package/bin/chat/types/ChannelContext.js.map +1 -0
  457. package/bin/chat/types/ChannelStatus.d.ts +88 -0
  458. package/bin/chat/types/ChannelStatus.d.ts.map +1 -0
  459. package/bin/chat/types/ChannelStatus.js +9 -0
  460. package/bin/chat/types/ChannelStatus.js.map +1 -0
  461. package/bin/chat/types/ChatCommand.d.ts +163 -0
  462. package/bin/chat/types/ChatCommand.d.ts.map +1 -0
  463. package/bin/chat/types/ChatCommand.js +9 -0
  464. package/bin/chat/types/ChatCommand.js.map +1 -0
  465. package/bin/chat/types/ChatDispatcher.d.ts +37 -0
  466. package/bin/chat/types/ChatDispatcher.d.ts.map +1 -0
  467. package/bin/chat/types/ChatDispatcher.js +9 -0
  468. package/bin/chat/types/ChatDispatcher.js.map +1 -0
  469. package/bin/chat/types/ChatHistory.d.ts +36 -0
  470. package/bin/chat/types/ChatHistory.d.ts.map +1 -0
  471. package/bin/chat/types/ChatHistory.js +9 -0
  472. package/bin/chat/types/ChatHistory.js.map +1 -0
  473. package/bin/chat/types/ChatMeta.d.ts +34 -0
  474. package/bin/chat/types/ChatMeta.d.ts.map +1 -0
  475. package/bin/chat/types/ChatMeta.js +10 -0
  476. package/bin/chat/types/ChatMeta.js.map +1 -0
  477. package/bin/chat/types/ChatPlugin.d.ts +238 -0
  478. package/bin/chat/types/ChatPlugin.d.ts.map +1 -0
  479. package/bin/chat/types/ChatPlugin.js +10 -0
  480. package/bin/chat/types/ChatPlugin.js.map +1 -0
  481. package/bin/chat/types/ChatPluginActionPayload.d.ts +145 -0
  482. package/bin/chat/types/ChatPluginActionPayload.d.ts.map +1 -0
  483. package/bin/chat/types/ChatPluginActionPayload.js +10 -0
  484. package/bin/chat/types/ChatPluginActionPayload.js.map +1 -0
  485. package/bin/chat/types/ChatPromptContext.d.ts +125 -0
  486. package/bin/chat/types/ChatPromptContext.d.ts.map +1 -0
  487. package/bin/chat/types/ChatPromptContext.js +10 -0
  488. package/bin/chat/types/ChatPromptContext.js.map +1 -0
  489. package/bin/chat/types/ChatQueue.d.ts +36 -0
  490. package/bin/chat/types/ChatQueue.d.ts.map +1 -0
  491. package/bin/chat/types/ChatQueue.js +9 -0
  492. package/bin/chat/types/ChatQueue.js.map +1 -0
  493. package/bin/chat/types/ChatQueueWorker.d.ts +25 -0
  494. package/bin/chat/types/ChatQueueWorker.d.ts.map +1 -0
  495. package/bin/chat/types/ChatQueueWorker.js +9 -0
  496. package/bin/chat/types/ChatQueueWorker.js.map +1 -0
  497. package/bin/chat/types/ChatRuntime.d.ts +32 -0
  498. package/bin/chat/types/ChatRuntime.d.ts.map +1 -0
  499. package/bin/chat/types/ChatRuntime.js +9 -0
  500. package/bin/chat/types/ChatRuntime.js.map +1 -0
  501. package/bin/chat/types/DirectDispatch.d.ts +115 -0
  502. package/bin/chat/types/DirectDispatch.d.ts.map +1 -0
  503. package/bin/chat/types/DirectDispatch.js +9 -0
  504. package/bin/chat/types/DirectDispatch.js.map +1 -0
  505. package/bin/chat/types/FeishuAttachment.d.ts +42 -0
  506. package/bin/chat/types/FeishuAttachment.d.ts.map +1 -0
  507. package/bin/chat/types/FeishuAttachment.js +9 -0
  508. package/bin/chat/types/FeishuAttachment.js.map +1 -0
  509. package/bin/chat/types/FeishuInboundAttachment.d.ts +114 -0
  510. package/bin/chat/types/FeishuInboundAttachment.d.ts.map +1 -0
  511. package/bin/chat/types/FeishuInboundAttachment.js +9 -0
  512. package/bin/chat/types/FeishuInboundAttachment.js.map +1 -0
  513. package/bin/chat/types/FeishuPost.d.ts +287 -0
  514. package/bin/chat/types/FeishuPost.d.ts.map +1 -0
  515. package/bin/chat/types/FeishuPost.js +9 -0
  516. package/bin/chat/types/FeishuPost.js.map +1 -0
  517. package/bin/chat/types/QqInboundDedupe.d.ts +12 -0
  518. package/bin/chat/types/QqInboundDedupe.d.ts.map +1 -0
  519. package/bin/chat/types/QqInboundDedupe.js +2 -0
  520. package/bin/chat/types/QqInboundDedupe.js.map +1 -0
  521. package/bin/chat/types/QqVoice.d.ts +118 -0
  522. package/bin/chat/types/QqVoice.d.ts.map +1 -0
  523. package/bin/chat/types/QqVoice.js +9 -0
  524. package/bin/chat/types/QqVoice.js.map +1 -0
  525. package/bin/chat/types/ReplyContext.d.ts +46 -0
  526. package/bin/chat/types/ReplyContext.d.ts.map +1 -0
  527. package/bin/chat/types/ReplyContext.js +10 -0
  528. package/bin/chat/types/ReplyContext.js.map +1 -0
  529. package/bin/contact/Action.d.ts +62 -0
  530. package/bin/contact/Action.d.ts.map +1 -0
  531. package/bin/contact/Action.js +221 -0
  532. package/bin/contact/Action.js.map +1 -0
  533. package/bin/contact/ContactPlugin.d.ts +39 -0
  534. package/bin/contact/ContactPlugin.d.ts.map +1 -0
  535. package/bin/contact/ContactPlugin.js +407 -0
  536. package/bin/contact/ContactPlugin.js.map +1 -0
  537. package/bin/contact/Index.d.ts +8 -0
  538. package/bin/contact/Index.d.ts.map +1 -0
  539. package/bin/contact/Index.js +8 -0
  540. package/bin/contact/Index.js.map +1 -0
  541. package/bin/contact/PROMPT.d.ts +7 -0
  542. package/bin/contact/PROMPT.d.ts.map +1 -0
  543. package/bin/contact/PROMPT.js +8 -0
  544. package/bin/contact/PROMPT.js.map +1 -0
  545. package/bin/contact/runtime/ApproveCallback.d.ts +23 -0
  546. package/bin/contact/runtime/ApproveCallback.d.ts.map +1 -0
  547. package/bin/contact/runtime/ApproveCallback.js +83 -0
  548. package/bin/contact/runtime/ApproveCallback.js.map +1 -0
  549. package/bin/contact/runtime/ChatRuntime.d.ts +27 -0
  550. package/bin/contact/runtime/ChatRuntime.d.ts.map +1 -0
  551. package/bin/contact/runtime/ChatRuntime.js +60 -0
  552. package/bin/contact/runtime/ChatRuntime.js.map +1 -0
  553. package/bin/contact/runtime/ContactPayload.d.ts +17 -0
  554. package/bin/contact/runtime/ContactPayload.d.ts.map +1 -0
  555. package/bin/contact/runtime/ContactPayload.js +23 -0
  556. package/bin/contact/runtime/ContactPayload.js.map +1 -0
  557. package/bin/contact/runtime/ContactPromptAssets.d.ts +12 -0
  558. package/bin/contact/runtime/ContactPromptAssets.d.ts.map +1 -0
  559. package/bin/contact/runtime/ContactPromptAssets.js +13 -0
  560. package/bin/contact/runtime/ContactPromptAssets.js.map +1 -0
  561. package/bin/contact/runtime/ContactStore.d.ts +49 -0
  562. package/bin/contact/runtime/ContactStore.d.ts.map +1 -0
  563. package/bin/contact/runtime/ContactStore.js +255 -0
  564. package/bin/contact/runtime/ContactStore.js.map +1 -0
  565. package/bin/contact/runtime/EndpointNotice.d.ts +39 -0
  566. package/bin/contact/runtime/EndpointNotice.d.ts.map +1 -0
  567. package/bin/contact/runtime/EndpointNotice.js +98 -0
  568. package/bin/contact/runtime/EndpointNotice.js.map +1 -0
  569. package/bin/contact/runtime/EndpointResolver.d.ts +36 -0
  570. package/bin/contact/runtime/EndpointResolver.d.ts.map +1 -0
  571. package/bin/contact/runtime/EndpointResolver.js +113 -0
  572. package/bin/contact/runtime/EndpointResolver.js.map +1 -0
  573. package/bin/contact/runtime/InboxStore.d.ts +33 -0
  574. package/bin/contact/runtime/InboxStore.d.ts.map +1 -0
  575. package/bin/contact/runtime/InboxStore.js +142 -0
  576. package/bin/contact/runtime/InboxStore.js.map +1 -0
  577. package/bin/contact/runtime/LinkApproval.d.ts +20 -0
  578. package/bin/contact/runtime/LinkApproval.d.ts.map +1 -0
  579. package/bin/contact/runtime/LinkApproval.js +317 -0
  580. package/bin/contact/runtime/LinkApproval.js.map +1 -0
  581. package/bin/contact/runtime/LinkCode.d.ts +21 -0
  582. package/bin/contact/runtime/LinkCode.d.ts.map +1 -0
  583. package/bin/contact/runtime/LinkCode.js +61 -0
  584. package/bin/contact/runtime/LinkCode.js.map +1 -0
  585. package/bin/contact/runtime/LinkStore.d.ts +17 -0
  586. package/bin/contact/runtime/LinkStore.d.ts.map +1 -0
  587. package/bin/contact/runtime/LinkStore.js +39 -0
  588. package/bin/contact/runtime/LinkStore.js.map +1 -0
  589. package/bin/contact/runtime/Paths.d.ts +64 -0
  590. package/bin/contact/runtime/Paths.d.ts.map +1 -0
  591. package/bin/contact/runtime/Paths.js +103 -0
  592. package/bin/contact/runtime/Paths.js.map +1 -0
  593. package/bin/contact/runtime/RemoteClient.d.ts +46 -0
  594. package/bin/contact/runtime/RemoteClient.d.ts.map +1 -0
  595. package/bin/contact/runtime/RemoteClient.js +120 -0
  596. package/bin/contact/runtime/RemoteClient.js.map +1 -0
  597. package/bin/contact/runtime/ShareBundle.d.ts +65 -0
  598. package/bin/contact/runtime/ShareBundle.d.ts.map +1 -0
  599. package/bin/contact/runtime/ShareBundle.js +185 -0
  600. package/bin/contact/runtime/ShareBundle.js.map +1 -0
  601. package/bin/contact/runtime/SystemProvider.d.ts +5 -0
  602. package/bin/contact/runtime/SystemProvider.d.ts.map +1 -0
  603. package/bin/contact/runtime/SystemProvider.js +15 -0
  604. package/bin/contact/runtime/SystemProvider.js.map +1 -0
  605. package/bin/contact/runtime/Token.d.ts +24 -0
  606. package/bin/contact/runtime/Token.d.ts.map +1 -0
  607. package/bin/contact/runtime/Token.js +36 -0
  608. package/bin/contact/runtime/Token.js.map +1 -0
  609. package/bin/contact/types/Contact.d.ts +78 -0
  610. package/bin/contact/types/Contact.d.ts.map +1 -0
  611. package/bin/contact/types/Contact.js +9 -0
  612. package/bin/contact/types/Contact.js.map +1 -0
  613. package/bin/contact/types/ContactApproval.d.ts +145 -0
  614. package/bin/contact/types/ContactApproval.d.ts.map +1 -0
  615. package/bin/contact/types/ContactApproval.js +9 -0
  616. package/bin/contact/types/ContactApproval.js.map +1 -0
  617. package/bin/contact/types/ContactChat.d.ts +46 -0
  618. package/bin/contact/types/ContactChat.d.ts.map +1 -0
  619. package/bin/contact/types/ContactChat.js +9 -0
  620. package/bin/contact/types/ContactChat.js.map +1 -0
  621. package/bin/contact/types/ContactCheck.d.ts +66 -0
  622. package/bin/contact/types/ContactCheck.d.ts.map +1 -0
  623. package/bin/contact/types/ContactCheck.js +9 -0
  624. package/bin/contact/types/ContactCheck.js.map +1 -0
  625. package/bin/contact/types/ContactCommand.d.ts +93 -0
  626. package/bin/contact/types/ContactCommand.d.ts.map +1 -0
  627. package/bin/contact/types/ContactCommand.js +8 -0
  628. package/bin/contact/types/ContactCommand.js.map +1 -0
  629. package/bin/contact/types/ContactEndpoint.d.ts +12 -0
  630. package/bin/contact/types/ContactEndpoint.d.ts.map +1 -0
  631. package/bin/contact/types/ContactEndpoint.js +9 -0
  632. package/bin/contact/types/ContactEndpoint.js.map +1 -0
  633. package/bin/contact/types/ContactLink.d.ts +160 -0
  634. package/bin/contact/types/ContactLink.d.ts.map +1 -0
  635. package/bin/contact/types/ContactLink.js +9 -0
  636. package/bin/contact/types/ContactLink.js.map +1 -0
  637. package/bin/contact/types/ContactShare.d.ts +163 -0
  638. package/bin/contact/types/ContactShare.d.ts.map +1 -0
  639. package/bin/contact/types/ContactShare.js +9 -0
  640. package/bin/contact/types/ContactShare.js.map +1 -0
  641. package/bin/index.d.ts +25 -0
  642. package/bin/index.d.ts.map +1 -0
  643. package/bin/index.js +21 -0
  644. package/bin/index.js.map +1 -0
  645. package/bin/memory/Action.d.ts +37 -0
  646. package/bin/memory/Action.d.ts.map +1 -0
  647. package/bin/memory/Action.js +111 -0
  648. package/bin/memory/Action.js.map +1 -0
  649. package/bin/memory/Index.d.ts +9 -0
  650. package/bin/memory/Index.d.ts.map +1 -0
  651. package/bin/memory/Index.js +9 -0
  652. package/bin/memory/Index.js.map +1 -0
  653. package/bin/memory/MemoryPlugin.d.ts +45 -0
  654. package/bin/memory/MemoryPlugin.d.ts.map +1 -0
  655. package/bin/memory/MemoryPlugin.js +242 -0
  656. package/bin/memory/MemoryPlugin.js.map +1 -0
  657. package/bin/memory/runtime/Flush.d.ts +15 -0
  658. package/bin/memory/runtime/Flush.d.ts.map +1 -0
  659. package/bin/memory/runtime/Flush.js +63 -0
  660. package/bin/memory/runtime/Flush.js.map +1 -0
  661. package/bin/memory/runtime/Search.d.ts +19 -0
  662. package/bin/memory/runtime/Search.d.ts.map +1 -0
  663. package/bin/memory/runtime/Search.js +268 -0
  664. package/bin/memory/runtime/Search.js.map +1 -0
  665. package/bin/memory/runtime/Store.d.ts +65 -0
  666. package/bin/memory/runtime/Store.d.ts.map +1 -0
  667. package/bin/memory/runtime/Store.js +142 -0
  668. package/bin/memory/runtime/Store.js.map +1 -0
  669. package/bin/memory/runtime/SystemProvider.d.ts +22 -0
  670. package/bin/memory/runtime/SystemProvider.d.ts.map +1 -0
  671. package/bin/memory/runtime/SystemProvider.js +126 -0
  672. package/bin/memory/runtime/SystemProvider.js.map +1 -0
  673. package/bin/memory/runtime/Writer.d.ts +23 -0
  674. package/bin/memory/runtime/Writer.d.ts.map +1 -0
  675. package/bin/memory/runtime/Writer.js +139 -0
  676. package/bin/memory/runtime/Writer.js.map +1 -0
  677. package/bin/memory/types/Memory.d.ts +264 -0
  678. package/bin/memory/types/Memory.d.ts.map +1 -0
  679. package/bin/memory/types/Memory.js +9 -0
  680. package/bin/memory/types/Memory.js.map +1 -0
  681. package/bin/shell/Index.d.ts +9 -0
  682. package/bin/shell/Index.d.ts.map +1 -0
  683. package/bin/shell/Index.js +9 -0
  684. package/bin/shell/Index.js.map +1 -0
  685. package/bin/shell/ShellPlugin.d.ts +65 -0
  686. package/bin/shell/ShellPlugin.d.ts.map +1 -0
  687. package/bin/shell/ShellPlugin.js +138 -0
  688. package/bin/shell/ShellPlugin.js.map +1 -0
  689. package/bin/shell/ShellRuntimeTypes.d.ts +91 -0
  690. package/bin/shell/ShellRuntimeTypes.d.ts.map +1 -0
  691. package/bin/shell/ShellRuntimeTypes.js +10 -0
  692. package/bin/shell/ShellRuntimeTypes.js.map +1 -0
  693. package/bin/shell/runtime/Paths.d.ts +12 -0
  694. package/bin/shell/runtime/Paths.d.ts.map +1 -0
  695. package/bin/shell/runtime/Paths.js +21 -0
  696. package/bin/shell/runtime/Paths.js.map +1 -0
  697. package/bin/shell/runtime/ShellActionResponse.d.ts +52 -0
  698. package/bin/shell/runtime/ShellActionResponse.d.ts.map +1 -0
  699. package/bin/shell/runtime/ShellActionResponse.js +73 -0
  700. package/bin/shell/runtime/ShellActionResponse.js.map +1 -0
  701. package/bin/shell/runtime/ShellActionRuntime.d.ts +49 -0
  702. package/bin/shell/runtime/ShellActionRuntime.d.ts.map +1 -0
  703. package/bin/shell/runtime/ShellActionRuntime.js +441 -0
  704. package/bin/shell/runtime/ShellActionRuntime.js.map +1 -0
  705. package/bin/shell/runtime/ShellActionRuntimeSupport.d.ts +79 -0
  706. package/bin/shell/runtime/ShellActionRuntimeSupport.d.ts.map +1 -0
  707. package/bin/shell/runtime/ShellActionRuntimeSupport.js +314 -0
  708. package/bin/shell/runtime/ShellActionRuntimeSupport.js.map +1 -0
  709. package/bin/shell/runtime/ShellProcessEvents.d.ts +22 -0
  710. package/bin/shell/runtime/ShellProcessEvents.d.ts.map +1 -0
  711. package/bin/shell/runtime/ShellProcessEvents.js +41 -0
  712. package/bin/shell/runtime/ShellProcessEvents.js.map +1 -0
  713. package/bin/shell/runtime/ShellRuntimeEnvironment.d.ts +21 -0
  714. package/bin/shell/runtime/ShellRuntimeEnvironment.d.ts.map +1 -0
  715. package/bin/shell/runtime/ShellRuntimeEnvironment.js +67 -0
  716. package/bin/shell/runtime/ShellRuntimeEnvironment.js.map +1 -0
  717. package/bin/skill/Action.d.ts +34 -0
  718. package/bin/skill/Action.d.ts.map +1 -0
  719. package/bin/skill/Action.js +122 -0
  720. package/bin/skill/Action.js.map +1 -0
  721. package/bin/skill/Command.d.ts +37 -0
  722. package/bin/skill/Command.d.ts.map +1 -0
  723. package/bin/skill/Command.js +70 -0
  724. package/bin/skill/Command.js.map +1 -0
  725. package/bin/skill/Config.d.ts +18 -0
  726. package/bin/skill/Config.d.ts.map +1 -0
  727. package/bin/skill/Config.js +37 -0
  728. package/bin/skill/Config.js.map +1 -0
  729. package/bin/skill/PROMPT.d.ts +7 -0
  730. package/bin/skill/PROMPT.d.ts.map +1 -0
  731. package/bin/skill/PROMPT.js +8 -0
  732. package/bin/skill/PROMPT.js.map +1 -0
  733. package/bin/skill/Plugin.d.ts +18 -0
  734. package/bin/skill/Plugin.d.ts.map +1 -0
  735. package/bin/skill/Plugin.js +311 -0
  736. package/bin/skill/Plugin.js.map +1 -0
  737. package/bin/skill/SkillPromptAssets.d.ts +12 -0
  738. package/bin/skill/SkillPromptAssets.d.ts.map +1 -0
  739. package/bin/skill/SkillPromptAssets.js +13 -0
  740. package/bin/skill/SkillPromptAssets.js.map +1 -0
  741. package/bin/skill/runtime/Discovery.d.ts +25 -0
  742. package/bin/skill/runtime/Discovery.d.ts.map +1 -0
  743. package/bin/skill/runtime/Discovery.js +130 -0
  744. package/bin/skill/runtime/Discovery.js.map +1 -0
  745. package/bin/skill/runtime/Frontmatter.d.ts +6 -0
  746. package/bin/skill/runtime/Frontmatter.d.ts.map +1 -0
  747. package/bin/skill/runtime/Frontmatter.js +12 -0
  748. package/bin/skill/runtime/Frontmatter.js.map +1 -0
  749. package/bin/skill/runtime/Paths.d.ts +16 -0
  750. package/bin/skill/runtime/Paths.d.ts.map +1 -0
  751. package/bin/skill/runtime/Paths.js +111 -0
  752. package/bin/skill/runtime/Paths.js.map +1 -0
  753. package/bin/skill/runtime/Prompt.d.ts +19 -0
  754. package/bin/skill/runtime/Prompt.d.ts.map +1 -0
  755. package/bin/skill/runtime/Prompt.js +54 -0
  756. package/bin/skill/runtime/Prompt.js.map +1 -0
  757. package/bin/skill/runtime/Store.d.ts +25 -0
  758. package/bin/skill/runtime/Store.d.ts.map +1 -0
  759. package/bin/skill/runtime/Store.js +81 -0
  760. package/bin/skill/runtime/Store.js.map +1 -0
  761. package/bin/skill/runtime/SystemProvider.d.ts +24 -0
  762. package/bin/skill/runtime/SystemProvider.d.ts.map +1 -0
  763. package/bin/skill/runtime/SystemProvider.js +33 -0
  764. package/bin/skill/runtime/SystemProvider.js.map +1 -0
  765. package/bin/skill/runtime/Types.d.ts +21 -0
  766. package/bin/skill/runtime/Types.d.ts.map +1 -0
  767. package/bin/skill/runtime/Types.js +2 -0
  768. package/bin/skill/runtime/Types.js.map +1 -0
  769. package/bin/skill/runtime/Utils.d.ts +4 -0
  770. package/bin/skill/runtime/Utils.d.ts.map +1 -0
  771. package/bin/skill/runtime/Utils.js +29 -0
  772. package/bin/skill/runtime/Utils.js.map +1 -0
  773. package/bin/skill/types/ClaudeSkill.d.ts +63 -0
  774. package/bin/skill/types/ClaudeSkill.d.ts.map +1 -0
  775. package/bin/skill/types/ClaudeSkill.js +10 -0
  776. package/bin/skill/types/ClaudeSkill.js.map +1 -0
  777. package/bin/skill/types/SkillCommand.d.ts +87 -0
  778. package/bin/skill/types/SkillCommand.d.ts.map +1 -0
  779. package/bin/skill/types/SkillCommand.js +9 -0
  780. package/bin/skill/types/SkillCommand.js.map +1 -0
  781. package/bin/skill/types/SkillPlugin.d.ts +102 -0
  782. package/bin/skill/types/SkillPlugin.d.ts.map +1 -0
  783. package/bin/skill/types/SkillPlugin.js +29 -0
  784. package/bin/skill/types/SkillPlugin.js.map +1 -0
  785. package/bin/skill/types/SkillRoot.d.ts +48 -0
  786. package/bin/skill/types/SkillRoot.d.ts.map +1 -0
  787. package/bin/skill/types/SkillRoot.js +9 -0
  788. package/bin/skill/types/SkillRoot.js.map +1 -0
  789. package/bin/task/Action.d.ts +36 -0
  790. package/bin/task/Action.d.ts.map +1 -0
  791. package/bin/task/Action.js +407 -0
  792. package/bin/task/Action.js.map +1 -0
  793. package/bin/task/Index.d.ts +9 -0
  794. package/bin/task/Index.d.ts.map +1 -0
  795. package/bin/task/Index.js +9 -0
  796. package/bin/task/Index.js.map +1 -0
  797. package/bin/task/PROMPT.d.ts +7 -0
  798. package/bin/task/PROMPT.d.ts.map +1 -0
  799. package/bin/task/PROMPT.js +8 -0
  800. package/bin/task/PROMPT.js.map +1 -0
  801. package/bin/task/Scheduler.d.ts +17 -0
  802. package/bin/task/Scheduler.d.ts.map +1 -0
  803. package/bin/task/Scheduler.js +231 -0
  804. package/bin/task/Scheduler.js.map +1 -0
  805. package/bin/task/TaskPlugin.d.ts +57 -0
  806. package/bin/task/TaskPlugin.d.ts.map +1 -0
  807. package/bin/task/TaskPlugin.js +126 -0
  808. package/bin/task/TaskPlugin.js.map +1 -0
  809. package/bin/task/runtime/CronTrigger.d.ts +19 -0
  810. package/bin/task/runtime/CronTrigger.d.ts.map +1 -0
  811. package/bin/task/runtime/CronTrigger.js +93 -0
  812. package/bin/task/runtime/CronTrigger.js.map +1 -0
  813. package/bin/task/runtime/Frontmatter.d.ts +13 -0
  814. package/bin/task/runtime/Frontmatter.d.ts.map +1 -0
  815. package/bin/task/runtime/Frontmatter.js +19 -0
  816. package/bin/task/runtime/Frontmatter.js.map +1 -0
  817. package/bin/task/runtime/Model.d.ts +73 -0
  818. package/bin/task/runtime/Model.d.ts.map +1 -0
  819. package/bin/task/runtime/Model.js +312 -0
  820. package/bin/task/runtime/Model.js.map +1 -0
  821. package/bin/task/runtime/Paths.d.ts +32 -0
  822. package/bin/task/runtime/Paths.d.ts.map +1 -0
  823. package/bin/task/runtime/Paths.js +103 -0
  824. package/bin/task/runtime/Paths.js.map +1 -0
  825. package/bin/task/runtime/Runner.d.ts +43 -0
  826. package/bin/task/runtime/Runner.d.ts.map +1 -0
  827. package/bin/task/runtime/Runner.js +440 -0
  828. package/bin/task/runtime/Runner.js.map +1 -0
  829. package/bin/task/runtime/Store.d.ts +89 -0
  830. package/bin/task/runtime/Store.d.ts.map +1 -0
  831. package/bin/task/runtime/Store.js +206 -0
  832. package/bin/task/runtime/Store.js.map +1 -0
  833. package/bin/task/runtime/TaskActionExecution.d.ts +160 -0
  834. package/bin/task/runtime/TaskActionExecution.d.ts.map +1 -0
  835. package/bin/task/runtime/TaskActionExecution.js +192 -0
  836. package/bin/task/runtime/TaskActionExecution.js.map +1 -0
  837. package/bin/task/runtime/TaskActionInput.d.ts +19 -0
  838. package/bin/task/runtime/TaskActionInput.d.ts.map +1 -0
  839. package/bin/task/runtime/TaskActionInput.js +218 -0
  840. package/bin/task/runtime/TaskActionInput.js.map +1 -0
  841. package/bin/task/runtime/TaskPluginActionRegistry.d.ts +16 -0
  842. package/bin/task/runtime/TaskPluginActionRegistry.d.ts.map +1 -0
  843. package/bin/task/runtime/TaskPluginActionRegistry.js +167 -0
  844. package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -0
  845. package/bin/task/runtime/TaskPluginActions.d.ts +5 -0
  846. package/bin/task/runtime/TaskPluginActions.d.ts.map +1 -0
  847. package/bin/task/runtime/TaskPluginActions.js +5 -0
  848. package/bin/task/runtime/TaskPluginActions.js.map +1 -0
  849. package/bin/task/runtime/TaskPluginSystem.d.ts +9 -0
  850. package/bin/task/runtime/TaskPluginSystem.d.ts.map +1 -0
  851. package/bin/task/runtime/TaskPluginSystem.js +9 -0
  852. package/bin/task/runtime/TaskPluginSystem.js.map +1 -0
  853. package/bin/task/runtime/TaskPromptAssets.d.ts +12 -0
  854. package/bin/task/runtime/TaskPromptAssets.d.ts.map +1 -0
  855. package/bin/task/runtime/TaskPromptAssets.js +13 -0
  856. package/bin/task/runtime/TaskPromptAssets.js.map +1 -0
  857. package/bin/task/runtime/TaskRunArtifacts.d.ts +189 -0
  858. package/bin/task/runtime/TaskRunArtifacts.d.ts.map +1 -0
  859. package/bin/task/runtime/TaskRunArtifacts.js +271 -0
  860. package/bin/task/runtime/TaskRunArtifacts.js.map +1 -0
  861. package/bin/task/runtime/TaskRunChatDispatch.d.ts +22 -0
  862. package/bin/task/runtime/TaskRunChatDispatch.d.ts.map +1 -0
  863. package/bin/task/runtime/TaskRunChatDispatch.js +66 -0
  864. package/bin/task/runtime/TaskRunChatDispatch.js.map +1 -0
  865. package/bin/task/runtime/TaskRunnerProgress.d.ts +35 -0
  866. package/bin/task/runtime/TaskRunnerProgress.d.ts.map +1 -0
  867. package/bin/task/runtime/TaskRunnerProgress.js +95 -0
  868. package/bin/task/runtime/TaskRunnerProgress.js.map +1 -0
  869. package/bin/task/runtime/TaskRunnerRound.d.ts +80 -0
  870. package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -0
  871. package/bin/task/runtime/TaskRunnerRound.js +272 -0
  872. package/bin/task/runtime/TaskRunnerRound.js.map +1 -0
  873. package/bin/task/runtime/TaskRunnerScript.d.ts +81 -0
  874. package/bin/task/runtime/TaskRunnerScript.d.ts.map +1 -0
  875. package/bin/task/runtime/TaskRunnerScript.js +96 -0
  876. package/bin/task/runtime/TaskRunnerScript.js.map +1 -0
  877. package/bin/task/runtime/TaskRunnerSession.d.ts +48 -0
  878. package/bin/task/runtime/TaskRunnerSession.d.ts.map +1 -0
  879. package/bin/task/runtime/TaskRunnerSession.js +153 -0
  880. package/bin/task/runtime/TaskRunnerSession.js.map +1 -0
  881. package/bin/task/runtime/TaskRunnerTypes.d.ts +186 -0
  882. package/bin/task/runtime/TaskRunnerTypes.d.ts.map +1 -0
  883. package/bin/task/runtime/TaskRunnerTypes.js +9 -0
  884. package/bin/task/runtime/TaskRunnerTypes.js.map +1 -0
  885. package/bin/task/types/Cron.d.ts +16 -0
  886. package/bin/task/types/Cron.d.ts.map +1 -0
  887. package/bin/task/types/Cron.js +2 -0
  888. package/bin/task/types/Cron.js.map +1 -0
  889. package/bin/task/types/Task.d.ts +146 -0
  890. package/bin/task/types/Task.d.ts.map +1 -0
  891. package/bin/task/types/Task.js +9 -0
  892. package/bin/task/types/Task.js.map +1 -0
  893. package/bin/task/types/TaskCommand.d.ts +147 -0
  894. package/bin/task/types/TaskCommand.d.ts.map +1 -0
  895. package/bin/task/types/TaskCommand.js +9 -0
  896. package/bin/task/types/TaskCommand.js.map +1 -0
  897. package/bin/task/types/TaskPluginTypes.d.ts +52 -0
  898. package/bin/task/types/TaskPluginTypes.d.ts.map +1 -0
  899. package/bin/task/types/TaskPluginTypes.js +9 -0
  900. package/bin/task/types/TaskPluginTypes.js.map +1 -0
  901. package/bin/tts/Dependency.d.ts +90 -0
  902. package/bin/tts/Dependency.d.ts.map +1 -0
  903. package/bin/tts/Dependency.js +344 -0
  904. package/bin/tts/Dependency.js.map +1 -0
  905. package/bin/tts/Plugin.d.ts +17 -0
  906. package/bin/tts/Plugin.d.ts.map +1 -0
  907. package/bin/tts/Plugin.js +491 -0
  908. package/bin/tts/Plugin.js.map +1 -0
  909. package/bin/tts/PluginSupport.d.ts +25 -0
  910. package/bin/tts/PluginSupport.d.ts.map +1 -0
  911. package/bin/tts/PluginSupport.js +72 -0
  912. package/bin/tts/PluginSupport.js.map +1 -0
  913. package/bin/tts/runtime/Catalog.d.ts +21 -0
  914. package/bin/tts/runtime/Catalog.d.ts.map +1 -0
  915. package/bin/tts/runtime/Catalog.js +90 -0
  916. package/bin/tts/runtime/Catalog.js.map +1 -0
  917. package/bin/tts/runtime/DependencyInstaller.d.ts +143 -0
  918. package/bin/tts/runtime/DependencyInstaller.d.ts.map +1 -0
  919. package/bin/tts/runtime/DependencyInstaller.js +261 -0
  920. package/bin/tts/runtime/DependencyInstaller.js.map +1 -0
  921. package/bin/tts/runtime/Installer.d.ts +89 -0
  922. package/bin/tts/runtime/Installer.d.ts.map +1 -0
  923. package/bin/tts/runtime/Installer.js +188 -0
  924. package/bin/tts/runtime/Installer.js.map +1 -0
  925. package/bin/tts/runtime/Paths.d.ts +20 -0
  926. package/bin/tts/runtime/Paths.d.ts.map +1 -0
  927. package/bin/tts/runtime/Paths.js +32 -0
  928. package/bin/tts/runtime/Paths.js.map +1 -0
  929. package/bin/tts/runtime/Synthesizer.d.ts +44 -0
  930. package/bin/tts/runtime/Synthesizer.d.ts.map +1 -0
  931. package/bin/tts/runtime/Synthesizer.js +363 -0
  932. package/bin/tts/runtime/Synthesizer.js.map +1 -0
  933. package/bin/tts/types/Tts.d.ts +91 -0
  934. package/bin/tts/types/Tts.d.ts.map +1 -0
  935. package/bin/tts/types/Tts.js +9 -0
  936. package/bin/tts/types/Tts.js.map +1 -0
  937. package/bin/tts/types/TtsPlugin.d.ts +161 -0
  938. package/bin/tts/types/TtsPlugin.d.ts.map +1 -0
  939. package/bin/tts/types/TtsPlugin.js +9 -0
  940. package/bin/tts/types/TtsPlugin.js.map +1 -0
  941. package/bin/voice/Config.d.ts +43 -0
  942. package/bin/voice/Config.d.ts.map +1 -0
  943. package/bin/voice/Config.js +104 -0
  944. package/bin/voice/Config.js.map +1 -0
  945. package/bin/voice/Dependency.d.ts +77 -0
  946. package/bin/voice/Dependency.d.ts.map +1 -0
  947. package/bin/voice/Dependency.js +237 -0
  948. package/bin/voice/Dependency.js.map +1 -0
  949. package/bin/voice/InboundAugment.d.ts +17 -0
  950. package/bin/voice/InboundAugment.d.ts.map +1 -0
  951. package/bin/voice/InboundAugment.js +47 -0
  952. package/bin/voice/InboundAugment.js.map +1 -0
  953. package/bin/voice/ModelCatalog.d.ts +29 -0
  954. package/bin/voice/ModelCatalog.d.ts.map +1 -0
  955. package/bin/voice/ModelCatalog.js +25 -0
  956. package/bin/voice/ModelCatalog.js.map +1 -0
  957. package/bin/voice/runtime/Catalog.d.ts +18 -0
  958. package/bin/voice/runtime/Catalog.d.ts.map +1 -0
  959. package/bin/voice/runtime/Catalog.js +61 -0
  960. package/bin/voice/runtime/Catalog.js.map +1 -0
  961. package/bin/voice/runtime/DependencyInstaller.d.ts +145 -0
  962. package/bin/voice/runtime/DependencyInstaller.d.ts.map +1 -0
  963. package/bin/voice/runtime/DependencyInstaller.js +309 -0
  964. package/bin/voice/runtime/DependencyInstaller.js.map +1 -0
  965. package/bin/voice/runtime/Installer.d.ts +94 -0
  966. package/bin/voice/runtime/Installer.d.ts.map +1 -0
  967. package/bin/voice/runtime/Installer.js +200 -0
  968. package/bin/voice/runtime/Installer.js.map +1 -0
  969. package/bin/voice/runtime/Paths.d.ts +8 -0
  970. package/bin/voice/runtime/Paths.d.ts.map +1 -0
  971. package/bin/voice/runtime/Paths.js +26 -0
  972. package/bin/voice/runtime/Paths.js.map +1 -0
  973. package/bin/voice/runtime/Transcriber.d.ts +57 -0
  974. package/bin/voice/runtime/Transcriber.d.ts.map +1 -0
  975. package/bin/voice/runtime/Transcriber.js +329 -0
  976. package/bin/voice/runtime/Transcriber.js.map +1 -0
  977. package/bin/voice/types/Voice.d.ts +58 -0
  978. package/bin/voice/types/Voice.d.ts.map +1 -0
  979. package/bin/voice/types/Voice.js +9 -0
  980. package/bin/voice/types/Voice.js.map +1 -0
  981. package/bin/voice/types/VoicePlugin.d.ts +190 -0
  982. package/bin/voice/types/VoicePlugin.d.ts.map +1 -0
  983. package/bin/voice/types/VoicePlugin.js +9 -0
  984. package/bin/voice/types/VoicePlugin.js.map +1 -0
  985. package/bin/web/Dependency.d.ts +10 -0
  986. package/bin/web/Dependency.d.ts.map +1 -0
  987. package/bin/web/Dependency.js +10 -0
  988. package/bin/web/Dependency.js.map +1 -0
  989. package/bin/web/PROMPT.agent-browser.d.ts +7 -0
  990. package/bin/web/PROMPT.agent-browser.d.ts.map +1 -0
  991. package/bin/web/PROMPT.agent-browser.js +8 -0
  992. package/bin/web/PROMPT.agent-browser.js.map +1 -0
  993. package/bin/web/PROMPT.d.ts +7 -0
  994. package/bin/web/PROMPT.d.ts.map +1 -0
  995. package/bin/web/PROMPT.js +8 -0
  996. package/bin/web/PROMPT.js.map +1 -0
  997. package/bin/web/PROMPT.web-access.d.ts +7 -0
  998. package/bin/web/PROMPT.web-access.d.ts.map +1 -0
  999. package/bin/web/PROMPT.web-access.js +8 -0
  1000. package/bin/web/PROMPT.web-access.js.map +1 -0
  1001. package/bin/web/Plugin.d.ts +17 -0
  1002. package/bin/web/Plugin.d.ts.map +1 -0
  1003. package/bin/web/Plugin.js +478 -0
  1004. package/bin/web/Plugin.js.map +1 -0
  1005. package/bin/web/WebPromptAssets.d.ts +20 -0
  1006. package/bin/web/WebPromptAssets.d.ts.map +1 -0
  1007. package/bin/web/WebPromptAssets.js +23 -0
  1008. package/bin/web/WebPromptAssets.js.map +1 -0
  1009. package/bin/web/runtime/Config.d.ts +21 -0
  1010. package/bin/web/runtime/Config.d.ts.map +1 -0
  1011. package/bin/web/runtime/Config.js +79 -0
  1012. package/bin/web/runtime/Config.js.map +1 -0
  1013. package/bin/web/runtime/Source.d.ts +29 -0
  1014. package/bin/web/runtime/Source.d.ts.map +1 -0
  1015. package/bin/web/runtime/Source.js +209 -0
  1016. package/bin/web/runtime/Source.js.map +1 -0
  1017. package/bin/web/types/WebPlugin.d.ts +133 -0
  1018. package/bin/web/types/WebPlugin.d.ts.map +1 -0
  1019. package/bin/web/types/WebPlugin.js +12 -0
  1020. package/bin/web/types/WebPlugin.js.map +1 -0
  1021. package/bin/workboard/Plugin.d.ts +17 -0
  1022. package/bin/workboard/Plugin.d.ts.map +1 -0
  1023. package/bin/workboard/Plugin.js +81 -0
  1024. package/bin/workboard/Plugin.js.map +1 -0
  1025. package/bin/workboard/runtime/Collector.d.ts +14 -0
  1026. package/bin/workboard/runtime/Collector.d.ts.map +1 -0
  1027. package/bin/workboard/runtime/Collector.js +63 -0
  1028. package/bin/workboard/runtime/Collector.js.map +1 -0
  1029. package/bin/workboard/runtime/Normalizer.d.ts +61 -0
  1030. package/bin/workboard/runtime/Normalizer.d.ts.map +1 -0
  1031. package/bin/workboard/runtime/Normalizer.js +172 -0
  1032. package/bin/workboard/runtime/Normalizer.js.map +1 -0
  1033. package/bin/workboard/runtime/Store.d.ts +48 -0
  1034. package/bin/workboard/runtime/Store.d.ts.map +1 -0
  1035. package/bin/workboard/runtime/Store.js +84 -0
  1036. package/bin/workboard/runtime/Store.js.map +1 -0
  1037. package/bin/workboard/types/Workboard.d.ts +150 -0
  1038. package/bin/workboard/types/Workboard.d.ts.map +1 -0
  1039. package/bin/workboard/types/Workboard.js +9 -0
  1040. package/bin/workboard/types/Workboard.js.map +1 -0
  1041. package/package.json +42 -0
  1042. package/src/BuiltinPlugins.ts +53 -0
  1043. package/src/asr/Config.ts +138 -0
  1044. package/src/asr/Dependency.ts +336 -0
  1045. package/src/asr/InboundAugment.ts +59 -0
  1046. package/src/asr/ModelCatalog.ts +43 -0
  1047. package/src/asr/Plugin.ts +510 -0
  1048. package/src/auth/Plugin.ts +221 -0
  1049. package/src/auth/runtime/AuthorizationConfig.ts +247 -0
  1050. package/src/auth/runtime/AuthorizationPolicy.ts +167 -0
  1051. package/src/auth/runtime/AuthorizationStore.ts +220 -0
  1052. package/src/auth/types/AuthPlugin.ts +545 -0
  1053. package/src/chat/Action.ts +477 -0
  1054. package/src/chat/ChatPlugin.ts +249 -0
  1055. package/src/chat/ChatPluginTypes.ts +126 -0
  1056. package/src/chat/Index.ts +8 -0
  1057. package/src/chat/PROMPT.direct.ts +9 -0
  1058. package/src/chat/PROMPT.direct.ts.txt +55 -0
  1059. package/src/chat/accounts/ChannelAccountManager.ts +314 -0
  1060. package/src/chat/accounts/Crypto.ts +83 -0
  1061. package/src/chat/accounts/Store.ts +287 -0
  1062. package/src/chat/channels/BaseChatChannel.ts +450 -0
  1063. package/src/chat/channels/BaseChatChannelQueue.ts +320 -0
  1064. package/src/chat/channels/BaseChatChannelSupport.ts +321 -0
  1065. package/src/chat/channels/BotInfoProvider.ts +49 -0
  1066. package/src/chat/channels/Configuration.ts +35 -0
  1067. package/src/chat/channels/ConfigurationRegistry.ts +43 -0
  1068. package/src/chat/channels/feishu/BotInfo.ts +199 -0
  1069. package/src/chat/channels/feishu/Configuration.ts +65 -0
  1070. package/src/chat/channels/feishu/Feishu.ts +467 -0
  1071. package/src/chat/channels/feishu/FeishuInbound.ts +51 -0
  1072. package/src/chat/channels/feishu/FeishuMessageHandler.ts +483 -0
  1073. package/src/chat/channels/feishu/FeishuPlatformClient.ts +421 -0
  1074. package/src/chat/channels/feishu/FeishuPlatformLookup.ts +523 -0
  1075. package/src/chat/channels/feishu/FeishuPlatformMessaging.ts +219 -0
  1076. package/src/chat/channels/feishu/InboundAttachment.ts +261 -0
  1077. package/src/chat/channels/feishu/PROMPT.direct.ts +9 -0
  1078. package/src/chat/channels/feishu/PROMPT.direct.ts.txt +5 -0
  1079. package/src/chat/channels/feishu/PostMessage.ts +492 -0
  1080. package/src/chat/channels/feishu/ReplyContext.ts +68 -0
  1081. package/src/chat/channels/feishu/Shared.ts +94 -0
  1082. package/src/chat/channels/feishu/types/FeishuChannel.ts +131 -0
  1083. package/src/chat/channels/qq/BotInfo.ts +137 -0
  1084. package/src/chat/channels/qq/Configuration.ts +64 -0
  1085. package/src/chat/channels/qq/PROMPT.direct.ts +9 -0
  1086. package/src/chat/channels/qq/PROMPT.direct.ts.txt +11 -0
  1087. package/src/chat/channels/qq/QQ.ts +398 -0
  1088. package/src/chat/channels/qq/QQEventCapture.ts +88 -0
  1089. package/src/chat/channels/qq/QQGatewayAuth.ts +318 -0
  1090. package/src/chat/channels/qq/QQGatewayClient.ts +467 -0
  1091. package/src/chat/channels/qq/QQGatewayConnection.ts +175 -0
  1092. package/src/chat/channels/qq/QQGatewayHeartbeat.ts +114 -0
  1093. package/src/chat/channels/qq/QQGatewayProtocol.ts +176 -0
  1094. package/src/chat/channels/qq/QQGatewaySend.ts +258 -0
  1095. package/src/chat/channels/qq/QQGatewaySupport.ts +159 -0
  1096. package/src/chat/channels/qq/QQInbound.ts +262 -0
  1097. package/src/chat/channels/qq/QQInboundDedupe.ts +126 -0
  1098. package/src/chat/channels/qq/QQMessageHandler.ts +465 -0
  1099. package/src/chat/channels/qq/QQSendSupport.ts +91 -0
  1100. package/src/chat/channels/qq/QQSupport.ts +263 -0
  1101. package/src/chat/channels/qq/VoiceInput.ts +381 -0
  1102. package/src/chat/channels/qq/types/QqChannel.ts +501 -0
  1103. package/src/chat/channels/qq/types/QqGatewaySupport.ts +97 -0
  1104. package/src/chat/channels/telegram/ApiClient.ts +373 -0
  1105. package/src/chat/channels/telegram/Bot.ts +357 -0
  1106. package/src/chat/channels/telegram/BotInfo.ts +92 -0
  1107. package/src/chat/channels/telegram/Configuration.ts +65 -0
  1108. package/src/chat/channels/telegram/Handlers.ts +91 -0
  1109. package/src/chat/channels/telegram/PROMPT.direct.ts +9 -0
  1110. package/src/chat/channels/telegram/PROMPT.direct.ts.txt +2 -0
  1111. package/src/chat/channels/telegram/ReplyContext.ts +76 -0
  1112. package/src/chat/channels/telegram/Shared.ts +404 -0
  1113. package/src/chat/channels/telegram/StateStore.ts +58 -0
  1114. package/src/chat/channels/telegram/TelegramInbound.ts +186 -0
  1115. package/src/chat/channels/telegram/TelegramMessageHandler.ts +485 -0
  1116. package/src/chat/channels/telegram/TelegramPendingUpdates.ts +204 -0
  1117. package/src/chat/channels/telegram/TelegramPlatformClient.ts +482 -0
  1118. package/src/chat/runtime/ChannelContextStore.ts +395 -0
  1119. package/src/chat/runtime/ChatActionExecution.ts +362 -0
  1120. package/src/chat/runtime/ChatActionInput.ts +167 -0
  1121. package/src/chat/runtime/ChatActionInputSupport.ts +85 -0
  1122. package/src/chat/runtime/ChatChannelActions.ts +308 -0
  1123. package/src/chat/runtime/ChatChannelConfig.ts +330 -0
  1124. package/src/chat/runtime/ChatChannelCore.ts +148 -0
  1125. package/src/chat/runtime/ChatChannelFacade.ts +23 -0
  1126. package/src/chat/runtime/ChatChannelLifecycle.ts +169 -0
  1127. package/src/chat/runtime/ChatHistoryStore.ts +289 -0
  1128. package/src/chat/runtime/ChatIngressStore.ts +68 -0
  1129. package/src/chat/runtime/ChatMetaStore.ts +186 -0
  1130. package/src/chat/runtime/ChatPluginActionRegistry.ts +367 -0
  1131. package/src/chat/runtime/ChatPluginActions.ts +5 -0
  1132. package/src/chat/runtime/ChatPluginSystem.ts +70 -0
  1133. package/src/chat/runtime/ChatPromptAssets.ts +32 -0
  1134. package/src/chat/runtime/ChatQueue.ts +77 -0
  1135. package/src/chat/runtime/ChatQueueReplyDispatch.ts +191 -0
  1136. package/src/chat/runtime/ChatQueueStore.ts +185 -0
  1137. package/src/chat/runtime/ChatQueueWorker.ts +485 -0
  1138. package/src/chat/runtime/ChatQueueWorkerSupport.ts +137 -0
  1139. package/src/chat/runtime/ChatSendActionInput.ts +255 -0
  1140. package/src/chat/runtime/ChatSendMetadata.ts +170 -0
  1141. package/src/chat/runtime/ChatSendRegistry.ts +43 -0
  1142. package/src/chat/runtime/ChatSession.ts +156 -0
  1143. package/src/chat/runtime/ChatSessionContextComposer.ts +106 -0
  1144. package/src/chat/runtime/ChatSessionDelete.ts +95 -0
  1145. package/src/chat/runtime/ChatSessionTypes.ts +32 -0
  1146. package/src/chat/runtime/ChatkeySend.ts +187 -0
  1147. package/src/chat/runtime/DirectDispatchParser.ts +158 -0
  1148. package/src/chat/runtime/EnqueueDispatch.ts +49 -0
  1149. package/src/chat/runtime/InboundAugment.ts +63 -0
  1150. package/src/chat/runtime/PluginDispatch.ts +89 -0
  1151. package/src/chat/runtime/PluginPoints.ts +78 -0
  1152. package/src/chat/runtime/QueuedUserMessage.ts +43 -0
  1153. package/src/chat/runtime/ReplyContextFormatter.ts +85 -0
  1154. package/src/chat/runtime/ReplyDispatch.ts +78 -0
  1155. package/src/chat/runtime/SystemPrompt.ts +84 -0
  1156. package/src/chat/types/BotInfo.ts +101 -0
  1157. package/src/chat/types/ChannelAccount.ts +232 -0
  1158. package/src/chat/types/ChannelConfiguration.ts +161 -0
  1159. package/src/chat/types/ChannelContext.ts +110 -0
  1160. package/src/chat/types/ChannelStatus.ts +98 -0
  1161. package/src/chat/types/ChatCommand.ts +174 -0
  1162. package/src/chat/types/ChatDispatcher.ts +42 -0
  1163. package/src/chat/types/ChatHistory.ts +42 -0
  1164. package/src/chat/types/ChatMeta.ts +35 -0
  1165. package/src/chat/types/ChatPlugin.ts +251 -0
  1166. package/src/chat/types/ChatPluginActionPayload.ts +165 -0
  1167. package/src/chat/types/ChatPromptContext.ts +139 -0
  1168. package/src/chat/types/ChatQueue.ts +41 -0
  1169. package/src/chat/types/ChatQueueWorker.ts +25 -0
  1170. package/src/chat/types/ChatRuntime.ts +33 -0
  1171. package/src/chat/types/DirectDispatch.ts +133 -0
  1172. package/src/chat/types/FeishuAttachment.ts +50 -0
  1173. package/src/chat/types/FeishuInboundAttachment.ts +138 -0
  1174. package/src/chat/types/FeishuPost.ts +338 -0
  1175. package/src/chat/types/QqInboundDedupe.ts +12 -0
  1176. package/src/chat/types/QqVoice.ts +126 -0
  1177. package/src/chat/types/ReplyContext.ts +49 -0
  1178. package/src/contact/Action.ts +316 -0
  1179. package/src/contact/ContactPlugin.ts +503 -0
  1180. package/src/contact/Index.ts +8 -0
  1181. package/src/contact/PROMPT.ts +9 -0
  1182. package/src/contact/PROMPT.ts.txt +25 -0
  1183. package/src/contact/runtime/ApproveCallback.ts +97 -0
  1184. package/src/contact/runtime/ChatRuntime.ts +83 -0
  1185. package/src/contact/runtime/ContactPayload.ts +26 -0
  1186. package/src/contact/runtime/ContactPromptAssets.ts +14 -0
  1187. package/src/contact/runtime/ContactStore.ts +299 -0
  1188. package/src/contact/runtime/EndpointNotice.ts +125 -0
  1189. package/src/contact/runtime/EndpointResolver.ts +146 -0
  1190. package/src/contact/runtime/InboxStore.ts +178 -0
  1191. package/src/contact/runtime/LinkApproval.ts +387 -0
  1192. package/src/contact/runtime/LinkCode.ts +70 -0
  1193. package/src/contact/runtime/LinkStore.ts +50 -0
  1194. package/src/contact/runtime/Paths.ts +139 -0
  1195. package/src/contact/runtime/RemoteClient.ts +158 -0
  1196. package/src/contact/runtime/ShareBundle.ts +286 -0
  1197. package/src/contact/runtime/SystemProvider.ts +15 -0
  1198. package/src/contact/runtime/Token.ts +40 -0
  1199. package/src/contact/types/Contact.ts +82 -0
  1200. package/src/contact/types/ContactApproval.ts +150 -0
  1201. package/src/contact/types/ContactChat.ts +47 -0
  1202. package/src/contact/types/ContactCheck.ts +67 -0
  1203. package/src/contact/types/ContactCommand.ts +98 -0
  1204. package/src/contact/types/ContactEndpoint.ts +16 -0
  1205. package/src/contact/types/ContactLink.ts +169 -0
  1206. package/src/contact/types/ContactShare.ts +172 -0
  1207. package/src/index.ts +64 -0
  1208. package/src/memory/Action.ts +147 -0
  1209. package/src/memory/Index.ts +9 -0
  1210. package/src/memory/MemoryPlugin.ts +270 -0
  1211. package/src/memory/runtime/Flush.ts +83 -0
  1212. package/src/memory/runtime/Search.ts +330 -0
  1213. package/src/memory/runtime/Store.ts +198 -0
  1214. package/src/memory/runtime/SystemProvider.ts +145 -0
  1215. package/src/memory/runtime/Writer.ts +173 -0
  1216. package/src/memory/types/Memory.ts +284 -0
  1217. package/src/shell/Index.ts +9 -0
  1218. package/src/shell/ShellPlugin.ts +199 -0
  1219. package/src/shell/ShellRuntimeTypes.ts +94 -0
  1220. package/src/shell/runtime/Paths.ts +28 -0
  1221. package/src/shell/runtime/ShellActionResponse.ts +135 -0
  1222. package/src/shell/runtime/ShellActionRuntime.ts +545 -0
  1223. package/src/shell/runtime/ShellActionRuntimeSupport.ts +386 -0
  1224. package/src/shell/runtime/ShellProcessEvents.ts +65 -0
  1225. package/src/shell/runtime/ShellRuntimeEnvironment.ts +67 -0
  1226. package/src/skill/Action.ts +159 -0
  1227. package/src/skill/Command.ts +98 -0
  1228. package/src/skill/Config.ts +51 -0
  1229. package/src/skill/PROMPT.ts +9 -0
  1230. package/src/skill/PROMPT.ts.txt +10 -0
  1231. package/src/skill/Plugin.ts +347 -0
  1232. package/src/skill/SkillPromptAssets.ts +14 -0
  1233. package/src/skill/runtime/Discovery.ts +141 -0
  1234. package/src/skill/runtime/Frontmatter.ts +17 -0
  1235. package/src/skill/runtime/Paths.ts +130 -0
  1236. package/src/skill/runtime/Prompt.ts +67 -0
  1237. package/src/skill/runtime/Store.ts +95 -0
  1238. package/src/skill/runtime/SystemProvider.ts +52 -0
  1239. package/src/skill/runtime/Types.ts +22 -0
  1240. package/src/skill/runtime/Utils.ts +28 -0
  1241. package/src/skill/types/ClaudeSkill.ts +64 -0
  1242. package/src/skill/types/SkillCommand.ts +90 -0
  1243. package/src/skill/types/SkillPlugin.ts +107 -0
  1244. package/src/skill/types/SkillRoot.ts +49 -0
  1245. package/src/task/Action.ts +491 -0
  1246. package/src/task/Index.ts +8 -0
  1247. package/src/task/PROMPT.ts +9 -0
  1248. package/src/task/PROMPT.ts.txt +237 -0
  1249. package/src/task/Scheduler.ts +245 -0
  1250. package/src/task/TaskPlugin.ts +167 -0
  1251. package/src/task/runtime/CronTrigger.ts +110 -0
  1252. package/src/task/runtime/Frontmatter.ts +24 -0
  1253. package/src/task/runtime/Model.ts +347 -0
  1254. package/src/task/runtime/Paths.ts +116 -0
  1255. package/src/task/runtime/Runner.ts +519 -0
  1256. package/src/task/runtime/Store.ts +253 -0
  1257. package/src/task/runtime/TaskActionExecution.ts +276 -0
  1258. package/src/task/runtime/TaskActionInput.ts +281 -0
  1259. package/src/task/runtime/TaskPluginActionRegistry.ts +214 -0
  1260. package/src/task/runtime/TaskPluginActions.ts +5 -0
  1261. package/src/task/runtime/TaskPluginSystem.ts +8 -0
  1262. package/src/task/runtime/TaskPromptAssets.ts +14 -0
  1263. package/src/task/runtime/TaskRunArtifacts.ts +493 -0
  1264. package/src/task/runtime/TaskRunChatDispatch.ts +81 -0
  1265. package/src/task/runtime/TaskRunnerProgress.ts +112 -0
  1266. package/src/task/runtime/TaskRunnerRound.ts +337 -0
  1267. package/src/task/runtime/TaskRunnerScript.ts +175 -0
  1268. package/src/task/runtime/TaskRunnerSession.ts +190 -0
  1269. package/src/task/runtime/TaskRunnerTypes.ts +199 -0
  1270. package/src/task/types/Cron.ts +16 -0
  1271. package/src/task/types/Task.ts +157 -0
  1272. package/src/task/types/TaskCommand.ts +165 -0
  1273. package/src/task/types/TaskPluginTypes.ts +55 -0
  1274. package/src/tts/Dependency.ts +473 -0
  1275. package/src/tts/Plugin.ts +518 -0
  1276. package/src/tts/PluginSupport.ts +85 -0
  1277. package/src/tts/runtime/Catalog.ts +97 -0
  1278. package/src/tts/runtime/DependencyInstaller.ts +436 -0
  1279. package/src/tts/runtime/Installer.ts +297 -0
  1280. package/src/tts/runtime/Paths.ts +39 -0
  1281. package/src/tts/runtime/Synthesizer.ts +480 -0
  1282. package/src/tts/types/Tts.ts +99 -0
  1283. package/src/tts/types/TtsPlugin.ts +164 -0
  1284. package/src/voice/Config.ts +135 -0
  1285. package/src/voice/Dependency.ts +329 -0
  1286. package/src/voice/InboundAugment.ts +59 -0
  1287. package/src/voice/ModelCatalog.ts +43 -0
  1288. package/src/voice/runtime/Catalog.ts +68 -0
  1289. package/src/voice/runtime/DependencyInstaller.ts +505 -0
  1290. package/src/voice/runtime/Installer.ts +324 -0
  1291. package/src/voice/runtime/Paths.ts +26 -0
  1292. package/src/voice/runtime/Transcriber.ts +467 -0
  1293. package/src/voice/types/Voice.ts +68 -0
  1294. package/src/voice/types/VoicePlugin.ts +194 -0
  1295. package/src/web/Dependency.ts +17 -0
  1296. package/src/web/PROMPT.agent-browser.ts +9 -0
  1297. package/src/web/PROMPT.agent-browser.ts.txt +17 -0
  1298. package/src/web/PROMPT.ts +9 -0
  1299. package/src/web/PROMPT.ts.txt +33 -0
  1300. package/src/web/PROMPT.web-access.ts +9 -0
  1301. package/src/web/PROMPT.web-access.ts.txt +13 -0
  1302. package/src/web/Plugin.ts +523 -0
  1303. package/src/web/WebPromptAssets.ts +26 -0
  1304. package/src/web/runtime/Config.ts +105 -0
  1305. package/src/web/runtime/Source.ts +257 -0
  1306. package/src/web/types/WebPlugin.ts +141 -0
  1307. package/src/workboard/Plugin.ts +94 -0
  1308. package/src/workboard/runtime/Collector.ts +79 -0
  1309. package/src/workboard/runtime/Normalizer.ts +213 -0
  1310. package/src/workboard/runtime/Store.ts +110 -0
  1311. package/src/workboard/types/Workboard.ts +158 -0
  1312. package/tsconfig.json +26 -0
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Auth Plugin。
3
+ *
4
+ * 关键点(中文)
5
+ * - auth 是内建且必需的 plugin,不走可选启停语义。
6
+ * - 静态授权配置与动态观测态都收敛在项目 `.downcity/chat/authorization/`。
7
+ * - auth plugin 只负责统一暴露扩展点 / action 边界,不再依赖宿主平台读写授权配置。
8
+ */
9
+ import { BasePlugin } from "@downcity/agent/internal/plugin/core/BasePlugin.js";
10
+ import { CHAT_PLUGIN_POINTS } from "../chat/runtime/PluginPoints.js";
11
+ import { AUTH_ACTIONS, } from "../auth/types/AuthPlugin.js";
12
+ import { readChatAuthorizationConfig, setChatAuthorizationUserRole, writeChatAuthorizationConfig, } from "../auth/runtime/AuthorizationConfig.js";
13
+ import { evaluateIncomingChatAuthorization, resolveAuthorizedUserRole, } from "../auth/runtime/AuthorizationPolicy.js";
14
+ import { readAuthorizationSnapshot, recordObservedAuthorizationPrincipal, } from "../auth/runtime/AuthorizationStore.js";
15
+ function toChannel(value) {
16
+ const text = String(value || "").trim().toLowerCase();
17
+ if (text === "telegram" || text === "feishu" || text === "qq")
18
+ return text;
19
+ return null;
20
+ }
21
+ function toRecord(value) {
22
+ if (!value || typeof value !== "object" || Array.isArray(value))
23
+ return {};
24
+ return value;
25
+ }
26
+ function toEvaluateInput(payload) {
27
+ const channel = toChannel(payload.channel);
28
+ if (!channel) {
29
+ throw new Error("auth.authorize_incoming requires a valid channel");
30
+ }
31
+ return {
32
+ channel,
33
+ chatId: String(payload.chatId || "").trim(),
34
+ ...(typeof payload.chatType === "string" ? { chatType: payload.chatType.trim() } : {}),
35
+ ...(typeof payload.userId === "string" ? { userId: payload.userId.trim() } : {}),
36
+ ...(typeof payload.username === "string" ? { username: payload.username.trim() } : {}),
37
+ ...(typeof payload.chatTitle === "string" ? { chatTitle: payload.chatTitle.trim() } : {}),
38
+ };
39
+ }
40
+ function toSnapshotData(snapshot) {
41
+ return {
42
+ config: snapshot.config,
43
+ users: snapshot.users,
44
+ chats: snapshot.chats,
45
+ };
46
+ }
47
+ function createAuthPluginDefinition() {
48
+ return {
49
+ name: "auth",
50
+ title: "User Authorization System",
51
+ description: "Controls who can talk to the agent in chat channels, records observed users and chats, and resolves each user's effective role for downstream service decisions.",
52
+ availability() {
53
+ return {
54
+ enabled: true,
55
+ available: true,
56
+ reasons: [],
57
+ };
58
+ },
59
+ hooks: {
60
+ guard: {
61
+ [CHAT_PLUGIN_POINTS.authorizeIncoming]: [
62
+ async ({ context, value }) => {
63
+ const input = value && typeof value === "object" && !Array.isArray(value)
64
+ ? value
65
+ : {};
66
+ const evaluateInput = toEvaluateInput(input);
67
+ const authorizationConfig = readChatAuthorizationConfig(context);
68
+ const result = evaluateIncomingChatAuthorization({
69
+ config: context.config,
70
+ channel: evaluateInput.channel,
71
+ input: evaluateInput,
72
+ authorizationConfig,
73
+ });
74
+ if (result.decision !== "allow") {
75
+ throw new Error(result.reason || "chat authorization blocked");
76
+ }
77
+ },
78
+ ],
79
+ },
80
+ effect: {
81
+ [CHAT_PLUGIN_POINTS.observePrincipal]: [
82
+ async ({ context, value }) => {
83
+ const input = toRecord(value);
84
+ const channel = toChannel(input.channel);
85
+ if (!channel) {
86
+ throw new Error("chat.observePrincipal requires a valid channel");
87
+ }
88
+ await recordObservedAuthorizationPrincipal({
89
+ context,
90
+ channel,
91
+ chatId: String(input.chatId || "").trim(),
92
+ ...(typeof input.chatType === "string" ? { chatType: input.chatType.trim() } : {}),
93
+ ...(typeof input.chatTitle === "string" ? { chatTitle: input.chatTitle.trim() } : {}),
94
+ ...(typeof input.userId === "string" ? { userId: input.userId.trim() } : {}),
95
+ ...(typeof input.username === "string" ? { username: input.username.trim() } : {}),
96
+ });
97
+ },
98
+ ],
99
+ },
100
+ },
101
+ resolves: {
102
+ [CHAT_PLUGIN_POINTS.resolveUserRole]: async ({ context, value }) => {
103
+ const input = value && typeof value === "object" && !Array.isArray(value)
104
+ ? value
105
+ : {};
106
+ const channel = toChannel(input.channel);
107
+ if (!channel) {
108
+ throw new Error("chat.resolveUserRole requires a valid channel");
109
+ }
110
+ const role = resolveAuthorizedUserRole({
111
+ channel,
112
+ userId: String(input.userId || "").trim(),
113
+ rootPath: context.rootPath,
114
+ });
115
+ return (role || null);
116
+ },
117
+ },
118
+ actions: {
119
+ [AUTH_ACTIONS.snapshot]: {
120
+ execute: async ({ context }) => {
121
+ const snapshot = await readAuthorizationSnapshot({
122
+ context,
123
+ });
124
+ return {
125
+ success: true,
126
+ data: toSnapshotData(snapshot),
127
+ };
128
+ },
129
+ },
130
+ [AUTH_ACTIONS.readConfig]: {
131
+ execute: async ({ context }) => {
132
+ return {
133
+ success: true,
134
+ data: readChatAuthorizationConfig(context),
135
+ };
136
+ },
137
+ },
138
+ [AUTH_ACTIONS.writeConfig]: {
139
+ execute: async ({ context, payload }) => {
140
+ const body = toRecord(payload);
141
+ const nextConfig = body.config && typeof body.config === "object" && !Array.isArray(body.config)
142
+ ? body.config
143
+ : {};
144
+ await writeChatAuthorizationConfig({
145
+ context,
146
+ nextConfig,
147
+ });
148
+ return {
149
+ success: true,
150
+ data: readChatAuthorizationConfig(context),
151
+ };
152
+ },
153
+ },
154
+ [AUTH_ACTIONS.setUserRole]: {
155
+ execute: async ({ context, payload }) => {
156
+ const body = toRecord(payload);
157
+ const channel = toChannel(body.channel);
158
+ if (!channel) {
159
+ return {
160
+ success: false,
161
+ error: "set-user-role requires a valid channel",
162
+ message: "set-user-role requires a valid channel",
163
+ };
164
+ }
165
+ await setChatAuthorizationUserRole({
166
+ context,
167
+ channel,
168
+ userId: String(body.userId || "").trim(),
169
+ roleId: String(body.roleId || "").trim(),
170
+ });
171
+ return {
172
+ success: true,
173
+ data: readChatAuthorizationConfig(context),
174
+ };
175
+ },
176
+ },
177
+ },
178
+ };
179
+ }
180
+ /**
181
+ * AuthPlugin:统一承载授权能力。
182
+ */
183
+ export class AuthPlugin extends BasePlugin {
184
+ name = "auth";
185
+ constructor(agent = null) {
186
+ super(agent);
187
+ Object.assign(this, createAuthPluginDefinition());
188
+ }
189
+ }
190
+ //# sourceMappingURL=Plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/auth/Plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,oDAAoD,CAAC;AAGhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,YAAY,GAOb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,iCAAiC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oBACD,MAAM,4BAA4B,CAAC;wBACjC,OAAO;wBACP,OAAO;wBACP,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;wBACxC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;qBACzC,CAAC,CAAC;oBACH,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,IAAI,EAAE,2BAA2B,CAAC,OAAO,CAAyB;qBACnE,CAAC;gBACJ,CAAC;aACF;SACF;KACA,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAC/B,IAAI,GAAG,MAAM,CAAC;IAEvB,YAAY,QAA6B,IAAI;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Auth 授权配置读写工具。
3
+ *
4
+ * 关键点(中文)
5
+ * - 静态授权规则直接存放在项目 `.downcity/chat/authorization/config.json`。
6
+ * - 授权核心模型为 role / permission / binding。
7
+ */
8
+ import type { AgentContext } from "@downcity/agent/internal/types/runtime/agent/AgentContext.js";
9
+ import type { ChatAuthorizationConfig, ChatAuthorizationChannel, ChatAuthorizationPermission, ChatAuthorizationRole } from "../../auth/types/AuthPlugin.js";
10
+ export declare const DEFAULT_CHAT_AUTHORIZATION_PERMISSIONS: ChatAuthorizationPermission[];
11
+ /**
12
+ * 同步读取当前 agent 的授权配置。
13
+ */
14
+ export declare function readChatAuthorizationConfigSync(projectRoot: string): ChatAuthorizationConfig;
15
+ /**
16
+ * 读取当前 agent 的授权配置。
17
+ */
18
+ export declare function readChatAuthorizationConfig(contextOrProjectRoot: Pick<AgentContext, "rootPath"> | string): ChatAuthorizationConfig;
19
+ /**
20
+ * 覆盖写入整份授权配置。
21
+ */
22
+ export declare function writeChatAuthorizationConfig(params: {
23
+ context: Pick<AgentContext, "rootPath">;
24
+ nextConfig: ChatAuthorizationConfig;
25
+ }): Promise<void>;
26
+ /**
27
+ * 读取角色列表。
28
+ */
29
+ export declare function listChatAuthorizationRoles(params: {
30
+ config: ChatAuthorizationConfig;
31
+ }): ChatAuthorizationRole[];
32
+ /**
33
+ * 设置用户角色。
34
+ */
35
+ export declare function setChatAuthorizationUserRole(params: {
36
+ context: Pick<AgentContext, "rootPath">;
37
+ channel: ChatAuthorizationChannel;
38
+ userId: string;
39
+ roleId: string;
40
+ }): Promise<void>;
41
+ //# sourceMappingURL=AuthorizationConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationConfig.d.ts","sourceRoot":"","sources":["../../../src/auth/runtime/AuthorizationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AACjG,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EAEtB,MAAM,4BAA4B,CAAC;AASpC,eAAO,MAAM,sCAAsC,EAAE,2BAA2B,EAE/E,CAAC;AAwJF;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,CAE5F;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,oBAAoB,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,MAAM,GAC5D,uBAAuB,CAKzB;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAAC,MAAM,EAAE;IACzD,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxC,UAAU,EAAE,uBAAuB,CAAC;CACrC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,MAAM,EAAE,uBAAuB,CAAC;CACjC,GAAG,qBAAqB,EAAE,CAG1B;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAAC,MAAM,EAAE;IACzD,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,EAAE,wBAAwB,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB"}
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Auth 授权配置读写工具。
3
+ *
4
+ * 关键点(中文)
5
+ * - 静态授权规则直接存放在项目 `.downcity/chat/authorization/config.json`。
6
+ * - 授权核心模型为 role / permission / binding。
7
+ */
8
+ import fs from "fs-extra";
9
+ import path from "node:path";
10
+ import { CHAT_AUTHORIZATION_CHANNELS, CHAT_AUTHORIZATION_PERMISSIONS, createDefaultChatAuthorizationRoles, } from "../../auth/types/AuthPlugin.js";
11
+ const CHANNELS = [...CHAT_AUTHORIZATION_CHANNELS];
12
+ export const DEFAULT_CHAT_AUTHORIZATION_PERMISSIONS = [
13
+ ...CHAT_AUTHORIZATION_PERMISSIONS,
14
+ ];
15
+ function normalizeText(value) {
16
+ const text = String(value || "").trim();
17
+ return text ? text : undefined;
18
+ }
19
+ function normalizePermissionList(values) {
20
+ const allowed = new Set(DEFAULT_CHAT_AUTHORIZATION_PERMISSIONS);
21
+ if (!Array.isArray(values))
22
+ return [];
23
+ return [
24
+ ...new Set(values
25
+ .map((value) => normalizeText(value))
26
+ .filter((value) => Boolean(value && allowed.has(value)))),
27
+ ];
28
+ }
29
+ function buildDefaultRole(roleId) {
30
+ return createDefaultChatAuthorizationRoles()[roleId];
31
+ }
32
+ function normalizeRoleMap(input) {
33
+ const defaultRoles = createDefaultChatAuthorizationRoles();
34
+ if (!input || typeof input !== "object" || Array.isArray(input))
35
+ return defaultRoles;
36
+ const roles = {};
37
+ for (const [rawRoleId, rawRole] of Object.entries(input)) {
38
+ const roleId = normalizeText(rawRoleId);
39
+ if (!roleId)
40
+ continue;
41
+ const roleObj = rawRole && typeof rawRole === "object" && !Array.isArray(rawRole)
42
+ ? rawRole
43
+ : null;
44
+ if (!roleObj)
45
+ continue;
46
+ const builtinRole = defaultRoles[roleId];
47
+ roles[roleId] = {
48
+ roleId,
49
+ name: normalizeText(roleObj.name) || builtinRole?.name || roleId,
50
+ ...(normalizeText(roleObj.description) || builtinRole?.description
51
+ ? {
52
+ description: normalizeText(roleObj.description) || builtinRole?.description || undefined,
53
+ }
54
+ : {}),
55
+ permissions: normalizePermissionList(roleObj.permissions),
56
+ };
57
+ }
58
+ if (Object.keys(roles).length === 0)
59
+ return defaultRoles;
60
+ if (!roles.default)
61
+ roles.default = buildDefaultRole("default");
62
+ return roles;
63
+ }
64
+ function normalizeBindingMap(input, roles) {
65
+ if (!input || typeof input !== "object" || Array.isArray(input))
66
+ return {};
67
+ const out = {};
68
+ for (const [rawId, rawRoleId] of Object.entries(input)) {
69
+ const entityId = normalizeText(rawId);
70
+ const roleId = normalizeText(rawRoleId);
71
+ if (!entityId || !roleId || !roles[roleId])
72
+ continue;
73
+ out[entityId] = roleId;
74
+ }
75
+ return out;
76
+ }
77
+ function normalizeChannelConfig(input, roles) {
78
+ const raw = input && typeof input === "object" && !Array.isArray(input)
79
+ ? input
80
+ : {};
81
+ const defaultUserRoleId = normalizeText(raw.defaultUserRoleId) || "default";
82
+ return {
83
+ defaultUserRoleId: roles[defaultUserRoleId] ? defaultUserRoleId : "default",
84
+ userRoles: normalizeBindingMap(raw.userRoles, roles),
85
+ };
86
+ }
87
+ function normalizeAuthorizationConfig(input) {
88
+ const raw = input && typeof input === "object" && !Array.isArray(input)
89
+ ? input
90
+ : {};
91
+ const roles = normalizeRoleMap(raw.roles);
92
+ const channels = {};
93
+ for (const channel of CHANNELS) {
94
+ channels[channel] = normalizeChannelConfig(raw.channels?.[channel], roles);
95
+ }
96
+ return { roles, channels };
97
+ }
98
+ function cloneAuthorizationConfig(input) {
99
+ return normalizeAuthorizationConfig(input ? JSON.parse(JSON.stringify(input)) : {});
100
+ }
101
+ function getChatAuthorizationConfigPath(projectRoot) {
102
+ return path.join(projectRoot, ".downcity", "chat", "authorization", "config.json");
103
+ }
104
+ function readAuthorizationConfigFromProjectRoot(projectRoot) {
105
+ const normalizedProjectRoot = normalizeText(projectRoot);
106
+ if (!normalizedProjectRoot)
107
+ return normalizeAuthorizationConfig({});
108
+ const file = getChatAuthorizationConfigPath(normalizedProjectRoot);
109
+ if (!fs.existsSync(file))
110
+ return normalizeAuthorizationConfig({});
111
+ try {
112
+ return normalizeAuthorizationConfig(fs.readJsonSync(file));
113
+ }
114
+ catch {
115
+ return normalizeAuthorizationConfig({});
116
+ }
117
+ }
118
+ async function writeAuthorizationConfigToPlatform(params) {
119
+ const normalizedProjectRoot = normalizeText(params.projectRoot);
120
+ if (!normalizedProjectRoot)
121
+ throw new Error("projectRoot is required");
122
+ const file = getChatAuthorizationConfigPath(normalizedProjectRoot);
123
+ await fs.ensureDir(path.dirname(file));
124
+ await fs.writeJson(file, normalizeAuthorizationConfig(params.nextConfig), {
125
+ spaces: 2,
126
+ });
127
+ }
128
+ function ensureChannelConfig(config, channel) {
129
+ config.roles = normalizeRoleMap(config.roles);
130
+ config.channels ??= {};
131
+ config.channels[channel] = normalizeChannelConfig(config.channels[channel], config.roles);
132
+ return config.channels[channel];
133
+ }
134
+ /**
135
+ * 同步读取当前 agent 的授权配置。
136
+ */
137
+ export function readChatAuthorizationConfigSync(projectRoot) {
138
+ return readAuthorizationConfigFromProjectRoot(projectRoot);
139
+ }
140
+ /**
141
+ * 读取当前 agent 的授权配置。
142
+ */
143
+ export function readChatAuthorizationConfig(contextOrProjectRoot) {
144
+ if (typeof contextOrProjectRoot === "string") {
145
+ return readAuthorizationConfigFromProjectRoot(contextOrProjectRoot);
146
+ }
147
+ return readAuthorizationConfigFromProjectRoot(contextOrProjectRoot.rootPath);
148
+ }
149
+ /**
150
+ * 覆盖写入整份授权配置。
151
+ */
152
+ export async function writeChatAuthorizationConfig(params) {
153
+ await writeAuthorizationConfigToPlatform({
154
+ projectRoot: params.context.rootPath,
155
+ nextConfig: params.nextConfig,
156
+ });
157
+ }
158
+ /**
159
+ * 读取角色列表。
160
+ */
161
+ export function listChatAuthorizationRoles(params) {
162
+ const config = normalizeAuthorizationConfig(params.config);
163
+ return Object.values(config.roles || {}).sort((a, b) => a.roleId.localeCompare(b.roleId));
164
+ }
165
+ /**
166
+ * 设置用户角色。
167
+ */
168
+ export async function setChatAuthorizationUserRole(params) {
169
+ const userId = normalizeText(params.userId);
170
+ const roleId = normalizeText(params.roleId);
171
+ if (!userId || !roleId)
172
+ throw new Error("userId and roleId are required");
173
+ const authorization = cloneAuthorizationConfig(readAuthorizationConfigFromProjectRoot(params.context.rootPath));
174
+ authorization.roles = normalizeRoleMap(authorization.roles);
175
+ const channelConfig = ensureChannelConfig(authorization, params.channel);
176
+ if (!authorization.roles?.[roleId])
177
+ throw new Error(`Unknown roleId: ${roleId}`);
178
+ channelConfig.userRoles ??= {};
179
+ channelConfig.userRoles[userId] = roleId;
180
+ await writeAuthorizationConfigToPlatform({
181
+ projectRoot: params.context.rootPath,
182
+ nextConfig: authorization,
183
+ });
184
+ }
185
+ //# sourceMappingURL=AuthorizationConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationConfig.js","sourceRoot":"","sources":["../../../src/auth/runtime/AuthorizationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAS7B,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,4BAA4B,CAAC;AAEpC,MAAM,QAAQ,GAA+B,CAAC,GAAG,2BAA2B,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,sCAAsC,GAAkC;IACnF,GAAG,8BAA8B;CAClC,CAAC;AAEF,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EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,MAKlD;IACC,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC1E,MAAM,aAAa,GAAG,wBAAwB,CAC5C,sCAAsC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAChE,CAAC;IACF,aAAa,CAAC,KAAK,GAAG,gBAAgB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,mBAAmB,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACzE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;IACjF,aAAa,CAAC,SAAS,KAAK,EAAE,CAAC;IAC/B,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACzC,MAAM,kCAAkC,CAAC;QACvC,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;QACpC,UAAU,EAAE,aAAa;KAC1B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Auth 授权判定逻辑。
3
+ *
4
+ * 关键点(中文)
5
+ * - 角色模型替代旧的 allowlist/pairing 模型。
6
+ * - 判定统一走“用户角色 + 权限集合”,群聊只看发言用户自身权限。
7
+ */
8
+ import type { DowncityConfig } from "@downcity/agent/internal/types/config/DowncityConfig.js";
9
+ import type { ChatAuthorizationConfig, ChatAuthorizationChannel, ChatAuthorizationEvaluateInput, ChatAuthorizationEvaluateResult, ChatAuthorizationRole } from "../../auth/types/AuthPlugin.js";
10
+ /**
11
+ * 解析用户授权角色。
12
+ */
13
+ export declare function resolveAuthorizedUserRole(params: {
14
+ channel: ChatAuthorizationChannel;
15
+ userId?: string;
16
+ authorizationConfig?: ChatAuthorizationConfig;
17
+ rootPath?: string;
18
+ }): ChatAuthorizationRole | undefined;
19
+ /**
20
+ * 执行入站授权判定。
21
+ */
22
+ export declare function evaluateIncomingChatAuthorization(params: {
23
+ config: DowncityConfig;
24
+ channel: ChatAuthorizationChannel;
25
+ input: ChatAuthorizationEvaluateInput;
26
+ authorizationConfig?: ChatAuthorizationConfig;
27
+ }): ChatAuthorizationEvaluateResult;
28
+ //# sourceMappingURL=AuthorizationPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationPolicy.d.ts","sourceRoot":"","sources":["../../../src/auth/runtime/AuthorizationPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAE/B,qBAAqB,EAEtB,MAAM,4BAA4B,CAAC;AAqEpC;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,OAAO,EAAE,wBAAwB,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,qBAAqB,GAAG,SAAS,CAepC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACxD,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,wBAAwB,CAAC;IAClC,KAAK,EAAE,8BAA8B,CAAC;IACtC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;CAC/C,GAAG,+BAA+B,CA+ClC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Auth 授权判定逻辑。
3
+ *
4
+ * 关键点(中文)
5
+ * - 角色模型替代旧的 allowlist/pairing 模型。
6
+ * - 判定统一走“用户角色 + 权限集合”,群聊只看发言用户自身权限。
7
+ */
8
+ import { createDefaultChatAuthorizationRoles } from "../../auth/types/AuthPlugin.js";
9
+ import { readChatAuthorizationConfigSync } from "../../auth/runtime/AuthorizationConfig.js";
10
+ function normalizeText(value) {
11
+ const text = String(value || "").trim();
12
+ return text ? text : undefined;
13
+ }
14
+ function isDirectMessage(channel, chatType) {
15
+ const type = String(chatType || "").trim().toLowerCase();
16
+ if (!type)
17
+ return true;
18
+ if (channel === "telegram")
19
+ return type === "private";
20
+ if (channel === "feishu")
21
+ return type === "p2p";
22
+ if (channel === "qq")
23
+ return type === "private" || type === "c2c";
24
+ return false;
25
+ }
26
+ function resolveAuthorizationRoles(authorizationConfig) {
27
+ const raw = authorizationConfig?.roles;
28
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
29
+ return createDefaultChatAuthorizationRoles();
30
+ }
31
+ return Object.keys(raw).length > 0 ? raw : createDefaultChatAuthorizationRoles();
32
+ }
33
+ function resolveChannelAuthorizationConfig(channel, authorizationConfig) {
34
+ const raw = authorizationConfig?.channels?.[channel];
35
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
36
+ return {
37
+ defaultUserRoleId: "default",
38
+ userRoles: {},
39
+ };
40
+ }
41
+ return raw;
42
+ }
43
+ function resolveRole(roleId, roles) {
44
+ if (roleId && roles?.[roleId])
45
+ return roles[roleId];
46
+ if (roles?.default)
47
+ return roles.default;
48
+ return { roleId: "default", name: "Default", permissions: [] };
49
+ }
50
+ function hasPermission(role, permission) {
51
+ return role.permissions.includes(permission);
52
+ }
53
+ function resolveUserRole(params) {
54
+ const userId = normalizeText(params.userId);
55
+ const defaultRoleId = normalizeText(params.channelConfig.defaultUserRoleId) || "default";
56
+ const boundRoleId = userId ? normalizeText(params.channelConfig.userRoles?.[userId]) : undefined;
57
+ return resolveRole(boundRoleId || defaultRoleId, params.roles);
58
+ }
59
+ /**
60
+ * 解析用户授权角色。
61
+ */
62
+ export function resolveAuthorizedUserRole(params) {
63
+ const userId = normalizeText(params.userId);
64
+ if (!userId)
65
+ return undefined;
66
+ const authorizationConfig = params.authorizationConfig ||
67
+ (params.rootPath
68
+ ? readChatAuthorizationConfigSync(params.rootPath)
69
+ : undefined);
70
+ const roles = resolveAuthorizationRoles(authorizationConfig);
71
+ const channelConfig = resolveChannelAuthorizationConfig(params.channel, authorizationConfig);
72
+ return resolveUserRole({
73
+ roles,
74
+ channelConfig,
75
+ userId,
76
+ });
77
+ }
78
+ /**
79
+ * 执行入站授权判定。
80
+ */
81
+ export function evaluateIncomingChatAuthorization(params) {
82
+ const channelConfig = resolveChannelAuthorizationConfig(params.channel, params.authorizationConfig);
83
+ const roles = resolveAuthorizationRoles(params.authorizationConfig);
84
+ const direct = isDirectMessage(params.channel, params.input.chatType);
85
+ const userRole = resolveUserRole({
86
+ roles,
87
+ channelConfig,
88
+ userId: params.input.userId,
89
+ });
90
+ const isOwner = hasPermission(userRole, "agent.manage");
91
+ if (direct) {
92
+ return hasPermission(userRole, "chat.dm.use")
93
+ ? {
94
+ decision: "allow",
95
+ isOwner,
96
+ userRoleId: userRole.roleId,
97
+ userPermissions: [...userRole.permissions],
98
+ reason: "dm_role_allowed",
99
+ }
100
+ : {
101
+ decision: "block",
102
+ isOwner,
103
+ userRoleId: userRole.roleId,
104
+ userPermissions: [...userRole.permissions],
105
+ reason: "dm_role_blocked",
106
+ };
107
+ }
108
+ return hasPermission(userRole, "chat.group.use")
109
+ ? {
110
+ decision: "allow",
111
+ isOwner,
112
+ userRoleId: userRole.roleId,
113
+ userPermissions: [...userRole.permissions],
114
+ reason: "group_user_role_allowed",
115
+ }
116
+ : {
117
+ decision: "block",
118
+ isOwner,
119
+ userRoleId: userRole.roleId,
120
+ userPermissions: [...userRole.permissions],
121
+ reason: "user_group_permission_blocked",
122
+ };
123
+ }
124
+ //# sourceMappingURL=AuthorizationPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationPolicy.js","sourceRoot":"","sources":["../../../src/auth/runtime/AuthorizationPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAExF,SAAS,aAAa,CAAC,KAAc;IACnC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACjC,CAAC;AAED,SAAS,eAAe,CAAC,OAAiC,EAAE,QAAiB;IAC3E,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,IAAI,OAAO,KAAK,UAAU;QAAE,OAAO,IAAI,KAAK,SAAS,CAAC;IACtD,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,IAAI,KAAK,KAAK,CAAC;IAChD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC;IAClE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,yBAAyB,CAChC,mBAA6C;IAE7C,MAAM,GAAG,GAAG,mBAAmB,EAAE,KAAK,CAAC;IACvC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK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AC,CAAC;IACH,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAExD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC;YAC3C,CAAC,CAAC;gBACE,QAAQ,EAAE,OAAO;gBACjB,OAAO;gBACP,UAAU,EAAE,QAAQ,CAAC,MAAM;gBAC3B,eAAe,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,iBAAiB;aAC1B;YACH,CAAC,CAAC;gBACE,QAAQ,EAAE,OAAO;gBACjB,OAAO;gBACP,UAAU,EAAE,QAAQ,CAAC,MAAM;gBAC3B,eAAe,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,iBAAiB;aAC1B,CAAC;IACR,CAAC;IAED,OAAO,aAAa,CAAC,QAAQ,EAAE,gBAAgB,CAAC;QAC9C,CAAC,CAAC;YACE,QAAQ,EAAE,OAAO;YACjB,OAAO;YACP,UAAU,EAAE,QAAQ,CAAC,MAAM;YAC3B,eAAe,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;YAC1C,MAAM,EAAE,yBAAyB;SAClC;QACH,CAAC,CAAC;YACE,QAAQ,EAAE,OAAO;YACjB,OAAO;YACP,UAAU,EAAE,QAAQ,CAAC,MAAM;YAC3B,eAAe,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;YAC1C,MAAM,EAAE,+BAA+B;SACxC,CAAC;AACR,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Auth 授权运行时状态存储。
3
+ *
4
+ * 关键点(中文)
5
+ * - 所有动态状态(观测用户 / 会话)统一落盘到 `.downcity/chat/authorization/state.json`。
6
+ * - 静态授权配置保存在同目录下的 `config.json`,不和运行时观测数据混写。
7
+ */
8
+ import type { ChatAuthorizationSnapshot } from "../../auth/types/AuthPlugin.js";
9
+ import type { AgentContext } from "@downcity/agent/internal/types/runtime/agent/AgentContext.js";
10
+ import type { ChatDispatchChannel } from "../../chat/types/ChatDispatcher.js";
11
+ /**
12
+ * 记录观测到的用户 / 会话。
13
+ */
14
+ export declare function recordObservedAuthorizationPrincipal(params: {
15
+ context: Pick<AgentContext, "rootPath">;
16
+ channel: ChatDispatchChannel;
17
+ chatId: string;
18
+ chatType?: string;
19
+ chatTitle?: string;
20
+ userId?: string;
21
+ username?: string;
22
+ }): Promise<void>;
23
+ /**
24
+ * 读取授权快照(配置 + 动态状态)。
25
+ */
26
+ export declare function readAuthorizationSnapshot(params: {
27
+ context: Pick<AgentContext, "rootPath">;
28
+ }): Promise<ChatAuthorizationSnapshot>;
29
+ //# sourceMappingURL=AuthorizationStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationStore.d.ts","sourceRoot":"","sources":["../../../src/auth/runtime/AuthorizationStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAGV,yBAAyB,EAE1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AACjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAwI1E;;GAEG;AACH,wBAAsB,oCAAoC,CAAC,MAAM,EAAE;IACjE,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChB;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE;IACtD,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CACzC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAOrC"}