@zhin.js/core 1.3.2 → 1.3.3

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 (408) hide show
  1. package/README.md +7 -7
  2. package/lib/adapter.d.ts +22 -2
  3. package/lib/adapter.js +71 -1
  4. package/lib/agent-prompt.d.ts +0 -1
  5. package/lib/agent-prompt.js +0 -1
  6. package/lib/built/adapter-process.d.ts +0 -1
  7. package/lib/built/adapter-process.js +0 -1
  8. package/lib/built/agent-preset.d.ts +0 -1
  9. package/lib/built/agent-preset.js +0 -1
  10. package/lib/built/ai-access.d.ts +36 -0
  11. package/lib/built/ai-access.js +46 -0
  12. package/lib/built/ai-outbound/adapter-access.d.ts +3 -0
  13. package/lib/built/ai-outbound/adapter-access.js +9 -0
  14. package/lib/built/ai-outbound/extensions/onebot-keyboard.d.ts +2 -0
  15. package/lib/built/ai-outbound/extensions/onebot-keyboard.js +67 -0
  16. package/lib/built/ai-outbound/extensions/qq-message.d.ts +3 -0
  17. package/lib/built/ai-outbound/extensions/qq-message.js +23 -0
  18. package/lib/built/ai-outbound/index.d.ts +9 -0
  19. package/lib/built/ai-outbound/index.js +9 -0
  20. package/lib/built/ai-outbound/parse.d.ts +13 -0
  21. package/lib/built/ai-outbound/parse.js +94 -0
  22. package/lib/built/ai-outbound/plain-mention-rewrite.d.ts +6 -0
  23. package/lib/built/ai-outbound/plain-mention-rewrite.js +37 -0
  24. package/lib/built/ai-outbound/prompt.d.ts +11 -0
  25. package/lib/built/ai-outbound/prompt.js +44 -0
  26. package/lib/built/ai-outbound/resolve.d.ts +4 -0
  27. package/lib/built/ai-outbound/resolve.js +64 -0
  28. package/lib/built/ai-outbound/structured-detect.d.ts +3 -0
  29. package/lib/built/ai-outbound/structured-detect.js +7 -0
  30. package/lib/built/ai-outbound/types.d.ts +60 -0
  31. package/lib/built/ai-outbound/types.js +5 -0
  32. package/lib/built/ai-trigger.d.ts +5 -1
  33. package/lib/built/ai-trigger.js +3 -7
  34. package/lib/built/authorization.d.ts +0 -1
  35. package/lib/built/authorization.js +0 -1
  36. package/lib/built/command.d.ts +0 -1
  37. package/lib/built/command.js +1 -3
  38. package/lib/built/common-adapter-tools.d.ts +25 -26
  39. package/lib/built/common-adapter-tools.js +48 -49
  40. package/lib/built/component.d.ts +0 -1
  41. package/lib/built/component.js +1 -3
  42. package/lib/built/config.d.ts +4 -1
  43. package/lib/built/config.js +26 -5
  44. package/lib/built/connect-endpoint-instance.d.ts +0 -1
  45. package/lib/built/connect-endpoint-instance.js +3 -2
  46. package/lib/built/database.d.ts +0 -1
  47. package/lib/built/database.js +1 -3
  48. package/lib/built/dispatcher.d.ts +6 -6
  49. package/lib/built/dispatcher.js +20 -8
  50. package/lib/built/endpoint-commands.d.ts +0 -1
  51. package/lib/built/endpoint-commands.js +6 -9
  52. package/lib/built/endpoint-lifecycle-service.d.ts +2 -1
  53. package/lib/built/endpoint-lifecycle-service.js +25 -3
  54. package/lib/built/endpoint-lifecycle.d.ts +0 -1
  55. package/lib/built/endpoint-lifecycle.js +0 -1
  56. package/lib/built/endpoint-manager.d.ts +0 -1
  57. package/lib/built/endpoint-manager.js +0 -1
  58. package/lib/built/generated-qrcode.d.ts +0 -1
  59. package/lib/built/generated-qrcode.js +0 -1
  60. package/lib/built/generic-segment-mapper.d.ts +6 -0
  61. package/lib/built/generic-segment-mapper.js +232 -0
  62. package/lib/built/html-renderer-loader.d.ts +2 -1
  63. package/lib/built/html-renderer-loader.js +6 -2
  64. package/lib/built/html-segment-fallback.d.ts +0 -1
  65. package/lib/built/html-segment-fallback.js +0 -1
  66. package/lib/built/html-to-text.d.ts +0 -1
  67. package/lib/built/html-to-text.js +0 -1
  68. package/lib/built/inbound-pipeline.d.ts +0 -1
  69. package/lib/built/inbound-pipeline.js +0 -1
  70. package/lib/built/inbound-runner.d.ts +0 -1
  71. package/lib/built/inbound-runner.js +0 -1
  72. package/lib/built/interactive-segment-contract.d.ts +6 -0
  73. package/lib/built/interactive-segment-contract.js +9 -0
  74. package/lib/built/interactive-segments/action.d.ts +17 -0
  75. package/lib/built/interactive-segments/action.js +54 -0
  76. package/lib/built/interactive-segments/button-spec.d.ts +10 -0
  77. package/lib/built/interactive-segments/button-spec.js +21 -0
  78. package/lib/built/interactive-segments/handlers.d.ts +9 -0
  79. package/lib/built/interactive-segments/handlers.js +58 -0
  80. package/lib/built/interactive-segments/index.d.ts +7 -0
  81. package/lib/built/interactive-segments/index.js +7 -0
  82. package/lib/built/interactive-segments/keyboard-segment.d.ts +12 -0
  83. package/lib/built/interactive-segments/keyboard-segment.js +13 -0
  84. package/lib/built/interactive-segments/onebot-keyboard.d.ts +10 -0
  85. package/lib/built/interactive-segments/onebot-keyboard.js +53 -0
  86. package/lib/built/interactive-segments/resolve.d.ts +9 -0
  87. package/lib/built/interactive-segments/resolve.js +84 -0
  88. package/lib/built/interactive-segments/types.d.ts +62 -0
  89. package/lib/built/interactive-segments/types.js +13 -0
  90. package/lib/built/introspection-format.d.ts +0 -1
  91. package/lib/built/introspection-format.js +1 -1
  92. package/lib/built/login-assist.d.ts +0 -1
  93. package/lib/built/login-assist.js +0 -1
  94. package/lib/built/management-command-guard.d.ts +5 -1
  95. package/lib/built/management-command-guard.js +5 -1
  96. package/lib/built/message-enrich.d.ts +0 -1
  97. package/lib/built/message-enrich.js +0 -1
  98. package/lib/built/message-filter.d.ts +0 -1
  99. package/lib/built/message-filter.js +1 -3
  100. package/lib/built/optional-peer-import.d.ts +3 -0
  101. package/lib/built/optional-peer-import.js +33 -0
  102. package/lib/built/outbound-media-contract.d.ts +0 -1
  103. package/lib/built/outbound-media-contract.js +0 -1
  104. package/lib/built/outbound-media-utils.d.ts +0 -1
  105. package/lib/built/outbound-media-utils.js +0 -1
  106. package/lib/built/permission.d.ts +0 -1
  107. package/lib/built/permission.js +1 -3
  108. package/lib/built/permit-check.d.ts +0 -1
  109. package/lib/built/permit-check.js +0 -1
  110. package/lib/built/permit-parse.d.ts +0 -1
  111. package/lib/built/permit-parse.js +0 -1
  112. package/lib/built/platform-permit.d.ts +5 -6
  113. package/lib/built/platform-permit.js +11 -12
  114. package/lib/built/prepend-quote-context.d.ts +0 -1
  115. package/lib/built/prepend-quote-context.js +0 -1
  116. package/lib/built/qrcode-segment.d.ts +0 -1
  117. package/lib/built/qrcode-segment.js +0 -1
  118. package/lib/built/queue-im-field-contract.d.ts +6 -1
  119. package/lib/built/queue-im-field-contract.js +10 -1
  120. package/lib/built/rich-segments/adapter-policies.d.ts +1 -2
  121. package/lib/built/rich-segments/adapter-policies.js +0 -1
  122. package/lib/built/rich-segments/base.d.ts +0 -1
  123. package/lib/built/rich-segments/base.js +0 -1
  124. package/lib/built/rich-segments/builtins.d.ts +0 -1
  125. package/lib/built/rich-segments/builtins.js +0 -1
  126. package/lib/built/rich-segments/capabilities.d.ts +0 -1
  127. package/lib/built/rich-segments/capabilities.js +0 -1
  128. package/lib/built/rich-segments/html-segment.d.ts +1 -2
  129. package/lib/built/rich-segments/html-segment.js +0 -1
  130. package/lib/built/rich-segments/index.d.ts +0 -1
  131. package/lib/built/rich-segments/index.js +0 -1
  132. package/lib/built/rich-segments/markdown-segment.d.ts +1 -2
  133. package/lib/built/rich-segments/markdown-segment.js +0 -1
  134. package/lib/built/rich-segments/markdown-to-text.d.ts +0 -1
  135. package/lib/built/rich-segments/markdown-to-text.js +0 -1
  136. package/lib/built/rich-segments/qrcode-segment.d.ts +1 -2
  137. package/lib/built/rich-segments/qrcode-segment.js +0 -1
  138. package/lib/built/rich-segments/registry.d.ts +0 -1
  139. package/lib/built/rich-segments/registry.js +0 -1
  140. package/lib/built/rich-segments/resolve.d.ts +1 -2
  141. package/lib/built/rich-segments/resolve.js +0 -1
  142. package/lib/built/rich-segments/tts-segment.d.ts +1 -2
  143. package/lib/built/rich-segments/tts-segment.js +0 -1
  144. package/lib/built/rich-segments/types.d.ts +0 -1
  145. package/lib/built/rich-segments/types.js +0 -1
  146. package/lib/built/roles.d.ts +0 -1
  147. package/lib/built/roles.js +0 -1
  148. package/lib/built/runtime-io.d.ts +0 -1
  149. package/lib/built/runtime-io.js +0 -1
  150. package/lib/built/schedule.d.ts +55 -0
  151. package/lib/built/schedule.js +112 -0
  152. package/lib/built/schema-endpoint-manager.d.ts +0 -1
  153. package/lib/built/schema-endpoint-manager.js +0 -1
  154. package/lib/built/schema-feature.d.ts +0 -1
  155. package/lib/built/schema-feature.js +1 -3
  156. package/lib/built/segment-contract/assert.d.ts +4 -0
  157. package/lib/built/segment-contract/assert.js +30 -0
  158. package/lib/built/segment-contract/delivery.d.ts +5 -0
  159. package/lib/built/segment-contract/delivery.js +40 -0
  160. package/lib/built/segment-contract/image.d.ts +5 -0
  161. package/lib/built/segment-contract/image.js +10 -0
  162. package/lib/built/segment-contract/index.d.ts +8 -0
  163. package/lib/built/segment-contract/index.js +7 -0
  164. package/lib/built/segment-contract/media.d.ts +8 -0
  165. package/lib/built/segment-contract/media.js +39 -0
  166. package/lib/built/segment-contract/mention.d.ts +10 -0
  167. package/lib/built/segment-contract/mention.js +26 -0
  168. package/lib/built/segment-contract/preview.d.ts +3 -0
  169. package/lib/built/segment-contract/preview.js +159 -0
  170. package/lib/built/segment-contract/types.d.ts +70 -0
  171. package/lib/built/segment-contract/types.js +5 -0
  172. package/lib/built/segment-contract/validate.d.ts +138 -0
  173. package/lib/built/segment-contract/validate.js +124 -0
  174. package/lib/built/skill.d.ts +0 -1
  175. package/lib/built/skill.js +0 -1
  176. package/lib/built/speech-loader.d.ts +2 -1
  177. package/lib/built/speech-loader.js +6 -2
  178. package/lib/built/tool.d.ts +0 -1
  179. package/lib/built/tool.js +1 -3
  180. package/lib/command.d.ts +12 -7
  181. package/lib/command.js +38 -16
  182. package/lib/component.d.ts +0 -1
  183. package/lib/component.js +0 -1
  184. package/lib/endpoint-capabilities.d.ts +3 -1
  185. package/lib/endpoint-capabilities.js +0 -1
  186. package/lib/endpoint.d.ts +0 -1
  187. package/lib/endpoint.js +0 -1
  188. package/lib/errors.d.ts +0 -1
  189. package/lib/errors.js +0 -1
  190. package/lib/host-plugin-registry.d.ts +0 -1
  191. package/lib/host-plugin-registry.js +0 -1
  192. package/lib/im-scene.d.ts +29 -0
  193. package/lib/im-scene.js +77 -0
  194. package/lib/im-session-id.d.ts +25 -12
  195. package/lib/im-session-id.js +35 -17
  196. package/lib/index.d.ts +13 -7
  197. package/lib/index.js +11 -6
  198. package/lib/jsx-dev-runtime.d.ts +0 -1
  199. package/lib/jsx-dev-runtime.js +0 -1
  200. package/lib/jsx-runtime.d.ts +0 -1
  201. package/lib/jsx-runtime.js +0 -1
  202. package/lib/jsx.d.ts +0 -1
  203. package/lib/jsx.js +0 -1
  204. package/lib/message-quote.d.ts +1 -2
  205. package/lib/message-quote.js +2 -3
  206. package/lib/message.d.ts +7 -5
  207. package/lib/message.js +16 -1
  208. package/lib/models/system-log.d.ts +0 -1
  209. package/lib/models/system-log.js +0 -1
  210. package/lib/models/user.d.ts +0 -1
  211. package/lib/models/user.js +0 -1
  212. package/lib/notice.d.ts +0 -1
  213. package/lib/notice.js +0 -1
  214. package/lib/plugin-context.d.ts +0 -1
  215. package/lib/plugin-context.js +0 -1
  216. package/lib/plugin.d.ts +11 -2
  217. package/lib/plugin.js +19 -7
  218. package/lib/prompt.d.ts +0 -1
  219. package/lib/prompt.js +0 -1
  220. package/lib/request.d.ts +0 -1
  221. package/lib/request.js +0 -1
  222. package/lib/tool-zod.d.ts +0 -1
  223. package/lib/tool-zod.js +0 -1
  224. package/lib/types-generator.d.ts +0 -1
  225. package/lib/types-generator.js +0 -1
  226. package/lib/types.d.ts +30 -11
  227. package/lib/types.js +0 -1
  228. package/lib/utils.d.ts +36 -1
  229. package/lib/utils.js +33 -25
  230. package/package.json +15 -8
  231. package/lib/adapter.d.ts.map +0 -1
  232. package/lib/adapter.js.map +0 -1
  233. package/lib/agent-prompt.d.ts.map +0 -1
  234. package/lib/agent-prompt.js.map +0 -1
  235. package/lib/built/adapter-process.d.ts.map +0 -1
  236. package/lib/built/adapter-process.js.map +0 -1
  237. package/lib/built/agent-preset.d.ts.map +0 -1
  238. package/lib/built/agent-preset.js.map +0 -1
  239. package/lib/built/ai-trigger.d.ts.map +0 -1
  240. package/lib/built/ai-trigger.js.map +0 -1
  241. package/lib/built/authorization.d.ts.map +0 -1
  242. package/lib/built/authorization.js.map +0 -1
  243. package/lib/built/command.d.ts.map +0 -1
  244. package/lib/built/command.js.map +0 -1
  245. package/lib/built/common-adapter-tools.d.ts.map +0 -1
  246. package/lib/built/common-adapter-tools.js.map +0 -1
  247. package/lib/built/component.d.ts.map +0 -1
  248. package/lib/built/component.js.map +0 -1
  249. package/lib/built/config.d.ts.map +0 -1
  250. package/lib/built/config.js.map +0 -1
  251. package/lib/built/connect-endpoint-instance.d.ts.map +0 -1
  252. package/lib/built/connect-endpoint-instance.js.map +0 -1
  253. package/lib/built/cron.d.ts +0 -75
  254. package/lib/built/cron.d.ts.map +0 -1
  255. package/lib/built/cron.js +0 -122
  256. package/lib/built/cron.js.map +0 -1
  257. package/lib/built/database.d.ts.map +0 -1
  258. package/lib/built/database.js.map +0 -1
  259. package/lib/built/dispatcher.d.ts.map +0 -1
  260. package/lib/built/dispatcher.js.map +0 -1
  261. package/lib/built/endpoint-commands.d.ts.map +0 -1
  262. package/lib/built/endpoint-commands.js.map +0 -1
  263. package/lib/built/endpoint-lifecycle-service.d.ts.map +0 -1
  264. package/lib/built/endpoint-lifecycle-service.js.map +0 -1
  265. package/lib/built/endpoint-lifecycle.d.ts.map +0 -1
  266. package/lib/built/endpoint-lifecycle.js.map +0 -1
  267. package/lib/built/endpoint-manager.d.ts.map +0 -1
  268. package/lib/built/endpoint-manager.js.map +0 -1
  269. package/lib/built/generated-qrcode.d.ts.map +0 -1
  270. package/lib/built/generated-qrcode.js.map +0 -1
  271. package/lib/built/html-renderer-loader.d.ts.map +0 -1
  272. package/lib/built/html-renderer-loader.js.map +0 -1
  273. package/lib/built/html-segment-fallback.d.ts.map +0 -1
  274. package/lib/built/html-segment-fallback.js.map +0 -1
  275. package/lib/built/html-to-text.d.ts.map +0 -1
  276. package/lib/built/html-to-text.js.map +0 -1
  277. package/lib/built/inbound-pipeline.d.ts.map +0 -1
  278. package/lib/built/inbound-pipeline.js.map +0 -1
  279. package/lib/built/inbound-runner.d.ts.map +0 -1
  280. package/lib/built/inbound-runner.js.map +0 -1
  281. package/lib/built/introspection-format.d.ts.map +0 -1
  282. package/lib/built/introspection-format.js.map +0 -1
  283. package/lib/built/login-assist.d.ts.map +0 -1
  284. package/lib/built/login-assist.js.map +0 -1
  285. package/lib/built/management-command-guard.d.ts.map +0 -1
  286. package/lib/built/management-command-guard.js.map +0 -1
  287. package/lib/built/mcp-mesh-registrar.d.ts +0 -9
  288. package/lib/built/mcp-mesh-registrar.d.ts.map +0 -1
  289. package/lib/built/mcp-mesh-registrar.js +0 -17
  290. package/lib/built/mcp-mesh-registrar.js.map +0 -1
  291. package/lib/built/message-enrich.d.ts.map +0 -1
  292. package/lib/built/message-enrich.js.map +0 -1
  293. package/lib/built/message-filter.d.ts.map +0 -1
  294. package/lib/built/message-filter.js.map +0 -1
  295. package/lib/built/outbound-media-contract.d.ts.map +0 -1
  296. package/lib/built/outbound-media-contract.js.map +0 -1
  297. package/lib/built/outbound-media-utils.d.ts.map +0 -1
  298. package/lib/built/outbound-media-utils.js.map +0 -1
  299. package/lib/built/permission.d.ts.map +0 -1
  300. package/lib/built/permission.js.map +0 -1
  301. package/lib/built/permit-check.d.ts.map +0 -1
  302. package/lib/built/permit-check.js.map +0 -1
  303. package/lib/built/permit-parse.d.ts.map +0 -1
  304. package/lib/built/permit-parse.js.map +0 -1
  305. package/lib/built/platform-permit.d.ts.map +0 -1
  306. package/lib/built/platform-permit.js.map +0 -1
  307. package/lib/built/prepend-quote-context.d.ts.map +0 -1
  308. package/lib/built/prepend-quote-context.js.map +0 -1
  309. package/lib/built/qrcode-segment.d.ts.map +0 -1
  310. package/lib/built/qrcode-segment.js.map +0 -1
  311. package/lib/built/queue-im-field-contract.d.ts.map +0 -1
  312. package/lib/built/queue-im-field-contract.js.map +0 -1
  313. package/lib/built/rich-segments/adapter-policies.d.ts.map +0 -1
  314. package/lib/built/rich-segments/adapter-policies.js.map +0 -1
  315. package/lib/built/rich-segments/base.d.ts.map +0 -1
  316. package/lib/built/rich-segments/base.js.map +0 -1
  317. package/lib/built/rich-segments/builtins.d.ts.map +0 -1
  318. package/lib/built/rich-segments/builtins.js.map +0 -1
  319. package/lib/built/rich-segments/capabilities.d.ts.map +0 -1
  320. package/lib/built/rich-segments/capabilities.js.map +0 -1
  321. package/lib/built/rich-segments/html-segment.d.ts.map +0 -1
  322. package/lib/built/rich-segments/html-segment.js.map +0 -1
  323. package/lib/built/rich-segments/index.d.ts.map +0 -1
  324. package/lib/built/rich-segments/index.js.map +0 -1
  325. package/lib/built/rich-segments/markdown-segment.d.ts.map +0 -1
  326. package/lib/built/rich-segments/markdown-segment.js.map +0 -1
  327. package/lib/built/rich-segments/markdown-to-text.d.ts.map +0 -1
  328. package/lib/built/rich-segments/markdown-to-text.js.map +0 -1
  329. package/lib/built/rich-segments/qrcode-segment.d.ts.map +0 -1
  330. package/lib/built/rich-segments/qrcode-segment.js.map +0 -1
  331. package/lib/built/rich-segments/registry.d.ts.map +0 -1
  332. package/lib/built/rich-segments/registry.js.map +0 -1
  333. package/lib/built/rich-segments/resolve.d.ts.map +0 -1
  334. package/lib/built/rich-segments/resolve.js.map +0 -1
  335. package/lib/built/rich-segments/tts-segment.d.ts.map +0 -1
  336. package/lib/built/rich-segments/tts-segment.js.map +0 -1
  337. package/lib/built/rich-segments/types.d.ts.map +0 -1
  338. package/lib/built/rich-segments/types.js.map +0 -1
  339. package/lib/built/roles.d.ts.map +0 -1
  340. package/lib/built/roles.js.map +0 -1
  341. package/lib/built/runtime-io.d.ts.map +0 -1
  342. package/lib/built/runtime-io.js.map +0 -1
  343. package/lib/built/schema-endpoint-manager.d.ts.map +0 -1
  344. package/lib/built/schema-endpoint-manager.js.map +0 -1
  345. package/lib/built/schema-feature.d.ts.map +0 -1
  346. package/lib/built/schema-feature.js.map +0 -1
  347. package/lib/built/skill.d.ts.map +0 -1
  348. package/lib/built/skill.js.map +0 -1
  349. package/lib/built/speech-loader.d.ts.map +0 -1
  350. package/lib/built/speech-loader.js.map +0 -1
  351. package/lib/built/tool.d.ts.map +0 -1
  352. package/lib/built/tool.js.map +0 -1
  353. package/lib/command.d.ts.map +0 -1
  354. package/lib/command.js.map +0 -1
  355. package/lib/component.d.ts.map +0 -1
  356. package/lib/component.js.map +0 -1
  357. package/lib/endpoint-capabilities.d.ts.map +0 -1
  358. package/lib/endpoint-capabilities.js.map +0 -1
  359. package/lib/endpoint.d.ts.map +0 -1
  360. package/lib/endpoint.js.map +0 -1
  361. package/lib/errors.d.ts.map +0 -1
  362. package/lib/errors.js.map +0 -1
  363. package/lib/host-plugin-registry.d.ts.map +0 -1
  364. package/lib/host-plugin-registry.js.map +0 -1
  365. package/lib/im-session-id.d.ts.map +0 -1
  366. package/lib/im-session-id.js.map +0 -1
  367. package/lib/index.d.ts.map +0 -1
  368. package/lib/index.js.map +0 -1
  369. package/lib/jsx-dev-runtime.d.ts.map +0 -1
  370. package/lib/jsx-dev-runtime.js.map +0 -1
  371. package/lib/jsx-runtime.d.ts.map +0 -1
  372. package/lib/jsx-runtime.js.map +0 -1
  373. package/lib/jsx.d.ts.map +0 -1
  374. package/lib/jsx.js.map +0 -1
  375. package/lib/message-quote.d.ts.map +0 -1
  376. package/lib/message-quote.js.map +0 -1
  377. package/lib/message.d.ts.map +0 -1
  378. package/lib/message.js.map +0 -1
  379. package/lib/models/system-log.d.ts.map +0 -1
  380. package/lib/models/system-log.js.map +0 -1
  381. package/lib/models/user.d.ts.map +0 -1
  382. package/lib/models/user.js.map +0 -1
  383. package/lib/notice.d.ts.map +0 -1
  384. package/lib/notice.js.map +0 -1
  385. package/lib/plugin-context.d.ts.map +0 -1
  386. package/lib/plugin-context.js.map +0 -1
  387. package/lib/plugin.d.ts.map +0 -1
  388. package/lib/plugin.js.map +0 -1
  389. package/lib/prompt.d.ts.map +0 -1
  390. package/lib/prompt.js.map +0 -1
  391. package/lib/request.d.ts.map +0 -1
  392. package/lib/request.js.map +0 -1
  393. package/lib/scheduler/scheduler.d.ts +0 -49
  394. package/lib/scheduler/scheduler.d.ts.map +0 -1
  395. package/lib/scheduler/scheduler.js +0 -352
  396. package/lib/scheduler/scheduler.js.map +0 -1
  397. package/lib/scheduler/types.d.ts +0 -71
  398. package/lib/scheduler/types.d.ts.map +0 -1
  399. package/lib/scheduler/types.js +0 -8
  400. package/lib/scheduler/types.js.map +0 -1
  401. package/lib/tool-zod.d.ts.map +0 -1
  402. package/lib/tool-zod.js.map +0 -1
  403. package/lib/types-generator.d.ts.map +0 -1
  404. package/lib/types-generator.js.map +0 -1
  405. package/lib/types.d.ts.map +0 -1
  406. package/lib/types.js.map +0 -1
  407. package/lib/utils.d.ts.map +0 -1
  408. package/lib/utils.js.map +0 -1
