@openclaw/feishu 2026.7.1 → 2026.7.2-beta.1

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 (749) hide show
  1. package/dist/{accounts-Bs5uJ4h0.js → accounts-BDoGHJDk.js} +29 -54
  2. package/dist/api.js +35 -25
  3. package/dist/{channel-DRQRQQQ3.js → channel-DdPQ2HGh.js} +578 -369
  4. package/dist/channel-plugin-api.js +1 -1
  5. package/dist/{channel.runtime-pvr-Y5ji.js → channel.runtime-DJ_B-bpG.js} +272 -107
  6. package/dist/{client-B7EAV_Ss.js → client-BUC-R2Wi.js} +4 -13
  7. package/dist/contract-api.js +1 -1
  8. package/dist/{conversation-id-CdLdoot3.js → conversation-id-BeJL-wq7.js} +3 -0
  9. package/dist/doctor-contract-DXH5hux1.js +97 -0
  10. package/dist/doctor-contract-api.js +2 -0
  11. package/dist/{drive-D0lIhxqZ.js → drive-Bpe8ONK_.js} +181 -33
  12. package/dist/{monitor-CsbheK9J.js → monitor-M3iYtoh4.js} +3 -3
  13. package/dist/{monitor.account-Dr7do33p.js → monitor.account-F99J862T.js} +474 -493
  14. package/dist/monitor.startup-DpZzunQn.js +43 -0
  15. package/dist/{probe-Dxyo9zlw.js → probe-CAloGqgG.js} +3 -6
  16. package/dist/{secret-contract-DLaBl9m4.js → secret-contract-DnlMcrn5.js} +14 -69
  17. package/dist/secret-contract-api.js +1 -1
  18. package/dist/{send-Be2GMA6Z.js → send-CpnLYueT.js} +12 -35
  19. package/dist/send-result-CPS7AozW.js +766 -0
  20. package/dist/{session-conversation-BYuoVJwl.js → session-conversation-BksWrfzm.js} +1 -1
  21. package/dist/session-key-api.js +1 -1
  22. package/dist/setup-api.js +1 -1
  23. package/dist/setup-entry.js +0 -5
  24. package/dist/{subagent-hooks-B2iWPYJ1.js → subagent-hooks-BKTOxB-T.js} +9 -5
  25. package/dist/subagent-hooks-api.js +1 -1
  26. package/node_modules/@types/debug/LICENSE +21 -0
  27. package/node_modules/@types/debug/README.md +69 -0
  28. package/node_modules/@types/debug/index.d.ts +50 -0
  29. package/node_modules/@types/debug/package.json +58 -0
  30. package/node_modules/@types/mdast/LICENSE +21 -0
  31. package/node_modules/@types/mdast/README.md +15 -0
  32. package/node_modules/@types/mdast/index.d.ts +1123 -0
  33. package/node_modules/@types/mdast/package.json +47 -0
  34. package/node_modules/@types/ms/LICENSE +21 -0
  35. package/node_modules/@types/ms/README.md +82 -0
  36. package/node_modules/@types/ms/index.d.ts +63 -0
  37. package/node_modules/@types/ms/package.json +26 -0
  38. package/node_modules/@types/unist/LICENSE +21 -0
  39. package/node_modules/@types/unist/README.md +15 -0
  40. package/node_modules/@types/unist/index.d.ts +119 -0
  41. package/node_modules/@types/unist/package.json +60 -0
  42. package/node_modules/character-entities/index.d.ts +6 -0
  43. package/node_modules/character-entities/index.js +2132 -0
  44. package/node_modules/character-entities/license +22 -0
  45. package/node_modules/character-entities/package.json +78 -0
  46. package/node_modules/character-entities/readme.md +152 -0
  47. package/node_modules/debug/LICENSE +20 -0
  48. package/node_modules/debug/README.md +481 -0
  49. package/node_modules/debug/package.json +64 -0
  50. package/node_modules/debug/src/browser.js +272 -0
  51. package/node_modules/debug/src/common.js +292 -0
  52. package/node_modules/debug/src/index.js +10 -0
  53. package/node_modules/debug/src/node.js +263 -0
  54. package/node_modules/decode-named-character-reference/index.d.ts +13 -0
  55. package/node_modules/decode-named-character-reference/index.d.ts.map +1 -0
  56. package/node_modules/decode-named-character-reference/index.dom.d.ts +6 -0
  57. package/node_modules/decode-named-character-reference/index.dom.d.ts.map +1 -0
  58. package/node_modules/decode-named-character-reference/index.dom.js +32 -0
  59. package/node_modules/decode-named-character-reference/index.js +19 -0
  60. package/node_modules/decode-named-character-reference/license +22 -0
  61. package/node_modules/decode-named-character-reference/package.json +90 -0
  62. package/node_modules/decode-named-character-reference/readme.md +136 -0
  63. package/node_modules/dequal/dist/index.js +86 -0
  64. package/node_modules/dequal/dist/index.min.js +1 -0
  65. package/node_modules/dequal/dist/index.mjs +84 -0
  66. package/node_modules/dequal/index.d.ts +1 -0
  67. package/node_modules/dequal/license +21 -0
  68. package/node_modules/dequal/lite/index.d.ts +1 -0
  69. package/node_modules/dequal/lite/index.js +31 -0
  70. package/node_modules/dequal/lite/index.min.js +1 -0
  71. package/node_modules/dequal/lite/index.mjs +29 -0
  72. package/node_modules/dequal/package.json +57 -0
  73. package/node_modules/dequal/readme.md +112 -0
  74. package/node_modules/devlop/lib/default.js +9 -0
  75. package/node_modules/devlop/lib/development.d.ts +84 -0
  76. package/node_modules/devlop/lib/development.js +238 -0
  77. package/node_modules/devlop/license +22 -0
  78. package/node_modules/devlop/package.json +80 -0
  79. package/node_modules/devlop/readme.md +360 -0
  80. package/node_modules/longest-streak/index.d.ts +11 -0
  81. package/node_modules/longest-streak/index.js +36 -0
  82. package/node_modules/longest-streak/license +22 -0
  83. package/node_modules/longest-streak/package.json +73 -0
  84. package/node_modules/longest-streak/readme.md +150 -0
  85. package/node_modules/markdown-table/index.d.ts +171 -0
  86. package/node_modules/markdown-table/index.d.ts.map +1 -0
  87. package/node_modules/markdown-table/index.js +393 -0
  88. package/node_modules/markdown-table/license +22 -0
  89. package/node_modules/markdown-table/package.json +77 -0
  90. package/node_modules/markdown-table/readme.md +344 -0
  91. package/node_modules/mdast-util-from-markdown/dev/index.d.ts +23 -0
  92. package/node_modules/mdast-util-from-markdown/dev/index.js +2 -0
  93. package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts +53 -0
  94. package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map +1 -0
  95. package/node_modules/mdast-util-from-markdown/dev/lib/index.js +1348 -0
  96. package/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts +295 -0
  97. package/node_modules/mdast-util-from-markdown/dev/lib/types.js +2 -0
  98. package/node_modules/mdast-util-from-markdown/index.d.ts +23 -0
  99. package/node_modules/mdast-util-from-markdown/index.js +2 -0
  100. package/node_modules/mdast-util-from-markdown/lib/index.d.ts +53 -0
  101. package/node_modules/mdast-util-from-markdown/lib/index.d.ts.map +1 -0
  102. package/node_modules/mdast-util-from-markdown/lib/index.js +1177 -0
  103. package/node_modules/mdast-util-from-markdown/lib/types.d.ts +295 -0
  104. package/node_modules/mdast-util-from-markdown/lib/types.js +2 -0
  105. package/node_modules/mdast-util-from-markdown/license +22 -0
  106. package/node_modules/mdast-util-from-markdown/package.json +99 -0
  107. package/node_modules/mdast-util-from-markdown/readme.md +535 -0
  108. package/node_modules/mdast-util-gfm-table/index.d.ts +54 -0
  109. package/node_modules/mdast-util-gfm-table/index.js +2 -0
  110. package/node_modules/mdast-util-gfm-table/lib/index.d.ts +51 -0
  111. package/node_modules/mdast-util-gfm-table/lib/index.js +300 -0
  112. package/node_modules/mdast-util-gfm-table/license +22 -0
  113. package/node_modules/mdast-util-gfm-table/package.json +101 -0
  114. package/node_modules/mdast-util-gfm-table/readme.md +605 -0
  115. package/node_modules/mdast-util-phrasing/index.d.ts +1 -0
  116. package/node_modules/mdast-util-phrasing/index.js +1 -0
  117. package/node_modules/mdast-util-phrasing/lib/index.d.ts +3 -0
  118. package/node_modules/mdast-util-phrasing/lib/index.js +45 -0
  119. package/node_modules/mdast-util-phrasing/license +23 -0
  120. package/node_modules/mdast-util-phrasing/package.json +78 -0
  121. package/node_modules/mdast-util-phrasing/readme.md +200 -0
  122. package/node_modules/mdast-util-to-markdown/index.d.ts +16 -0
  123. package/node_modules/mdast-util-to-markdown/index.js +3 -0
  124. package/node_modules/mdast-util-to-markdown/lib/configure.d.ts +9 -0
  125. package/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map +1 -0
  126. package/node_modules/mdast-util-to-markdown/lib/configure.js +79 -0
  127. package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts +17 -0
  128. package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map +1 -0
  129. package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +29 -0
  130. package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts +13 -0
  131. package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map +1 -0
  132. package/node_modules/mdast-util-to-markdown/lib/handle/break.js +30 -0
  133. package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts +13 -0
  134. package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map +1 -0
  135. package/node_modules/mdast-util-to-markdown/lib/handle/code.js +75 -0
  136. package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts +13 -0
  137. package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map +1 -0
  138. package/node_modules/mdast-util-to-markdown/lib/handle/definition.js +76 -0
  139. package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts +24 -0
  140. package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map +1 -0
  141. package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +69 -0
  142. package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts +13 -0
  143. package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map +1 -0
  144. package/node_modules/mdast-util-to-markdown/lib/handle/heading.js +75 -0
  145. package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts +15 -0
  146. package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map +1 -0
  147. package/node_modules/mdast-util-to-markdown/lib/handle/html.js +20 -0
  148. package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts +21 -0
  149. package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map +1 -0
  150. package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +63 -0
  151. package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts +21 -0
  152. package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map +1 -0
  153. package/node_modules/mdast-util-to-markdown/lib/handle/image.js +82 -0
  154. package/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts +42 -0
  155. package/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts.map +1 -0
  156. package/node_modules/mdast-util-to-markdown/lib/handle/index.js +45 -0
  157. package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts +19 -0
  158. package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map +1 -0
  159. package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +76 -0
  160. package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts +21 -0
  161. package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map +1 -0
  162. package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +63 -0
  163. package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts +24 -0
  164. package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map +1 -0
  165. package/node_modules/mdast-util-to-markdown/lib/handle/link.js +114 -0
  166. package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts +13 -0
  167. package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map +1 -0
  168. package/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +62 -0
  169. package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts +13 -0
  170. package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map +1 -0
  171. package/node_modules/mdast-util-to-markdown/lib/handle/list.js +100 -0
  172. package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts +17 -0
  173. package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map +1 -0
  174. package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +20 -0
  175. package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts +13 -0
  176. package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map +1 -0
  177. package/node_modules/mdast-util-to-markdown/lib/handle/root.js +23 -0
  178. package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts +24 -0
  179. package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map +1 -0
  180. package/node_modules/mdast-util-to-markdown/lib/handle/strong.js +69 -0
  181. package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts +17 -0
  182. package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map +1 -0
  183. package/node_modules/mdast-util-to-markdown/lib/handle/text.js +15 -0
  184. package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts +11 -0
  185. package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map +1 -0
  186. package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +21 -0
  187. package/node_modules/mdast-util-to-markdown/lib/index.d.ts +14 -0
  188. package/node_modules/mdast-util-to-markdown/lib/index.d.ts.map +1 -0
  189. package/node_modules/mdast-util-to-markdown/lib/index.js +187 -0
  190. package/node_modules/mdast-util-to-markdown/lib/join.d.ts +4 -0
  191. package/node_modules/mdast-util-to-markdown/lib/join.d.ts.map +1 -0
  192. package/node_modules/mdast-util-to-markdown/lib/join.js +39 -0
  193. package/node_modules/mdast-util-to-markdown/lib/types.d.ts +965 -0
  194. package/node_modules/mdast-util-to-markdown/lib/types.js +2 -0
  195. package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts +4 -0
  196. package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map +1 -0
  197. package/node_modules/mdast-util-to-markdown/lib/unsafe.js +146 -0
  198. package/node_modules/mdast-util-to-markdown/lib/util/association.d.ts +2 -0
  199. package/node_modules/mdast-util-to-markdown/lib/util/association.d.ts.map +1 -0
  200. package/node_modules/mdast-util-to-markdown/lib/util/association.js +33 -0
  201. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts +11 -0
  202. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map +1 -0
  203. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +21 -0
  204. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts +8 -0
  205. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map +1 -0
  206. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +38 -0
  207. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts +11 -0
  208. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map +1 -0
  209. package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +21 -0
  210. package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts +11 -0
  211. package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map +1 -0
  212. package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +21 -0
  213. package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts +11 -0
  214. package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map +1 -0
  215. package/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +21 -0
  216. package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts +11 -0
  217. package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map +1 -0
  218. package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +21 -0
  219. package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts +11 -0
  220. package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map +1 -0
  221. package/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +21 -0
  222. package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts +11 -0
  223. package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map +1 -0
  224. package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +21 -0
  225. package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts +11 -0
  226. package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map +1 -0
  227. package/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +21 -0
  228. package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts +11 -0
  229. package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map +1 -0
  230. package/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +21 -0
  231. package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts +2 -0
  232. package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts.map +1 -0
  233. package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js +24 -0
  234. package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts +19 -0
  235. package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map +1 -0
  236. package/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +84 -0
  237. package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts +19 -0
  238. package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map +1 -0
  239. package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +125 -0
  240. package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts +7 -0
  241. package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map +1 -0
  242. package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts +10 -0
  243. package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts.map +1 -0
  244. package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js +11 -0
  245. package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts +33 -0
  246. package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map +1 -0
  247. package/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +82 -0
  248. package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts +13 -0
  249. package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map +1 -0
  250. package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +22 -0
  251. package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts +9 -0
  252. package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map +1 -0
  253. package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +34 -0
  254. package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts +9 -0
  255. package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map +1 -0
  256. package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +34 -0
  257. package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts +2 -0
  258. package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts.map +1 -0
  259. package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +35 -0
  260. package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts +12 -0
  261. package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map +1 -0
  262. package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +41 -0
  263. package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts +29 -0
  264. package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map +1 -0
  265. package/node_modules/mdast-util-to-markdown/lib/util/safe.js +174 -0
  266. package/node_modules/mdast-util-to-markdown/lib/util/track.d.ts +2 -0
  267. package/node_modules/mdast-util-to-markdown/lib/util/track.d.ts.map +1 -0
  268. package/node_modules/mdast-util-to-markdown/lib/util/track.js +55 -0
  269. package/node_modules/mdast-util-to-markdown/license +22 -0
  270. package/node_modules/mdast-util-to-markdown/package.json +132 -0
  271. package/node_modules/mdast-util-to-markdown/readme.md +750 -0
  272. package/node_modules/mdast-util-to-string/index.d.ts +2 -0
  273. package/node_modules/mdast-util-to-string/index.js +5 -0
  274. package/node_modules/mdast-util-to-string/lib/index.d.ts +31 -0
  275. package/node_modules/mdast-util-to-string/lib/index.js +108 -0
  276. package/node_modules/mdast-util-to-string/license +22 -0
  277. package/node_modules/mdast-util-to-string/package.json +78 -0
  278. package/node_modules/mdast-util-to-string/readme.md +218 -0
  279. package/node_modules/micromark/dev/index.d.ts +82 -0
  280. package/node_modules/micromark/dev/index.d.ts.map +1 -0
  281. package/node_modules/micromark/dev/index.js +68 -0
  282. package/node_modules/micromark/dev/lib/compile.d.ts +16 -0
  283. package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -0
  284. package/node_modules/micromark/dev/lib/compile.js +1152 -0
  285. package/node_modules/micromark/dev/lib/constructs.d.ts +73 -0
  286. package/node_modules/micromark/dev/lib/constructs.d.ts.map +1 -0
  287. package/node_modules/micromark/dev/lib/constructs.js +101 -0
  288. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts +46 -0
  289. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -0
  290. package/node_modules/micromark/dev/lib/create-tokenizer.js +717 -0
  291. package/node_modules/micromark/dev/lib/initialize/content.d.ts +4 -0
  292. package/node_modules/micromark/dev/lib/initialize/content.d.ts.map +1 -0
  293. package/node_modules/micromark/dev/lib/initialize/content.js +99 -0
  294. package/node_modules/micromark/dev/lib/initialize/document.d.ts +10 -0
  295. package/node_modules/micromark/dev/lib/initialize/document.d.ts.map +1 -0
  296. package/node_modules/micromark/dev/lib/initialize/document.js +445 -0
  297. package/node_modules/micromark/dev/lib/initialize/flow.d.ts +4 -0
  298. package/node_modules/micromark/dev/lib/initialize/flow.d.ts.map +1 -0
  299. package/node_modules/micromark/dev/lib/initialize/flow.js +86 -0
  300. package/node_modules/micromark/dev/lib/initialize/text.d.ts +8 -0
  301. package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -0
  302. package/node_modules/micromark/dev/lib/initialize/text.js +244 -0
  303. package/node_modules/micromark/dev/lib/parse.d.ts +10 -0
  304. package/node_modules/micromark/dev/lib/parse.d.ts.map +1 -0
  305. package/node_modules/micromark/dev/lib/parse.js +58 -0
  306. package/node_modules/micromark/dev/lib/postprocess.d.ts +9 -0
  307. package/node_modules/micromark/dev/lib/postprocess.d.ts.map +1 -0
  308. package/node_modules/micromark/dev/lib/postprocess.js +19 -0
  309. package/node_modules/micromark/dev/lib/preprocess.d.ts +13 -0
  310. package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -0
  311. package/node_modules/micromark/dev/lib/preprocess.js +141 -0
  312. package/node_modules/micromark/dev/stream.d.ts +35 -0
  313. package/node_modules/micromark/dev/stream.d.ts.map +1 -0
  314. package/node_modules/micromark/dev/stream.js +270 -0
  315. package/node_modules/micromark/index.d.ts +82 -0
  316. package/node_modules/micromark/index.d.ts.map +1 -0
  317. package/node_modules/micromark/index.js +60 -0
  318. package/node_modules/micromark/lib/compile.d.ts +16 -0
  319. package/node_modules/micromark/lib/compile.d.ts.map +1 -0
  320. package/node_modules/micromark/lib/compile.js +1060 -0
  321. package/node_modules/micromark/lib/constructs.d.ts +73 -0
  322. package/node_modules/micromark/lib/constructs.d.ts.map +1 -0
  323. package/node_modules/micromark/lib/constructs.js +85 -0
  324. package/node_modules/micromark/lib/create-tokenizer.d.ts +46 -0
  325. package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -0
  326. package/node_modules/micromark/lib/create-tokenizer.js +611 -0
  327. package/node_modules/micromark/lib/initialize/content.d.ts +4 -0
  328. package/node_modules/micromark/lib/initialize/content.d.ts.map +1 -0
  329. package/node_modules/micromark/lib/initialize/content.js +79 -0
  330. package/node_modules/micromark/lib/initialize/document.d.ts +10 -0
  331. package/node_modules/micromark/lib/initialize/document.d.ts.map +1 -0
  332. package/node_modules/micromark/lib/initialize/document.js +362 -0
  333. package/node_modules/micromark/lib/initialize/flow.d.ts +4 -0
  334. package/node_modules/micromark/lib/initialize/flow.d.ts.map +1 -0
  335. package/node_modules/micromark/lib/initialize/flow.js +58 -0
  336. package/node_modules/micromark/lib/initialize/text.d.ts +8 -0
  337. package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -0
  338. package/node_modules/micromark/lib/initialize/text.js +212 -0
  339. package/node_modules/micromark/lib/parse.d.ts +10 -0
  340. package/node_modules/micromark/lib/parse.d.ts.map +1 -0
  341. package/node_modules/micromark/lib/parse.js +56 -0
  342. package/node_modules/micromark/lib/postprocess.d.ts +9 -0
  343. package/node_modules/micromark/lib/postprocess.d.ts.map +1 -0
  344. package/node_modules/micromark/lib/postprocess.js +18 -0
  345. package/node_modules/micromark/lib/preprocess.d.ts +13 -0
  346. package/node_modules/micromark/lib/preprocess.d.ts.map +1 -0
  347. package/node_modules/micromark/lib/preprocess.js +115 -0
  348. package/node_modules/micromark/license +22 -0
  349. package/node_modules/micromark/package.json +100 -0
  350. package/node_modules/micromark/readme.md +488 -0
  351. package/node_modules/micromark/stream.d.ts +35 -0
  352. package/node_modules/micromark/stream.d.ts.map +1 -0
  353. package/node_modules/micromark/stream.js +256 -0
  354. package/node_modules/micromark-core-commonmark/dev/index.d.ts +23 -0
  355. package/node_modules/micromark-core-commonmark/dev/index.d.ts.map +1 -0
  356. package/node_modules/micromark-core-commonmark/dev/index.js +22 -0
  357. package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts +4 -0
  358. package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts.map +1 -0
  359. package/node_modules/micromark-core-commonmark/dev/lib/attention.js +300 -0
  360. package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts +4 -0
  361. package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts.map +1 -0
  362. package/node_modules/micromark-core-commonmark/dev/lib/autolink.js +269 -0
  363. package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts +4 -0
  364. package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts.map +1 -0
  365. package/node_modules/micromark-core-commonmark/dev/lib/blank-line.js +62 -0
  366. package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts +4 -0
  367. package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts.map +1 -0
  368. package/node_modules/micromark-core-commonmark/dev/lib/block-quote.js +162 -0
  369. package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts +4 -0
  370. package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts.map +1 -0
  371. package/node_modules/micromark-core-commonmark/dev/lib/character-escape.js +69 -0
  372. package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts +4 -0
  373. package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts.map +1 -0
  374. package/node_modules/micromark-core-commonmark/dev/lib/character-reference.js +166 -0
  375. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts +4 -0
  376. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -0
  377. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +514 -0
  378. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts +4 -0
  379. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts.map +1 -0
  380. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +202 -0
  381. package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts +4 -0
  382. package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts.map +1 -0
  383. package/node_modules/micromark-core-commonmark/dev/lib/code-text.js +257 -0
  384. package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts +7 -0
  385. package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts.map +1 -0
  386. package/node_modules/micromark-core-commonmark/dev/lib/content.js +185 -0
  387. package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts +4 -0
  388. package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts.map +1 -0
  389. package/node_modules/micromark-core-commonmark/dev/lib/definition.js +295 -0
  390. package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts +4 -0
  391. package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts.map +1 -0
  392. package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js +65 -0
  393. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts +4 -0
  394. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts.map +1 -0
  395. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +233 -0
  396. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts +4 -0
  397. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -0
  398. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +989 -0
  399. package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts +4 -0
  400. package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts.map +1 -0
  401. package/node_modules/micromark-core-commonmark/dev/lib/html-text.js +783 -0
  402. package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts +4 -0
  403. package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts.map +1 -0
  404. package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +656 -0
  405. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts +4 -0
  406. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -0
  407. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +110 -0
  408. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts +4 -0
  409. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -0
  410. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +62 -0
  411. package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts +4 -0
  412. package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts.map +1 -0
  413. package/node_modules/micromark-core-commonmark/dev/lib/line-ending.js +34 -0
  414. package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts +4 -0
  415. package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts.map +1 -0
  416. package/node_modules/micromark-core-commonmark/dev/lib/list.js +306 -0
  417. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts +4 -0
  418. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -0
  419. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +210 -0
  420. package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts +4 -0
  421. package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts.map +1 -0
  422. package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.js +120 -0
  423. package/node_modules/micromark-core-commonmark/index.d.ts +23 -0
  424. package/node_modules/micromark-core-commonmark/index.d.ts.map +1 -0
  425. package/node_modules/micromark-core-commonmark/index.js +22 -0
  426. package/node_modules/micromark-core-commonmark/lib/attention.d.ts +4 -0
  427. package/node_modules/micromark-core-commonmark/lib/attention.d.ts.map +1 -0
  428. package/node_modules/micromark-core-commonmark/lib/attention.js +241 -0
  429. package/node_modules/micromark-core-commonmark/lib/autolink.d.ts +4 -0
  430. package/node_modules/micromark-core-commonmark/lib/autolink.d.ts.map +1 -0
  431. package/node_modules/micromark-core-commonmark/lib/autolink.js +233 -0
  432. package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts +4 -0
  433. package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts.map +1 -0
  434. package/node_modules/micromark-core-commonmark/lib/blank-line.js +61 -0
  435. package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts +4 -0
  436. package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts.map +1 -0
  437. package/node_modules/micromark-core-commonmark/lib/block-quote.js +143 -0
  438. package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts +4 -0
  439. package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts.map +1 -0
  440. package/node_modules/micromark-core-commonmark/lib/character-escape.js +64 -0
  441. package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts +4 -0
  442. package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts.map +1 -0
  443. package/node_modules/micromark-core-commonmark/lib/character-reference.js +149 -0
  444. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts +4 -0
  445. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -0
  446. package/node_modules/micromark-core-commonmark/lib/code-fenced.js +460 -0
  447. package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts +4 -0
  448. package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts.map +1 -0
  449. package/node_modules/micromark-core-commonmark/lib/code-indented.js +177 -0
  450. package/node_modules/micromark-core-commonmark/lib/code-text.d.ts +4 -0
  451. package/node_modules/micromark-core-commonmark/lib/code-text.d.ts.map +1 -0
  452. package/node_modules/micromark-core-commonmark/lib/code-text.js +225 -0
  453. package/node_modules/micromark-core-commonmark/lib/content.d.ts +7 -0
  454. package/node_modules/micromark-core-commonmark/lib/content.d.ts.map +1 -0
  455. package/node_modules/micromark-core-commonmark/lib/content.js +163 -0
  456. package/node_modules/micromark-core-commonmark/lib/definition.d.ts +4 -0
  457. package/node_modules/micromark-core-commonmark/lib/definition.d.ts.map +1 -0
  458. package/node_modules/micromark-core-commonmark/lib/definition.js +254 -0
  459. package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts +4 -0
  460. package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts.map +1 -0
  461. package/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
  462. package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts +4 -0
  463. package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts.map +1 -0
  464. package/node_modules/micromark-core-commonmark/lib/heading-atx.js +195 -0
  465. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts +4 -0
  466. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -0
  467. package/node_modules/micromark-core-commonmark/lib/html-flow.js +876 -0
  468. package/node_modules/micromark-core-commonmark/lib/html-text.d.ts +4 -0
  469. package/node_modules/micromark-core-commonmark/lib/html-text.d.ts.map +1 -0
  470. package/node_modules/micromark-core-commonmark/lib/html-text.js +678 -0
  471. package/node_modules/micromark-core-commonmark/lib/label-end.d.ts +4 -0
  472. package/node_modules/micromark-core-commonmark/lib/label-end.d.ts.map +1 -0
  473. package/node_modules/micromark-core-commonmark/lib/label-end.js +560 -0
  474. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts +4 -0
  475. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -0
  476. package/node_modules/micromark-core-commonmark/lib/label-start-image.js +102 -0
  477. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts +4 -0
  478. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -0
  479. package/node_modules/micromark-core-commonmark/lib/label-start-link.js +55 -0
  480. package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts +4 -0
  481. package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts.map +1 -0
  482. package/node_modules/micromark-core-commonmark/lib/line-ending.js +33 -0
  483. package/node_modules/micromark-core-commonmark/lib/list.d.ts +4 -0
  484. package/node_modules/micromark-core-commonmark/lib/list.d.ts.map +1 -0
  485. package/node_modules/micromark-core-commonmark/lib/list.js +213 -0
  486. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts +4 -0
  487. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -0
  488. package/node_modules/micromark-core-commonmark/lib/setext-underline.js +185 -0
  489. package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts +4 -0
  490. package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts.map +1 -0
  491. package/node_modules/micromark-core-commonmark/lib/thematic-break.js +102 -0
  492. package/node_modules/micromark-core-commonmark/license +22 -0
  493. package/node_modules/micromark-core-commonmark/package.json +74 -0
  494. package/node_modules/micromark-core-commonmark/readme.md +171 -0
  495. package/node_modules/micromark-extension-gfm-table/dev/index.d.ts +55 -0
  496. package/node_modules/micromark-extension-gfm-table/dev/index.js +2 -0
  497. package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts +38 -0
  498. package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts.map +1 -0
  499. package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.js +212 -0
  500. package/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts +11 -0
  501. package/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts.map +1 -0
  502. package/node_modules/micromark-extension-gfm-table/dev/lib/html.js +148 -0
  503. package/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts +14 -0
  504. package/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts.map +1 -0
  505. package/node_modules/micromark-extension-gfm-table/dev/lib/infer.js +64 -0
  506. package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts +18 -0
  507. package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts.map +1 -0
  508. package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.js +941 -0
  509. package/node_modules/micromark-extension-gfm-table/index.d.ts +55 -0
  510. package/node_modules/micromark-extension-gfm-table/index.js +2 -0
  511. package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts +38 -0
  512. package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts.map +1 -0
  513. package/node_modules/micromark-extension-gfm-table/lib/edit-map.js +202 -0
  514. package/node_modules/micromark-extension-gfm-table/lib/html.d.ts +11 -0
  515. package/node_modules/micromark-extension-gfm-table/lib/html.d.ts.map +1 -0
  516. package/node_modules/micromark-extension-gfm-table/lib/html.js +130 -0
  517. package/node_modules/micromark-extension-gfm-table/lib/infer.d.ts +14 -0
  518. package/node_modules/micromark-extension-gfm-table/lib/infer.d.ts.map +1 -0
  519. package/node_modules/micromark-extension-gfm-table/lib/infer.js +52 -0
  520. package/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts +18 -0
  521. package/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts.map +1 -0
  522. package/node_modules/micromark-extension-gfm-table/lib/syntax.js +819 -0
  523. package/node_modules/micromark-extension-gfm-table/license +22 -0
  524. package/node_modules/micromark-extension-gfm-table/package.json +128 -0
  525. package/node_modules/micromark-extension-gfm-table/readme.md +515 -0
  526. package/node_modules/micromark-factory-destination/dev/index.d.ts +42 -0
  527. package/node_modules/micromark-factory-destination/dev/index.d.ts.map +1 -0
  528. package/node_modules/micromark-factory-destination/dev/index.js +255 -0
  529. package/node_modules/micromark-factory-destination/index.d.ts +42 -0
  530. package/node_modules/micromark-factory-destination/index.d.ts.map +1 -0
  531. package/node_modules/micromark-factory-destination/index.js +206 -0
  532. package/node_modules/micromark-factory-destination/license +22 -0
  533. package/node_modules/micromark-factory-destination/package.json +57 -0
  534. package/node_modules/micromark-factory-destination/readme.md +234 -0
  535. package/node_modules/micromark-factory-label/dev/index.d.ts +37 -0
  536. package/node_modules/micromark-factory-label/dev/index.d.ts.map +1 -0
  537. package/node_modules/micromark-factory-label/dev/index.js +172 -0
  538. package/node_modules/micromark-factory-label/index.d.ts +37 -0
  539. package/node_modules/micromark-factory-label/index.d.ts.map +1 -0
  540. package/node_modules/micromark-factory-label/index.js +148 -0
  541. package/node_modules/micromark-factory-label/license +22 -0
  542. package/node_modules/micromark-factory-label/package.json +60 -0
  543. package/node_modules/micromark-factory-label/readme.md +224 -0
  544. package/node_modules/micromark-factory-space/dev/index.d.ts +37 -0
  545. package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -0
  546. package/node_modules/micromark-factory-space/dev/index.js +67 -0
  547. package/node_modules/micromark-factory-space/index.d.ts +37 -0
  548. package/node_modules/micromark-factory-space/index.d.ts.map +1 -0
  549. package/node_modules/micromark-factory-space/index.js +64 -0
  550. package/node_modules/micromark-factory-space/license +22 -0
  551. package/node_modules/micromark-factory-space/package.json +55 -0
  552. package/node_modules/micromark-factory-space/readme.md +225 -0
  553. package/node_modules/micromark-factory-title/dev/index.d.ts +36 -0
  554. package/node_modules/micromark-factory-title/dev/index.d.ts.map +1 -0
  555. package/node_modules/micromark-factory-title/dev/index.js +169 -0
  556. package/node_modules/micromark-factory-title/index.d.ts +36 -0
  557. package/node_modules/micromark-factory-title/index.d.ts.map +1 -0
  558. package/node_modules/micromark-factory-title/index.js +158 -0
  559. package/node_modules/micromark-factory-title/license +22 -0
  560. package/node_modules/micromark-factory-title/package.json +58 -0
  561. package/node_modules/micromark-factory-title/readme.md +229 -0
  562. package/node_modules/micromark-factory-whitespace/dev/index.d.ts +22 -0
  563. package/node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
  564. package/node_modules/micromark-factory-whitespace/dev/index.js +53 -0
  565. package/node_modules/micromark-factory-whitespace/index.d.ts +22 -0
  566. package/node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
  567. package/node_modules/micromark-factory-whitespace/index.js +44 -0
  568. package/node_modules/micromark-factory-whitespace/license +22 -0
  569. package/node_modules/micromark-factory-whitespace/package.json +57 -0
  570. package/node_modules/micromark-factory-whitespace/readme.md +205 -0
  571. package/node_modules/micromark-util-character/dev/index.d.ts +195 -0
  572. package/node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
  573. package/node_modules/micromark-util-character/dev/index.js +252 -0
  574. package/node_modules/micromark-util-character/index.d.ts +195 -0
  575. package/node_modules/micromark-util-character/index.d.ts.map +1 -0
  576. package/node_modules/micromark-util-character/index.js +246 -0
  577. package/node_modules/micromark-util-character/license +22 -0
  578. package/node_modules/micromark-util-character/package.json +57 -0
  579. package/node_modules/micromark-util-character/readme.md +446 -0
  580. package/node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
  581. package/node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
  582. package/node_modules/micromark-util-chunked/dev/index.js +89 -0
  583. package/node_modules/micromark-util-chunked/index.d.ts +41 -0
  584. package/node_modules/micromark-util-chunked/index.d.ts.map +1 -0
  585. package/node_modules/micromark-util-chunked/index.js +81 -0
  586. package/node_modules/micromark-util-chunked/license +22 -0
  587. package/node_modules/micromark-util-chunked/package.json +57 -0
  588. package/node_modules/micromark-util-chunked/readme.md +219 -0
  589. package/node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
  590. package/node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
  591. package/node_modules/micromark-util-classify-character/dev/index.js +38 -0
  592. package/node_modules/micromark-util-classify-character/index.d.ts +18 -0
  593. package/node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
  594. package/node_modules/micromark-util-classify-character/index.js +27 -0
  595. package/node_modules/micromark-util-classify-character/license +22 -0
  596. package/node_modules/micromark-util-classify-character/package.json +59 -0
  597. package/node_modules/micromark-util-classify-character/readme.md +205 -0
  598. package/node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
  599. package/node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
  600. package/node_modules/micromark-util-combine-extensions/index.js +143 -0
  601. package/node_modules/micromark-util-combine-extensions/license +22 -0
  602. package/node_modules/micromark-util-combine-extensions/package.json +52 -0
  603. package/node_modules/micromark-util-combine-extensions/readme.md +201 -0
  604. package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
  605. package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
  606. package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
  607. package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
  608. package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
  609. package/node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
  610. package/node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
  611. package/node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
  612. package/node_modules/micromark-util-decode-numeric-character-reference/readme.md +184 -0
  613. package/node_modules/micromark-util-decode-string/dev/index.d.ts +14 -0
  614. package/node_modules/micromark-util-decode-string/dev/index.d.ts.map +1 -0
  615. package/node_modules/micromark-util-decode-string/dev/index.js +53 -0
  616. package/node_modules/micromark-util-decode-string/index.d.ts +14 -0
  617. package/node_modules/micromark-util-decode-string/index.d.ts.map +1 -0
  618. package/node_modules/micromark-util-decode-string/index.js +45 -0
  619. package/node_modules/micromark-util-decode-string/license +22 -0
  620. package/node_modules/micromark-util-decode-string/package.json +63 -0
  621. package/node_modules/micromark-util-decode-string/readme.md +179 -0
  622. package/node_modules/micromark-util-encode/index.d.ts +14 -0
  623. package/node_modules/micromark-util-encode/index.d.ts.map +1 -0
  624. package/node_modules/micromark-util-encode/index.js +33 -0
  625. package/node_modules/micromark-util-encode/license +22 -0
  626. package/node_modules/micromark-util-encode/package.json +47 -0
  627. package/node_modules/micromark-util-encode/readme.md +176 -0
  628. package/node_modules/micromark-util-html-tag-name/index.d.ts +30 -0
  629. package/node_modules/micromark-util-html-tag-name/index.d.ts.map +1 -0
  630. package/node_modules/micromark-util-html-tag-name/index.js +93 -0
  631. package/node_modules/micromark-util-html-tag-name/license +22 -0
  632. package/node_modules/micromark-util-html-tag-name/package.json +47 -0
  633. package/node_modules/micromark-util-html-tag-name/readme.md +193 -0
  634. package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts +21 -0
  635. package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts.map +1 -0
  636. package/node_modules/micromark-util-normalize-identifier/dev/index.js +38 -0
  637. package/node_modules/micromark-util-normalize-identifier/index.d.ts +21 -0
  638. package/node_modules/micromark-util-normalize-identifier/index.d.ts.map +1 -0
  639. package/node_modules/micromark-util-normalize-identifier/index.js +33 -0
  640. package/node_modules/micromark-util-normalize-identifier/license +22 -0
  641. package/node_modules/micromark-util-normalize-identifier/package.json +58 -0
  642. package/node_modules/micromark-util-normalize-identifier/readme.md +187 -0
  643. package/node_modules/micromark-util-resolve-all/index.d.ts +22 -0
  644. package/node_modules/micromark-util-resolve-all/index.d.ts.map +1 -0
  645. package/node_modules/micromark-util-resolve-all/index.js +32 -0
  646. package/node_modules/micromark-util-resolve-all/license +22 -0
  647. package/node_modules/micromark-util-resolve-all/package.json +48 -0
  648. package/node_modules/micromark-util-resolve-all/readme.md +238 -0
  649. package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts +36 -0
  650. package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts.map +1 -0
  651. package/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
  652. package/node_modules/micromark-util-sanitize-uri/index.d.ts +36 -0
  653. package/node_modules/micromark-util-sanitize-uri/index.d.ts.map +1 -0
  654. package/node_modules/micromark-util-sanitize-uri/index.js +107 -0
  655. package/node_modules/micromark-util-sanitize-uri/license +22 -0
  656. package/node_modules/micromark-util-sanitize-uri/package.json +59 -0
  657. package/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
  658. package/node_modules/micromark-util-subtokenize/dev/index.d.ts +12 -0
  659. package/node_modules/micromark-util-subtokenize/dev/index.d.ts.map +1 -0
  660. package/node_modules/micromark-util-subtokenize/dev/index.js +284 -0
  661. package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts +161 -0
  662. package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts.map +1 -0
  663. package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js +288 -0
  664. package/node_modules/micromark-util-subtokenize/index.d.ts +12 -0
  665. package/node_modules/micromark-util-subtokenize/index.d.ts.map +1 -0
  666. package/node_modules/micromark-util-subtokenize/index.js +228 -0
  667. package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts +161 -0
  668. package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts.map +1 -0
  669. package/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
  670. package/node_modules/micromark-util-subtokenize/license +22 -0
  671. package/node_modules/micromark-util-subtokenize/package.json +60 -0
  672. package/node_modules/micromark-util-subtokenize/readme.md +181 -0
  673. package/node_modules/micromark-util-symbol/lib/codes.d.ts +139 -0
  674. package/node_modules/micromark-util-symbol/lib/codes.d.ts.map +1 -0
  675. package/node_modules/micromark-util-symbol/lib/codes.js +158 -0
  676. package/node_modules/micromark-util-symbol/lib/constants.d.ts +37 -0
  677. package/node_modules/micromark-util-symbol/lib/constants.d.ts.map +1 -0
  678. package/node_modules/micromark-util-symbol/lib/constants.js +44 -0
  679. package/node_modules/micromark-util-symbol/lib/default.d.ts +5 -0
  680. package/node_modules/micromark-util-symbol/lib/default.d.ts.map +1 -0
  681. package/node_modules/micromark-util-symbol/lib/default.js +4 -0
  682. package/node_modules/micromark-util-symbol/lib/types.d.ts +106 -0
  683. package/node_modules/micromark-util-symbol/lib/types.d.ts.map +1 -0
  684. package/node_modules/micromark-util-symbol/lib/types.js +453 -0
  685. package/node_modules/micromark-util-symbol/lib/values.d.ts +102 -0
  686. package/node_modules/micromark-util-symbol/lib/values.d.ts.map +1 -0
  687. package/node_modules/micromark-util-symbol/lib/values.js +109 -0
  688. package/node_modules/micromark-util-symbol/license +22 -0
  689. package/node_modules/micromark-util-symbol/package.json +43 -0
  690. package/node_modules/micromark-util-symbol/readme.md +168 -0
  691. package/node_modules/micromark-util-types/index.d.ts +1312 -0
  692. package/node_modules/micromark-util-types/index.js +2 -0
  693. package/node_modules/micromark-util-types/license +22 -0
  694. package/node_modules/micromark-util-types/package.json +71 -0
  695. package/node_modules/micromark-util-types/readme.md +151 -0
  696. package/node_modules/ms/index.js +162 -0
  697. package/node_modules/ms/license.md +21 -0
  698. package/node_modules/ms/package.json +38 -0
  699. package/node_modules/ms/readme.md +59 -0
  700. package/node_modules/unist-util-is/index.d.ts +5 -0
  701. package/node_modules/unist-util-is/index.d.ts.map +1 -0
  702. package/node_modules/unist-util-is/index.js +7 -0
  703. package/node_modules/unist-util-is/lib/index.d.ts +111 -0
  704. package/node_modules/unist-util-is/lib/index.d.ts.map +1 -0
  705. package/node_modules/unist-util-is/lib/index.js +296 -0
  706. package/node_modules/unist-util-is/license +22 -0
  707. package/node_modules/unist-util-is/package.json +103 -0
  708. package/node_modules/unist-util-is/readme.md +351 -0
  709. package/node_modules/unist-util-stringify-position/index.d.ts +1 -0
  710. package/node_modules/unist-util-stringify-position/index.js +1 -0
  711. package/node_modules/unist-util-stringify-position/lib/index.d.ts +61 -0
  712. package/node_modules/unist-util-stringify-position/lib/index.js +84 -0
  713. package/node_modules/unist-util-stringify-position/license +22 -0
  714. package/node_modules/unist-util-stringify-position/package.json +80 -0
  715. package/node_modules/unist-util-stringify-position/readme.md +206 -0
  716. package/node_modules/unist-util-visit/index.d.ts +9 -0
  717. package/node_modules/unist-util-visit/index.js +2 -0
  718. package/node_modules/unist-util-visit/lib/index.d.ts +195 -0
  719. package/node_modules/unist-util-visit/lib/index.d.ts.map +1 -0
  720. package/node_modules/unist-util-visit/lib/index.js +312 -0
  721. package/node_modules/unist-util-visit/license +22 -0
  722. package/node_modules/unist-util-visit/package.json +108 -0
  723. package/node_modules/unist-util-visit/readme.md +313 -0
  724. package/node_modules/unist-util-visit-parents/index.d.ts +14 -0
  725. package/node_modules/unist-util-visit-parents/index.js +2 -0
  726. package/node_modules/unist-util-visit-parents/lib/color.d.ts +6 -0
  727. package/node_modules/unist-util-visit-parents/lib/color.d.ts.map +1 -0
  728. package/node_modules/unist-util-visit-parents/lib/color.js +7 -0
  729. package/node_modules/unist-util-visit-parents/lib/color.node.d.ts +6 -0
  730. package/node_modules/unist-util-visit-parents/lib/color.node.d.ts.map +1 -0
  731. package/node_modules/unist-util-visit-parents/lib/color.node.js +7 -0
  732. package/node_modules/unist-util-visit-parents/lib/index.d.ts +219 -0
  733. package/node_modules/unist-util-visit-parents/lib/index.d.ts.map +1 -0
  734. package/node_modules/unist-util-visit-parents/lib/index.js +399 -0
  735. package/node_modules/unist-util-visit-parents/license +22 -0
  736. package/node_modules/unist-util-visit-parents/package.json +106 -0
  737. package/node_modules/unist-util-visit-parents/readme.md +388 -0
  738. package/node_modules/zwitch/index.d.ts +67 -0
  739. package/node_modules/zwitch/index.js +118 -0
  740. package/node_modules/zwitch/license +22 -0
  741. package/node_modules/zwitch/package.json +72 -0
  742. package/node_modules/zwitch/readme.md +226 -0
  743. package/npm-shrinkwrap.json +737 -3
  744. package/openclaw.plugin.json +154 -81
  745. package/package.json +10 -7
  746. package/skills/feishu-drive/SKILL.md +5 -2
  747. package/dist/legacy-state-migrations-api.js +0 -73
  748. package/dist/monitor.state-DAHbcR2N.js +0 -173
  749. package/dist/send-result-BMQw-YhV.js +0 -287