@@ -0,0 +1,33 @@
1
+ import { createRequire } from 'node:module';
2
+ import path from 'node:path';
3
+ import { pathToFileURL } from 'node:url';
4
+ /** 从应用根(ZHIN_PROJECT_ROOT / cwd)解析 optional peer,避免 core 包目录下 dynamic import 失败 */
5
+ export function resolveOptionalPeerPackage(packageName) {
6
+ const roots = new Set();
7
+ const envRoot = process.env.ZHIN_PROJECT_ROOT?.trim();
8
+ if (envRoot)
9
+ roots.add(path.resolve(envRoot));
10
+ roots.add(process.cwd());
11
+ for (const root of roots) {
12
+ try {
13
+ const req = createRequire(path.join(root, 'package.json'));
14
+ return req.resolve(packageName);
15
+ }
16
+ catch {
17
+ // try next root
18
+ }
19
+ }
20
+ try {
21
+ return createRequire(import.meta.url).resolve(packageName);
22
+ }
23
+ catch {
24
+ return undefined;
25
+ }
26
+ }
27
+ export async function importOptionalPeerPackage(packageName) {
28
+ const resolved = resolveOptionalPeerPackage(packageName);
29
+ if (resolved) {
30
+ return import(pathToFileURL(resolved).href);
31
+ }
32
+ return import(packageName);
33
+ }
@@ -20,4 +20,3 @@ export type OutboundMediaMaterializer = (content: SendContent, ctx: OutboundMedi
20
20
  export declare function assertAdapterDeclaresRichSegmentPolicy(adapterClass: {
21
21
  outboundRichSegmentPolicy?: Record<string, string>;
22
22
  }): void;
23
- //# sourceMappingURL=outbound-media-contract.d.ts.map
@@ -8,4 +8,3 @@ export function assertAdapterDeclaresRichSegmentPolicy(adapterClass) {
8
8
  throw new Error('outboundRichSegmentPolicy must be a non-empty object');
9
9
  }
10
10
  }
11
- //# sourceMappingURL=outbound-media-contract.js.map
@@ -7,4 +7,3 @@ export declare function resolveLocalMediaPath(data: Record<string, unknown>): st
7
7
  export declare function asMessageElements(content: SendContent): MessageElement[];
8
8
  export declare function isMediaSegmentType(type: string): boolean;
9
9
  export declare function collectOutboundMediaKinds(content: SendContent | undefined): string[];
10
- //# sourceMappingURL=outbound-media-utils.d.ts.map
@@ -60,4 +60,3 @@ export function collectOutboundMediaKinds(content) {
60
60
  }
61
61
  return [...kinds];
62
62
  }
63
- //# sourceMappingURL=outbound-media-utils.js.map
@@ -53,4 +53,3 @@ export declare namespace Permissions {
53
53
  * @deprecated Use PermissionFeature instead
54
54
  */
55
55
  export declare const PermissionService: typeof PermissionFeature;
56
- //# sourceMappingURL=permission.d.ts.map
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { Feature } from "@zhin.js/kernel";
6
6
  import logger, { formatCompact } from "@zhin.js/logger";
7
- import { getPlugin } from "../plugin.js";
8
7
  import { isBuiltinPermit, parsePermitName } from "./permit-parse.js";
9
8
  import { checkBuiltinPermit } from "./permit-check.js";
10
9
  import { senderRolesFromMessage } from "./message-enrich.js";
@@ -81,7 +80,7 @@ export class PermissionFeature extends Feature {
81
80
  const feature = this;
82
81
  return {
83
82
  addPermission(permission) {
84
- const plugin = getPlugin();
83
+ const plugin = this;
85
84
  const dispose = feature.add(permission, plugin.name);
86
85
  const permName = permission.name instanceof RegExp ? permission.name.source : permission.name;
87
86
  plugin.recordFeatureContribution(feature.name, permName);
@@ -102,4 +101,3 @@ export var Permissions;
102
101
  * @deprecated Use PermissionFeature instead
103
102
  */
104
103
  export const PermissionService = PermissionFeature;
105
- //# sourceMappingURL=permission.js.map
@@ -5,4 +5,3 @@ import type { Message } from '../message.js';
5
5
  import type { SenderRole } from './roles.js';
6
6
  export declare function checkBuiltinPermit(name: string, message: Message<any>, roles: readonly SenderRole[]): boolean;
7
7
  export declare function checkBuiltinPermitList(permits: readonly string[], message: Message<any>, roles: readonly SenderRole[]): boolean;
8
- //# sourceMappingURL=permit-check.d.ts.map
@@ -33,4 +33,3 @@ export function checkBuiltinPermit(name, message, roles) {
33
33
  export function checkBuiltinPermitList(permits, message, roles) {
34
34
  return permits.every((p) => checkBuiltinPermit(p, message, roles));
35
35
  }
36
- //# sourceMappingURL=permit-check.js.map
@@ -14,4 +14,3 @@ export interface ParsedPlatformPermit {
14
14
  }
15
15
  export declare function parsePlatformPermitName(name: string): ParsedPlatformPermit | null;
16
16
  export declare function isPlatformPermit(name: string): boolean;
17
- //# sourceMappingURL=permit-parse.d.ts.map
@@ -30,4 +30,3 @@ export function parsePlatformPermitName(name) {
30
30
  export function isPlatformPermit(name) {
31
31
  return PLATFORM_PERMIT_RE.test(name);
32
32
  }
33
- //# sourceMappingURL=permit-parse.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Platform permit — 适配器注册的平台级权限校验(群管、频道身份等)
2
+ * Platform permit — 适配器注册的平台级权限校验(场景治理、频道身份等)
3
3
  */
4
4
  import type { Message } from '../message.js';
5
5
  export type PlatformPermitChecker = (perm: string, message: Message<any>) => boolean;
@@ -14,8 +14,7 @@ export declare function applyQqSenderRoleToMessageSender(sender: {
14
14
  role?: string;
15
15
  permissions?: string[];
16
16
  }, role?: string): void;
17
- /** 常见 IM 平台群身份:$sender.role 为 owner / admin */
18
- export declare function createGroupRolePlatformChecker(): PlatformPermitChecker;
19
- /** 为适配器注册默认群管 platform checker(幂等) */
20
- export declare function registerDefaultGroupPlatformPermitChecker(adapter: string): () => void;
21
- //# sourceMappingURL=platform-permit.d.ts.map
17
+ /** 常见 IM 平台场景身份:$sender.role 为 owner / admin */
18
+ export declare function createSceneRolePlatformChecker(): PlatformPermitChecker;
19
+ /** 为适配器注册默认场景治理 platform checker(幂等) */
20
+ export declare function registerDefaultScenePlatformPermitChecker(adapter: string): () => void;
@@ -1,6 +1,6 @@
1
1
  import { parsePlatformPermitName, isPlatformPermit } from './permit-parse.js';
2
2
  const checkers = new Map();
3
- const registeredDefaultGroupCheckers = new Set();
3
+ const registeredDefaultSceneCheckers = new Set();
4
4
  export function registerPlatformPermitChecker(adapter, checker) {
5
5
  const key = String(adapter);
6
6
  checkers.set(key, checker);
@@ -12,7 +12,7 @@ export function registerPlatformPermitChecker(adapter, checker) {
12
12
  }
13
13
  export function clearPlatformPermitCheckers() {
14
14
  checkers.clear();
15
- registeredDefaultGroupCheckers.clear();
15
+ registeredDefaultSceneCheckers.clear();
16
16
  }
17
17
  export function checkPlatformPermit(name, message) {
18
18
  const parsed = parsePlatformPermitName(name);
@@ -44,24 +44,23 @@ export function applyQqSenderRoleToMessageSender(sender, role) {
44
44
  sender.role = normalized;
45
45
  sender.permissions = [normalized];
46
46
  }
47
- /** 常见 IM 平台群身份:$sender.role 为 owner / admin */
48
- export function createGroupRolePlatformChecker() {
47
+ /** 常见 IM 平台场景身份:$sender.role 为 owner / admin */
48
+ export function createSceneRolePlatformChecker() {
49
49
  return (perm, message) => {
50
50
  const role = message.$sender?.role;
51
- if (perm === 'group_admin')
51
+ if (perm === 'scene_admin')
52
52
  return role === 'admin' || role === 'owner';
53
- if (perm === 'group_owner')
53
+ if (perm === 'scene_owner')
54
54
  return role === 'owner';
55
55
  return false;
56
56
  };
57
57
  }
58
- /** 为适配器注册默认群管 platform checker(幂等) */
59
- export function registerDefaultGroupPlatformPermitChecker(adapter) {
58
+ /** 为适配器注册默认场景治理 platform checker(幂等) */
59
+ export function registerDefaultScenePlatformPermitChecker(adapter) {
60
60
  const key = String(adapter);
61
- if (registeredDefaultGroupCheckers.has(key)) {
61
+ if (registeredDefaultSceneCheckers.has(key)) {
62
62
  return () => { };
63
63
  }
64
- registeredDefaultGroupCheckers.add(key);
65
- return registerPlatformPermitChecker(key, createGroupRolePlatformChecker());
64
+ registeredDefaultSceneCheckers.add(key);
65
+ return registerPlatformPermitChecker(key, createSceneRolePlatformChecker());
66
66
  }
67
- //# sourceMappingURL=platform-permit.js.map
@@ -32,4 +32,3 @@ export declare function resolveQuoteContextBlock(message: Message<any>, root: Pl
32
32
  export declare function prependQuoteContext(message: Message<any>, root: Plugin, userText: string, options?: {
33
33
  enabled?: boolean;
34
34
  }): Promise<string>;
35
- //# sourceMappingURL=prepend-quote-context.d.ts.map
@@ -128,4 +128,3 @@ export async function prependQuoteContext(message, root, userText, options) {
128
128
  const quoteBlock = await resolveQuoteContextBlock(message, root, options);
129
129
  return buildUserTurnWithQuoteContext(userText, quoteBlock);
130
130
  }
131
- //# sourceMappingURL=prepend-quote-context.js.map
@@ -16,4 +16,3 @@ export declare function resolveQrcodeSegmentsToImages(content: SendContent | und
16
16
  export declare function resolveQrcodeSegmentsToTerminal(content: SendContent | undefined): Promise<SendContent | undefined>;
17
17
  /** 不支持图片的平台:仅输出链接文本 */
18
18
  export declare function coerceQrcodeSegmentsToText(content: SendContent): SendContent;
19
- //# sourceMappingURL=qrcode-segment.d.ts.map
@@ -76,4 +76,3 @@ export function coerceQrcodeSegmentsToText(content) {
76
76
  }
77
77
  return packSegments(out);
78
78
  }
79
- //# sourceMappingURL=qrcode-segment.js.map
@@ -1,5 +1,6 @@
1
1
  import type { MessageType } from '../message.js';
2
2
  import type { SendContent, SendOptions } from '../types.js';
3
+ import { type IMDeliveryTarget } from '../im-scene.js';
3
4
  export interface QueueEnvelope<TDetail extends Record<string, unknown> = Record<string, unknown>> {
4
5
  kind: string;
5
6
  type: string;
@@ -23,5 +24,9 @@ export declare function isMessageType(value: unknown): value is MessageType;
23
24
  /** Normalize queue outbound detail into the canonical queue-IM shape. */
24
25
  export declare function normalizeQueueOutboundDetail(record: Record<string, unknown>): NormalizedQueueOutboundDetail;
25
26
  export declare function toSendOptions(detail: NormalizedQueueOutboundDetail): SendOptions;
27
+ export interface QueueIMSceneTargetDetail {
28
+ target: IMDeliveryTarget;
29
+ content: SendContent;
30
+ }
31
+ export declare function sceneTargetToSendOptions(detail: QueueIMSceneTargetDetail): SendOptions;
26
32
  export declare function normalizeRecordToSendOptions(record: Record<string, unknown>): SendOptions;
27
- //# sourceMappingURL=queue-im-field-contract.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { sceneRefToSendOptions } from '../im-scene.js';
1
2
  export class QueueIMFieldContractError extends Error {
2
3
  code;
3
4
  field;
@@ -52,7 +53,15 @@ export function toSendOptions(detail) {
52
53
  content: detail.content,
53
54
  };
54
55
  }
56
+ export function sceneTargetToSendOptions(detail) {
57
+ return sceneRefToSendOptions(detail.target, detail.content);
58
+ }
55
59
  export function normalizeRecordToSendOptions(record) {
60
+ if (record.target && typeof record.target === 'object') {
61
+ return sceneTargetToSendOptions({
62
+ target: record.target,
63
+ content: requireContent(record.content),
64
+ });
65
+ }
56
66
  return toSendOptions(normalizeQueueOutboundDetail(record));
57
67
  }
58
- //# sourceMappingURL=queue-im-field-contract.js.map
@@ -1,4 +1,4 @@
1
- import type { OutboundRichSegmentPolicy } from './types.js';
1
+ import { type OutboundRichSegmentPolicy } from './types.js';
2
2
  /** 全功能 IM:html/markdown/qrcode→image,tts→audio */
3
3
  export declare const OUTBOUND_RICH_SEGMENT_POLICY_IM_FULL: OutboundRichSegmentPolicy;
4
4
  /** 仅文本降级(无富媒体出站能力) */
@@ -7,4 +7,3 @@ export declare const OUTBOUND_RICH_SEGMENT_POLICY_TEXT_ONLY: OutboundRichSegment
7
7
  export declare const OUTBOUND_RICH_SEGMENT_POLICY_IM_DEFAULT: OutboundRichSegmentPolicy;
8
8
  /** 无音频出站(tts 降级 text) */
9
9
  export declare const OUTBOUND_RICH_SEGMENT_POLICY_NO_AUDIO: OutboundRichSegmentPolicy;
10
- //# sourceMappingURL=adapter-policies.d.ts.map
@@ -25,4 +25,3 @@ export const OUTBOUND_RICH_SEGMENT_POLICY_NO_AUDIO = {
25
25
  ...OUTBOUND_RICH_SEGMENT_POLICY_IM_FULL,
26
26
  [BUILTIN_RICH_SEGMENT_KINDS.TTS]: RICH_SEGMENT_MODE.TEXT,
27
27
  };
28
- //# sourceMappingURL=adapter-policies.js.map
@@ -9,4 +9,3 @@ export declare abstract class RichSegment<TData> {
9
9
  }
10
10
  export declare function isRichSegment(item: unknown): item is RichSegment<unknown>;
11
11
  export declare function richSegmentKind(item: MessageElement | string): string | null;
12
- //# sourceMappingURL=base.d.ts.map
@@ -22,4 +22,3 @@ export function richSegmentKind(item) {
22
22
  }
23
23
  return null;
24
24
  }
25
- //# sourceMappingURL=base.js.map
@@ -2,4 +2,3 @@
2
2
  export declare const DEFAULT_OUTBOUND_RICH_SEGMENT_POLICY: import("./types.js").OutboundRichSegmentPolicy;
3
3
  /** 测试:清空 registry 后重新注册内置 kind */
4
4
  export declare function resetBuiltinRichSegmentKindsForTests(): void;
5
- //# sourceMappingURL=builtins.d.ts.map
@@ -38,4 +38,3 @@ export function resetBuiltinRichSegmentKindsForTests() {
38
38
  richSegmentRegistry.clearForTests();
39
39
  registerBuiltinRichSegmentKinds();
40
40
  }
41
- //# sourceMappingURL=builtins.js.map
@@ -4,4 +4,3 @@ export declare function registerRichSegmentCapabilityLoader(id: string, loader:
4
4
  /** 测试隔离 */
5
5
  export declare function resetRichSegmentCapabilityLoadersForTests(): void;
6
6
  export declare function createRichSegmentRenderContext(options?: RichSegmentCapabilityLoaderOptions): RichSegmentRenderContext;
7
- //# sourceMappingURL=capabilities.d.ts.map
@@ -37,4 +37,3 @@ export function createRichSegmentRenderContext(options = {}) {
37
37
  logContentChain: options.logContentChain,
38
38
  };
39
39
  }
40
- //# sourceMappingURL=capabilities.js.map
@@ -1,5 +1,5 @@
1
1
  import { RichSegment } from './base.js';
2
- import type { RichSegmentRenderContext, RichSegmentRenderResult } from './types.js';
2
+ import { type RichSegmentRenderContext, type RichSegmentRenderResult } from './types.js';
3
3
  export interface HtmlSegmentData {
4
4
  html: string;
5
5
  text?: string;
@@ -13,4 +13,3 @@ export declare class HtmlSegment extends RichSegment<HtmlSegmentData> {
13
13
  render(mode: string, ctx?: RichSegmentRenderContext): Promise<RichSegmentRenderResult>;
14
14
  }
15
15
  export declare function wrapHtmlSegment(data: Record<string, unknown>): HtmlSegment;
16
- //# sourceMappingURL=html-segment.d.ts.map
@@ -63,4 +63,3 @@ export function wrapHtmlSegment(data) {
63
63
  fileName: typeof data.fileName === 'string' ? data.fileName : undefined,
64
64
  });
65
65
  }
66
- //# sourceMappingURL=html-segment.js.map
@@ -11,4 +11,3 @@ export * from './tts-segment.js';
11
11
  export * from './markdown-to-text.js';
12
12
  export * from './resolve.js';
13
13
  export * from './adapter-policies.js';
14
- //# sourceMappingURL=index.d.ts.map
@@ -11,4 +11,3 @@ export * from './tts-segment.js';
11
11
  export * from './markdown-to-text.js';
12
12
  export * from './resolve.js';
13
13
  export * from './adapter-policies.js';
14
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { RichSegment } from './base.js';
2
- import type { RichSegmentRenderContext, RichSegmentRenderResult } from './types.js';
2
+ import { type RichSegmentRenderContext, type RichSegmentRenderResult } from './types.js';
3
3
  export interface MarkdownSegmentData {
4
4
  content: string;
5
5
  width?: number;
@@ -12,4 +12,3 @@ export declare class MarkdownSegment extends RichSegment<MarkdownSegmentData> {
12
12
  render(mode: string, ctx?: RichSegmentRenderContext): Promise<RichSegmentRenderResult>;
13
13
  }
14
14
  export declare function wrapMarkdownSegment(data: Record<string, unknown>): MarkdownSegment;
15
- //# sourceMappingURL=markdown-segment.d.ts.map
@@ -59,4 +59,3 @@ export function wrapMarkdownSegment(data) {
59
59
  fileName: typeof data.fileName === 'string' ? data.fileName : undefined,
60
60
  });
61
61
  }
62
- //# sourceMappingURL=markdown-segment.js.map
@@ -1,4 +1,3 @@
1
1
  /** 将 Markdown 转为可读纯文本(出站 text 降级用) */
2
2
  export declare function markdownToPlainText(md: string): string;
3
3
  export declare function markdownToHtmlForRender(md: string): string;
4
- //# sourceMappingURL=markdown-to-text.d.ts.map
@@ -25,4 +25,3 @@ export function markdownToHtmlForRender(md) {
25
25
  .replace(/>/g, '&gt;');
26
26
  return `<pre style="white-space:pre-wrap;font-family:sans-serif;font-size:14px;line-height:1.5;padding:16px;">${escaped}</pre>`;
27
27
  }
28
- //# sourceMappingURL=markdown-to-text.js.map
@@ -1,7 +1,7 @@
1
1
  import type { MessageElement } from '../../types.js';
2
2
  import { type GenerateQrCodeOptions } from '../generated-qrcode.js';
3
3
  import { RichSegment } from './base.js';
4
- import type { RichSegmentRenderContext, RichSegmentRenderResult } from './types.js';
4
+ import { type RichSegmentRenderContext, type RichSegmentRenderResult } from './types.js';
5
5
  export interface QrcodeSegmentData extends GenerateQrCodeOptions {
6
6
  text: string;
7
7
  /** process origin 模式终端渲染时使用 */
@@ -16,4 +16,3 @@ export declare class QrcodeSegment extends RichSegment<QrcodeSegmentData> {
16
16
  export declare function wrapQrcodeSegment(data: Record<string, unknown>): QrcodeSegment;
17
17
  /** process endpoint:origin qrcode 段 → 终端 ASCII + 文本占位 */
18
18
  export declare function interpretOriginQrcodeForProcess(content: MessageElement | string | (MessageElement | string)[]): Promise<MessageElement | string | (MessageElement | string)[]>;
19
- //# sourceMappingURL=qrcode-segment.d.ts.map
@@ -71,4 +71,3 @@ export async function interpretOriginQrcodeForProcess(content) {
71
71
  return out[0];
72
72
  return out;
73
73
  }
74
- //# sourceMappingURL=qrcode-segment.js.map
@@ -14,4 +14,3 @@ export declare class RichSegmentRegistry {
14
14
  export declare const RICH_SEGMENT_FALLBACK_MODE = "origin";
15
15
  export declare const richSegmentRegistry: RichSegmentRegistry;
16
16
  export declare function registerRichSegmentKind(definition: RichSegmentKindDefinition): void;
17
- //# sourceMappingURL=registry.d.ts.map
@@ -50,4 +50,3 @@ export const richSegmentRegistry = new RichSegmentRegistry();
50
50
  export function registerRichSegmentKind(definition) {
51
51
  richSegmentRegistry.register(definition);
52
52
  }
53
- //# sourceMappingURL=registry.js.map
@@ -1,6 +1,5 @@
1
1
  import type { SendContent } from '../../types.js';
2
- import type { OutboundRichSegmentPolicy, RichSegmentRenderContext } from './types.js';
2
+ import { type OutboundRichSegmentPolicy, type RichSegmentRenderContext } from './types.js';
3
3
  export declare function hasRichSegment(content: SendContent | undefined): boolean;
4
4
  /** 按 Adapter 出站策略在 renderSendMessage 首步统一渲染富媒体段 */
5
5
  export declare function resolveRichSegments(content: SendContent, policy: OutboundRichSegmentPolicy, ctx?: RichSegmentRenderContext): Promise<SendContent>;
6
- //# sourceMappingURL=resolve.d.ts.map
@@ -85,4 +85,3 @@ export async function resolveRichSegments(content, policy, ctx) {
85
85
  }
86
86
  return packSegments(out);
87
87
  }
88
- //# sourceMappingURL=resolve.js.map
@@ -1,5 +1,5 @@
1
1
  import { RichSegment } from './base.js';
2
- import type { RichSegmentRenderContext, RichSegmentRenderResult } from './types.js';
2
+ import { type RichSegmentRenderContext, type RichSegmentRenderResult } from './types.js';
3
3
  export interface TtsSegmentData {
4
4
  text: string;
5
5
  voice?: string;
@@ -11,4 +11,3 @@ export declare class TtsSegment extends RichSegment<TtsSegmentData> {
11
11
  render(mode: string, ctx?: RichSegmentRenderContext): Promise<RichSegmentRenderResult>;
12
12
  }
13
13
  export declare function wrapTtsSegment(data: Record<string, unknown>): TtsSegment;
14
- //# sourceMappingURL=tts-segment.d.ts.map
@@ -49,4 +49,3 @@ export function wrapTtsSegment(data) {
49
49
  provider: typeof data.provider === 'string' ? data.provider : undefined,
50
50
  });
51
51
  }
52
- //# sourceMappingURL=tts-segment.js.map
@@ -82,4 +82,3 @@ export interface RichSegmentCapabilityLoaderOptions {
82
82
  logContentChain?: RichSegmentRenderContext['logContentChain'];
83
83
  }
84
84
  export type RichSegmentCapabilityLoader = (options: RichSegmentCapabilityLoaderOptions) => Promise<unknown>;
85
- //# sourceMappingURL=types.d.ts.map
@@ -15,4 +15,3 @@ export const RICH_SEGMENT_MODE = {
15
15
  AUDIO: 'audio',
16
16
  VIDEO: 'video',
17
17
  };
18
- //# sourceMappingURL=types.js.map
@@ -12,4 +12,3 @@ export declare function hasSenderRole(roles: Iterable<SenderRole>, role: SenderR
12
12
  export declare function formatSenderRolesForLabel(roles: readonly SenderRole[]): string;
13
13
  /** 剥离用户正文里自造的发送者前缀 */
14
14
  export declare function stripUserSpoofedSenderPrefix(rawContent: string): string;
15
- //# sourceMappingURL=roles.d.ts.map
@@ -60,4 +60,3 @@ export function stripUserSpoofedSenderPrefix(rawContent) {
60
60
  }
61
61
  return text;
62
62
  }
63
- //# sourceMappingURL=roles.js.map
@@ -7,4 +7,3 @@ export declare function shouldBindProcessStdin(): boolean;
7
7
  export declare function isInteractiveStdin(): boolean;
8
8
  export declare function isDenoDeploy(): boolean;
9
9
  export declare function bindStdin(onChunk: (chunk: string) => void): () => void;
10
- //# sourceMappingURL=runtime-io.d.ts.map
@@ -65,4 +65,3 @@ export function bindStdin(onChunk) {
65
65
  process.stdin.on("data", handler);
66
66
  return () => process.stdin.removeListener("data", handler);
67
67
  }
68
- //# sourceMappingURL=runtime-io.js.map
@@ -0,0 +1,55 @@
1
+ /**
2
+ * ScheduleFeature — 管理插件注册的内存定时任务
3
+ */
4
+ import { Feature, FeatureJSON, type ScheduleKind } from '@zhin.js/kernel';
5
+ import type { HolidayInput, ScatterInput } from '@zhin.js/kernel';
6
+ export interface ScheduleDescriptor {
7
+ kind: ScheduleKind | 'every' | 'at';
8
+ /** 6 段 cron(solar/lunar/workday/freeDay/holiday) */
9
+ cron?: string;
10
+ everyMs?: number;
11
+ atMs?: number;
12
+ scatterInput?: ScatterInput;
13
+ holidayInput?: HolidayInput;
14
+ tz?: string;
15
+ }
16
+ export interface ScheduleHandle {
17
+ id: string;
18
+ descriptor: ScheduleDescriptor;
19
+ dispose: () => void;
20
+ }
21
+ export interface ScheduleContextExtensions {
22
+ addSchedule(descriptor: ScheduleDescriptor, callback: () => void | Promise<void>, id?: string): () => void;
23
+ }
24
+ declare module '../plugin.js' {
25
+ namespace Plugin {
26
+ interface Extensions extends ScheduleContextExtensions {
27
+ }
28
+ interface Contexts {
29
+ schedule: ScheduleFeature;
30
+ }
31
+ }
32
+ }
33
+ export declare class ScheduleFeature extends Feature<ScheduleHandle> {
34
+ readonly name: "schedule";
35
+ readonly icon = "Clock";
36
+ readonly desc = "\u65E5\u5386\u8C03\u5EA6";
37
+ readonly byName: Map<string, ScheduleHandle>;
38
+ add(handle: ScheduleHandle, pluginName: string): () => void;
39
+ remove(handle: ScheduleHandle): boolean;
40
+ get(id: string): ScheduleHandle | undefined;
41
+ stopAll(): void;
42
+ getStatus(): Array<{
43
+ id: string;
44
+ kind: string;
45
+ expression?: string;
46
+ running: boolean;
47
+ nextExecution: Date | null;
48
+ plugin: string;
49
+ }>;
50
+ dispose(): void;
51
+ toJSON(pluginName?: string): FeatureJSON;
52
+ get extensions(): {
53
+ addSchedule(descriptor: ScheduleDescriptor, callback: () => void | Promise<void>, id?: string): () => void;
54
+ };
55
+ }