@@ -1,61 +1,57 @@
1
- import { a as resolveDefaultFeishuAccountId, d as isRecord$1, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-Bs5uJ4h0.js";
2
- import { i as resolveReceiveIdType, n as looksLikeFeishuId, r as normalizeFeishuTarget, t as detectIdType } from "./targets-BUjQ1TcA.js";
3
- import { a as readNativeFeishuCardJson, n as createFeishuSendReceipt, u as createFeishuCardInteractionEnvelope } from "./send-result-BMQw-YhV.js";
4
- import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-CdLdoot3.js";
1
+ import { a as resolveDefaultFeishuAccountId, d as isRecord$1, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-BDoGHJDk.js";
2
+ import { i as resolveReceiveIdType, n as looksLikeFeishuId, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
3
+ import { C as resolveFeishuGroupConfig, E as resolveFeishuGroupToolPolicy, M as createFeishuCardInteractionEnvelope, O as normalizeFeishuChatType, _ as isFeishuGroupReadAllowed, a as readNativeFeishuCardJson, g as canEnumerateAllFeishuPeers, h as canEnumerateAllFeishuGroups, k as resolveFeishuChatType, m as authorizeFeishuChatMemberRead, n as createFeishuSendReceipt, p as assertFeishuChatReadAllowed, u as chunkFeishuMarkdown, v as isFeishuGroupReadEnabled, y as resolveFeishuChatReadPreliminaryAuthorization } from "./send-result-CPS7AozW.js";
4
+ import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
5
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DXH5hux1.js";
5
6
  import { t as messageActionTargetAliases } from "./security-audit-BIeA3W3Q.js";
6
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DLaBl9m4.js";
7
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DnlMcrn5.js";
7
8
  import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BIHeF-S_.js";
8
- import { t as resolveFeishuSessionConversation } from "./session-conversation-BYuoVJwl.js";
9
+ import { t as resolveFeishuSessionConversation } from "./session-conversation-BksWrfzm.js";
9
10
  import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
10
11
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
11
12
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
13
+ import { ToolAuthorizationError, createActionGate } from "openclaw/plugin-sdk/channel-actions";
12
14
  import { adaptScopedAccountAccessor, createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
13
15
  import { buildChannelOutboundSessionRoute, createChatChannelPlugin, stripChannelTargetPrefix } from "openclaw/plugin-sdk/channel-core";
14
16
  import { createAccountStatusSink, createRuntimeOutboundDelegates, defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-outbound";
15
17
  import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
16
18
  import { createAllowlistProviderGroupPolicyWarningCollector, projectConfigAccountIdWarningCollector } from "openclaw/plugin-sdk/channel-policy";
17
19
  import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
18
- import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
19
- import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
20
+ import { applyDirectoryQueryAndLimit, createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
21
+ import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationChartFallbackText, renderMessagePresentationFallbackText, renderMessagePresentationTableFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
20
22
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
21
23
  import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
22
24
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
23
- import { chunkTextForOutbound, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
24
- import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
25
- import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
26
- import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
27
- import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-primitives";
25
+ import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
26
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2 } from "openclaw/plugin-sdk/account-resolution";
27
+ import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
28
28
  import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
29
29
  import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-id";
30
+ import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
30
31
  import { z } from "zod";
31
32
  import { buildSecretInputSchema, hasConfiguredSecretInput as hasConfiguredSecretInput$2 } from "openclaw/plugin-sdk/secret-input";
32
33
  import fs from "node:fs";
33
34
  import os from "node:os";
34
35
  import path from "node:path";
35
36
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
36
- import { loadSessionStore, resolveSessionFilePath, resolveStorePath, updateSessionStore } from "openclaw/plugin-sdk/session-store-runtime";
37
+ import { deleteSessionEntry, isValidAgentHarnessSessionStoreEntry, listSessionEntries, loadTranscriptEventsSync, parseSqliteSessionFileMarker, resolveSessionStoreBackupPaths, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
37
38
  import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
38
- import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
39
39
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createSetupTranslator, formatDocsLink, hasConfiguredSecretInput as hasConfiguredSecretInput$1, mergeAllowFromEntries, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, splitSetupEntries } from "openclaw/plugin-sdk/setup";
40
40
  //#region extensions/feishu/src/approval-auth.ts
41
41
  function normalizeFeishuApproverId(value) {
42
42
  const trimmed = normalizeOptionalLowercaseString(normalizeFeishuTarget(String(value)));
43
43
  return trimmed?.startsWith("ou_") ? trimmed : void 0;
44
44
  }
45
- const feishuApprovalAuth = createResolvedApproverActionAuthAdapter({
45
+ const feishuApprovalAuth = createChannelApprovalAuth({
46
46
  channelLabel: "Feishu",
47
- resolveApprovers: ({ cfg, accountId }) => {
48
- const account = resolveFeishuAccount({
47
+ resolveInputs: ({ cfg, accountId }) => {
48
+ return { allowFrom: resolveFeishuAccount({
49
49
  cfg,
50
50
  accountId
51
- }).config;
52
- return resolveApprovalApprovers({
53
- allowFrom: account.allowFrom,
54
- normalizeApprover: normalizeFeishuApproverId
55
- });
51
+ }).config.allowFrom };
56
52
  },
57
- normalizeSenderId: (value) => normalizeFeishuApproverId(value)
58
- });
53
+ normalizeApprover: normalizeFeishuApproverId
54
+ }).approvalAuth;
59
55
  //#endregion
60
56
  //#region extensions/feishu/src/config-schema.ts
61
57
  const ChannelActionsSchema = z.object({ reactions: z.boolean().optional() }).strict().optional();
@@ -115,12 +111,18 @@ const RenderModeSchema = z.enum([
115
111
  "raw",
116
112
  "card"
117
113
  ]).optional();
118
- const StreamingModeSchema = z.boolean().optional();
119
- const BlockStreamingSchema = z.boolean().optional();
120
114
  const BlockStreamingCoalesceSchema = z.object({
121
- enabled: z.boolean().optional(),
122
- minDelayMs: z.number().int().positive().optional(),
123
- maxDelayMs: z.number().int().positive().optional()
115
+ minChars: z.number().int().positive().optional(),
116
+ maxChars: z.number().int().positive().optional(),
117
+ idleMs: z.number().int().nonnegative().optional()
118
+ }).strict().optional();
119
+ const FeishuStreamingSchema = z.object({
120
+ mode: z.enum(["off", "partial"]).optional(),
121
+ chunkMode: z.enum(["length", "newline"]).optional(),
122
+ block: z.object({
123
+ enabled: z.boolean().optional(),
124
+ coalesce: BlockStreamingCoalesceSchema
125
+ }).strict().optional()
124
126
  }).strict().optional();
125
127
  const ChannelHeartbeatVisibilitySchema = z.object({
126
128
  visibility: z.enum(["visible", "hidden"]).optional(),
@@ -222,14 +224,11 @@ const FeishuSharedConfigShape = {
222
224
  dmHistoryLimit: z.number().int().min(0).optional(),
223
225
  dms: z.record(z.string(), DmConfigSchema).optional(),
224
226
  textChunkLimit: z.number().int().positive().optional(),
225
- chunkMode: z.enum(["length", "newline"]).optional(),
226
- blockStreaming: BlockStreamingSchema,
227
- blockStreamingCoalesce: BlockStreamingCoalesceSchema,
228
227
  mediaMaxMb: z.number().positive().optional(),
229
228
  httpTimeoutMs: z.number().int().positive().max(3e5).optional(),
230
229
  heartbeat: ChannelHeartbeatVisibilitySchema,
231
230
  renderMode: RenderModeSchema,
232
- streaming: StreamingModeSchema,
231
+ streaming: FeishuStreamingSchema,
233
232
  tools: FeishuToolsConfigSchema,
234
233
  actions: ChannelActionsSchema,
235
234
  replyInThread: ReplyInThreadSchema,
@@ -256,7 +255,7 @@ const FeishuAccountConfigSchema = z.object({
256
255
  groupSessionScope: GroupSessionScopeSchema,
257
256
  topicSessionMode: TopicSessionModeSchema
258
257
  }).strict();
259
- const FeishuConfigSchema = z.object({
258
+ const FeishuChannelConfigSchema = buildChannelConfigSchema(z.object({
260
259
  enabled: z.boolean().optional(),
261
260
  defaultAccount: z.string().optional(),
262
261
  appId: z.string().optional(),
@@ -333,7 +332,7 @@ const FeishuConfigSchema = z.object({
333
332
  message: "channels.feishu.dmPolicy=\"open\" requires channels.feishu.allowFrom to include \"*\""
334
333
  });
335
334
  }
336
- });
335
+ }), { jsonSchemaMode: "input" });
337
336
  //#endregion
338
337
  //#region extensions/feishu/src/directory.static.ts
339
338
  function toFeishuDirectoryPeers(ids) {
@@ -374,6 +373,27 @@ async function listFeishuDirectoryGroups(params) {
374
373
  limit: params.limit
375
374
  }).map((entry) => entry.id));
376
375
  }
376
+ async function listAuthorizedFeishuDirectoryPeers(params) {
377
+ return toFeishuDirectoryPeers(listDirectoryUserEntriesFromAllowFrom({
378
+ allowFrom: resolveFeishuAccount({
379
+ cfg: params.cfg,
380
+ accountId: params.accountId
381
+ }).config.allowFrom,
382
+ query: params.query,
383
+ limit: params.limit,
384
+ normalizeId: (entry) => normalizeFeishuTarget(entry) ?? entry
385
+ }).map((entry) => entry.id));
386
+ }
387
+ async function listAuthorizedFeishuDirectoryGroups(params) {
388
+ const account = resolveFeishuAccount({
389
+ cfg: params.cfg,
390
+ accountId: params.accountId
391
+ });
392
+ return toFeishuDirectoryGroups(applyDirectoryQueryAndLimit(listDirectoryGroupEntriesFromMapKeysAndAllowFrom({
393
+ groups: Object.fromEntries(Object.entries(account.config.groups ?? {}).filter(([, group]) => group?.enabled !== false)),
394
+ allowFrom: account.config.groupAllowFrom
395
+ }).filter((entry) => isFeishuGroupReadAllowed(params.cfg, account, entry.id, false)).map((entry) => entry.id), params));
396
+ }
377
397
  //#endregion
378
398
  //#region extensions/feishu/src/doctor.ts
379
399
  const FEISHU_STATE_DIR = "feishu";
@@ -407,6 +427,12 @@ function existsFile(filePath) {
407
427
  return false;
408
428
  }
409
429
  }
430
+ function resolveFeishuAgentSessionsDir(agentId) {
431
+ return path.join(resolveStateDir(), "agents", normalizeAgentId(agentId), "sessions");
432
+ }
433
+ function isSqliteTranscriptMarker(value) {
434
+ return parseSqliteSessionFileMarker(value) !== void 0;
435
+ }
410
436
  function safeReadDir(dir) {
411
437
  try {
412
438
  return fs.readdirSync(dir, { withFileTypes: true });
@@ -472,9 +498,11 @@ function resolveConfiguredDefaultAgentId(cfg) {
472
498
  function collectFeishuSessionTargets(params) {
473
499
  const byStorePath = /* @__PURE__ */ new Map();
474
500
  const addTarget = (target) => {
475
- byStorePath.set(path.resolve(target.storePath), {
501
+ const resolvedStorePath = path.resolve(target.storePath);
502
+ byStorePath.set(`${normalizeAgentId(target.agentId)}\0${resolvedStorePath}`, {
476
503
  ...target,
477
- storePath: path.resolve(target.storePath)
504
+ agentId: normalizeAgentId(target.agentId),
505
+ storePath: resolvedStorePath
478
506
  });
479
507
  };
480
508
  for (const agentId of collectConfiguredAgentIds(params.cfg)) addTarget({
@@ -528,16 +556,23 @@ function collectCorruptFeishuStateJsonFindings(feishuStateDir) {
528
556
  function resolveSessionTranscriptCandidates(params) {
529
557
  const candidates = /* @__PURE__ */ new Set();
530
558
  const sessionsDir = path.dirname(params.storePath);
559
+ const agentSessionsDir = resolveFeishuAgentSessionsDir(params.agentId);
531
560
  const addSafeCandidate = (candidate) => {
532
561
  const resolved = path.isAbsolute(candidate) ? path.resolve(candidate) : path.resolve(sessionsDir, candidate);
533
- if (resolved === sessionsDir || !isPathWithinRoot(resolved, sessionsDir)) return;
562
+ const isStoreCandidate = isPathWithinRoot(resolved, sessionsDir);
563
+ const isAgentSessionCandidate = isPathWithinRoot(resolved, agentSessionsDir);
564
+ if (resolved === sessionsDir || resolved === agentSessionsDir || !isStoreCandidate && !isAgentSessionCandidate) return false;
534
565
  candidates.add(resolved);
566
+ return true;
535
567
  };
536
568
  if (typeof params.entry.sessionId === "string" && /^[a-z0-9][a-z0-9._-]{0,127}$/i.test(params.entry.sessionId)) {
537
- candidates.add(resolveSessionFilePath(params.entry.sessionId, typeof params.entry.sessionFile === "string" ? { sessionFile: params.entry.sessionFile } : void 0, {
538
- agentId: params.agentId,
539
- sessionsDir
540
- }));
569
+ let addedExplicitCandidate = false;
570
+ if (typeof params.entry.sessionFile === "string" && params.entry.sessionFile.trim()) {
571
+ const explicitSessionFile = params.entry.sessionFile.trim();
572
+ if (isSqliteTranscriptMarker(explicitSessionFile)) return [];
573
+ addedExplicitCandidate = addSafeCandidate(explicitSessionFile);
574
+ }
575
+ if (!addedExplicitCandidate) candidates.add(path.join(sessionsDir, `${params.entry.sessionId}.jsonl`));
541
576
  return [...candidates].toSorted();
542
577
  }
543
578
  if (typeof params.entry.sessionFile === "string" && params.entry.sessionFile.trim()) addSafeCandidate(params.entry.sessionFile.trim());
@@ -556,6 +591,47 @@ function isBlankUserMessage(value) {
556
591
  function isUserMessage(value) {
557
592
  return isRecord(value) && value.type === "message" && isRecord(value.message) && value.message.role === "user";
558
593
  }
594
+ function inspectTranscriptEntries(params) {
595
+ let blankUserMessageRun = 0;
596
+ let maxBlankUserMessageRun = 0;
597
+ for (const entry of params.entries) if (isBlankUserMessage(entry)) {
598
+ blankUserMessageRun += 1;
599
+ maxBlankUserMessageRun = Math.max(maxBlankUserMessageRun, blankUserMessageRun);
600
+ } else if (isUserMessage(entry)) blankUserMessageRun = 0;
601
+ if (params.entries.length === 0) {
602
+ if (params.allowMissingSessionHeader) return null;
603
+ return {
604
+ kind: "invalid-session-transcript",
605
+ sessionKey: params.sessionKey,
606
+ storePath: params.storePath,
607
+ path: params.transcriptPath,
608
+ reason: "empty transcript"
609
+ };
610
+ }
611
+ const firstEntry = params.entries[0];
612
+ if (!isSessionHeader(firstEntry) && (!params.allowMissingSessionHeader || !isUserMessage(firstEntry) && !isBlankUserMessage(firstEntry))) return {
613
+ kind: "invalid-session-transcript",
614
+ sessionKey: params.sessionKey,
615
+ storePath: params.storePath,
616
+ path: params.transcriptPath,
617
+ reason: "invalid session header"
618
+ };
619
+ if ((params.malformedLines ?? 0) > 0) return {
620
+ kind: "invalid-session-transcript",
621
+ sessionKey: params.sessionKey,
622
+ storePath: params.storePath,
623
+ path: params.transcriptPath,
624
+ reason: `${params.malformedLines} malformed JSONL line(s)`
625
+ };
626
+ if (maxBlankUserMessageRun >= BLANK_USER_MESSAGE_REPAIR_THRESHOLD) return {
627
+ kind: "blank-user-message-run",
628
+ sessionKey: params.sessionKey,
629
+ storePath: params.storePath,
630
+ path: params.transcriptPath,
631
+ count: maxBlankUserMessageRun
632
+ };
633
+ return null;
634
+ }
559
635
  function inspectSessionTranscript(params) {
560
636
  let stat;
561
637
  try {
@@ -585,52 +661,54 @@ function inspectSessionTranscript(params) {
585
661
  }
586
662
  const entries = [];
587
663
  let malformedLines = 0;
588
- let blankUserMessageRun = 0;
589
- let maxBlankUserMessageRun = 0;
590
664
  for (const line of raw.split(/\r?\n/)) {
591
665
  if (!line.trim()) continue;
592
666
  try {
593
667
  const entry = JSON.parse(line);
594
668
  entries.push(entry);
595
- if (isBlankUserMessage(entry)) {
596
- blankUserMessageRun += 1;
597
- maxBlankUserMessageRun = Math.max(maxBlankUserMessageRun, blankUserMessageRun);
598
- } else if (isUserMessage(entry)) blankUserMessageRun = 0;
599
669
  } catch {
600
670
  malformedLines += 1;
601
671
  }
602
672
  }
603
- if (entries.length === 0) return {
604
- kind: "invalid-session-transcript",
605
- sessionKey: params.sessionKey,
606
- storePath: params.storePath,
607
- path: params.transcriptPath,
608
- reason: "empty transcript"
609
- };
610
- if (!isSessionHeader(entries[0])) return {
611
- kind: "invalid-session-transcript",
612
- sessionKey: params.sessionKey,
613
- storePath: params.storePath,
614
- path: params.transcriptPath,
615
- reason: "invalid session header"
616
- };
617
- if (malformedLines > 0) return {
618
- kind: "invalid-session-transcript",
619
- sessionKey: params.sessionKey,
620
- storePath: params.storePath,
621
- path: params.transcriptPath,
622
- reason: `${malformedLines} malformed JSONL line(s)`
623
- };
624
- if (maxBlankUserMessageRun >= BLANK_USER_MESSAGE_REPAIR_THRESHOLD) return {
625
- kind: "blank-user-message-run",
673
+ return inspectTranscriptEntries({
674
+ ...params,
675
+ entries,
676
+ malformedLines
677
+ });
678
+ }
679
+ function inspectSqliteSessionTranscript(params) {
680
+ if (typeof params.entry.sessionFile !== "string") return null;
681
+ const marker = parseSqliteSessionFileMarker(params.entry.sessionFile);
682
+ if (!marker) return null;
683
+ const sessionId = typeof params.entry.sessionId === "string" && params.entry.sessionId.trim() ? params.entry.sessionId.trim() : marker.sessionId;
684
+ let entries;
685
+ try {
686
+ entries = loadTranscriptEventsSync({
687
+ agentId: marker.agentId,
688
+ sessionId,
689
+ sessionKey: params.sessionKey,
690
+ storePath: marker.storePath
691
+ });
692
+ } catch {
693
+ return {
694
+ kind: "invalid-session-transcript",
695
+ sessionKey: params.sessionKey,
696
+ storePath: params.storePath,
697
+ path: params.entry.sessionFile,
698
+ reason: "unreadable"
699
+ };
700
+ }
701
+ return inspectTranscriptEntries({
626
702
  sessionKey: params.sessionKey,
627
703
  storePath: params.storePath,
628
- path: params.transcriptPath,
629
- count: maxBlankUserMessageRun
630
- };
631
- return null;
704
+ transcriptPath: params.entry.sessionFile,
705
+ allowMissingSessionHeader: true,
706
+ entries
707
+ });
632
708
  }
633
709
  function collectFeishuSessionFindings(params) {
710
+ const sqliteFinding = inspectSqliteSessionTranscript(params);
711
+ if (sqliteFinding) return [sqliteFinding];
634
712
  const transcriptCandidates = resolveSessionTranscriptCandidates(params);
635
713
  const existing = transcriptCandidates.filter(existsFile);
636
714
  if (transcriptCandidates.length > 0 && existing.length === 0) return [{
@@ -682,24 +760,23 @@ function inspectFeishuDoctorState(params) {
682
760
  cfg: params.cfg,
683
761
  env,
684
762
  stateDir
685
- })) {
686
- const store = loadSessionStore(target.storePath, { skipCache: true });
687
- for (const [key, entry] of Object.entries(store).toSorted(([left], [right]) => left.localeCompare(right))) {
688
- if (!isFeishuSessionEntry(key, entry)) continue;
689
- const sessionEntry = toFeishuSessionEntry(entry);
690
- sessionEntries.push({
691
- key,
692
- storePath: target.storePath,
693
- agentId: target.agentId,
694
- entry: sessionEntry
695
- });
696
- findings.push(...collectFeishuSessionFindings({
697
- sessionKey: key,
698
- storePath: target.storePath,
699
- agentId: target.agentId,
700
- entry: sessionEntry
701
- }));
702
- }
763
+ })) for (const { sessionKey: key, entry } of listSessionEntries({
764
+ agentId: target.agentId,
765
+ storePath: target.storePath
766
+ }).filter(({ sessionKey, entry: sessionEntry }) => !isValidAgentHarnessSessionStoreEntry(sessionKey, sessionEntry) && isFeishuSessionEntry(sessionKey, sessionEntry)).toSorted((left, right) => left.sessionKey.localeCompare(right.sessionKey))) {
767
+ const sessionEntry = toFeishuSessionEntry(entry);
768
+ sessionEntries.push({
769
+ key,
770
+ storePath: target.storePath,
771
+ agentId: target.agentId,
772
+ entry: sessionEntry
773
+ });
774
+ findings.push(...collectFeishuSessionFindings({
775
+ sessionKey: key,
776
+ storePath: target.storePath,
777
+ agentId: target.agentId,
778
+ entry: sessionEntry
779
+ }));
703
780
  }
704
781
  return {
705
782
  stateDir,
@@ -735,13 +812,19 @@ function movePathToBackup(params) {
735
812
  return true;
736
813
  }
737
814
  function copyStoreBackup(params) {
738
- if (!existsFile(params.storePath)) return;
739
- const targetPath = path.join(params.backupDir, "session-stores", params.agentId, path.basename(params.storePath));
740
- fs.mkdirSync(path.dirname(targetPath), {
741
- recursive: true,
742
- mode: 448
743
- });
744
- fs.copyFileSync(params.storePath, resolveUniquePath(targetPath));
815
+ const targetDir = path.join(params.backupDir, "session-stores", params.agentId);
816
+ for (const sourcePath of resolveSessionStoreBackupPaths({
817
+ agentId: params.agentId,
818
+ storePath: params.storePath
819
+ })) {
820
+ if (!existsFile(sourcePath)) continue;
821
+ const targetPath = path.join(targetDir, path.basename(sourcePath));
822
+ fs.mkdirSync(path.dirname(targetPath), {
823
+ recursive: true,
824
+ mode: 448
825
+ });
826
+ fs.copyFileSync(sourcePath, resolveUniquePath(targetPath));
827
+ }
745
828
  }
746
829
  function collectSessionArtifactPaths(params) {
747
830
  const artifacts = /* @__PURE__ */ new Set();
@@ -821,15 +904,22 @@ async function repairFeishuDoctorState(params) {
821
904
  agentId: group.agentId
822
905
  });
823
906
  const keys = new Set(group.entries.map((entry) => entry.key));
824
- const removedEntries = await updateSessionStore(storePath, (store) => {
825
- const removed = [];
826
- for (const key of keys) if (Object.hasOwn(store, key)) {
827
- delete store[key];
828
- const entry = group.entries.find((candidate) => candidate.key === key);
829
- if (entry) removed.push(entry);
830
- }
831
- return removed;
832
- }, { skipMaintenance: true });
907
+ const removedEntries = [];
908
+ for (const key of keys) {
909
+ const currentEntry = listSessionEntries({
910
+ agentId: group.agentId,
911
+ storePath
912
+ }).find((candidate) => candidate.sessionKey === key)?.entry;
913
+ if (!currentEntry || isValidAgentHarnessSessionStoreEntry(key, currentEntry)) continue;
914
+ if (!await deleteSessionEntry({
915
+ agentId: group.agentId,
916
+ archiveTranscript: true,
917
+ sessionKey: key,
918
+ storePath
919
+ })) continue;
920
+ const entry = group.entries.find((candidate) => candidate.key === key);
921
+ if (entry) removedEntries.push(entry);
922
+ }
833
923
  const removed = removedEntries.length;
834
924
  removedSessionEntries += removed;
835
925
  if (removed > 0) {
@@ -913,189 +1003,43 @@ async function runFeishuDoctorSequence(params) {
913
1003
  warningNotes: report.warnings
914
1004
  };
915
1005
  }
916
- const feishuDoctor = { runConfigSequence: async ({ cfg, env, shouldRepair }) => await runFeishuDoctorSequence({
917
- cfg,
918
- env,
919
- shouldRepair
920
- }) };
1006
+ const feishuDoctor = {
1007
+ legacyConfigRules,
1008
+ normalizeCompatibilityConfig,
1009
+ runConfigSequence: async ({ cfg, env, shouldRepair }) => await runFeishuDoctorSequence({
1010
+ cfg,
1011
+ env,
1012
+ shouldRepair
1013
+ })
1014
+ };
921
1015
  //#endregion
922
- //#region extensions/feishu/src/policy.ts
923
- const FEISHU_PROVIDER_PREFIX_RE = /^(feishu|lark):/i;
924
- const FEISHU_TYPED_PREFIX_RE = /^(chat|group|channel|user|dm|open_id):/i;
925
- const FEISHU_ID_KIND = "plugin:feishu-id";
926
- const feishuIngressIdentity = defineStableChannelIngressIdentity({
927
- key: "feishu-id",
928
- kind: FEISHU_ID_KIND,
929
- normalize: normalizeFeishuAllowEntry,
930
- sensitivity: "pii",
931
- aliases: [{
932
- key: "feishu-alt-id",
933
- kind: FEISHU_ID_KIND,
934
- normalizeEntry: () => null,
935
- normalizeSubject: normalizeFeishuAllowEntry,
936
- sensitivity: "pii"
937
- }],
938
- isWildcardEntry: (entry) => normalizeFeishuAllowEntry(entry) === "*",
939
- resolveEntryId: ({ entryIndex }) => `feishu-entry-${entryIndex + 1}`
940
- });
941
- function normalizeFeishuAllowEntry(raw) {
942
- const trimmed = raw.trim();
943
- if (!trimmed) return "";
944
- if (trimmed === "*") return "*";
945
- let withoutProviderPrefix = trimmed;
946
- while (FEISHU_PROVIDER_PREFIX_RE.test(withoutProviderPrefix)) withoutProviderPrefix = withoutProviderPrefix.replace(FEISHU_PROVIDER_PREFIX_RE, "").trim();
947
- if (withoutProviderPrefix === "*") return "*";
948
- const lowered = normalizeOptionalLowercaseString(withoutProviderPrefix) ?? "";
949
- if (!lowered) return "";
950
- const prefixed = lowered.match(FEISHU_TYPED_PREFIX_RE);
951
- if (prefixed?.[1]) {
952
- const kind = [
953
- "chat",
954
- "group",
955
- "channel"
956
- ].includes(prefixed[1]) ? "chat" : "user";
957
- const value = withoutProviderPrefix.slice(prefixed[0].length).trim();
958
- return value === "*" ? "*" : value ? `${kind}:${value}` : "";
1016
+ //#region extensions/feishu/src/presentation-card.ts
1017
+ const FEISHU_CARD_MAX_BYTES = 30 * 1024;
1018
+ const FEISHU_CARD_MAX_ELEMENTS = 200;
1019
+ function countFeishuCardElements(value, ancestors = /* @__PURE__ */ new Set()) {
1020
+ if (Array.isArray(value)) return value.reduce((count, entry) => count + countFeishuCardElements(entry, ancestors), 0);
1021
+ if (!value || typeof value !== "object") return 0;
1022
+ if (ancestors.has(value)) return 201;
1023
+ ancestors.add(value);
1024
+ const record = value;
1025
+ let count = typeof record.tag === "string" ? 1 : 0;
1026
+ for (const entry of Object.values(record)) {
1027
+ count += countFeishuCardElements(entry, ancestors);
1028
+ if (count > FEISHU_CARD_MAX_ELEMENTS) break;
959
1029
  }
960
- const detectedType = detectIdType(withoutProviderPrefix);
961
- if (detectedType === "chat_id") return `chat:${withoutProviderPrefix}`;
962
- if (detectedType === "open_id" || detectedType === "user_id") return `user:${withoutProviderPrefix}`;
963
- return "";
964
- }
965
- function normalizeFeishuDmPolicy(policy) {
966
- return policy === "open" || policy === "pairing" || policy === "allowlist" || policy === "disabled" ? policy : "pairing";
967
- }
968
- function normalizeFeishuGroupPolicy(policy) {
969
- return policy === "allowall" ? "open" : policy;
970
- }
971
- function createFeishuIngressSubject(params) {
972
- const ids = [params.primaryId, ...params.alternateIds ?? []].map((value) => value?.trim()).filter((value) => Boolean(value));
973
- return {
974
- stableId: ids[0],
975
- aliases: { "feishu-alt-id": ids[1] }
976
- };
977
- }
978
- function createFeishuIngressResolver(params) {
979
- return createChannelIngressResolver({
980
- channelId: "feishu",
981
- accountId: normalizeAccountId(params.accountId) ?? "default",
982
- identity: feishuIngressIdentity,
983
- cfg: params.cfg,
984
- ...params.readAllowFromStore ? { readStoreAllowFrom: params.readAllowFromStore } : {}
985
- });
986
- }
987
- async function resolveFeishuDmIngressAccess(params) {
988
- return await createFeishuIngressResolver({
989
- cfg: params.cfg,
990
- accountId: params.accountId,
991
- readAllowFromStore: params.readAllowFromStore
992
- }).message({
993
- subject: createFeishuIngressSubject({
994
- primaryId: params.senderOpenId,
995
- alternateIds: [params.senderUserId]
996
- }),
997
- conversation: {
998
- kind: "direct",
999
- id: params.conversationId
1000
- },
1001
- event: { mayPair: params.mayPair },
1002
- dmPolicy: normalizeFeishuDmPolicy(params.dmPolicy),
1003
- groupPolicy: "disabled",
1004
- allowFrom: params.allowFrom ?? [],
1005
- ...params.command ? { command: params.command } : {}
1006
- });
1007
- }
1008
- async function resolveFeishuGroupConversationIngressAccess(params) {
1009
- const groupPolicy = normalizeFeishuGroupPolicy(params.groupPolicy);
1010
- const groupAllowFrom = groupPolicy === "allowlist" && params.groupExplicitlyConfigured ? [...params.groupAllowFrom ?? [], params.chatId] : params.groupAllowFrom ?? [];
1011
- return await createFeishuIngressResolver({
1012
- cfg: params.cfg,
1013
- accountId: params.accountId
1014
- }).message({
1015
- subject: createFeishuIngressSubject({ primaryId: params.chatId }),
1016
- conversation: {
1017
- kind: "group",
1018
- id: params.chatId
1019
- },
1020
- dmPolicy: "disabled",
1021
- groupPolicy,
1022
- groupAllowFrom
1023
- });
1024
- }
1025
- async function resolveFeishuGroupSenderActivationIngressAccess(params) {
1026
- const groupAllowFrom = params.allowFrom ?? [];
1027
- return await createFeishuIngressResolver({
1028
- cfg: params.cfg,
1029
- accountId: params.accountId
1030
- }).message({
1031
- subject: createFeishuIngressSubject({
1032
- primaryId: params.senderOpenId,
1033
- alternateIds: [params.senderUserId]
1034
- }),
1035
- conversation: {
1036
- kind: "group",
1037
- id: params.chatId
1038
- },
1039
- dmPolicy: "disabled",
1040
- groupPolicy: groupAllowFrom.length > 0 ? "allowlist" : "open",
1041
- groupAllowFrom,
1042
- mentionFacts: {
1043
- canDetectMention: true,
1044
- wasMentioned: params.mentionedBot
1045
- },
1046
- policy: { activation: {
1047
- requireMention: params.requireMention,
1048
- allowTextCommands: false
1049
- } },
1050
- ...params.command ? { command: params.command } : {}
1051
- });
1030
+ ancestors.delete(value);
1031
+ return count;
1052
1032
  }
1053
- function resolveFeishuGroupConfig(params) {
1054
- const groups = params.cfg?.groups ?? {};
1055
- const wildcard = groups["*"];
1056
- const groupId = params.groupId?.trim();
1057
- if (!groupId) return;
1058
- const direct = groups[groupId];
1059
- if (direct) return direct;
1060
- const lowered = normalizeOptionalLowercaseString(groupId) ?? "";
1061
- const matchKey = Object.keys(groups).find((key) => normalizeOptionalLowercaseString(key) === lowered);
1062
- if (matchKey) return groups[matchKey];
1063
- return wildcard;
1064
- }
1065
- function hasExplicitFeishuGroupConfig(params) {
1066
- const groups = params.cfg?.groups ?? {};
1067
- const groupId = params.groupId?.trim();
1068
- if (!groupId) return false;
1069
- if (Object.hasOwn(groups, groupId) && groupId !== "*") return true;
1070
- const lowered = normalizeOptionalLowercaseString(groupId) ?? "";
1071
- return Object.keys(groups).some((key) => key !== "*" && normalizeOptionalLowercaseString(key) === lowered);
1072
- }
1073
- function resolveFeishuGroupToolPolicy(params) {
1074
- const cfg = params.cfg.channels?.feishu;
1075
- if (!cfg) return;
1076
- return resolveFeishuGroupConfig({
1077
- cfg,
1078
- groupId: params.groupId
1079
- })?.tools;
1033
+ function isFeishuCardWithinEnvelope(card) {
1034
+ try {
1035
+ return Buffer.byteLength(JSON.stringify(card), "utf8") <= FEISHU_CARD_MAX_BYTES && countFeishuCardElements(card) <= FEISHU_CARD_MAX_ELEMENTS;
1036
+ } catch {
1037
+ return false;
1038
+ }
1080
1039
  }
1081
- function resolveFeishuReplyPolicy(params) {
1082
- if (params.isDirectMessage) return { requireMention: false };
1083
- const feishuCfg = params.cfg.channels?.feishu;
1084
- const resolvedCfg = resolveMergedAccountConfig({
1085
- channelConfig: feishuCfg,
1086
- accounts: feishuCfg?.accounts,
1087
- accountId: normalizeAccountId(params.accountId),
1088
- normalizeAccountId,
1089
- omitKeys: ["defaultAccount"]
1090
- });
1091
- const groupRequireMention = resolveFeishuGroupConfig({
1092
- cfg: resolvedCfg,
1093
- groupId: params.groupId
1094
- })?.requireMention;
1095
- return { requireMention: typeof groupRequireMention === "boolean" ? groupRequireMention : typeof resolvedCfg.requireMention === "boolean" ? resolvedCfg.requireMention : params.groupPolicy !== "open" };
1040
+ function assertFeishuCardWithinEnvelope(card, label = "Feishu card") {
1041
+ if (!isFeishuCardWithinEnvelope(card)) throw new Error(`${label} exceeds the 30 KB or 200-element API limit.`);
1096
1042
  }
1097
- //#endregion
1098
- //#region extensions/feishu/src/presentation-card.ts
1099
1043
  function escapeFeishuCardMarkdownText(text) {
1100
1044
  return text.replace(/[&<>]/g, (char) => {
1101
1045
  switch (char) {
@@ -1117,11 +1061,13 @@ function resolveSafeFeishuButtonUrl(url) {
1117
1061
  }
1118
1062
  }
1119
1063
  function resolveFeishuButtonUrl(button) {
1064
+ if (button.action?.type === "url" || button.action?.type === "web-app") return button.action.url;
1065
+ if (button.action) return;
1120
1066
  return button.url ?? button.webApp?.url ?? button.web_app?.url;
1121
1067
  }
1122
1068
  function resolveFeishuCommandButtonValue(button) {
1123
- if (button.action?.type === "callback") return;
1124
1069
  if (button.action?.type === "command") return button.action.command;
1070
+ if (button.action) return;
1125
1071
  return button.value;
1126
1072
  }
1127
1073
  function mapFeishuButtonType(style) {
@@ -1171,6 +1117,14 @@ function buildFeishuCardElementsForBlock(block) {
1171
1117
  }];
1172
1118
  if (block.type === "divider") return [{ tag: "hr" }];
1173
1119
  if (block.type === "buttons") return block.buttons.map((button) => buildFeishuPayloadButton(button)).filter((button) => Boolean(button));
1120
+ if (block.type === "chart") return [{
1121
+ tag: "markdown",
1122
+ content: escapeFeishuCardMarkdownText(renderMessagePresentationChartFallbackText(block))
1123
+ }];
1124
+ if (block.type === "table") return [{
1125
+ tag: "markdown",
1126
+ content: escapeFeishuCardMarkdownText(renderMessagePresentationTableFallbackText(block))
1127
+ }];
1174
1128
  const labels = block.options.map((option) => `- ${option.label}`).join("\n");
1175
1129
  return [{
1176
1130
  tag: "markdown",
@@ -1454,7 +1408,7 @@ async function promptFeishuSetupMethod(prompter) {
1454
1408
  initialValue: "manual"
1455
1409
  });
1456
1410
  }
1457
- async function runScanToCreate(prompter, domain) {
1411
+ async function runScanToCreate(prompter, domain, beforePersistentEffect) {
1458
1412
  const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await loadAppRegistrationModule();
1459
1413
  try {
1460
1414
  await initAppRegistration(domain);
@@ -1462,6 +1416,7 @@ async function runScanToCreate(prompter, domain) {
1462
1416
  await prompter.note(t("wizard.feishu.scanUnavailable"), t("wizard.feishu.setupTitle"));
1463
1417
  return null;
1464
1418
  }
1419
+ await beforePersistentEffect?.();
1465
1420
  const begin = await beginAppRegistration(domain);
1466
1421
  await prompter.note(t("wizard.feishu.scanQr"), t("wizard.feishu.scanTitle"));
1467
1422
  await printQrCode(begin.qrUrl);
@@ -1508,7 +1463,7 @@ async function runNewAppFlow(params) {
1508
1463
  initialValue: currentDomain
1509
1464
  });
1510
1465
  scanDomain = selectedDomain;
1511
- const scanResult = setupMethod === "scan" ? await runScanToCreate(prompter, selectedDomain) : null;
1466
+ const scanResult = setupMethod === "scan" ? await runScanToCreate(prompter, selectedDomain, options?.beforePersistentEffect) : null;
1512
1467
  if (scanResult) {
1513
1468
  appId = scanResult.appId;
1514
1469
  appSecret = scanResult.appSecret;
@@ -1651,7 +1606,7 @@ const feishuSetupWizard = {
1651
1606
  });
1652
1607
  let probeResult = null;
1653
1608
  if (configured && account.configured) try {
1654
- const { probeFeishu } = await import("./probe-Dxyo9zlw.js").then((n) => n.n);
1609
+ const { probeFeishu } = await import("./probe-CAloGqgG.js").then((n) => n.n);
1655
1610
  probeResult = await probeFeishu(account);
1656
1611
  } catch {}
1657
1612
  if (!configured) return [formatFeishuStatusLine("needs-credentials")];
@@ -1727,7 +1682,7 @@ const meta = {
1727
1682
  order: 70,
1728
1683
  preferSessionLookupForAnnounceTarget: true
1729
1684
  };
1730
- const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-pvr-Y5ji.js"), "feishuChannelRuntime");
1685
+ const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DJ_B-bpG.js"), "feishuChannelRuntime");
1731
1686
  function toFeishuMessageSendResult(result, kind) {
1732
1687
  const receipt = result.receipt ?? createFeishuSendReceipt({
1733
1688
  messageId: result.messageId,
@@ -1771,9 +1726,22 @@ const feishuMessageAdapter = defineChannelMessageAdapter({
1771
1726
  }
1772
1727
  });
1773
1728
  async function createFeishuActionClient(account) {
1774
- const { createFeishuClient } = await import("./client-B7EAV_Ss.js").then((n) => n.t);
1729
+ const { createFeishuClient } = await import("./client-BUC-R2Wi.js").then((n) => n.t);
1775
1730
  return createFeishuClient(account);
1776
1731
  }
1732
+ async function resolveFeishuChatTypeById(params) {
1733
+ const client = await createFeishuActionClient(params.account);
1734
+ return resolveFeishuChatType(await params.runtime.getChatInfo(client, params.chatId));
1735
+ }
1736
+ async function resolveFeishuMessageChatType(params) {
1737
+ const knownChatType = normalizeFeishuChatType(params.message.chatType);
1738
+ if (knownChatType) return knownChatType;
1739
+ return resolveFeishuChatTypeById({
1740
+ account: params.account,
1741
+ chatId: params.message.chatId,
1742
+ runtime: params.runtime
1743
+ });
1744
+ }
1777
1745
  const collectFeishuSecurityWarnings = createAllowlistProviderGroupPolicyWarningCollector({
1778
1746
  providerConfigPresent: (cfg) => cfg.channels?.feishu !== void 0,
1779
1747
  resolveGroupPolicy: ({ cfg, accountId }) => resolveFeishuAccount({
@@ -2017,6 +1985,119 @@ function resolveFeishuMessageId(params) {
2017
1985
  "reply_to"
2018
1986
  ]);
2019
1987
  }
1988
+ function resolveFeishuMessageReadTarget(ctx) {
1989
+ const explicitChatId = resolveFeishuChatId({ params: ctx.params });
1990
+ const currentChatId = resolveFeishuChatId({
1991
+ params: {},
1992
+ toolContext: ctx.toolContext
1993
+ });
1994
+ const chatId = explicitChatId ?? currentChatId;
1995
+ if (!chatId) return;
1996
+ const normalizedChatId = normalizeFeishuTarget(chatId) ?? chatId.trim();
1997
+ if (normalizedChatId !== (currentChatId ? normalizeFeishuTarget(currentChatId) ?? currentChatId.trim() : void 0)) return { chatId: normalizedChatId };
1998
+ return {
1999
+ chatId: normalizedChatId,
2000
+ chatType: ctx.toolContext?.currentChatType === "direct" ? "p2p" : ctx.toolContext?.currentChatType === "group" || ctx.toolContext?.currentChatType === "channel" ? "group" : void 0
2001
+ };
2002
+ }
2003
+ function assertFeishuMessageMatchesReadTarget(params) {
2004
+ if ((normalizeFeishuTarget(params.messageChatId) ?? params.messageChatId.trim()) !== params.authorizedChatId) throw new ToolAuthorizationError("Feishu message target is not allowed.");
2005
+ }
2006
+ async function authorizeFeishuMessageReadTarget(params) {
2007
+ const authorize = (chatType) => assertFeishuChatReadAllowed({
2008
+ cfg: params.ctx.cfg,
2009
+ account: params.account,
2010
+ chatId: params.target.chatId,
2011
+ chatType,
2012
+ ctx: params.ctx
2013
+ });
2014
+ if (params.target.chatType) return authorize(params.target.chatType);
2015
+ const preliminary = resolveFeishuChatReadPreliminaryAuthorization({
2016
+ cfg: params.ctx.cfg,
2017
+ account: params.account,
2018
+ chatId: params.target.chatId,
2019
+ ctx: params.ctx
2020
+ });
2021
+ if (preliminary.decision === "allow") return preliminary.chatId;
2022
+ if (preliminary.decision === "deny") throw new ToolAuthorizationError("Feishu read target is not allowed.");
2023
+ await getAuthorizedFeishuChatInfo({
2024
+ ctx: params.ctx,
2025
+ account: params.account,
2026
+ runtime: params.runtime,
2027
+ chatId: params.target.chatId
2028
+ });
2029
+ return preliminary.chatId;
2030
+ }
2031
+ async function getAuthorizedFeishuChatInfo(params) {
2032
+ const preliminary = resolveFeishuChatReadPreliminaryAuthorization({
2033
+ cfg: params.ctx.cfg,
2034
+ account: params.account,
2035
+ chatId: params.chatId,
2036
+ ctx: params.ctx
2037
+ });
2038
+ if (preliminary.decision === "deny") throw new ToolAuthorizationError("Feishu read target is not allowed.");
2039
+ const client = await createFeishuActionClient(params.account);
2040
+ let chat;
2041
+ try {
2042
+ chat = await params.runtime.getChatInfo(client, preliminary.chatId);
2043
+ } catch (error) {
2044
+ if (preliminary.decision === "needs-metadata") assertFeishuChatReadAllowed({
2045
+ cfg: params.ctx.cfg,
2046
+ account: params.account,
2047
+ chatId: preliminary.chatId,
2048
+ ctx: params.ctx
2049
+ });
2050
+ throw error;
2051
+ }
2052
+ assertFeishuChatReadAllowed({
2053
+ cfg: params.ctx.cfg,
2054
+ account: params.account,
2055
+ chatId: preliminary.chatId,
2056
+ chatType: resolveFeishuChatType(chat),
2057
+ ctx: params.ctx
2058
+ });
2059
+ return {
2060
+ chat,
2061
+ client
2062
+ };
2063
+ }
2064
+ async function getAuthorizedFeishuMessage(params) {
2065
+ const target = resolveFeishuMessageReadTarget(params.ctx);
2066
+ if (!target && params.ctx.conversationReadOrigin !== "direct-operator") throw new ToolAuthorizationError("Feishu message reads require a chat target or current conversation.");
2067
+ const authorizedChatId = target ? await authorizeFeishuMessageReadTarget({
2068
+ ctx: params.ctx,
2069
+ account: params.account,
2070
+ runtime: params.runtime,
2071
+ target
2072
+ }) : void 0;
2073
+ const message = await params.runtime.getMessageFeishu({
2074
+ cfg: params.ctx.cfg,
2075
+ messageId: params.messageId,
2076
+ accountId: params.ctx.accountId ?? void 0
2077
+ });
2078
+ if (!message) return null;
2079
+ if (authorizedChatId) assertFeishuMessageMatchesReadTarget({
2080
+ authorizedChatId,
2081
+ messageChatId: message.chatId
2082
+ });
2083
+ assertFeishuChatReadAllowed({
2084
+ cfg: params.ctx.cfg,
2085
+ account: params.account,
2086
+ chatId: message.chatId,
2087
+ chatType: await resolveFeishuMessageChatType({
2088
+ account: params.account,
2089
+ message,
2090
+ runtime: params.runtime
2091
+ }),
2092
+ ctx: params.ctx
2093
+ });
2094
+ return message;
2095
+ }
2096
+ async function requireAuthorizedFeishuMessage(params) {
2097
+ const message = await getAuthorizedFeishuMessage(params);
2098
+ if (!message) throw new Error(`Feishu message not found: ${params.messageId}`);
2099
+ return message;
2100
+ }
2020
2101
  function resolveFeishuMemberId(params) {
2021
2102
  return readFirstString(params, [
2022
2103
  "memberId",
@@ -2030,6 +2111,9 @@ function resolveFeishuMemberId(params) {
2030
2111
  ]);
2031
2112
  }
2032
2113
  function resolveFeishuMemberIdType(params) {
2114
+ return resolveRequestedFeishuMemberIdType(params) ?? "open_id";
2115
+ }
2116
+ function resolveRequestedFeishuMemberIdType(params) {
2033
2117
  const raw = readFirstString(params, [
2034
2118
  "memberIdType",
2035
2119
  "member_id_type",
@@ -2044,7 +2128,7 @@ function resolveFeishuMemberIdType(params) {
2044
2128
  "union_id"
2045
2129
  ])) return "user_id";
2046
2130
  if (readFirstString(params, ["unionId", "union_id"]) && !readFirstString(params, ["openId", "open_id"])) return "union_id";
2047
- return "open_id";
2131
+ if (readFirstString(params, ["openId", "open_id"])) return "open_id";
2048
2132
  }
2049
2133
  const feishuPlugin = createChatChannelPlugin({
2050
2134
  base: {
@@ -2076,7 +2160,7 @@ const feishuPlugin = createChatChannelPlugin({
2076
2160
  mentions: { stripPatterns: () => ["<at user_id=\"[^\"]*\">[^<]*</at>"] },
2077
2161
  reload: { configPrefixes: ["channels.feishu"] },
2078
2162
  doctor: feishuDoctor,
2079
- configSchema: buildChannelConfigSchema(FeishuConfigSchema),
2163
+ configSchema: FeishuChannelConfigSchema,
2080
2164
  config: {
2081
2165
  ...feishuConfigAdapter,
2082
2166
  setAccountEnabled: ({ cfg, accountId, enabled }) => {
@@ -2153,21 +2237,44 @@ const feishuPlugin = createChatChannelPlugin({
2153
2237
  const presentation = normalizeMessagePresentation(ctx.params.presentation) ?? (interactive ? interactiveReplyToPresentation(interactive) : void 0);
2154
2238
  const mediaUrl = readFeishuMediaParam(ctx.params);
2155
2239
  const audioAsVoice = readBooleanParam(ctx.params, ["asVoice", "audioAsVoice"]);
2156
- const card = presentation ? buildFeishuPresentationCard({
2240
+ if (textCard && !presentation) assertFeishuCardWithinEnvelope(textCard, "Feishu native card");
2241
+ const generatedCard = presentation ? buildFeishuPresentationCard({
2157
2242
  presentation,
2158
2243
  fallbackText: textCard ? void 0 : resolveInteractiveTextFallback({
2159
2244
  text,
2160
2245
  interactive
2161
2246
  })
2162
- }) : textCard;
2247
+ }) : void 0;
2248
+ const presentationCard = generatedCard && isFeishuCardWithinEnvelope(generatedCard) ? generatedCard : void 0;
2249
+ const presentationFellBack = Boolean(generatedCard && !presentationCard);
2250
+ const card = presentation ? presentationCard : textCard;
2163
2251
  if (card && mediaUrl) throw new Error(`Feishu ${ctx.action} does not support card with media.`);
2164
- if (!card && !text && !mediaUrl) throw new Error(`Feishu ${ctx.action} requires text/message, media, or card.`);
2252
+ if (!card && !text && !mediaUrl && !presentationFellBack) throw new Error(`Feishu ${ctx.action} requires text/message, media, or card.`);
2165
2253
  const runtime = await loadFeishuChannelRuntime();
2166
2254
  const maybeSendMedia = runtime.feishuOutbound.sendMedia;
2167
2255
  if (mediaUrl && !maybeSendMedia) throw new Error("Feishu media sending is not available.");
2168
2256
  const sendMedia = maybeSendMedia;
2169
2257
  let result;
2170
- if (card) {
2258
+ if (presentationFellBack && presentation) {
2259
+ const sendPayload = runtime.feishuOutbound.sendPayload;
2260
+ if (!sendPayload) throw new Error("Feishu presentation fallback delivery is not available.");
2261
+ const fallbackText = textCard ? void 0 : text;
2262
+ result = await sendPayload({
2263
+ cfg: ctx.cfg,
2264
+ to,
2265
+ text: fallbackText ?? "",
2266
+ payload: {
2267
+ text: fallbackText,
2268
+ presentation,
2269
+ ...mediaUrl ? { mediaUrl } : {},
2270
+ ...audioAsVoice === void 0 ? {} : { audioAsVoice }
2271
+ },
2272
+ accountId: ctx.accountId ?? void 0,
2273
+ mediaLocalRoots: ctx.mediaLocalRoots,
2274
+ ...replyInThread ? { threadId: replyToMessageId } : { replyToId: replyToMessageId },
2275
+ ...audioAsVoice === void 0 ? {} : { audioAsVoice }
2276
+ });
2277
+ } else if (card) {
2171
2278
  if (containsLegacyFeishuCardCommandValue(card)) throw new Error("Feishu card buttons that trigger text or commands must use structured interaction envelopes.");
2172
2279
  result = await runtime.sendCardFeishu({
2173
2280
  cfg: ctx.cfg,
@@ -2205,11 +2312,11 @@ const feishuPlugin = createChatChannelPlugin({
2205
2312
  if (ctx.action === "read") {
2206
2313
  const messageId = resolveFeishuMessageId(ctx.params);
2207
2314
  if (!messageId) throw new Error("Feishu read requires messageId.");
2208
- const { getMessageFeishu } = await loadFeishuChannelRuntime();
2209
- const message = await getMessageFeishu({
2210
- cfg: ctx.cfg,
2211
- messageId,
2212
- accountId: ctx.accountId ?? void 0
2315
+ const message = await getAuthorizedFeishuMessage({
2316
+ ctx,
2317
+ account,
2318
+ runtime: await loadFeishuChannelRuntime(),
2319
+ messageId
2213
2320
  });
2214
2321
  if (!message) return {
2215
2322
  isError: true,
@@ -2231,12 +2338,18 @@ const feishuPlugin = createChatChannelPlugin({
2231
2338
  if (!messageId) throw new Error("Feishu edit requires messageId.");
2232
2339
  const text = readFirstString(ctx.params, ["text", "message"]);
2233
2340
  const card = ctx.params.card && typeof ctx.params.card === "object" ? ctx.params.card : void 0;
2234
- const { editMessageFeishu } = await loadFeishuChannelRuntime();
2341
+ const runtime = await loadFeishuChannelRuntime();
2342
+ await requireAuthorizedFeishuMessage({
2343
+ ctx,
2344
+ account,
2345
+ runtime,
2346
+ messageId
2347
+ });
2235
2348
  return jsonActionResult({
2236
2349
  ok: true,
2237
2350
  channel: "feishu",
2238
2351
  action: "edit",
2239
- ...await editMessageFeishu({
2352
+ ...await runtime.editMessageFeishu({
2240
2353
  cfg: ctx.cfg,
2241
2354
  messageId,
2242
2355
  text,
@@ -2248,12 +2361,18 @@ const feishuPlugin = createChatChannelPlugin({
2248
2361
  if (ctx.action === "pin") {
2249
2362
  const messageId = resolveFeishuMessageId(ctx.params);
2250
2363
  if (!messageId) throw new Error("Feishu pin requires messageId.");
2251
- const { createPinFeishu } = await loadFeishuChannelRuntime();
2364
+ const runtime = await loadFeishuChannelRuntime();
2365
+ await requireAuthorizedFeishuMessage({
2366
+ ctx,
2367
+ account,
2368
+ runtime,
2369
+ messageId
2370
+ });
2252
2371
  return jsonActionResult({
2253
2372
  ok: true,
2254
2373
  channel: "feishu",
2255
2374
  action: "pin",
2256
- pin: await createPinFeishu({
2375
+ pin: await runtime.createPinFeishu({
2257
2376
  cfg: ctx.cfg,
2258
2377
  messageId,
2259
2378
  accountId: ctx.accountId ?? void 0
@@ -2263,8 +2382,14 @@ const feishuPlugin = createChatChannelPlugin({
2263
2382
  if (ctx.action === "unpin") {
2264
2383
  const messageId = resolveFeishuMessageId(ctx.params);
2265
2384
  if (!messageId) throw new Error("Feishu unpin requires messageId.");
2266
- const { removePinFeishu } = await loadFeishuChannelRuntime();
2267
- await removePinFeishu({
2385
+ const runtime = await loadFeishuChannelRuntime();
2386
+ await requireAuthorizedFeishuMessage({
2387
+ ctx,
2388
+ account,
2389
+ runtime,
2390
+ messageId
2391
+ });
2392
+ await runtime.removePinFeishu({
2268
2393
  cfg: ctx.cfg,
2269
2394
  messageId,
2270
2395
  accountId: ctx.accountId ?? void 0
@@ -2279,7 +2404,14 @@ const feishuPlugin = createChatChannelPlugin({
2279
2404
  if (ctx.action === "list-pins") {
2280
2405
  const chatId = resolveFeishuChatId(ctx);
2281
2406
  if (!chatId) throw new Error("Feishu list-pins requires chatId or channelId.");
2282
- const { listPinsFeishu } = await loadFeishuChannelRuntime();
2407
+ const runtime = await loadFeishuChannelRuntime();
2408
+ await getAuthorizedFeishuChatInfo({
2409
+ ctx,
2410
+ account,
2411
+ runtime,
2412
+ chatId
2413
+ });
2414
+ const { listPinsFeishu } = runtime;
2283
2415
  return jsonActionResult({
2284
2416
  ok: true,
2285
2417
  channel: "feishu",
@@ -2299,39 +2431,97 @@ const feishuPlugin = createChatChannelPlugin({
2299
2431
  const chatId = resolveFeishuChatId(ctx);
2300
2432
  if (!chatId) throw new Error("Feishu channel-info requires chatId or channelId.");
2301
2433
  const runtime = await loadFeishuChannelRuntime();
2302
- const client = await createFeishuActionClient(account);
2303
- const channel = await runtime.getChatInfo(client, chatId);
2434
+ const { chat: channel, client } = await getAuthorizedFeishuChatInfo({
2435
+ ctx,
2436
+ account,
2437
+ runtime,
2438
+ chatId
2439
+ });
2440
+ const chatType = resolveFeishuChatType(channel);
2304
2441
  if (!(ctx.params.includeMembers === true || ctx.params.members === true)) return jsonActionResult({
2305
2442
  ok: true,
2306
2443
  provider: "feishu",
2307
2444
  action: "channel-info",
2308
2445
  channel
2309
2446
  });
2447
+ const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
2448
+ const authorization = authorizeFeishuChatMemberRead({
2449
+ cfg: ctx.cfg,
2450
+ account,
2451
+ chatId,
2452
+ chatType,
2453
+ ctx,
2454
+ memberIdType: requestedMemberIdType
2455
+ });
2310
2456
  return jsonActionResult({
2311
2457
  ok: true,
2312
2458
  provider: "feishu",
2313
2459
  action: "channel-info",
2314
2460
  channel,
2315
- members: await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
2461
+ members: authorization.kind === "direct" ? runtime.buildFeishuDirectChatMembers(authorization) : await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
2316
2462
  });
2317
2463
  }
2318
2464
  if (ctx.action === "member-info") {
2319
2465
  const runtime = await loadFeishuChannelRuntime();
2320
- const client = await createFeishuActionClient(account);
2321
2466
  const memberId = resolveFeishuMemberId(ctx.params);
2322
- if (memberId) return jsonActionResult({
2323
- ok: true,
2324
- channel: "feishu",
2325
- action: "member-info",
2326
- member: await runtime.getFeishuMemberInfo(client, memberId, resolveFeishuMemberIdType(ctx.params))
2327
- });
2467
+ if (memberId) {
2468
+ const chatId = resolveFeishuChatId(ctx);
2469
+ if (!chatId) throw new Error("Feishu member-info requires chatId or channelId when memberId is provided.");
2470
+ const { chat, client } = await getAuthorizedFeishuChatInfo({
2471
+ ctx,
2472
+ account,
2473
+ runtime,
2474
+ chatId
2475
+ });
2476
+ const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
2477
+ const memberIdType = resolveFeishuMemberIdType(ctx.params);
2478
+ const authorization = authorizeFeishuChatMemberRead({
2479
+ cfg: ctx.cfg,
2480
+ account,
2481
+ chatId,
2482
+ chatType: resolveFeishuChatType(chat),
2483
+ ctx,
2484
+ memberId,
2485
+ memberIdType: requestedMemberIdType
2486
+ });
2487
+ if (authorization.kind === "group") {
2488
+ await runtime.assertFeishuChatMember(client, chatId, memberId, memberIdType);
2489
+ return jsonActionResult({
2490
+ ok: true,
2491
+ channel: "feishu",
2492
+ action: "member-info",
2493
+ member: await runtime.getFeishuMemberInfo(client, memberId, memberIdType)
2494
+ });
2495
+ }
2496
+ return jsonActionResult({
2497
+ ok: true,
2498
+ channel: "feishu",
2499
+ action: "member-info",
2500
+ member: await runtime.getFeishuMemberInfo(client, authorization.memberId, authorization.memberIdType)
2501
+ });
2502
+ }
2328
2503
  const chatId = resolveFeishuChatId(ctx);
2329
2504
  if (!chatId) throw new Error("Feishu member-info requires memberId or chatId/channelId.");
2505
+ const { chat, client } = await getAuthorizedFeishuChatInfo({
2506
+ ctx,
2507
+ account,
2508
+ runtime,
2509
+ chatId
2510
+ });
2511
+ const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
2512
+ const authorization = authorizeFeishuChatMemberRead({
2513
+ cfg: ctx.cfg,
2514
+ account,
2515
+ chatId,
2516
+ chatType: resolveFeishuChatType(chat),
2517
+ ctx,
2518
+ memberIdType: requestedMemberIdType
2519
+ });
2330
2520
  return jsonActionResult({
2331
2521
  ok: true,
2332
2522
  channel: "feishu",
2333
2523
  action: "member-info",
2334
- ...await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
2524
+ ...authorization.kind === "direct" ? runtime.buildFeishuDirectChatMembers(authorization) : await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
2335
2525
  });
2336
2526
  }
2337
2527
  if (ctx.action === "channel-list") {
@@ -2339,43 +2529,33 @@ const feishuPlugin = createChatChannelPlugin({
2339
2529
  const query = readFirstString(ctx.params, ["query"]);
2340
2530
  const limit = readOptionalPositiveInteger(ctx.params, ["limit"]);
2341
2531
  const scope = readFirstString(ctx.params, ["scope", "kind"]) ?? "all";
2532
+ const directOperator = ctx.conversationReadOrigin === "direct-operator";
2533
+ const listGroups = directOperator || canEnumerateAllFeishuGroups(ctx.cfg, account) ? runtime.listFeishuDirectoryGroupsLive : listAuthorizedFeishuDirectoryGroups;
2534
+ const listPeers = directOperator || canEnumerateAllFeishuPeers(account) ? runtime.listFeishuDirectoryPeersLive : listAuthorizedFeishuDirectoryPeers;
2535
+ const directoryParams = {
2536
+ cfg: ctx.cfg,
2537
+ query,
2538
+ limit,
2539
+ accountId: ctx.accountId ?? void 0,
2540
+ fallbackToStatic: false
2541
+ };
2542
+ const groupDirectoryParams = {
2543
+ ...directoryParams,
2544
+ filter: directOperator ? (group) => isFeishuGroupReadEnabled(ctx.cfg, account, group.id) : canEnumerateAllFeishuGroups(ctx.cfg, account) ? (group) => isFeishuGroupReadAllowed(ctx.cfg, account, group.id, false) : void 0
2545
+ };
2342
2546
  if (scope === "groups" || scope === "group" || scope === "channels" || scope === "channel") return jsonActionResult({
2343
2547
  ok: true,
2344
2548
  channel: "feishu",
2345
2549
  action: "channel-list",
2346
- groups: await runtime.listFeishuDirectoryGroupsLive({
2347
- cfg: ctx.cfg,
2348
- query,
2349
- limit,
2350
- fallbackToStatic: false,
2351
- accountId: ctx.accountId ?? void 0
2352
- })
2550
+ groups: await listGroups(groupDirectoryParams)
2353
2551
  });
2354
2552
  if (scope === "peers" || scope === "peer" || scope === "members" || scope === "member" || scope === "users" || scope === "user") return jsonActionResult({
2355
2553
  ok: true,
2356
2554
  channel: "feishu",
2357
2555
  action: "channel-list",
2358
- peers: await runtime.listFeishuDirectoryPeersLive({
2359
- cfg: ctx.cfg,
2360
- query,
2361
- limit,
2362
- fallbackToStatic: false,
2363
- accountId: ctx.accountId ?? void 0
2364
- })
2556
+ peers: await listPeers(directoryParams)
2365
2557
  });
2366
- const [groups, peers] = await Promise.all([runtime.listFeishuDirectoryGroupsLive({
2367
- cfg: ctx.cfg,
2368
- query,
2369
- limit,
2370
- fallbackToStatic: false,
2371
- accountId: ctx.accountId ?? void 0
2372
- }), runtime.listFeishuDirectoryPeersLive({
2373
- cfg: ctx.cfg,
2374
- query,
2375
- limit,
2376
- fallbackToStatic: false,
2377
- accountId: ctx.accountId ?? void 0
2378
- })]);
2558
+ const [groups, peers] = await Promise.all([listGroups(groupDirectoryParams), listPeers(directoryParams)]);
2379
2559
  return jsonActionResult({
2380
2560
  ok: true,
2381
2561
  channel: "feishu",
@@ -2392,18 +2572,24 @@ const feishuPlugin = createChatChannelPlugin({
2392
2572
  const clearAll = ctx.params.clearAll === true;
2393
2573
  if (remove) {
2394
2574
  if (!emoji) throw new Error("Emoji is required to remove a Feishu reaction.");
2395
- const { listReactionsFeishu, removeReactionFeishu } = await loadFeishuChannelRuntime();
2396
- const ownReaction = (await listReactionsFeishu({
2575
+ const runtime = await loadFeishuChannelRuntime();
2576
+ await requireAuthorizedFeishuMessage({
2577
+ ctx,
2578
+ account,
2579
+ runtime,
2580
+ messageId
2581
+ });
2582
+ const ownReaction = (await runtime.listReactionsFeishu({
2397
2583
  cfg: ctx.cfg,
2398
2584
  messageId,
2399
2585
  emojiType: emoji,
2400
2586
  accountId: ctx.accountId ?? void 0
2401
- })).find((entry) => entry.operatorType === "app");
2587
+ })).find((entry) => entry.operatorType === "app" && Boolean(account.appId) && entry.operatorId === account.appId);
2402
2588
  if (!ownReaction) return jsonActionResult({
2403
2589
  ok: true,
2404
2590
  removed: null
2405
2591
  });
2406
- await removeReactionFeishu({
2592
+ await runtime.removeReactionFeishu({
2407
2593
  cfg: ctx.cfg,
2408
2594
  messageId,
2409
2595
  reactionId: ownReaction.reactionId,
@@ -2416,15 +2602,22 @@ const feishuPlugin = createChatChannelPlugin({
2416
2602
  }
2417
2603
  if (!emoji) {
2418
2604
  if (!clearAll) throw new Error("Emoji is required to add a Feishu reaction. Set clearAll=true to remove all bot reactions.");
2419
- const { listReactionsFeishu, removeReactionFeishu } = await loadFeishuChannelRuntime();
2420
- const reactions = await listReactionsFeishu({
2605
+ const runtime = await loadFeishuChannelRuntime();
2606
+ await requireAuthorizedFeishuMessage({
2607
+ ctx,
2608
+ account,
2609
+ runtime,
2610
+ messageId
2611
+ });
2612
+ const reactions = await runtime.listReactionsFeishu({
2421
2613
  cfg: ctx.cfg,
2422
2614
  messageId,
2423
2615
  accountId: ctx.accountId ?? void 0
2424
2616
  });
2425
2617
  let removed = 0;
2426
- for (const reaction of reactions.filter((entry) => entry.operatorType === "app")) {
2427
- await removeReactionFeishu({
2618
+ const ownReactions = reactions.filter((entry) => entry.operatorType === "app" && Boolean(account.appId) && entry.operatorId === account.appId);
2619
+ for (const reaction of ownReactions) {
2620
+ await runtime.removeReactionFeishu({
2428
2621
  cfg: ctx.cfg,
2429
2622
  messageId,
2430
2623
  reactionId: reaction.reactionId,
@@ -2437,8 +2630,14 @@ const feishuPlugin = createChatChannelPlugin({
2437
2630
  removed
2438
2631
  });
2439
2632
  }
2440
- const { addReactionFeishu } = await loadFeishuChannelRuntime();
2441
- await addReactionFeishu({
2633
+ const runtime = await loadFeishuChannelRuntime();
2634
+ await requireAuthorizedFeishuMessage({
2635
+ ctx,
2636
+ account,
2637
+ runtime,
2638
+ messageId
2639
+ });
2640
+ await runtime.addReactionFeishu({
2442
2641
  cfg: ctx.cfg,
2443
2642
  messageId,
2444
2643
  emojiType: emoji,
@@ -2452,10 +2651,16 @@ const feishuPlugin = createChatChannelPlugin({
2452
2651
  if (ctx.action === "reactions") {
2453
2652
  const messageId = resolveFeishuMessageId(ctx.params);
2454
2653
  if (!messageId) throw new Error("Feishu reactions lookup requires messageId.");
2455
- const { listReactionsFeishu } = await loadFeishuChannelRuntime();
2654
+ const runtime = await loadFeishuChannelRuntime();
2655
+ await requireAuthorizedFeishuMessage({
2656
+ ctx,
2657
+ account,
2658
+ runtime,
2659
+ messageId
2660
+ });
2456
2661
  return jsonActionResult({
2457
2662
  ok: true,
2458
- reactions: await listReactionsFeishu({
2663
+ reactions: await runtime.listReactionsFeishu({
2459
2664
  cfg: ctx.cfg,
2460
2665
  messageId,
2461
2666
  accountId: ctx.accountId ?? void 0
@@ -2513,10 +2718,7 @@ const feishuPlugin = createChatChannelPlugin({
2513
2718
  };
2514
2719
  return { to: `chat:${parsed?.chatId ?? conversationId.trim()}` };
2515
2720
  },
2516
- resolveSessionConversation: ({ kind, rawId }) => resolveFeishuSessionConversation({
2517
- kind,
2518
- rawId
2519
- }),
2721
+ resolveSessionConversation: resolveFeishuSessionConversation,
2520
2722
  resolveOutboundSessionRoute: (params) => resolveFeishuOutboundSessionRoute(params),
2521
2723
  targetResolver: {
2522
2724
  looksLikeId: looksLikeFeishuId,
@@ -2569,7 +2771,7 @@ const feishuPlugin = createChatChannelPlugin({
2569
2771
  })
2570
2772
  }),
2571
2773
  gateway: { startAccount: async (ctx) => {
2572
- const { monitorFeishuProvider } = await import("./monitor-CsbheK9J.js");
2774
+ const { monitorFeishuProvider } = await import("./monitor-M3iYtoh4.js");
2573
2775
  const account = resolveFeishuRuntimeAccount({
2574
2776
  cfg: ctx.cfg,
2575
2777
  accountId: ctx.accountId
@@ -2613,9 +2815,16 @@ const feishuPlugin = createChatChannelPlugin({
2613
2815
  });
2614
2816
  }
2615
2817
  } },
2818
+ threading: { buildToolContext: ({ context, hasRepliedRef }) => ({
2819
+ currentChannelId: normalizeOptionalString(context.NativeChannelId) ?? normalizeOptionalString(context.To),
2820
+ currentChatType: context.ChatType === "direct" || context.ChatType === "group" || context.ChatType === "channel" ? context.ChatType : void 0,
2821
+ currentMessagingTarget: normalizeOptionalString(context.To),
2822
+ currentThreadTs: context.MessageThreadId != null ? String(context.MessageThreadId) : void 0,
2823
+ hasRepliedRef
2824
+ }) },
2616
2825
  outbound: {
2617
2826
  deliveryMode: "direct",
2618
- chunker: chunkTextForOutbound,
2827
+ chunker: chunkFeishuMarkdown,
2619
2828
  chunkerMode: "markdown",
2620
2829
  textChunkLimit: 4e3,
2621
2830
  sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text),
@@ -2656,4 +2865,4 @@ const feishuPlugin = createChatChannelPlugin({
2656
2865
  }
2657
2866
  });
2658
2867
  //#endregion
2659
- export { setFeishuNamedAccountEnabled$1 as a, normalizeFeishuAllowEntry as c, resolveFeishuGroupConversationIngressAccess as d, resolveFeishuGroupSenderActivationIngressAccess as f, listFeishuDirectoryPeers as h, feishuSetupAdapter as i, resolveFeishuDmIngressAccess as l, listFeishuDirectoryGroups as m, feishuSetupWizard as n, buildFeishuPresentationCardElements as o, resolveFeishuReplyPolicy as p, runFeishuLogin as r, hasExplicitFeishuGroupConfig as s, feishuPlugin as t, resolveFeishuGroupConfig as u };
2868
+ export { setFeishuNamedAccountEnabled$1 as a, isFeishuCardWithinEnvelope as c, feishuSetupAdapter as i, listFeishuDirectoryGroups as l, feishuSetupWizard as n, assertFeishuCardWithinEnvelope as o, runFeishuLogin as r, buildFeishuPresentationCardElements as s, feishuPlugin as t, listFeishuDirectoryPeers as u };