fengming 0.3.8 → 0.3.9

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 (1263) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/abort-CCR8oZyg.js +277 -0
  3. package/dist/abort.runtime-eqx84NZa.js +2 -0
  4. package/dist/abort.runtime.js +1 -1
  5. package/dist/acp-spawn-BcDyvaXh.js +2 -0
  6. package/dist/acp-spawn-CCtSel-_.js +1286 -0
  7. package/dist/acp-stateful-target-driver-B3pCvuOV.js +89 -0
  8. package/dist/active-tool-schema-warnings-Cf-5q5WU.js +105 -0
  9. package/dist/active-tool-schema-warnings-Dzt3XE-y.js +2 -0
  10. package/dist/agent-1M2dVE2G.js +2 -0
  11. package/dist/agent-DLDIbUT4.js +1825 -0
  12. package/dist/agent-DZi6j3o6.js +3 -0
  13. package/dist/agent-command-ppfDBwET.js +1435 -0
  14. package/dist/agent-harness-runtime-C0bo62eY.d.ts +913 -0
  15. package/dist/agent-harness-runtime-RkTGiliR.js +207 -0
  16. package/dist/agent-runner-utils-B4YeVAO_.js +267 -0
  17. package/dist/agent-runner.runtime-T_3tlZN1.js +3784 -0
  18. package/dist/agent-runner.runtime.js +1 -1
  19. package/dist/agent-runtime-CloshyK-.d.ts +207 -0
  20. package/dist/agent-runtime-DZsmp1xr.js +199 -0
  21. package/dist/agent-tools-CET9usCz.js +2506 -0
  22. package/dist/agent-via-gateway-CZ0X0YkM.js +486 -0
  23. package/dist/agent-wait-dedupe-I81_F2tr.js +180 -0
  24. package/dist/agents/embedded-agent-runner/run/runtime-context-prompt.d.ts +1 -1
  25. package/dist/agents/embedded-agent-runner/tool-split.d.ts +1 -1
  26. package/dist/agents/model-catalog.runtime.d.ts +1 -1
  27. package/dist/api-BDB5xHYj.js +3 -0
  28. package/dist/api-BH7bfI5d.js +6 -0
  29. package/dist/api-BxJNXitd.js +2 -0
  30. package/dist/approval-client-helpers-CfQA9Jzh.d.ts +78 -0
  31. package/dist/approval-native-helpers-B2zyhxWc.d.ts +241 -0
  32. package/dist/approval-renderers-CMqSXyvm.d.ts +39 -0
  33. package/dist/assistant-Cu_Mzzgu.js +291 -0
  34. package/dist/attachment-normalize-Bb3v5iCC.js +213 -0
  35. package/dist/attempt-execution-BskbAq5I.js +584 -0
  36. package/dist/attempt-execution.runtime-BuT1wpNS.js +3 -0
  37. package/dist/attempt-execution.runtime.js +1 -1
  38. package/dist/attempt.prompt-helpers-ByKj-vQ7.js +543 -0
  39. package/dist/auto-reply/reply/commands-crestodian.d.ts +1 -1
  40. package/dist/binding-routing-EGRNvRC4.js +113 -0
  41. package/dist/binding-targets-B9vYS8n6.js +121 -0
  42. package/dist/bridge-server-DG9YtKQe.js +113 -0
  43. package/dist/browser-cli-B0Ou-Nbm.js +2 -0
  44. package/dist/browser-cli-GF25gL6M.js +230 -0
  45. package/dist/browser-cli-actions-input-CuER6RVe.js +522 -0
  46. package/dist/browser-cli-actions-observe-Dq-Zz_FA.js +81 -0
  47. package/dist/browser-cli-debug-7hvb49S1.js +137 -0
  48. package/dist/browser-cli-inspect-WU5KeWOK.js +117 -0
  49. package/dist/browser-cli-manage-B9D9BvSe.js +446 -0
  50. package/dist/browser-cli-resize-BUOusOPb.js +32 -0
  51. package/dist/browser-cli-shared-DmpSN-Qi.js +69 -0
  52. package/dist/browser-cli-state-D_YxTqRw.js +371 -0
  53. package/dist/browser-control-auth-Cqd1n9FA.js +2 -0
  54. package/dist/browser-profiles-9tQ05wYh.js +2 -0
  55. package/dist/browser-runtime-Bbzumoha.js +389 -0
  56. package/dist/build-CBXuT2K1.js +261 -0
  57. package/dist/build-info.json +3 -3
  58. package/dist/bundled/boot-md/handler.js +2 -2
  59. package/dist/bundled/session-memory/handler.js +1 -1
  60. package/dist/bundled-channel-config-schema-DpdKMATU.d.ts +3168 -0
  61. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  62. package/dist/capability-cli-CiVGX7ut.js +1809 -0
  63. package/dist/channel-BIVwHq7P.js +2309 -0
  64. package/dist/channel-CiA2FVdL.d.ts +427 -0
  65. package/dist/channel-core-Cj9JTqeu.js +5 -0
  66. package/dist/channel-core-DjVpcH1C.d.ts +6 -0
  67. package/dist/channel-entry-contract-Bs_54m1D.d.ts +114 -0
  68. package/dist/channel-inbound-CdUdeQRa.js +121 -0
  69. package/dist/channel-inbound-iGiqx6CS.d.ts +97 -0
  70. package/dist/channel-message-C3QPaDUk.js +12 -0
  71. package/dist/channel-message-CXDjxb2U.d.ts +9 -0
  72. package/dist/channel-outbound-ofvvmMSK.d.ts +325 -0
  73. package/dist/channel-pairing-DKscOV1K.d.ts +58 -0
  74. package/dist/channel.runtime-VW6PW_ez.js +697 -0
  75. package/dist/channel.runtime.js +1 -1
  76. package/dist/chat-CFkQepUQ.js +3 -0
  77. package/dist/chat-Czh_tXM0.js +2940 -0
  78. package/dist/chrome-B2cq8YyH.js +1517 -0
  79. package/dist/cli/run-main.js +5 -5
  80. package/dist/cli-compaction-Dxv4nt7R.js +363 -0
  81. package/dist/cli-runner-CimXSTVs.js +2 -0
  82. package/dist/cli-runner-orCzE1Sr.js +597 -0
  83. package/dist/cli-runner.runtime-CsW0dXJW.js +3 -0
  84. package/dist/cli-runner.runtime-DgPrc1do.js +4 -0
  85. package/dist/cli-runner.runtime.js +1 -1
  86. package/dist/cli-startup-metadata.json +10 -12
  87. package/dist/command-registry-C5ooX6PF.js +4 -0
  88. package/dist/command-registry-DMB-HKIk.js +9 -0
  89. package/dist/command-registry-core-B2w_XWvn.js +114 -0
  90. package/dist/command-status.runtime-Bdy3Dkar.js +90 -0
  91. package/dist/command-status.runtime.js +1 -1
  92. package/dist/commands-compact.runtime-Bk2jTQo6.js +10 -0
  93. package/dist/commands-compact.runtime.js +1 -1
  94. package/dist/commands-handlers.runtime-Csw1og0U.js +6327 -0
  95. package/dist/commands-handlers.runtime.js +1 -1
  96. package/dist/commands-mRqmLIVz.d.ts +117 -0
  97. package/dist/commands-status-Dgrj_ubK.js +3 -0
  98. package/dist/commands-status-s32HJOpD.js +16 -0
  99. package/dist/commands-status.runtime-Dgrj_ubK.js +3 -0
  100. package/dist/commands-status.runtime.js +1 -1
  101. package/dist/commands-subagents-control.runtime-C_hnOO9l.js +2 -0
  102. package/dist/commands-subagents-control.runtime.js +1 -1
  103. package/dist/commands-system-prompt-CQV742Cc.js +2 -0
  104. package/dist/commands-system-prompt-DTfsKwK1.js +161 -0
  105. package/dist/commands-types-MXHhrssO.d.ts +132 -0
  106. package/dist/commands.runtime-akiVK67l.js +175 -0
  107. package/dist/commands.runtime.js +1 -1
  108. package/dist/commitments/runtime.js +1 -1
  109. package/dist/compact-U6ZhvPtD.js +1165 -0
  110. package/dist/compact.runtime-36E5vKsC.js +12 -0
  111. package/dist/compact.runtime.js +1 -1
  112. package/dist/completion-cli-Bf4mEw2W.js +393 -0
  113. package/dist/config-BJJhHN9E.js +374 -0
  114. package/dist/config-mutations-swLu-j_p.js +161 -0
  115. package/dist/config-schema-Tjner6bM.d.ts +20 -0
  116. package/dist/context-engine-host-compat-6fkn_daV.js +280 -0
  117. package/dist/context-engine-host-compat-DtAZC1bS.js +2 -0
  118. package/dist/context-engine-lifecycle-R__Idxi1.js +627 -0
  119. package/dist/control-auth-DnkI94_D.js +114 -0
  120. package/dist/control-service-BBsamNjq.js +40 -0
  121. package/dist/control-service-BGpHj7RL.js +3 -0
  122. package/dist/control-ui/assets/activity-B2W-IeAT.js +124 -0
  123. package/dist/control-ui/assets/agents-mRUyNVCz.js +1030 -0
  124. package/dist/control-ui/assets/channels-8QHOqBnt.js +120 -0
  125. package/dist/control-ui/assets/cron-H3unP_mO.js +1016 -0
  126. package/dist/control-ui/assets/debug-CxLsQ9vH.js +97 -0
  127. package/dist/control-ui/assets/index-jtIYT0Eh.js +7214 -0
  128. package/dist/control-ui/assets/instances-B1JQeCRb.js +57 -0
  129. package/dist/control-ui/assets/nodes-RGOmq_1l.js +444 -0
  130. package/dist/control-ui/assets/sessions-C2O-Jgpg.js +425 -0
  131. package/dist/control-ui/assets/skills-jyJOYA4I.js +362 -0
  132. package/dist/control-ui/assets/workboard-uM_kK8cQ.js +402 -0
  133. package/dist/control-ui/index.html +1 -1
  134. package/dist/control-ui/sw.js +1 -1
  135. package/dist/conversation-runtime-DDekWU-U.js +31 -0
  136. package/dist/core-Bpk-qSJH.js +284 -0
  137. package/dist/core-Chrz4oRB.d.ts +223 -0
  138. package/dist/core-api-DSpUKNVW.js +2 -0
  139. package/dist/core-api-hLsW03Wo.js +5 -0
  140. package/dist/crestodian/crestodian.js +1 -1
  141. package/dist/crestodian/rescue-message.d.ts +1 -1
  142. package/dist/crestodian/rescue-message.js +1 -1
  143. package/dist/crestodian-C0x7JjF-.js +55 -0
  144. package/dist/delegate-BArFIZ4B.d.ts +30 -0
  145. package/dist/deliver-BnVp3VbL.d.ts +111 -0
  146. package/dist/delivery-queue-BFOASdf5.d.ts +161 -0
  147. package/dist/delivery-queue-runtime-BFfc8AEs.d.ts +9 -0
  148. package/dist/dialogue-No0NvYX7.js +37 -0
  149. package/dist/direct-dm-C-h88JJH.d.ts +79 -0
  150. package/dist/directive-handling.fast-lane-DTyDKhZb.js +70 -0
  151. package/dist/directive-handling.impl-DMReM6tu.js +2 -0
  152. package/dist/directive-handling.impl-DzPouhV-.js +823 -0
  153. package/dist/directive-handling.model-selection-BjwTBAZJ.js +122 -0
  154. package/dist/directive-handling.persist.runtime-D_O1okkR.js +274 -0
  155. package/dist/directive-handling.persist.runtime.js +1 -1
  156. package/dist/dispatch-Dtl-oRuN.js +2057 -0
  157. package/dist/dispatch-acp-transcript.runtime-M4y0Dq74.js +40 -0
  158. package/dist/dispatch-acp-transcript.runtime.js +1 -1
  159. package/dist/dispatch-acp.runtime-B8uCIKZS.js +18 -0
  160. package/dist/dispatch-acp.runtime.js +1 -1
  161. package/dist/dispatcher-DslvaRcj.js +106 -0
  162. package/dist/doctor-config-flow-LU2C94af.js +1819 -0
  163. package/dist/doctor-core-checks-BqcjExIZ.js +666 -0
  164. package/dist/doctor-core-checks-Diuk8l0N.js +2 -0
  165. package/dist/doctor-core-checks.runtime-DbS-kMZN.js +278 -0
  166. package/dist/doctor-core-checks.runtime.js +1 -1
  167. package/dist/doctor-health-BdqHwfYE.js +65 -0
  168. package/dist/doctor-health-contributions-DLLTVnll.js +874 -0
  169. package/dist/doctor-lint-PZqkVMWf.js +95 -0
  170. package/dist/doctor-mRfJMSb5.js +6 -0
  171. package/dist/doctor-state-integrity-Cdlm-peH.js +1257 -0
  172. package/dist/draft-stream-controls-B7uLonbw.d.ts +159 -0
  173. package/dist/embedded-agent-CEpOPW6X.js +4 -0
  174. package/dist/embedded-agent-CNINO_M-.d.ts +5 -0
  175. package/dist/embedded-agent-DxwzoZkp.js +4074 -0
  176. package/dist/embedded-agent.runtime-DDbhA85-.js +4 -0
  177. package/dist/embedded-agent.runtime.js +1 -1
  178. package/dist/embedded-backend-ChaKCepC.js +1581 -0
  179. package/dist/embedded-gateway-stub.runtime-e_ZxGhcW.js +12 -0
  180. package/dist/embedded-gateway-stub.runtime.js +1 -1
  181. package/dist/entry.d.ts +1 -1
  182. package/dist/extensionAPI.d.ts +2 -2
  183. package/dist/extensionAPI.js +1 -1
  184. package/dist/extensions/active-memory/index.d.ts +1 -1
  185. package/dist/extensions/active-memory/index.js +1 -1
  186. package/dist/extensions/admin-http-rpc/index.d.ts +1 -1
  187. package/dist/extensions/admin-http-rpc/index.js +1 -1
  188. package/dist/extensions/bonjour/index.d.ts +1 -1
  189. package/dist/extensions/browser/browser-bridge.js +1 -1
  190. package/dist/extensions/browser/browser-config.js +4 -4
  191. package/dist/extensions/browser/browser-control-auth.js +2 -2
  192. package/dist/extensions/browser/browser-doctor.js +2 -2
  193. package/dist/extensions/browser/browser-maintenance.js +1 -1
  194. package/dist/extensions/browser/browser-profiles.js +2 -2
  195. package/dist/extensions/browser/browser-runtime-api.js +12 -12
  196. package/dist/extensions/browser/cli-metadata.d.ts +1 -1
  197. package/dist/extensions/browser/cli-metadata.js +1 -1
  198. package/dist/extensions/browser/index.d.ts +1 -1
  199. package/dist/extensions/browser/index.js +1 -1
  200. package/dist/extensions/browser/plugin-registration.d.ts +1 -1
  201. package/dist/extensions/browser/plugin-registration.js +1 -1
  202. package/dist/extensions/browser/register.runtime.d.ts +2 -2
  203. package/dist/extensions/browser/register.runtime.js +4 -4
  204. package/dist/extensions/browser/runtime-api.d.ts +3 -3
  205. package/dist/extensions/browser/runtime-api.js +14 -14
  206. package/dist/extensions/browser/setup-api.d.ts +1 -1
  207. package/dist/extensions/canvas/cli-metadata.d.ts +1 -1
  208. package/dist/extensions/canvas/index.d.ts +1 -1
  209. package/dist/extensions/canvas/index.js +1 -1
  210. package/dist/extensions/canvas/setup-api.d.ts +1 -1
  211. package/dist/extensions/deepseek/api.d.ts +1 -1
  212. package/dist/extensions/deepseek/index.d.ts +1 -1
  213. package/dist/extensions/deepseek/provider-discovery.d.ts +1 -1
  214. package/dist/extensions/deepseek/stream.d.ts +1 -1
  215. package/dist/extensions/device-pair/api.d.ts +4 -4
  216. package/dist/extensions/device-pair/api.js +1 -1
  217. package/dist/extensions/device-pair/index.d.ts +1 -1
  218. package/dist/extensions/device-pair/notify.d.ts +1 -1
  219. package/dist/extensions/device-pair/pair-command-approve.js +1 -1
  220. package/dist/extensions/device-pair/qr-image.d.ts +1 -1
  221. package/dist/extensions/memory-core/api.d.ts +1 -1
  222. package/dist/extensions/memory-core/cli-metadata.d.ts +1 -1
  223. package/dist/extensions/memory-core/cli-metadata.js +1 -1
  224. package/dist/extensions/memory-core/index.d.ts +1 -1
  225. package/dist/extensions/memory-core/manager-runtime.d.ts +1 -1
  226. package/dist/extensions/memory-core/runtime-api.d.ts +3 -3
  227. package/dist/extensions/skill-workshop/api.d.ts +2 -2
  228. package/dist/extensions/skill-workshop/api.js +1 -1
  229. package/dist/extensions/skill-workshop/index.d.ts +1 -1
  230. package/dist/extensions/skill-workshop/index.js +2 -2
  231. package/dist/extensions/tavily/index.d.ts +1 -1
  232. package/dist/extensions/tavily/web-search-contract-api.d.ts +1 -1
  233. package/dist/extensions/tavily/web-search-provider.d.ts +1 -1
  234. package/dist/extensions/thread-ownership/api.d.ts +2 -2
  235. package/dist/extensions/thread-ownership/index.d.ts +1 -1
  236. package/dist/extensions/webhooks/api.d.ts +2 -2
  237. package/dist/extensions/webhooks/api.js +1 -1
  238. package/dist/extensions/webhooks/index.d.ts +1 -1
  239. package/dist/extensions/webhooks/index.js +1 -1
  240. package/dist/extensions/webhooks/runtime-api.d.ts +1 -1
  241. package/dist/extensions/workboard/api.d.ts +2 -2
  242. package/dist/extensions/workboard/index.d.ts +1 -1
  243. package/dist/extensions/workboard/index.js +1 -1
  244. package/dist/extensions/workboard/runtime-api.d.ts +1 -1
  245. package/dist/fengming-runtime-CtRd5677.d.ts +153 -0
  246. package/dist/fengming-tools-DBLsJfsf.js +12221 -0
  247. package/dist/gateway/protocol/index.d.ts +1 -1
  248. package/dist/gateway-cli-BgDV2HF9.js +443 -0
  249. package/dist/gateway-method-runtime-d9oN_XO9.js +21 -0
  250. package/dist/get-reply-CEMtvaTJ.js +5198 -0
  251. package/dist/get-reply-from-config.runtime-CE8zmX7o.js +2 -0
  252. package/dist/get-reply-from-config.runtime.js +1 -1
  253. package/dist/heartbeat-runner-H8SmaKmJ.js +5 -0
  254. package/dist/heartbeat-runner.runtime-6hUaxEbl.js +3 -0
  255. package/dist/heartbeat-runner.runtime.js +1 -1
  256. package/dist/hooks-DkEvkwzS.js +536 -0
  257. package/dist/host-compat-DeAq3dnI.d.ts +21 -0
  258. package/dist/http-registry-BDoApjTY.d.ts +23 -0
  259. package/dist/inbound-reply-dispatch-CIYP2OPo.d.ts +156 -0
  260. package/dist/inbound-reply-dispatch-geHu6oUK.js +147 -0
  261. package/dist/inbound-reply-dispatch-vwW5Hl-_.js +2 -0
  262. package/dist/index-DhOQs6M_.d.ts +1497 -0
  263. package/dist/index.js +1 -1
  264. package/dist/init-DpE_6dG4.js +59 -0
  265. package/dist/interactive-Cb_1f91G.d.ts +26 -0
  266. package/dist/isolated-agent-B_upYOOM.js +2 -0
  267. package/dist/isolated-agent-KH9uwWhw.js +1097 -0
  268. package/dist/kernel-BHnBXnm2.d.ts +241 -0
  269. package/dist/lifecycle-BmZwopzF.js +570 -0
  270. package/dist/list.probe-5kzWm9Jk.js +451 -0
  271. package/dist/list.probe-9zBcGGQ4.js +2 -0
  272. package/dist/list.status-command-DY2ifqp1.js +815 -0
  273. package/dist/llm-slug-generator-Bmx0I84M.js +78 -0
  274. package/dist/llm-slug-generator.js +1 -1
  275. package/dist/loader-BVz75gSb.d.ts +142 -0
  276. package/dist/local-dispatch.runtime-CX3IOY1E.js +10 -0
  277. package/dist/local-dispatch.runtime.js +1 -1
  278. package/dist/manager-BXGg8bfG.d.ts +409 -0
  279. package/dist/mcp-http-B1lnh67s.js +2 -0
  280. package/dist/mcp-http-CamghE-W.js +583 -0
  281. package/dist/media-runtime-DpykroJR.d.ts +261 -0
  282. package/dist/memory-core-host-engine-embeddings-N2dX5P40.d.ts +324 -0
  283. package/dist/memory-core-host-engine-storage-WQfkQMer.d.ts +54 -0
  284. package/dist/message-handler-Ca_pqGVS.js +1806 -0
  285. package/dist/model-catalog-BBMLIjhq.d.ts +88 -0
  286. package/dist/model-selection-Cq82FXLy.js +352 -0
  287. package/dist/models-cli-Dm_393dw.js +257 -0
  288. package/dist/monitor-d0eyE2k0.js +60 -0
  289. package/dist/monitor.account-vLQ3bKHu.js +5382 -0
  290. package/dist/nodes-Bunvrb33.js +1483 -0
  291. package/dist/nodes-edNlxb2I.js +3 -0
  292. package/dist/nodes-pending-DEIwVh9v.js +211 -0
  293. package/dist/openai-compat-errors-CvWEoG98.js +136 -0
  294. package/dist/openai-http-Bskdv4Tv.js +836 -0
  295. package/dist/openresponses-http-DxdgCxFU.js +1175 -0
  296. package/dist/operations-Z85LFqsT.js +805 -0
  297. package/dist/outbound.types-DVkbsxo8.d.ts +291 -0
  298. package/dist/plugin-enabled-fvhTpvYS.js +232 -0
  299. package/dist/plugin-entry-CunlVUw6.d.ts +47 -0
  300. package/dist/plugin-registration-9ovnK_Tk.js +97 -0
  301. package/dist/plugin-runtime-DH2ZM9P5.d.ts +117 -0
  302. package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
  303. package/dist/plugin-sdk/acp-runtime-backend.js +1 -1
  304. package/dist/plugin-sdk/acp-runtime.js +1 -1
  305. package/dist/plugin-sdk/agent-harness-runtime.js +5 -5
  306. package/dist/plugin-sdk/agent-harness-task-runtime.js +1 -1
  307. package/dist/plugin-sdk/agent-harness.js +6 -6
  308. package/dist/plugin-sdk/agent-runtime.js +2 -2
  309. package/dist/plugin-sdk/bundled-channel-config-schema-Dfn3b8sF.d.ts +3169 -0
  310. package/dist/plugin-sdk/bundled-channel-config-schema.d.ts +1 -1
  311. package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +1 -1
  312. package/dist/plugin-sdk/channel-core.js +2 -2
  313. package/dist/plugin-sdk/channel-envelope.js +1 -1
  314. package/dist/plugin-sdk/channel-inbound-roots.js +1 -1
  315. package/dist/plugin-sdk/channel-inbound.js +2 -2
  316. package/dist/plugin-sdk/channel-location.js +1 -1
  317. package/dist/plugin-sdk/channel-message-runtime.js +3 -3
  318. package/dist/plugin-sdk/channel-message.js +2 -2
  319. package/dist/plugin-sdk/channel-runtime.js +0 -1
  320. package/dist/plugin-sdk/command-status-runtime.js +1 -1
  321. package/dist/plugin-sdk/compat.js +1 -1
  322. package/dist/plugin-sdk/config-schema.d.ts +4 -4
  323. package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
  324. package/dist/plugin-sdk/conversation-runtime.js +3 -3
  325. package/dist/plugin-sdk/core.js +2 -2
  326. package/dist/plugin-sdk/discord.d.ts +1 -1
  327. package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
  328. package/dist/plugin-sdk/health.js +1 -1
  329. package/dist/plugin-sdk/hook-runtime.js +0 -1
  330. package/dist/plugin-sdk/inbound-reply-dispatch.js +2 -2
  331. package/dist/plugin-sdk/index.js +1 -1
  332. package/dist/plugin-sdk/infra-runtime.js +3 -1
  333. package/dist/plugin-sdk/provider-auth-api-key.js +0 -1
  334. package/dist/plugin-sdk/provider-stream-family.js +0 -1
  335. package/dist/plugin-sdk/provider-usage.js +649 -1
  336. package/dist/plugin-sdk/reply-runtime.js +4 -4
  337. package/dist/plugin-sdk/video-generation.js +206 -1
  338. package/dist/plugin-service-BdZxoKBZ.js +1249 -0
  339. package/dist/plugin-service-quTl5hT0.d.ts +24 -0
  340. package/dist/plugins/build-smoke-entry.d.ts +2 -2
  341. package/dist/plugins/loader.d.ts +1 -1
  342. package/dist/plugins/provider-discovery.runtime.d.ts +1 -1
  343. package/dist/plugins/provider-runtime.runtime.d.ts +1 -1
  344. package/dist/plugins/runtime/index.d.ts +1 -1
  345. package/dist/plugins/runtime/index.js +4 -4
  346. package/dist/plugins/tools.d.ts +1 -1
  347. package/dist/prepare.runtime-DFvkUqBZ.js +798 -0
  348. package/dist/prepare.runtime.js +1 -1
  349. package/dist/preview-warnings-CGzc8ccG.js +618 -0
  350. package/dist/program-D19g2jaa.js +131 -0
  351. package/dist/provider-api-key-auth-B8GgTfo8.d.ts +27 -0
  352. package/dist/provider-auth-result-Diw-woMA.d.ts +21 -0
  353. package/dist/provider-catalog-shared-hMvzzDgL.d.ts +62 -0
  354. package/dist/provider-dispatcher-DCTc4lG_.js +22 -0
  355. package/dist/provider-dispatcher.runtime.js +1 -1
  356. package/dist/provider-model-shared-BUCh3uCL.d.ts +143 -0
  357. package/dist/provider-registry-BIokPlxa.d.ts +8 -0
  358. package/dist/provider-registry-CyUOXHG-.d.ts +8 -0
  359. package/dist/provider-registry-i--H79Ao.d.ts +29 -0
  360. package/dist/provider-self-hosted-setup-BF8UR8wg.d.ts +74 -0
  361. package/dist/provider-stream-NF0XJnar.d.ts +139 -0
  362. package/dist/provider-stream-shared-DLwDaYed.d.ts +132 -0
  363. package/dist/provider-web-search-contract-fields-D61Vl5Kl.d.ts +25 -0
  364. package/dist/pw-ai-DYR-D7xR.js +3064 -0
  365. package/dist/register.agent-DwW0mQPk.js +152 -0
  366. package/dist/register.crestodian-BhIukKDA.js +24 -0
  367. package/dist/register.maintenance-DWHlvztJ.js +85 -0
  368. package/dist/register.subclis-Bsvdh8RI.js +3 -0
  369. package/dist/register.subclis-DVk0HU4k.js +31 -0
  370. package/dist/register.subclis-core-BK7nVvl6.js +278 -0
  371. package/dist/registry-hscEPAcC.d.ts +8 -0
  372. package/dist/registry-types-Ce-n1tuw.d.ts +392 -0
  373. package/dist/repair-sequencing-0-qGNSUO.js +652 -0
  374. package/dist/reply-payload-mCw4ZND6.d.ts +200 -0
  375. package/dist/reply-turn-admission-DMWNadoS.js +2056 -0
  376. package/dist/reply.runtime-CE8zmX7o.js +2 -0
  377. package/dist/reply.runtime.js +1 -1
  378. package/dist/result-fallback-classifier-BZmv2ACy.js +98 -0
  379. package/dist/route-qQ-jYpFa.js +475 -0
  380. package/dist/routes-dTCmw98g.js +2 -0
  381. package/dist/routes-r8DRKa83.js +3701 -0
  382. package/dist/run-BgH7EPGH.js +1162 -0
  383. package/dist/run-command-DCsM-BVh.js +23 -0
  384. package/dist/run-command-I2ib4dwS.js +2 -0
  385. package/dist/run-context-CWaKUKKJ.js +66 -0
  386. package/dist/run-embedded.runtime-CBnDBWN0.js +4 -0
  387. package/dist/run-embedded.runtime.js +1 -1
  388. package/dist/run-execution-cli.runtime-DlYXI-lw.js +4 -0
  389. package/dist/run-execution-cli.runtime.js +1 -1
  390. package/dist/run-executor.runtime-DwepGrmB.js +330 -0
  391. package/dist/run-executor.runtime.js +1 -1
  392. package/dist/run-subagent-registry.runtime-CeVpoIhj.js +2 -0
  393. package/dist/run-subagent-registry.runtime.js +1 -1
  394. package/dist/runtime-D2ee-rNh.js +436 -0
  395. package/dist/runtime-api-B99ZlkNt.d.ts +5 -0
  396. package/dist/runtime-api-Cta2L_Yo.js +12 -0
  397. package/dist/runtime-channel-LKOkML3M.js +2 -0
  398. package/dist/runtime-channel-UtWvrTZ5.js +148 -0
  399. package/dist/runtime-embedded-agent.runtime-9O2Idzyb.js +2 -0
  400. package/dist/runtime-embedded-agent.runtime.js +1 -1
  401. package/dist/runtime-forwarders-DjI8RFL5.d.ts +39 -0
  402. package/dist/sdk-setup-tools-B-X04pa6.js +8 -0
  403. package/dist/selection-B02h8Old.js +3 -0
  404. package/dist/selection-DEPvzrW2.js +18365 -0
  405. package/dist/server-CMYi8gDo.js +24 -0
  406. package/dist/server-Cx07rsiY.js +72 -0
  407. package/dist/server-close.runtime.js +1 -1
  408. package/dist/server-context-BIemGRt4.js +2 -0
  409. package/dist/server-context-CB_an9iy.js +955 -0
  410. package/dist/server-cron-BeyuBUjb.js +3173 -0
  411. package/dist/server-cron-CV7KkVeB.js +2 -0
  412. package/dist/server-methods-C7EnpOhB.js +497 -0
  413. package/dist/server-node-events-DMMzZciN.js +597 -0
  414. package/dist/server-plugin-bootstrap-O6MzvzL8.js +71 -0
  415. package/dist/server-plugins-Dwnaz9kX.js +435 -0
  416. package/dist/server-reload-handlers-C-6TyPvI.js +719 -0
  417. package/dist/server-restart-sentinel-Dc35eYgk.js +700 -0
  418. package/dist/server-runtime-services-DCs-gqh_.js +3 -0
  419. package/dist/server-runtime-services-DF2fzzVd.js +147 -0
  420. package/dist/server-startup-plugins-t-YeYibm.js +127 -0
  421. package/dist/server-startup-post-attach-CiEki-DC.js +793 -0
  422. package/dist/server-ws-runtime-uaUpI-e8.js +374 -0
  423. package/dist/server.impl-MoHjSMr5.js +2622 -0
  424. package/dist/session-kill-http-CYCiQpt2.js +121 -0
  425. package/dist/session-reset-service-BYbADY57.js +651 -0
  426. package/dist/session-status.runtime-8NASbeO4.js +2 -0
  427. package/dist/session-status.runtime.js +1 -1
  428. package/dist/session-subagent-reactivation.runtime-DGeNY2Rb.js +2 -0
  429. package/dist/session-subagent-reactivation.runtime.js +1 -1
  430. package/dist/session-tab-registry-C2eElZrt.js +551 -0
  431. package/dist/sessions-DXAdVXIx.js +1917 -0
  432. package/dist/sessions-history-http-BwK7b8OH.js +432 -0
  433. package/dist/sessions-patch-BYC5gvY1.js +401 -0
  434. package/dist/sessions-resolve-C3ORcdmo.js +180 -0
  435. package/dist/sessions.runtime-BijldeSY.js +2 -0
  436. package/dist/sessions.runtime.js +1 -1
  437. package/dist/snapshot-urls-C5CfP3Co.js +317 -0
  438. package/dist/speech-core-wWkTZPpQ.d.ts +49 -0
  439. package/dist/standalone-CHrieUsw.js +42 -0
  440. package/dist/startup-context-CZfmG8-g.js +314 -0
  441. package/dist/status-subagents.runtime-D2XMebiS.js +32 -0
  442. package/dist/status-subagents.runtime.js +1 -1
  443. package/dist/status-text-JR7IPyzZ.js +301 -0
  444. package/dist/stream-BJgTkLEI.d.ts +5 -0
  445. package/dist/subagent-announce-B9cfs_KZ.js +353 -0
  446. package/dist/subagent-announce-delivery-CtmEvLTS.js +1369 -0
  447. package/dist/subagent-control-DVqLHi9O.js +492 -0
  448. package/dist/subagent-hooks-D251uSvy.js +230 -0
  449. package/dist/subagent-hooks-api-DvdMKxsC.js +23 -0
  450. package/dist/subagent-hooks-uLORYChc.js +2 -0
  451. package/dist/subagent-registry-BW2l_oYu.js +3 -0
  452. package/dist/subagent-registry-BxEMHuiN.js +2627 -0
  453. package/dist/subagent-registry.runtime.d.ts +1 -1
  454. package/dist/subagent-registry.runtime.js +1 -1
  455. package/dist/subagent-session-cleanup-BC5wV2qQ.js +390 -0
  456. package/dist/system-fvgHsr2x.js +111 -0
  457. package/dist/talk-DU0Sod_K.js +2454 -0
  458. package/dist/target-id-BR2xJIkd.js +107 -0
  459. package/dist/task-registry-control.runtime.js +1 -1
  460. package/dist/thread-bindings-8XNu5U2p.js +228 -0
  461. package/dist/tool-Boeg0N5g.js +143 -0
  462. package/dist/tool-dispatch-BhLLaL2g.js +155 -0
  463. package/dist/tool-resolution-CzsLs-87.js +153 -0
  464. package/dist/tool-split-Bedy42Ms.d.ts +19 -0
  465. package/dist/tools-B6egHpE3.d.ts +38 -0
  466. package/dist/tools-effective-NXscxK8n.js +442 -0
  467. package/dist/tools-effective-inventory-NsGMUVo-.js +379 -0
  468. package/dist/tools-invoke-_sSu96Kq.js +51 -0
  469. package/dist/tools-invoke-http-BDhlRl-G.js +68 -0
  470. package/dist/tools-invoke-shared-BH-T9Bcg.js +200 -0
  471. package/dist/tts-runtime-C1wu3o15.d.ts +230 -0
  472. package/dist/tui-C733Qov0.js +2 -0
  473. package/dist/tui-DqbscVN5.js +3 -0
  474. package/dist/tui-backend-_Pn3Byj-.js +257 -0
  475. package/dist/tui-cli-CAiC39zd.js +40 -0
  476. package/dist/tui-ink-run-ChXEGj1h.js +7414 -0
  477. package/dist/tui-ink-run-D4mSfLHj.js +2 -0
  478. package/dist/types-BQw1qXGl.d.ts +7034 -0
  479. package/dist/types-BzMoU6-C.d.ts +111 -0
  480. package/dist/types-DltHmoCX.d.ts +393 -0
  481. package/dist/types.public-C_bVIMBl.d.ts +70 -0
  482. package/dist/web-fetch/runtime.d.ts +1 -1
  483. package/dist/webhook-targets-DW2jhddP.d.ts +99 -0
  484. package/dist/zod-schema.core-Cuz0lz6m.d.ts +166 -0
  485. package/npm-shrinkwrap.json +12861 -11889
  486. package/package.json +2 -5
  487. package/skills/batch/SKILL.md +118 -0
  488. package/skills/code-review/SKILL.md +107 -0
  489. package/skills/debug/SKILL.md +83 -0
  490. package/skills/loop/SKILL.md +118 -0
  491. package/skills/run/SKILL.md +79 -0
  492. package/skills/run-skill-generator/SKILL.md +179 -0
  493. package/skills/verify/SKILL.md +103 -0
  494. package/dist/abort-DGskei2p.js +0 -277
  495. package/dist/abort.runtime-Buq9IZxn.js +0 -2
  496. package/dist/acp-spawn-DC6IyYaB.js +0 -1286
  497. package/dist/acp-spawn-Diqb3nel.js +0 -2
  498. package/dist/acp-stateful-target-driver-Clhe_L8v.js +0 -89
  499. package/dist/active-tool-schema-warnings-BRhKkyvt.js +0 -2
  500. package/dist/active-tool-schema-warnings-C6N0-ce6.js +0 -105
  501. package/dist/agent-C5lhsEZJ.js +0 -2
  502. package/dist/agent-WEb757bl.js +0 -1825
  503. package/dist/agent-command-iLD_nsVY.js +0 -1435
  504. package/dist/agent-core-BeDN8Ns5.d.ts +0 -13
  505. package/dist/agent-harness-runtime-C89_Q-bW.d.ts +0 -913
  506. package/dist/agent-harness-runtime-Dfn5rik2.js +0 -207
  507. package/dist/agent-runner-utils-DNiuuo43.js +0 -267
  508. package/dist/agent-runner.runtime-CFF_qJ5V.js +0 -3784
  509. package/dist/agent-runtime-BkMtWXxn.js +0 -199
  510. package/dist/agent-runtime-HufMO_YR.d.ts +0 -207
  511. package/dist/agent-tools-HmaDv4ot.js +0 -2506
  512. package/dist/agent-via-gateway-CZQG8RYL.js +0 -486
  513. package/dist/agent-wait-dedupe-C3xQk2Ww.js +0 -180
  514. package/dist/agent-z1cs3c7n.js +0 -3
  515. package/dist/api-B4IMKjSe.js +0 -3
  516. package/dist/api-BwSbBWI8.js +0 -3
  517. package/dist/api-CE9In9m4.js +0 -5
  518. package/dist/api-ClPvYNGa.js +0 -32
  519. package/dist/api-CntBCaZf.js +0 -3
  520. package/dist/api-DBZBwTsn.js +0 -6
  521. package/dist/api-OCPwGOvK.js +0 -2
  522. package/dist/api-yYhEo7gK.js +0 -4
  523. package/dist/approval-client-helpers-CfdQ3-vv.d.ts +0 -78
  524. package/dist/approval-native-helpers-DSHPksK4.d.ts +0 -241
  525. package/dist/approval-renderers-BfEfwk44.d.ts +0 -39
  526. package/dist/assistant-v5fdOYu7.js +0 -291
  527. package/dist/attachment-normalize-BHAbLiL2.js +0 -213
  528. package/dist/attempt-execution-5w9WYbaJ.js +0 -584
  529. package/dist/attempt-execution.runtime-DnhOWGzr.js +0 -3
  530. package/dist/attempt.prompt-helpers-C4M4erF7.js +0 -543
  531. package/dist/binding-routing-Dpes-QF1.js +0 -113
  532. package/dist/binding-targets-B6H5Pd-A.js +0 -121
  533. package/dist/bridge-server-BCpxCRm_.js +0 -113
  534. package/dist/browser-cli-DMhXHopl.js +0 -230
  535. package/dist/browser-cli-Dy_VugK0.js +0 -2
  536. package/dist/browser-cli-actions-input-WMP7_lm6.js +0 -522
  537. package/dist/browser-cli-actions-observe-DQWAWhwU.js +0 -81
  538. package/dist/browser-cli-debug-CaT2ZKAx.js +0 -137
  539. package/dist/browser-cli-inspect-DU-LUXq1.js +0 -117
  540. package/dist/browser-cli-manage-DAuogqIh.js +0 -446
  541. package/dist/browser-cli-resize-Cz5uO_aR.js +0 -32
  542. package/dist/browser-cli-shared-CjPZcG3j.js +0 -69
  543. package/dist/browser-cli-state-CC3l77-K.js +0 -371
  544. package/dist/browser-control-auth-ELccIUZy.js +0 -2
  545. package/dist/browser-profiles-Cuy4ia6_.js +0 -2
  546. package/dist/browser-runtime-De-iUfME.js +0 -389
  547. package/dist/build-DEF8Per9.js +0 -261
  548. package/dist/bundled-channel-config-schema-Bte--ZlY.d.ts +0 -3168
  549. package/dist/capability-cli-Bydel4E7.js +0 -1809
  550. package/dist/channel-6SGL4R5P.js +0 -2309
  551. package/dist/channel-D3Q3b8J-.d.ts +0 -427
  552. package/dist/channel-core-Bj71kAB5.d.ts +0 -6
  553. package/dist/channel-core-DMvyWnHg.js +0 -5
  554. package/dist/channel-entry-contract-zYxRmEdf.d.ts +0 -114
  555. package/dist/channel-inbound-DVJzBcJ8.d.ts +0 -97
  556. package/dist/channel-inbound-DlCa7eJe.js +0 -121
  557. package/dist/channel-message-CyPGMMFB.js +0 -12
  558. package/dist/channel-message-Czl4cdoA.d.ts +0 -9
  559. package/dist/channel-outbound-BNbhmruA.d.ts +0 -325
  560. package/dist/channel-pairing-BiS-tSvl.d.ts +0 -58
  561. package/dist/channel-runtime-D8hntg7H.js +0 -7
  562. package/dist/channel.runtime-DxErReJR.js +0 -697
  563. package/dist/chat-BLA8ORQI.js +0 -3
  564. package/dist/chat-DWRXkuvU.js +0 -2940
  565. package/dist/chrome-DPwFYi-g.js +0 -1517
  566. package/dist/cli-compaction-YZpssARf.js +0 -363
  567. package/dist/cli-runner-D2OAqxu3.js +0 -597
  568. package/dist/cli-runner-DO4SORQf.js +0 -2
  569. package/dist/cli-runner.runtime-CNSIpbeT.js +0 -4
  570. package/dist/cli-runner.runtime-DAOYvpVQ.js +0 -3
  571. package/dist/command-registry-DpD0fb8D.js +0 -4
  572. package/dist/command-registry-core-Cl3tLG8G.js +0 -114
  573. package/dist/command-registry-nbP7c8RT.js +0 -9
  574. package/dist/command-status.runtime-BBuXTkq0.js +0 -90
  575. package/dist/commands-CR8MVvlD.d.ts +0 -117
  576. package/dist/commands-compact.runtime-BoafIjjg.js +0 -10
  577. package/dist/commands-handlers.runtime-D9jViG_x.js +0 -6327
  578. package/dist/commands-status-BqqJ7PVq.js +0 -16
  579. package/dist/commands-status-CMd41Vxf.js +0 -3
  580. package/dist/commands-status.runtime-CMd41Vxf.js +0 -3
  581. package/dist/commands-subagents-control.runtime-CU4I3A_n.js +0 -2
  582. package/dist/commands-system-prompt-CTtu1D3-.js +0 -2
  583. package/dist/commands-system-prompt-xswhORdM.js +0 -161
  584. package/dist/commands-types-B67CsqXf.d.ts +0 -132
  585. package/dist/commands.runtime-BUFhkrjQ.js +0 -175
  586. package/dist/compact-Dz_WvRkQ.js +0 -1165
  587. package/dist/compact.runtime-n-AKErni.js +0 -12
  588. package/dist/completion-cli-DJYs_L4_.js +0 -393
  589. package/dist/config-CFMbHJb0.js +0 -374
  590. package/dist/config-mutations-DCAloTKR.js +0 -161
  591. package/dist/config-schema-Drw1zrnG.d.ts +0 -20
  592. package/dist/context-engine-host-compat-4mNm1HCE.js +0 -2
  593. package/dist/context-engine-host-compat-BzJ7fUIn.js +0 -280
  594. package/dist/context-engine-lifecycle-V4PNQp6k.js +0 -627
  595. package/dist/control-auth-DG_cw-aN.js +0 -114
  596. package/dist/control-service-CurYipgK.js +0 -3
  597. package/dist/control-service-VyncoV7j.js +0 -40
  598. package/dist/control-ui/assets/activity-D5Plhlo-.js +0 -124
  599. package/dist/control-ui/assets/agents-Chcdfe1E.js +0 -1030
  600. package/dist/control-ui/assets/channels-BEtB4H37.js +0 -120
  601. package/dist/control-ui/assets/cron-CZyPkxSU.js +0 -1016
  602. package/dist/control-ui/assets/debug-DvM8iG47.js +0 -97
  603. package/dist/control-ui/assets/index-Rmpgh0f1.js +0 -7214
  604. package/dist/control-ui/assets/instances-yTC_uu60.js +0 -57
  605. package/dist/control-ui/assets/nodes-vbAxVHIH.js +0 -444
  606. package/dist/control-ui/assets/sessions-DOviHme5.js +0 -425
  607. package/dist/control-ui/assets/skills-Bfp5HEGW.js +0 -362
  608. package/dist/control-ui/assets/workboard-5sU2kHsV.js +0 -402
  609. package/dist/conversation-runtime-DgaABwHh.js +0 -31
  610. package/dist/core-BeBXdneV.js +0 -284
  611. package/dist/core-Chqb7X6l.d.ts +0 -223
  612. package/dist/core-api-BlK0FgBM.js +0 -2
  613. package/dist/core-api-pAvYk716.js +0 -5
  614. package/dist/crestodian-FeGTBqO1.js +0 -55
  615. package/dist/delegate-BjIjSU_E.d.ts +0 -30
  616. package/dist/deliver-CvtWN4Ey.d.ts +0 -111
  617. package/dist/delivery-queue-CQ-cj3KG.d.ts +0 -161
  618. package/dist/delivery-queue-runtime-ut7MG04m.d.ts +0 -9
  619. package/dist/detect-BjXPyrwn.js +0 -115
  620. package/dist/detect-C1xeIemQ.d.ts +0 -16
  621. package/dist/dialogue-BowVYhEC.js +0 -37
  622. package/dist/direct-dm-DoZZHpA0.d.ts +0 -79
  623. package/dist/directive-handling.fast-lane-hnmQ_CvD.js +0 -70
  624. package/dist/directive-handling.impl-Cai-CFS1.js +0 -2
  625. package/dist/directive-handling.impl-DY84qIfU.js +0 -823
  626. package/dist/directive-handling.model-selection-DASssLFQ.js +0 -122
  627. package/dist/directive-handling.persist.runtime-BY7tJUs2.js +0 -274
  628. package/dist/dispatch-D5iG5A8j.js +0 -2057
  629. package/dist/dispatch-acp-transcript.runtime-D3r16hbD.js +0 -40
  630. package/dist/dispatch-acp.runtime-CAIau5qX.js +0 -18
  631. package/dist/dispatcher-7-d2gw3J.js +0 -106
  632. package/dist/doctor-DD5YEMmf.js +0 -6
  633. package/dist/doctor-config-flow-CdlLHJmX.js +0 -1819
  634. package/dist/doctor-core-checks-6MP99TQG.js +0 -666
  635. package/dist/doctor-core-checks-Dm_o576z.js +0 -2
  636. package/dist/doctor-core-checks.runtime-B2qbKATd.js +0 -278
  637. package/dist/doctor-health-BKrhOv1v.js +0 -65
  638. package/dist/doctor-health-contributions-bIBLmw69.js +0 -874
  639. package/dist/doctor-lint-aOLOWli4.js +0 -95
  640. package/dist/doctor-state-integrity-23NQNNuo.js +0 -1257
  641. package/dist/draft-stream-controls-Bk1GVJ1l.d.ts +0 -159
  642. package/dist/embedded-agent-BeK8FhZr.d.ts +0 -5
  643. package/dist/embedded-agent-CNp_y7jW.js +0 -4074
  644. package/dist/embedded-agent-NEmNlXDR.js +0 -4
  645. package/dist/embedded-agent.runtime-hEby8P2s.js +0 -4
  646. package/dist/embedded-backend-BdbgfpBP.js +0 -1581
  647. package/dist/embedded-gateway-stub.runtime-ySZUA3Gy.js +0 -12
  648. package/dist/extensions/alibaba/fengming.plugin.json +0 -47
  649. package/dist/extensions/alibaba/index.d.ts +0 -12
  650. package/dist/extensions/alibaba/index.js +0 -13
  651. package/dist/extensions/alibaba/package.json +0 -15
  652. package/dist/extensions/alibaba/video-generation-provider.d.ts +0 -6
  653. package/dist/extensions/alibaba/video-generation-provider.js +0 -2
  654. package/dist/extensions/baichuan/fengming.plugin.json +0 -69
  655. package/dist/extensions/baichuan/index.d.ts +0 -11
  656. package/dist/extensions/baichuan/index.js +0 -45
  657. package/dist/extensions/baichuan/models.d.ts +0 -7
  658. package/dist/extensions/baichuan/models.js +0 -2
  659. package/dist/extensions/baichuan/onboard.d.ts +0 -5
  660. package/dist/extensions/baichuan/onboard.js +0 -2
  661. package/dist/extensions/baichuan/package.json +0 -15
  662. package/dist/extensions/baichuan/provider-catalog.d.ts +0 -2
  663. package/dist/extensions/baichuan/provider-catalog.js +0 -2
  664. package/dist/extensions/baichuan/provider-discovery.d.ts +0 -2
  665. package/dist/extensions/baichuan/provider-discovery.js +0 -5
  666. package/dist/extensions/byteplus/api.d.ts +0 -3
  667. package/dist/extensions/byteplus/api.js +0 -3
  668. package/dist/extensions/byteplus/fengming.plugin.json +0 -196
  669. package/dist/extensions/byteplus/index.d.ts +0 -12
  670. package/dist/extensions/byteplus/index.js +0 -85
  671. package/dist/extensions/byteplus/models.d.ts +0 -2
  672. package/dist/extensions/byteplus/models.js +0 -2
  673. package/dist/extensions/byteplus/package.json +0 -15
  674. package/dist/extensions/byteplus/provider-catalog.d.ts +0 -2
  675. package/dist/extensions/byteplus/provider-catalog.js +0 -2
  676. package/dist/extensions/byteplus/provider-discovery.d.ts +0 -5
  677. package/dist/extensions/byteplus/provider-discovery.js +0 -23
  678. package/dist/extensions/byteplus/video-generation-provider.d.ts +0 -6
  679. package/dist/extensions/byteplus/video-generation-provider.js +0 -2
  680. package/dist/extensions/longcat/fengming.plugin.json +0 -84
  681. package/dist/extensions/longcat/index.d.ts +0 -11
  682. package/dist/extensions/longcat/index.js +0 -45
  683. package/dist/extensions/longcat/models.d.ts +0 -7
  684. package/dist/extensions/longcat/models.js +0 -2
  685. package/dist/extensions/longcat/onboard.d.ts +0 -5
  686. package/dist/extensions/longcat/onboard.js +0 -2
  687. package/dist/extensions/longcat/package.json +0 -15
  688. package/dist/extensions/longcat/provider-catalog.d.ts +0 -2
  689. package/dist/extensions/longcat/provider-catalog.js +0 -2
  690. package/dist/extensions/longcat/provider-discovery.d.ts +0 -2
  691. package/dist/extensions/longcat/provider-discovery.js +0 -5
  692. package/dist/extensions/minimax/api.d.ts +0 -5
  693. package/dist/extensions/minimax/api.js +0 -6
  694. package/dist/extensions/minimax/fengming.plugin.json +0 -206
  695. package/dist/extensions/minimax/image-generation-provider.d.ts +0 -6
  696. package/dist/extensions/minimax/image-generation-provider.js +0 -2
  697. package/dist/extensions/minimax/index.d.ts +0 -12
  698. package/dist/extensions/minimax/index.js +0 -29
  699. package/dist/extensions/minimax/media-understanding-provider.d.ts +0 -6
  700. package/dist/extensions/minimax/media-understanding-provider.js +0 -2
  701. package/dist/extensions/minimax/model-definitions.d.ts +0 -2
  702. package/dist/extensions/minimax/model-definitions.js +0 -2
  703. package/dist/extensions/minimax/music-generation-provider.d.ts +0 -6
  704. package/dist/extensions/minimax/music-generation-provider.js +0 -2
  705. package/dist/extensions/minimax/oauth.d.ts +0 -2
  706. package/dist/extensions/minimax/oauth.js +0 -2
  707. package/dist/extensions/minimax/oauth.runtime.d.ts +0 -2
  708. package/dist/extensions/minimax/oauth.runtime.js +0 -2
  709. package/dist/extensions/minimax/onboard.d.ts +0 -2
  710. package/dist/extensions/minimax/onboard.js +0 -2
  711. package/dist/extensions/minimax/package.json +0 -15
  712. package/dist/extensions/minimax/provider-catalog.d.ts +0 -2
  713. package/dist/extensions/minimax/provider-catalog.js +0 -2
  714. package/dist/extensions/minimax/provider-contract-api.d.ts +0 -6
  715. package/dist/extensions/minimax/provider-contract-api.js +0 -77
  716. package/dist/extensions/minimax/provider-discovery.d.ts +0 -5
  717. package/dist/extensions/minimax/provider-discovery.js +0 -23
  718. package/dist/extensions/minimax/provider-models.d.ts +0 -2
  719. package/dist/extensions/minimax/provider-models.js +0 -2
  720. package/dist/extensions/minimax/provider-registration.d.ts +0 -7
  721. package/dist/extensions/minimax/provider-registration.js +0 -2
  722. package/dist/extensions/minimax/speech-provider.d.ts +0 -5
  723. package/dist/extensions/minimax/speech-provider.js +0 -2
  724. package/dist/extensions/minimax/tts.d.ts +0 -20
  725. package/dist/extensions/minimax/tts.js +0 -2
  726. package/dist/extensions/minimax/video-generation-provider.d.ts +0 -7
  727. package/dist/extensions/minimax/video-generation-provider.js +0 -2
  728. package/dist/extensions/minimax/web-search-contract-api.d.ts +0 -5
  729. package/dist/extensions/minimax/web-search-contract-api.js +0 -31
  730. package/dist/extensions/minimax/web-search-provider.d.ts +0 -5
  731. package/dist/extensions/minimax/web-search-provider.js +0 -2
  732. package/dist/extensions/moonshot/api.d.ts +0 -3
  733. package/dist/extensions/moonshot/api.js +0 -4
  734. package/dist/extensions/moonshot/fengming.plugin.json +0 -250
  735. package/dist/extensions/moonshot/index.d.ts +0 -11
  736. package/dist/extensions/moonshot/index.js +0 -70
  737. package/dist/extensions/moonshot/media-understanding-provider.d.ts +0 -6
  738. package/dist/extensions/moonshot/media-understanding-provider.js +0 -2
  739. package/dist/extensions/moonshot/onboard.d.ts +0 -2
  740. package/dist/extensions/moonshot/onboard.js +0 -2
  741. package/dist/extensions/moonshot/package.json +0 -15
  742. package/dist/extensions/moonshot/provider-catalog.d.ts +0 -2
  743. package/dist/extensions/moonshot/provider-catalog.js +0 -2
  744. package/dist/extensions/moonshot/provider-contract-api.d.ts +0 -5
  745. package/dist/extensions/moonshot/provider-contract-api.js +0 -27
  746. package/dist/extensions/moonshot/provider-discovery.d.ts +0 -5
  747. package/dist/extensions/moonshot/provider-discovery.js +0 -15
  748. package/dist/extensions/moonshot/web-search-contract-api.d.ts +0 -5
  749. package/dist/extensions/moonshot/web-search-contract-api.js +0 -29
  750. package/dist/extensions/moonshot/web-search-provider.d.ts +0 -5
  751. package/dist/extensions/moonshot/web-search-provider.js +0 -2
  752. package/dist/extensions/qianfan/api.d.ts +0 -3
  753. package/dist/extensions/qianfan/api.js +0 -3
  754. package/dist/extensions/qianfan/fengming.plugin.json +0 -89
  755. package/dist/extensions/qianfan/index.d.ts +0 -11
  756. package/dist/extensions/qianfan/index.js +0 -26
  757. package/dist/extensions/qianfan/onboard.d.ts +0 -2
  758. package/dist/extensions/qianfan/onboard.js +0 -2
  759. package/dist/extensions/qianfan/package.json +0 -15
  760. package/dist/extensions/qianfan/provider-catalog.d.ts +0 -2
  761. package/dist/extensions/qianfan/provider-catalog.js +0 -2
  762. package/dist/extensions/qwen/api.d.ts +0 -4
  763. package/dist/extensions/qwen/api.js +0 -5
  764. package/dist/extensions/qwen/fengming.plugin.json +0 -389
  765. package/dist/extensions/qwen/index.d.ts +0 -11
  766. package/dist/extensions/qwen/index.js +0 -202
  767. package/dist/extensions/qwen/media-understanding-provider.d.ts +0 -6
  768. package/dist/extensions/qwen/media-understanding-provider.js +0 -2
  769. package/dist/extensions/qwen/model-definitions.d.ts +0 -2
  770. package/dist/extensions/qwen/model-definitions.js +0 -2
  771. package/dist/extensions/qwen/models.d.ts +0 -2
  772. package/dist/extensions/qwen/models.js +0 -2
  773. package/dist/extensions/qwen/onboard.d.ts +0 -21
  774. package/dist/extensions/qwen/onboard.js +0 -2
  775. package/dist/extensions/qwen/package.json +0 -15
  776. package/dist/extensions/qwen/provider-catalog.d.ts +0 -2
  777. package/dist/extensions/qwen/provider-catalog.js +0 -2
  778. package/dist/extensions/qwen/stream.d.ts +0 -2
  779. package/dist/extensions/qwen/stream.js +0 -2
  780. package/dist/extensions/qwen/video-generation-provider.d.ts +0 -6
  781. package/dist/extensions/qwen/video-generation-provider.js +0 -2
  782. package/dist/extensions/sensenova/fengming.plugin.json +0 -69
  783. package/dist/extensions/sensenova/index.d.ts +0 -11
  784. package/dist/extensions/sensenova/index.js +0 -45
  785. package/dist/extensions/sensenova/models.d.ts +0 -7
  786. package/dist/extensions/sensenova/models.js +0 -2
  787. package/dist/extensions/sensenova/onboard.d.ts +0 -5
  788. package/dist/extensions/sensenova/onboard.js +0 -2
  789. package/dist/extensions/sensenova/package.json +0 -15
  790. package/dist/extensions/sensenova/provider-catalog.d.ts +0 -2
  791. package/dist/extensions/sensenova/provider-catalog.js +0 -2
  792. package/dist/extensions/sensenova/provider-discovery.d.ts +0 -2
  793. package/dist/extensions/sensenova/provider-discovery.js +0 -5
  794. package/dist/extensions/stepfun/fengming.plugin.json +0 -162
  795. package/dist/extensions/stepfun/index.d.ts +0 -12
  796. package/dist/extensions/stepfun/index.js +0 -165
  797. package/dist/extensions/stepfun/onboard.d.ts +0 -7
  798. package/dist/extensions/stepfun/onboard.js +0 -2
  799. package/dist/extensions/stepfun/package.json +0 -15
  800. package/dist/extensions/stepfun/provider-catalog.d.ts +0 -14
  801. package/dist/extensions/stepfun/provider-catalog.js +0 -2
  802. package/dist/extensions/tencent/api.d.ts +0 -3
  803. package/dist/extensions/tencent/api.js +0 -4
  804. package/dist/extensions/tencent/fengming.plugin.json +0 -105
  805. package/dist/extensions/tencent/index.d.ts +0 -12
  806. package/dist/extensions/tencent/index.js +0 -62
  807. package/dist/extensions/tencent/models.d.ts +0 -2
  808. package/dist/extensions/tencent/models.js +0 -2
  809. package/dist/extensions/tencent/onboard.d.ts +0 -6
  810. package/dist/extensions/tencent/onboard.js +0 -2
  811. package/dist/extensions/tencent/package.json +0 -15
  812. package/dist/extensions/tencent/provider-catalog.d.ts +0 -2
  813. package/dist/extensions/tencent/provider-catalog.js +0 -2
  814. package/dist/extensions/tencent/provider-discovery.d.ts +0 -5
  815. package/dist/extensions/tencent/provider-discovery.js +0 -14
  816. package/dist/extensions/tiangong/fengming.plugin.json +0 -69
  817. package/dist/extensions/tiangong/index.d.ts +0 -11
  818. package/dist/extensions/tiangong/index.js +0 -45
  819. package/dist/extensions/tiangong/models.d.ts +0 -7
  820. package/dist/extensions/tiangong/models.js +0 -2
  821. package/dist/extensions/tiangong/onboard.d.ts +0 -5
  822. package/dist/extensions/tiangong/onboard.js +0 -2
  823. package/dist/extensions/tiangong/package.json +0 -15
  824. package/dist/extensions/tiangong/provider-catalog.d.ts +0 -2
  825. package/dist/extensions/tiangong/provider-catalog.js +0 -2
  826. package/dist/extensions/tiangong/provider-discovery.d.ts +0 -2
  827. package/dist/extensions/tiangong/provider-discovery.js +0 -5
  828. package/dist/extensions/volcengine/api.d.ts +0 -12
  829. package/dist/extensions/volcengine/api.js +0 -4
  830. package/dist/extensions/volcengine/fengming.plugin.json +0 -263
  831. package/dist/extensions/volcengine/index.d.ts +0 -12
  832. package/dist/extensions/volcengine/index.js +0 -88
  833. package/dist/extensions/volcengine/models.d.ts +0 -2
  834. package/dist/extensions/volcengine/models.js +0 -2
  835. package/dist/extensions/volcengine/package.json +0 -15
  836. package/dist/extensions/volcengine/provider-catalog.d.ts +0 -2
  837. package/dist/extensions/volcengine/provider-catalog.js +0 -2
  838. package/dist/extensions/volcengine/provider-discovery.d.ts +0 -5
  839. package/dist/extensions/volcengine/provider-discovery.js +0 -23
  840. package/dist/extensions/volcengine/speech-provider.d.ts +0 -5
  841. package/dist/extensions/volcengine/speech-provider.js +0 -2
  842. package/dist/extensions/volcengine/tts.d.ts +0 -22
  843. package/dist/extensions/volcengine/tts.js +0 -2
  844. package/dist/extensions/weixin/fengming.plugin.json +0 -22
  845. package/dist/extensions/weixin/index.d.ts +0 -26
  846. package/dist/extensions/weixin/index.js +0 -862
  847. package/dist/extensions/weixin/package.json +0 -45
  848. package/dist/extensions/xiaomi/api.d.ts +0 -3
  849. package/dist/extensions/xiaomi/api.js +0 -3
  850. package/dist/extensions/xiaomi/fengming.plugin.json +0 -260
  851. package/dist/extensions/xiaomi/index.d.ts +0 -12
  852. package/dist/extensions/xiaomi/index.js +0 -284
  853. package/dist/extensions/xiaomi/onboard.d.ts +0 -2
  854. package/dist/extensions/xiaomi/onboard.js +0 -2
  855. package/dist/extensions/xiaomi/package.json +0 -15
  856. package/dist/extensions/xiaomi/provider-catalog.d.ts +0 -2
  857. package/dist/extensions/xiaomi/provider-catalog.js +0 -2
  858. package/dist/extensions/xiaomi/speech-provider.d.ts +0 -5
  859. package/dist/extensions/xiaomi/speech-provider.js +0 -2
  860. package/dist/extensions/xiaomi/stream.d.ts +0 -5
  861. package/dist/extensions/xiaomi/stream.js +0 -2
  862. package/dist/extensions/xiaomi/thinking.d.ts +0 -11
  863. package/dist/extensions/xiaomi/thinking.js +0 -2
  864. package/dist/extensions/xingchen/fengming.plugin.json +0 -69
  865. package/dist/extensions/xingchen/index.d.ts +0 -11
  866. package/dist/extensions/xingchen/index.js +0 -45
  867. package/dist/extensions/xingchen/models.d.ts +0 -7
  868. package/dist/extensions/xingchen/models.js +0 -2
  869. package/dist/extensions/xingchen/onboard.d.ts +0 -5
  870. package/dist/extensions/xingchen/onboard.js +0 -2
  871. package/dist/extensions/xingchen/package.json +0 -15
  872. package/dist/extensions/xingchen/provider-catalog.d.ts +0 -2
  873. package/dist/extensions/xingchen/provider-catalog.js +0 -2
  874. package/dist/extensions/xingchen/provider-discovery.d.ts +0 -2
  875. package/dist/extensions/xingchen/provider-discovery.js +0 -5
  876. package/dist/extensions/yi/fengming.plugin.json +0 -84
  877. package/dist/extensions/yi/index.d.ts +0 -11
  878. package/dist/extensions/yi/index.js +0 -45
  879. package/dist/extensions/yi/models.d.ts +0 -7
  880. package/dist/extensions/yi/models.js +0 -2
  881. package/dist/extensions/yi/onboard.d.ts +0 -5
  882. package/dist/extensions/yi/onboard.js +0 -2
  883. package/dist/extensions/yi/package.json +0 -15
  884. package/dist/extensions/yi/provider-catalog.d.ts +0 -2
  885. package/dist/extensions/yi/provider-catalog.js +0 -2
  886. package/dist/extensions/yi/provider-discovery.d.ts +0 -2
  887. package/dist/extensions/yi/provider-discovery.js +0 -5
  888. package/dist/extensions/zai/api.d.ts +0 -4
  889. package/dist/extensions/zai/api.js +0 -4
  890. package/dist/extensions/zai/detect.d.ts +0 -2
  891. package/dist/extensions/zai/detect.js +0 -2
  892. package/dist/extensions/zai/fengming.plugin.json +0 -377
  893. package/dist/extensions/zai/index.d.ts +0 -12
  894. package/dist/extensions/zai/index.js +0 -297
  895. package/dist/extensions/zai/media-understanding-provider.d.ts +0 -5
  896. package/dist/extensions/zai/media-understanding-provider.js +0 -2
  897. package/dist/extensions/zai/model-definitions.d.ts +0 -2
  898. package/dist/extensions/zai/model-definitions.js +0 -2
  899. package/dist/extensions/zai/onboard.d.ts +0 -2
  900. package/dist/extensions/zai/onboard.js +0 -2
  901. package/dist/extensions/zai/package.json +0 -15
  902. package/dist/extensions/zai/runtime-api.d.ts +0 -2
  903. package/dist/extensions/zai/runtime-api.js +0 -2
  904. package/dist/extensions/zhinao/fengming.plugin.json +0 -69
  905. package/dist/extensions/zhinao/index.d.ts +0 -11
  906. package/dist/extensions/zhinao/index.js +0 -45
  907. package/dist/extensions/zhinao/models.d.ts +0 -7
  908. package/dist/extensions/zhinao/models.js +0 -2
  909. package/dist/extensions/zhinao/onboard.d.ts +0 -5
  910. package/dist/extensions/zhinao/onboard.js +0 -2
  911. package/dist/extensions/zhinao/package.json +0 -15
  912. package/dist/extensions/zhinao/provider-catalog.d.ts +0 -2
  913. package/dist/extensions/zhinao/provider-catalog.js +0 -2
  914. package/dist/extensions/zhinao/provider-discovery.d.ts +0 -2
  915. package/dist/extensions/zhinao/provider-discovery.js +0 -5
  916. package/dist/fengming-runtime-0jdu_329.d.ts +0 -153
  917. package/dist/fengming-tools-gQkwsWYz.js +0 -12221
  918. package/dist/fengming.plugin-C-Kdi1_5.js +0 -130
  919. package/dist/fengming.plugin-CRPqMj85.js +0 -166
  920. package/dist/gateway-cli-BV1V43-D.js +0 -443
  921. package/dist/gateway-method-runtime-J2OPP_oH.js +0 -21
  922. package/dist/get-reply-BE8ZGJos.js +0 -5198
  923. package/dist/get-reply-from-config.runtime-C5wfxVI_.js +0 -2
  924. package/dist/heartbeat-runner-_0HlObMb.js +0 -5
  925. package/dist/heartbeat-runner.runtime-DvYz_4Z3.js +0 -3
  926. package/dist/hook-runtime-BH9moP5T.js +0 -4
  927. package/dist/hooks-icCwsmrQ.js +0 -536
  928. package/dist/host-compat-dfJvEfe7.d.ts +0 -21
  929. package/dist/http-registry-Buj7R-F_.d.ts +0 -23
  930. package/dist/image-generation-provider-hrRXkkGc.js +0 -152
  931. package/dist/inbound-reply-dispatch-5AYt56Yt.js +0 -147
  932. package/dist/inbound-reply-dispatch-B5weFW8i.js +0 -2
  933. package/dist/inbound-reply-dispatch-cJh4H31y.d.ts +0 -156
  934. package/dist/index-AZzJCgph.d.ts +0 -1497
  935. package/dist/infra-runtime-3_0R8nmO.js +0 -32
  936. package/dist/init-BnfkYG_k.js +0 -59
  937. package/dist/interactive-V8NfYsTW.d.ts +0 -26
  938. package/dist/isolated-agent-CgH7dfOj.js +0 -1097
  939. package/dist/isolated-agent-dBWkiw0a.js +0 -2
  940. package/dist/kernel-Ds2aqAJF.d.ts +0 -241
  941. package/dist/kimi-web-search-provider-QJT3Ftj3.js +0 -80
  942. package/dist/kimi-web-search-provider.runtime-Dj3SS4T5.js +0 -307
  943. package/dist/kimi-web-search-provider.runtime.js +0 -1
  944. package/dist/lib-Dg4yjNFQ.js +0 -871
  945. package/dist/lifecycle-B9k7QGsS.js +0 -570
  946. package/dist/list.probe-CbVHFNwf.js +0 -2
  947. package/dist/list.probe-CxiEBmyW.js +0 -451
  948. package/dist/list.status-command-DE-edGgB.js +0 -815
  949. package/dist/llm-slug-generator-DJgq9eFd.js +0 -78
  950. package/dist/loader-5AqYM9PC.d.ts +0 -142
  951. package/dist/local-dispatch.runtime-D3F4v51B.js +0 -10
  952. package/dist/manager-BWf1ks-Z.d.ts +0 -409
  953. package/dist/mcp-http-DU7Nsg4P.js +0 -583
  954. package/dist/mcp-http-iZCW6Cet.js +0 -2
  955. package/dist/media-runtime-DZ5RpQN7.d.ts +0 -261
  956. package/dist/media-understanding-DEdEyoQB.d.ts +0 -46
  957. package/dist/media-understanding-provider-4JHrQOUE.js +0 -70
  958. package/dist/media-understanding-provider-BV7O82XV.js +0 -29
  959. package/dist/media-understanding-provider-BlPRhYkx.js +0 -69
  960. package/dist/media-understanding-provider-BuX8eQLj.js +0 -13
  961. package/dist/memory-core-host-engine-embeddings-BDu5fx8E.d.ts +0 -324
  962. package/dist/memory-core-host-engine-storage-CdCuH-E2.d.ts +0 -54
  963. package/dist/message-handler-L6QLWNVP.js +0 -1806
  964. package/dist/minimax-web-search-provider-_gxeEOy8.js +0 -58
  965. package/dist/minimax-web-search-provider.runtime-BF4mGi6U.js +0 -148
  966. package/dist/minimax-web-search-provider.runtime.js +0 -1
  967. package/dist/model-catalog-DCnRkX8f.d.ts +0 -88
  968. package/dist/model-definitions-B2gY43hI.d.ts +0 -34
  969. package/dist/model-definitions-BLOyeH5h.js +0 -73
  970. package/dist/model-definitions-CoByf5mT.js +0 -243
  971. package/dist/model-definitions-WP3OmzbS.d.ts +0 -57
  972. package/dist/model-selection-DhTE6GZD.js +0 -352
  973. package/dist/models--iAR9QkZ.js +0 -175
  974. package/dist/models-8ImVEkvh.js +0 -36
  975. package/dist/models-BIDM8htk.js +0 -48
  976. package/dist/models-BRgRfrcS.js +0 -36
  977. package/dist/models-Bib5-APc.js +0 -67
  978. package/dist/models-Bl67zOoe.js +0 -36
  979. package/dist/models-BqDDYFE3.d.ts +0 -65
  980. package/dist/models-BtRQoRIu.js +0 -36
  981. package/dist/models-BvXmOXik.js +0 -48
  982. package/dist/models-C-sJciOD.d.ts +0 -9
  983. package/dist/models-COnXPdlL.js +0 -24
  984. package/dist/models-CXTmk-Da.d.ts +0 -8
  985. package/dist/models-Cz0C_8re.js +0 -36
  986. package/dist/models-DbwEIt-m.d.ts +0 -15
  987. package/dist/models-DgXkSADi.js +0 -30
  988. package/dist/models-cli-Bv3y3JgQ.js +0 -257
  989. package/dist/monitor-BiVOsbbN.js +0 -1024
  990. package/dist/monitor-BumfRp1t.js +0 -60
  991. package/dist/monitor.account-Cd6EwtuZ.js +0 -5382
  992. package/dist/music-generation-provider-ZdDMiC-c.js +0 -308
  993. package/dist/nodes-C0f8XgD5.js +0 -1483
  994. package/dist/nodes-Dk4vOgg9.js +0 -3
  995. package/dist/nodes-pending-Cjg09MXz.js +0 -211
  996. package/dist/oauth-BIO69Qw0.d.ts +0 -25
  997. package/dist/oauth-CnO10TN2.js +0 -207
  998. package/dist/onboard-B3BYT5k7.js +0 -34
  999. package/dist/onboard-BDMNV6RE.js +0 -23
  1000. package/dist/onboard-B_WNNy5F.d.ts +0 -6
  1001. package/dist/onboard-BbyMaErU.js +0 -69
  1002. package/dist/onboard-BuYPNE6j2.js +0 -23
  1003. package/dist/onboard-C394zMnM.d.ts +0 -11
  1004. package/dist/onboard-CHn4oVbY.js +0 -24
  1005. package/dist/onboard-CPpVbb0O.js +0 -73
  1006. package/dist/onboard-CWDx7Crt.js +0 -23
  1007. package/dist/onboard-CbzkwBzu.d.ts +0 -12
  1008. package/dist/onboard-D099qUd0.js +0 -23
  1009. package/dist/onboard-D7dbzfHc.js +0 -23
  1010. package/dist/onboard-DB-x0nHF.js +0 -30
  1011. package/dist/onboard-DFVrRnxJ.js +0 -23
  1012. package/dist/onboard-DFiqoOc2.d.ts +0 -7
  1013. package/dist/onboard-DJaMK3rr.d.ts +0 -6
  1014. package/dist/onboard-DMdK8D_h.js +0 -67
  1015. package/dist/onboard-J-KL-I6m.js +0 -48
  1016. package/dist/onboard-MIBU-Rmv.js +0 -39
  1017. package/dist/onboard-vmGylfFe.js +0 -23
  1018. package/dist/openai-compat-errors-Dcr5Y8bF.js +0 -136
  1019. package/dist/openai-http-CcqspzU6.js +0 -836
  1020. package/dist/openresponses-http-BnyYYvUF.js +0 -1175
  1021. package/dist/operations-H2Oq0KYz.js +0 -805
  1022. package/dist/outbound.types-BhRehecY.d.ts +0 -291
  1023. package/dist/plugin-enabled-CEIKWKrq.js +0 -232
  1024. package/dist/plugin-entry-CTVRRaaA.d.ts +0 -47
  1025. package/dist/plugin-registration-BTyO5Fwt.js +0 -97
  1026. package/dist/plugin-runtime-_XF2N_UQ.d.ts +0 -117
  1027. package/dist/plugin-sdk/bundled-channel-config-schema-BsOWCrJT.d.ts +0 -3169
  1028. package/dist/plugin-service-B91jVlmZ.d.ts +0 -24
  1029. package/dist/plugin-service-CtGwVz8V.js +0 -1249
  1030. package/dist/prepare.runtime-9dlboph7.js +0 -798
  1031. package/dist/preview-warnings-DJx4KJpC.js +0 -618
  1032. package/dist/program-CWC-NBBB.js +0 -131
  1033. package/dist/provider-api-key-auth-BmNcYRMl.d.ts +0 -27
  1034. package/dist/provider-auth-api-key-CCaFiqY3.js +0 -5
  1035. package/dist/provider-auth-result-D_E9dcVc.d.ts +0 -21
  1036. package/dist/provider-catalog-5KZLmrDO.js +0 -11
  1037. package/dist/provider-catalog-7P6AvDzS.js +0 -11
  1038. package/dist/provider-catalog-B2gyTjTU.js +0 -88
  1039. package/dist/provider-catalog-B3YBhe77.js +0 -17
  1040. package/dist/provider-catalog-B7XEeuUm.js +0 -11
  1041. package/dist/provider-catalog-BFGPRd9v.js +0 -17
  1042. package/dist/provider-catalog-BLvkIMSk.d.ts +0 -6
  1043. package/dist/provider-catalog-BPBL9mJf.d.ts +0 -5
  1044. package/dist/provider-catalog-BRkZ6-HD.d.ts +0 -5
  1045. package/dist/provider-catalog-Bfl_AoTZ.js +0 -142
  1046. package/dist/provider-catalog-BpiHWHu1.js +0 -11
  1047. package/dist/provider-catalog-C1qDLekT.d.ts +0 -5
  1048. package/dist/provider-catalog-CKWNCfry.js +0 -11
  1049. package/dist/provider-catalog-CUHB2pSt.d.ts +0 -7
  1050. package/dist/provider-catalog-CWqN2j6J.d.ts +0 -5
  1051. package/dist/provider-catalog-CZ8oYbx3.js +0 -11
  1052. package/dist/provider-catalog-CcQ5-4ZW.d.ts +0 -6
  1053. package/dist/provider-catalog-Cd16uZ0U.js +0 -20
  1054. package/dist/provider-catalog-CpF2D0VK.js +0 -61
  1055. package/dist/provider-catalog-CvXq36zW.d.ts +0 -5
  1056. package/dist/provider-catalog-D2pgEME3.js +0 -48
  1057. package/dist/provider-catalog-DPzcupEl.d.ts +0 -5
  1058. package/dist/provider-catalog-DaeI606G.d.ts +0 -9
  1059. package/dist/provider-catalog-DrOCtTb-.js +0 -11
  1060. package/dist/provider-catalog-DwZ1J2Al.d.ts +0 -6
  1061. package/dist/provider-catalog-Dy7IcHmS.js +0 -107
  1062. package/dist/provider-catalog-TsZS52nq.d.ts +0 -10
  1063. package/dist/provider-catalog-YqIFRCND.d.ts +0 -5
  1064. package/dist/provider-catalog-Ywb5jRwG.d.ts +0 -5
  1065. package/dist/provider-catalog-evknl1oN.js +0 -11
  1066. package/dist/provider-catalog-l0hFpFO2.d.ts +0 -17
  1067. package/dist/provider-catalog-shared-DsRBv0Tp.d.ts +0 -62
  1068. package/dist/provider-dispatcher-BMy9mBJ1.js +0 -22
  1069. package/dist/provider-model-shared-CPAfQBNs.d.ts +0 -143
  1070. package/dist/provider-models-Diu65OcG.d.ts +0 -18
  1071. package/dist/provider-models-LE7PlLYY.js +0 -22
  1072. package/dist/provider-onboard-CpvXEmvz.d.ts +0 -91
  1073. package/dist/provider-registration-DF-LkmNE.js +0 -235
  1074. package/dist/provider-registry-D9cTPW1F.d.ts +0 -8
  1075. package/dist/provider-registry-DI7gMKUP.d.ts +0 -8
  1076. package/dist/provider-registry-DZtgZDkl.d.ts +0 -29
  1077. package/dist/provider-self-hosted-setup-CoHvoyKm.d.ts +0 -74
  1078. package/dist/provider-stream-BpXJr5Ap.d.ts +0 -139
  1079. package/dist/provider-stream-family-Bj5aBD8w.js +0 -2
  1080. package/dist/provider-stream-shared-BaUkhUHj.d.ts +0 -132
  1081. package/dist/provider-usage-DFUhW2do.js +0 -651
  1082. package/dist/provider-web-search-contract-fields-CkXzSsWu.d.ts +0 -25
  1083. package/dist/pw-ai-9Q_dIq4B.js +0 -3064
  1084. package/dist/register.agent-CbfrlzXB.js +0 -152
  1085. package/dist/register.crestodian-CEg0rPfK.js +0 -24
  1086. package/dist/register.maintenance-k9N8I4Wg.js +0 -85
  1087. package/dist/register.subclis-CrXOeaS3.js +0 -3
  1088. package/dist/register.subclis-DfKlni8N.js +0 -31
  1089. package/dist/register.subclis-core-Bg4wbDsO.js +0 -278
  1090. package/dist/registry-Bh3-P2HL.d.ts +0 -8
  1091. package/dist/registry-types-BmEUS4d3.d.ts +0 -392
  1092. package/dist/repair-sequencing-E4yViXG9.js +0 -652
  1093. package/dist/reply-payload-S2mrc_Mh.d.ts +0 -200
  1094. package/dist/reply-turn-admission-BBoPjmGB.js +0 -2056
  1095. package/dist/reply.runtime-C5wfxVI_.js +0 -2
  1096. package/dist/result-fallback-classifier-CX4iLD1G.js +0 -98
  1097. package/dist/route-CifxcQZ1.js +0 -475
  1098. package/dist/routes-B3XAOeWo.js +0 -2
  1099. package/dist/routes-H185h3U-.js +0 -3701
  1100. package/dist/run-CTJFbwbB.js +0 -1162
  1101. package/dist/run-command-B7B53tYk.js +0 -23
  1102. package/dist/run-command-BFuxRDxS.js +0 -2
  1103. package/dist/run-context-C7im9ICg.js +0 -66
  1104. package/dist/run-embedded.runtime-TljBTbzh.js +0 -4
  1105. package/dist/run-execution-cli.runtime-Bt5zwx1W.js +0 -4
  1106. package/dist/run-executor.runtime-hmbWX2Ct.js +0 -330
  1107. package/dist/run-subagent-registry.runtime-B70X80nS.js +0 -2
  1108. package/dist/runtime-DoKE0o7v.js +0 -436
  1109. package/dist/runtime-api-Ca4Llbgf.js +0 -12
  1110. package/dist/runtime-api-pa8xcEmg.d.ts +0 -5
  1111. package/dist/runtime-channel-CFQ59svm.js +0 -148
  1112. package/dist/runtime-channel-DRwCWGUx.js +0 -2
  1113. package/dist/runtime-embedded-agent.runtime-DwmqKUVp.js +0 -2
  1114. package/dist/runtime-forwarders-BMThPHg_.d.ts +0 -39
  1115. package/dist/sdk-setup-tools-Cg_Tabrf.js +0 -8
  1116. package/dist/selection-COhr7g82.js +0 -18365
  1117. package/dist/selection-_G44EVqd.js +0 -3
  1118. package/dist/send-media-BNc67G7I.js +0 -2072
  1119. package/dist/server-5rR0RCpI.js +0 -24
  1120. package/dist/server-context-BhiPROPA.js +0 -955
  1121. package/dist/server-context-OShBAJZQ.js +0 -2
  1122. package/dist/server-cron-Bkzb9edh.js +0 -3173
  1123. package/dist/server-cron-DdR-ugiU.js +0 -2
  1124. package/dist/server-lwtC1vaS.js +0 -72
  1125. package/dist/server-methods-BY_ZqDFJ.js +0 -497
  1126. package/dist/server-node-events-CLvE94AS.js +0 -597
  1127. package/dist/server-plugin-bootstrap-cKOAH5GL.js +0 -71
  1128. package/dist/server-plugins-CPpUykw5.js +0 -435
  1129. package/dist/server-reload-handlers-uzt4VDZ-.js +0 -719
  1130. package/dist/server-restart-sentinel-CpvV0t4O.js +0 -700
  1131. package/dist/server-runtime-services-BhOHoerM.js +0 -147
  1132. package/dist/server-runtime-services-D3Ig68nC.js +0 -3
  1133. package/dist/server-startup-plugins-DslzKVHK.js +0 -127
  1134. package/dist/server-startup-post-attach-DPFBTQez.js +0 -793
  1135. package/dist/server-ws-runtime-D0zoWoiz.js +0 -374
  1136. package/dist/server.impl-CzqLQ3qt.js +0 -2622
  1137. package/dist/session-kill-http-D8JhwZVS.js +0 -121
  1138. package/dist/session-reset-service-uoi7E4Xp.js +0 -651
  1139. package/dist/session-status.runtime-CZK5IU8w.js +0 -2
  1140. package/dist/session-subagent-reactivation.runtime-BSO00-FY.js +0 -2
  1141. package/dist/session-tab-registry-DM9U7e3o.js +0 -551
  1142. package/dist/sessions-B-SkIoaa.js +0 -1917
  1143. package/dist/sessions-history-http-DCiOG4FK.js +0 -432
  1144. package/dist/sessions-patch-DlAAvQvB.js +0 -401
  1145. package/dist/sessions-resolve-DfMXookg.js +0 -180
  1146. package/dist/sessions.runtime-0V2YxKxB.js +0 -2
  1147. package/dist/snapshot-urls-Ble1-NEW.js +0 -317
  1148. package/dist/speech-core-Bk60ZS_y.d.ts +0 -49
  1149. package/dist/speech-provider-DQO9eZd0.js +0 -233
  1150. package/dist/speech-provider-DnBCla4V.js +0 -171
  1151. package/dist/speech-provider-DyYHFxT5.js +0 -227
  1152. package/dist/standalone-9EWfcxeO.js +0 -42
  1153. package/dist/startup-context-nti4X0_w.js +0 -314
  1154. package/dist/status-subagents.runtime-CPZb1EF1.js +0 -32
  1155. package/dist/status-text-C1Hf37lF.js +0 -301
  1156. package/dist/stream-9VBt1MDs.js +0 -26
  1157. package/dist/stream-B_3P7v7P.js +0 -86
  1158. package/dist/stream-CXsue2-v.d.ts +0 -9
  1159. package/dist/stream-oNBFxfKt.d.ts +0 -5
  1160. package/dist/subagent-announce-CPjQQLy8.js +0 -353
  1161. package/dist/subagent-announce-delivery-B6iBOicL.js +0 -1369
  1162. package/dist/subagent-control-DP72sk-l.js +0 -492
  1163. package/dist/subagent-hooks-B1oUIYH3.js +0 -2
  1164. package/dist/subagent-hooks-BkGj4_xI.js +0 -230
  1165. package/dist/subagent-hooks-api-D2mulK3S.js +0 -23
  1166. package/dist/subagent-registry-CEKAUB5h.js +0 -3
  1167. package/dist/subagent-registry-OUVucPAn.js +0 -2627
  1168. package/dist/subagent-session-cleanup-Bx8d3kw0.js +0 -390
  1169. package/dist/system-CelaP2zI.js +0 -111
  1170. package/dist/talk-DGOI3Lu3.js +0 -2454
  1171. package/dist/target-id-BXRG7x9x.js +0 -107
  1172. package/dist/thinking-B8V29FhB.js +0 -35
  1173. package/dist/thread-bindings-DpVdEPZ0.js +0 -228
  1174. package/dist/tool-DHzDpxE4.js +0 -143
  1175. package/dist/tool-dispatch-ClP3Rc7g.js +0 -155
  1176. package/dist/tool-resolution-CZcLod1d.js +0 -153
  1177. package/dist/tool-split-BhiQ8676.d.ts +0 -19
  1178. package/dist/tools-ZvSvbsCW.d.ts +0 -38
  1179. package/dist/tools-effective-C2mHZT-A.js +0 -442
  1180. package/dist/tools-effective-inventory-ctnM7hc6.js +0 -379
  1181. package/dist/tools-invoke-Ci6Rux2s.js +0 -51
  1182. package/dist/tools-invoke-http-CJflXcJk.js +0 -68
  1183. package/dist/tools-invoke-shared-BLu_mJEX.js +0 -200
  1184. package/dist/tts-B2rPJPij.js +0 -83
  1185. package/dist/tts-Gp9FI3_n.js +0 -163
  1186. package/dist/tts-runtime-DNi1HXPF.d.ts +0 -230
  1187. package/dist/tui-BUhfQ9vD.js +0 -3
  1188. package/dist/tui-BhH5mvLf.js +0 -2
  1189. package/dist/tui-backend-C_4ajTHI.js +0 -257
  1190. package/dist/tui-cli-BhWJ-QoB.js +0 -40
  1191. package/dist/tui-ink-run-BTWbUQGb.js +0 -7414
  1192. package/dist/tui-ink-run-DfTdivkh.js +0 -2
  1193. package/dist/types-B4fW3r5y.d.ts +0 -111
  1194. package/dist/types-DI62NfFe.d.ts +0 -7034
  1195. package/dist/types-sAih_uQb.d.ts +0 -393
  1196. package/dist/types.public-B3MKhuo2.d.ts +0 -70
  1197. package/dist/video-generation-B9c6a5cw.js +0 -207
  1198. package/dist/video-generation-BgJp7UIA.d.ts +0 -224
  1199. package/dist/video-generation-provider-BjiVjf40.js +0 -325
  1200. package/dist/video-generation-provider-CsnQJg_h.js +0 -297
  1201. package/dist/video-generation-provider-DtU-ZPqP.js +0 -64
  1202. package/dist/video-generation-provider-wZ0bzv0e.js +0 -77
  1203. package/dist/webhook-targets-Cy8e7y3g.d.ts +0 -99
  1204. package/dist/zod-schema.core-BGLctDlK.d.ts +0 -166
  1205. package/skills/canvas/SKILL.md +0 -78
  1206. package/skills/clawhub/SKILL.md +0 -77
  1207. package/skills/coding-agent/SKILL.md +0 -143
  1208. package/skills/diagram-maker/SKILL.md +0 -53
  1209. package/skills/diagram-maker/references/excalidraw-patterns.md +0 -85
  1210. package/skills/diagram-maker/references/svg-template.md +0 -112
  1211. package/skills/gemini/SKILL.md +0 -47
  1212. package/skills/gh-issues/SKILL.md +0 -213
  1213. package/skills/gifgrep/SKILL.md +0 -85
  1214. package/skills/github/SKILL.md +0 -84
  1215. package/skills/healthcheck/SKILL.md +0 -105
  1216. package/skills/mcporter/SKILL.md +0 -61
  1217. package/skills/meme-maker/SKILL.md +0 -42
  1218. package/skills/meme-maker/references/templates.json +0 -358
  1219. package/skills/meme-maker/scripts/meme.mjs +0 -398
  1220. package/skills/model-usage/SKILL.md +0 -71
  1221. package/skills/model-usage/references/codexbar-cli.md +0 -33
  1222. package/skills/model-usage/scripts/model_usage.py +0 -319
  1223. package/skills/model-usage/scripts/test_model_usage.py +0 -40
  1224. package/skills/nano-pdf/SKILL.md +0 -38
  1225. package/skills/node-connect/SKILL.md +0 -143
  1226. package/skills/node-inspect-debugger/SKILL.md +0 -85
  1227. package/skills/openai-whisper/SKILL.md +0 -38
  1228. package/skills/openai-whisper-api/SKILL.md +0 -71
  1229. package/skills/openai-whisper-api/scripts/transcribe.sh +0 -154
  1230. package/skills/oracle/SKILL.md +0 -126
  1231. package/skills/pyproject.toml +0 -10
  1232. package/skills/python-debugpy/SKILL.md +0 -73
  1233. package/skills/sag/SKILL.md +0 -87
  1234. package/skills/session-logs/SKILL.md +0 -151
  1235. package/skills/sherpa-onnx-tts/SKILL.md +0 -109
  1236. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +0 -178
  1237. package/skills/skill-creator/SKILL.md +0 -78
  1238. package/skills/skill-creator/license.txt +0 -202
  1239. package/skills/skill-creator/scripts/init_skill.py +0 -378
  1240. package/skills/skill-creator/scripts/package_skill.py +0 -139
  1241. package/skills/skill-creator/scripts/quick_validate.py +0 -169
  1242. package/skills/skill-creator/scripts/test_package_skill.py +0 -161
  1243. package/skills/skill-creator/scripts/test_quick_validate.py +0 -116
  1244. package/skills/spike/SKILL.md +0 -51
  1245. package/skills/summarize/SKILL.md +0 -87
  1246. package/skills/taskflow/SKILL.md +0 -149
  1247. package/skills/taskflow/examples/inbox-triage.lobster +0 -33
  1248. package/skills/taskflow/examples/pr-intake.lobster +0 -32
  1249. package/skills/taskflow-inbox-triage/SKILL.md +0 -119
  1250. package/skills/video-frames/SKILL.md +0 -46
  1251. package/skills/video-frames/scripts/frame.sh +0 -81
  1252. package/skills/voice-call/SKILL.md +0 -45
  1253. package/skills/weather/SKILL.md +0 -64
  1254. /package/dist/{acp-runtime-backend-DbchQ02o.js → acp-runtime-backend-DZ1Lnt7f.js} +0 -0
  1255. /package/dist/{delegate-k1aptKei.js → delegate-CwhxUdeb.js} +0 -0
  1256. /package/dist/{dispatch-acp-CD4YxPpf.js → dispatch-acp-BP4I5ZQf.js} +0 -0
  1257. /package/dist/{exec-approvals-ByWUCFQM.js → exec-approvals-ByWUCFQM2.js} +0 -0
  1258. /package/dist/{heartbeat-runner-CM0UZxa_.js → heartbeat-runner-CL3alQ8-.js} +0 -0
  1259. /package/dist/{index-B0VJdRJQ.d.ts → index-B0VJdRJQ2.d.ts} +0 -0
  1260. /package/dist/{library-CQ71yATP.js → library-CiTr_aqC.js} +0 -0
  1261. /package/dist/{run-session-state-DbDeH-q6.js → run-session-state-BOMUtBKZ.js} +0 -0
  1262. /package/dist/{session-subagent-reactivation-Bj91A2ms.js → session-subagent-reactivation-CH0C2I6Y.js} +0 -0
  1263. /package/dist/{types-C4HgagiY2.d.ts → types-C4HgagiY.d.ts} +0 -0
@@ -0,0 +1,2309 @@
1
+ import { a as normalizeLowercaseStringOrEmpty, c as normalizeOptionalString, s as normalizeOptionalLowercaseString } from "./string-coerce-DKw2K5wM.js";
2
+ import { _ as parseStrictPositiveInteger } from "./number-coercion-D1aDmIZp.js";
3
+ import { y as resolveStateDir } from "./paths-9MqJt9oL.js";
4
+ import { t as formatDocsLink } from "./links-CgdQazeA.js";
5
+ import { s as hasConfiguredSecretInput } from "./types.secrets-Z7uJY7vF.js";
6
+ import { n as normalizeAccountId, t as DEFAULT_ACCOUNT_ID } from "./account-id-B0YIFDpA.js";
7
+ import { l as normalizeAgentId } from "./session-key-CJf5_zWs.js";
8
+ import { At as boolean, Et as array, Nn as record, Rn as string, Tn as object, Xn as union, Zn as unknown, dn as literal, wn as number, yt as _enum } from "./schemas-Del5uzR8.js";
9
+ import { n as ZodIssueCode } from "./compat-bCpUj7Jq.js";
10
+ import { r as buildChannelConfigSchema } from "./config-schema-CDjjqZEJ.js";
11
+ import { i as resolveSessionFilePath, u as resolveStorePath } from "./paths-C79m3Aob.js";
12
+ import { d as updateSessionStore } from "./store-DH20opqS.js";
13
+ import { n as getSessionBindingService } from "./session-binding-service-BjjMIxQb.js";
14
+ import { l as normalizeMessagePresentation } from "./payload-Cpx3heIy.js";
15
+ import { i as createLazyRuntimeNamedExport } from "./lazy-runtime-D-7_JraP.js";
16
+ import { i as createActionGate } from "./common-DSTX6z7j.js";
17
+ import { i as createHybridChannelConfigAdapter, t as adaptScopedAccountAccessor } from "./channel-config-helpers-DRhB8UDj.js";
18
+ import "./number-runtime-Cu8gqEYx.js";
19
+ import "./string-coerce-runtime-BurriTLB.js";
20
+ import { t as chunkTextForOutbound } from "./text-chunking-BoSCx-lb.js";
21
+ import { t as formatAllowFromLowercase } from "./allow-from-D9EKO1Ew.js";
22
+ import { E as projectConfigAccountIdWarningCollector, g as createAllowlistProviderGroupPolicyWarningCollector } from "./channel-policy-9Cz1b0wS.js";
23
+ import { t as createChannelDirectoryAdapter } from "./directory-runtime-DXtG3OFQ.js";
24
+ import { n as createRuntimeOutboundDelegates, t as createRuntimeDirectoryLiveAdapter } from "./runtime-forwarders-CJHIfxll.js";
25
+ import { i as createChatChannelPlugin, t as buildChannelOutboundSessionRoute, u as stripChannelTargetPrefix } from "./core-Bpk-qSJH.js";
26
+ import "./routing-B7t3bis6.js";
27
+ import { t as createSetupTranslator } from "./i18n-B2NGlG0C.js";
28
+ import { D as patchTopLevelChannelConfigSection, P as promptSingleChannelSecretInput, Q as splitSetupEntries, v as mergeAllowFromEntries } from "./setup-wizard-helpers-DM-DI5ds.js";
29
+ import "./setup-BWHs8y0v.js";
30
+ import { t as resolveApprovalApprovers } from "./approval-approvers-DngDfOqq.js";
31
+ import { t as createResolvedApproverActionAuthAdapter } from "./approval-auth-helpers-DZDuVKe4.js";
32
+ import { S as defineChannelMessageAdapter } from "./channel-outbound-Bt45s9Ss.js";
33
+ import "./conversation-runtime-DDekWU-U.js";
34
+ import { n as describeAccountSnapshot } from "./account-helpers-BSPsbBAx.js";
35
+ import "./account-resolution-BvA1gwmf.js";
36
+ import { t as PAIRING_APPROVED_MESSAGE } from "./pairing-message-CdyV9HGl.js";
37
+ import { d as createDefaultChannelRuntimeState, i as buildProbeChannelStatusSummary, u as createComputedAccountStatusAdapter } from "./status-helpers-BO7Kjlqy.js";
38
+ import "./channel-status-CGihze3B.js";
39
+ import "./channel-config-primitives-RuHxMs98.js";
40
+ import "./channel-actions-DJzt_5gv.js";
41
+ import "./channel-core-Cj9JTqeu.js";
42
+ import { i as createPairingPrefixStripper } from "./channel-pairing-Cv2ZnWj8.js";
43
+ import { t as loadSessionStore } from "./session-store-runtime-BFRScnF6.js";
44
+ import { r as buildSecretInputSchema } from "./secret-input-CBkLs08d.js";
45
+ import "./state-paths-CERdaFAp.js";
46
+ import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DaD9SG4D.js";
47
+ import { n as looksLikeFeishuId, r as normalizeFeishuTarget } from "./targets-RVqOtwc5.js";
48
+ import { a as resolveDefaultFeishuAccountId, i as listFeishuAccountIds, l as resolveFeishuRuntimeAccount, m as isRecord$1, n as inspectFeishuCredentials, r as listEnabledFeishuAccounts, s as resolveFeishuAccount } from "./accounts-DU3luv-7.js";
49
+ import { n as createFeishuSendReceipt } from "./send-result-D3UUXtak.js";
50
+ import { i as listFeishuDirectoryPeers, r as listFeishuDirectoryGroups, t as buildFeishuPresentationCard } from "./presentation-card-DFxD_c4q.js";
51
+ import { t as messageActionTargetAliases } from "./security-audit-CLHDHSiw.js";
52
+ import { s as resolveFeishuGroupToolPolicy } from "./policy-DAfEs1ki.js";
53
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qXYOiUB7.js";
54
+ import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-CGEy1FMp.js";
55
+ import { t as resolveFeishuSessionConversation } from "./session-conversation-ChO3o_8-.js";
56
+ import fs from "node:fs";
57
+ import path from "node:path";
58
+ import os from "node:os";
59
+ //#region extensions/feishu/src/approval-auth.ts
60
+ function normalizeFeishuApproverId(value) {
61
+ const trimmed = normalizeOptionalLowercaseString(normalizeFeishuTarget(String(value)));
62
+ return trimmed?.startsWith("ou_") ? trimmed : void 0;
63
+ }
64
+ const feishuApprovalAuth = createResolvedApproverActionAuthAdapter({
65
+ channelLabel: "Feishu",
66
+ resolveApprovers: ({ cfg, accountId }) => {
67
+ const account = resolveFeishuAccount({
68
+ cfg,
69
+ accountId
70
+ }).config;
71
+ return resolveApprovalApprovers({
72
+ allowFrom: account.allowFrom,
73
+ normalizeApprover: normalizeFeishuApproverId
74
+ });
75
+ },
76
+ normalizeSenderId: (value) => normalizeFeishuApproverId(value)
77
+ });
78
+ //#endregion
79
+ //#region extensions/feishu/src/config-schema.ts
80
+ const ChannelActionsSchema = object({ reactions: boolean().optional() }).strict().optional();
81
+ const DmPolicySchema = _enum([
82
+ "open",
83
+ "pairing",
84
+ "allowlist"
85
+ ]);
86
+ const GroupPolicySchema = union([_enum([
87
+ "open",
88
+ "allowlist",
89
+ "disabled"
90
+ ]), literal("allowall").transform(() => "open")]);
91
+ const FeishuDomainSchema = union([_enum(["feishu", "lark"]), string().url().startsWith("https://")]);
92
+ const FeishuConnectionModeSchema = _enum(["websocket", "webhook"]);
93
+ const TtsOverrideSchema = object({
94
+ auto: _enum([
95
+ "off",
96
+ "always",
97
+ "inbound",
98
+ "tagged"
99
+ ]).optional(),
100
+ enabled: boolean().optional(),
101
+ mode: _enum(["final", "all"]).optional(),
102
+ provider: string().optional(),
103
+ persona: string().optional(),
104
+ personas: record(string(), record(string(), unknown())).optional(),
105
+ summaryModel: string().optional(),
106
+ modelOverrides: record(string(), unknown()).optional(),
107
+ providers: record(string(), record(string(), unknown())).optional(),
108
+ prefsPath: string().optional(),
109
+ maxTextLength: number().int().min(1).optional(),
110
+ timeoutMs: number().int().min(1e3).max(12e4).optional()
111
+ }).strict().optional();
112
+ const ToolPolicySchema = object({
113
+ allow: array(string()).optional(),
114
+ deny: array(string()).optional()
115
+ }).strict().optional();
116
+ const DmConfigSchema = object({
117
+ enabled: boolean().optional(),
118
+ systemPrompt: string().optional()
119
+ }).strict().optional();
120
+ const MarkdownConfigSchema = object({
121
+ mode: _enum([
122
+ "native",
123
+ "escape",
124
+ "strip"
125
+ ]).optional(),
126
+ tableMode: _enum([
127
+ "native",
128
+ "ascii",
129
+ "simple"
130
+ ]).optional()
131
+ }).strict().optional();
132
+ const RenderModeSchema = _enum([
133
+ "auto",
134
+ "raw",
135
+ "card"
136
+ ]).optional();
137
+ const StreamingModeSchema = boolean().optional();
138
+ const BlockStreamingSchema = boolean().optional();
139
+ const BlockStreamingCoalesceSchema = object({
140
+ enabled: boolean().optional(),
141
+ minDelayMs: number().int().positive().optional(),
142
+ maxDelayMs: number().int().positive().optional()
143
+ }).strict().optional();
144
+ const ChannelHeartbeatVisibilitySchema = object({
145
+ visibility: _enum(["visible", "hidden"]).optional(),
146
+ intervalMs: number().int().positive().optional()
147
+ }).strict().optional();
148
+ /**
149
+ * Dynamic agent creation configuration.
150
+ * When enabled, a new agent is created for each unique DM user.
151
+ */
152
+ const DynamicAgentCreationSchema = object({
153
+ enabled: boolean().optional(),
154
+ workspaceTemplate: string().optional(),
155
+ agentDirTemplate: string().optional(),
156
+ maxAgents: number().int().positive().optional()
157
+ }).strict().optional();
158
+ /**
159
+ * Feishu tools configuration.
160
+ * Controls which tool categories are enabled.
161
+ *
162
+ * Dependencies:
163
+ * - wiki requires doc (wiki content is edited via doc tools)
164
+ * - perm can work independently but is typically used with drive
165
+ */
166
+ const FeishuToolsConfigSchema = object({
167
+ doc: boolean().optional(),
168
+ chat: boolean().optional(),
169
+ wiki: boolean().optional(),
170
+ drive: boolean().optional(),
171
+ perm: boolean().optional(),
172
+ scopes: boolean().optional()
173
+ }).strict().optional();
174
+ /**
175
+ * Group session scope for routing Feishu group messages.
176
+ * - "group" (default): one session per group chat
177
+ * - "group_sender": one session per (group + sender)
178
+ * - "group_topic": one session per group topic thread (falls back to group if no topic)
179
+ * - "group_topic_sender": one session per (group + topic thread + sender),
180
+ * falls back to (group + sender) if no topic
181
+ */
182
+ const GroupSessionScopeSchema = _enum([
183
+ "group",
184
+ "group_sender",
185
+ "group_topic",
186
+ "group_topic_sender"
187
+ ]).optional();
188
+ /**
189
+ * @deprecated Use groupSessionScope instead.
190
+ *
191
+ * Topic session isolation mode for group chats.
192
+ * - "disabled" (default): All messages in a group share one session
193
+ * - "enabled": Messages in different topics get separate sessions
194
+ *
195
+ * Topic routing uses Feishu topic-group `thread_id` when the event identifies a
196
+ * native topic group, and keeps `root_id` precedence for normal groups so
197
+ * reply-created threads stay on the initiating message session.
198
+ */
199
+ const TopicSessionModeSchema = _enum(["disabled", "enabled"]).optional();
200
+ const ReactionNotificationModeSchema = _enum([
201
+ "off",
202
+ "own",
203
+ "all"
204
+ ]).optional();
205
+ /**
206
+ * Reply-in-thread mode for group chats.
207
+ * - "disabled" (default): Bot replies are normal inline replies
208
+ * - "enabled": Bot replies create or continue a Feishu topic thread
209
+ *
210
+ * When enabled, the Feishu reply API is called with `reply_in_thread: true`,
211
+ * causing the reply to appear as a topic (话题) under the original message.
212
+ */
213
+ const ReplyInThreadSchema = _enum(["disabled", "enabled"]).optional();
214
+ const FeishuGroupSchema = object({
215
+ requireMention: boolean().optional(),
216
+ tools: ToolPolicySchema,
217
+ skills: array(string()).optional(),
218
+ enabled: boolean().optional(),
219
+ allowFrom: array(union([string(), number()])).optional(),
220
+ systemPrompt: string().optional(),
221
+ groupSessionScope: GroupSessionScopeSchema,
222
+ topicSessionMode: TopicSessionModeSchema,
223
+ replyInThread: ReplyInThreadSchema
224
+ }).strict();
225
+ const FeishuSharedConfigShape = {
226
+ webhookHost: string().optional(),
227
+ webhookPort: number().int().positive().optional(),
228
+ capabilities: array(string()).optional(),
229
+ markdown: MarkdownConfigSchema,
230
+ configWrites: boolean().optional(),
231
+ dmPolicy: DmPolicySchema.optional(),
232
+ allowFrom: array(union([string(), number()])).optional(),
233
+ groupPolicy: GroupPolicySchema.optional(),
234
+ groupAllowFrom: array(union([string(), number()])).optional(),
235
+ groupSenderAllowFrom: array(union([string(), number()])).optional(),
236
+ requireMention: boolean().optional(),
237
+ groups: record(string(), FeishuGroupSchema.optional()).optional(),
238
+ historyLimit: number().int().min(0).optional(),
239
+ dmHistoryLimit: number().int().min(0).optional(),
240
+ dms: record(string(), DmConfigSchema).optional(),
241
+ textChunkLimit: number().int().positive().optional(),
242
+ chunkMode: _enum(["length", "newline"]).optional(),
243
+ blockStreaming: BlockStreamingSchema,
244
+ blockStreamingCoalesce: BlockStreamingCoalesceSchema,
245
+ mediaMaxMb: number().positive().optional(),
246
+ httpTimeoutMs: number().int().positive().max(3e5).optional(),
247
+ heartbeat: ChannelHeartbeatVisibilitySchema,
248
+ renderMode: RenderModeSchema,
249
+ streaming: StreamingModeSchema,
250
+ tools: FeishuToolsConfigSchema,
251
+ actions: ChannelActionsSchema,
252
+ replyInThread: ReplyInThreadSchema,
253
+ reactionNotifications: ReactionNotificationModeSchema,
254
+ typingIndicator: boolean().optional(),
255
+ resolveSenderNames: boolean().optional(),
256
+ tts: TtsOverrideSchema
257
+ };
258
+ /**
259
+ * Per-account configuration.
260
+ * All fields are optional - missing fields inherit from top-level config.
261
+ */
262
+ const FeishuAccountConfigSchema = object({
263
+ enabled: boolean().optional(),
264
+ name: string().optional(),
265
+ appId: string().optional(),
266
+ appSecret: buildSecretInputSchema().optional(),
267
+ encryptKey: buildSecretInputSchema().optional(),
268
+ verificationToken: buildSecretInputSchema().optional(),
269
+ domain: FeishuDomainSchema.optional(),
270
+ connectionMode: FeishuConnectionModeSchema.optional(),
271
+ webhookPath: string().optional(),
272
+ ...FeishuSharedConfigShape,
273
+ groupSessionScope: GroupSessionScopeSchema,
274
+ topicSessionMode: TopicSessionModeSchema
275
+ }).strict();
276
+ const FeishuConfigSchema = object({
277
+ enabled: boolean().optional(),
278
+ defaultAccount: string().optional(),
279
+ appId: string().optional(),
280
+ appSecret: buildSecretInputSchema().optional(),
281
+ encryptKey: buildSecretInputSchema().optional(),
282
+ verificationToken: buildSecretInputSchema().optional(),
283
+ domain: FeishuDomainSchema.optional().default("feishu"),
284
+ connectionMode: FeishuConnectionModeSchema.optional().default("websocket"),
285
+ webhookPath: string().optional().default("/feishu/events"),
286
+ ...FeishuSharedConfigShape,
287
+ dmPolicy: DmPolicySchema.optional().default("pairing"),
288
+ reactionNotifications: ReactionNotificationModeSchema.optional().default("own"),
289
+ groupPolicy: GroupPolicySchema.optional().default("allowlist"),
290
+ requireMention: boolean().optional(),
291
+ groupSessionScope: GroupSessionScopeSchema,
292
+ topicSessionMode: TopicSessionModeSchema,
293
+ dynamicAgentCreation: DynamicAgentCreationSchema,
294
+ typingIndicator: boolean().optional().default(true),
295
+ resolveSenderNames: boolean().optional().default(true),
296
+ accounts: record(string(), FeishuAccountConfigSchema.optional()).optional()
297
+ }).strict().superRefine((value, ctx) => {
298
+ const defaultAccount = value.defaultAccount?.trim();
299
+ if (defaultAccount && value.accounts && Object.keys(value.accounts).length > 0) {
300
+ const normalizedDefaultAccount = normalizeAccountId(defaultAccount);
301
+ if (!Object.prototype.hasOwnProperty.call(value.accounts, normalizedDefaultAccount)) ctx.addIssue({
302
+ code: ZodIssueCode.custom,
303
+ path: ["defaultAccount"],
304
+ message: `channels.feishu.defaultAccount="${defaultAccount}" does not match a configured account key`
305
+ });
306
+ }
307
+ const defaultConnectionMode = value.connectionMode ?? "websocket";
308
+ const defaultVerificationTokenConfigured = hasConfiguredSecretInput(value.verificationToken);
309
+ const defaultEncryptKeyConfigured = hasConfiguredSecretInput(value.encryptKey);
310
+ if (defaultConnectionMode === "webhook") {
311
+ if (!defaultVerificationTokenConfigured) ctx.addIssue({
312
+ code: ZodIssueCode.custom,
313
+ path: ["verificationToken"],
314
+ message: "channels.feishu.connectionMode=\"webhook\" requires channels.feishu.verificationToken"
315
+ });
316
+ if (!defaultEncryptKeyConfigured) ctx.addIssue({
317
+ code: ZodIssueCode.custom,
318
+ path: ["encryptKey"],
319
+ message: "channels.feishu.connectionMode=\"webhook\" requires channels.feishu.encryptKey"
320
+ });
321
+ }
322
+ for (const [accountId, account] of Object.entries(value.accounts ?? {})) {
323
+ if (!account) continue;
324
+ if ((account.connectionMode ?? defaultConnectionMode) !== "webhook") continue;
325
+ const accountVerificationTokenConfigured = hasConfiguredSecretInput(account.verificationToken) || defaultVerificationTokenConfigured;
326
+ const accountEncryptKeyConfigured = hasConfiguredSecretInput(account.encryptKey) || defaultEncryptKeyConfigured;
327
+ if (!accountVerificationTokenConfigured) ctx.addIssue({
328
+ code: ZodIssueCode.custom,
329
+ path: [
330
+ "accounts",
331
+ accountId,
332
+ "verificationToken"
333
+ ],
334
+ message: `channels.feishu.accounts.${accountId}.connectionMode="webhook" requires a verificationToken (account-level or top-level)`
335
+ });
336
+ if (!accountEncryptKeyConfigured) ctx.addIssue({
337
+ code: ZodIssueCode.custom,
338
+ path: [
339
+ "accounts",
340
+ accountId,
341
+ "encryptKey"
342
+ ],
343
+ message: `channels.feishu.accounts.${accountId}.connectionMode="webhook" requires an encryptKey (account-level or top-level)`
344
+ });
345
+ }
346
+ if (value.dmPolicy === "open") {
347
+ if (!(value.allowFrom ?? []).some((entry) => String(entry).trim() === "*")) ctx.addIssue({
348
+ code: ZodIssueCode.custom,
349
+ path: ["allowFrom"],
350
+ message: "channels.feishu.dmPolicy=\"open\" requires channels.feishu.allowFrom to include \"*\""
351
+ });
352
+ }
353
+ });
354
+ //#endregion
355
+ //#region extensions/feishu/src/doctor.ts
356
+ const FEISHU_STATE_DIR = "feishu";
357
+ const BACKUP_PREFIX = "feishu-state-repair";
358
+ const BLANK_USER_MESSAGE_REPAIR_THRESHOLD = 3;
359
+ const SESSION_FILE_INSPECTION_MAX_BYTES = 16 * 1024 * 1024;
360
+ function timestampForPath(now = /* @__PURE__ */ new Date()) {
361
+ return now.toISOString().replaceAll(":", "-");
362
+ }
363
+ function isRecord(value) {
364
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
365
+ }
366
+ function toFeishuSessionEntry(value) {
367
+ if (!isRecord(value)) return {};
368
+ return {
369
+ sessionId: value.sessionId,
370
+ sessionFile: value.sessionFile
371
+ };
372
+ }
373
+ function countLabel(count, singular, plural = `${singular}s`) {
374
+ return `${count} ${count === 1 ? singular : plural}`;
375
+ }
376
+ function existsDir(dir) {
377
+ try {
378
+ return fs.statSync(dir).isDirectory();
379
+ } catch {
380
+ return false;
381
+ }
382
+ }
383
+ function existsFile(filePath) {
384
+ try {
385
+ return fs.statSync(filePath).isFile();
386
+ } catch {
387
+ return false;
388
+ }
389
+ }
390
+ function safeReadDir(dir) {
391
+ try {
392
+ return fs.readdirSync(dir, { withFileTypes: true });
393
+ } catch {
394
+ return [];
395
+ }
396
+ }
397
+ function isPathWithinRoot(targetPath, rootPath) {
398
+ const resolvedTarget = path.resolve(targetPath);
399
+ const resolvedRoot = path.resolve(rootPath);
400
+ const relative = path.relative(resolvedRoot, resolvedTarget);
401
+ return Boolean(relative) && !relative.startsWith("..") && !path.isAbsolute(relative);
402
+ }
403
+ function formatDisplayPath(filePath) {
404
+ const home = os.homedir();
405
+ const resolved = path.resolve(filePath);
406
+ return resolved === home || resolved.startsWith(`${home}${path.sep}`) ? `~${resolved.slice(home.length)}` : resolved;
407
+ }
408
+ function formatFinding(finding) {
409
+ switch (finding.kind) {
410
+ case "corrupt-state-json": return `- Feishu local JSON state is corrupt: ${formatDisplayPath(finding.path)}`;
411
+ case "missing-session-transcript": return `- Feishu session ${finding.sessionKey} points to a missing transcript in ${formatDisplayPath(finding.storePath)}`;
412
+ case "invalid-session-transcript": return `- Feishu session ${finding.sessionKey} has an invalid transcript (${finding.reason}): ${formatDisplayPath(finding.path)}`;
413
+ case "blank-user-message-run": return `- Feishu session ${finding.sessionKey} contains ${finding.count} blank user messages: ${formatDisplayPath(finding.path)}`;
414
+ }
415
+ return finding;
416
+ }
417
+ function isFeishuSessionStoreKey(key) {
418
+ const normalized = key.trim().toLowerCase();
419
+ return /^agent:[^:]+:feishu(?::|$)/.test(normalized) || /^feishu(?::|$)/.test(normalized);
420
+ }
421
+ function isFeishuAcpBindingSessionKey(key) {
422
+ return /^agent:[^:]+:acp:binding:feishu(?::|$)/.test(key.trim().toLowerCase());
423
+ }
424
+ function normalizeMetadataString(value) {
425
+ return typeof value === "string" ? value.trim().toLowerCase() : "";
426
+ }
427
+ function isFeishuSessionEntry(key, value) {
428
+ if (isFeishuAcpBindingSessionKey(key)) return false;
429
+ if (isFeishuSessionStoreKey(key)) return true;
430
+ if (!isRecord(value)) return false;
431
+ if (normalizeMetadataString(value.channel) === "feishu" || normalizeMetadataString(value.lastChannel) === "feishu") return true;
432
+ if (normalizeMetadataString((isRecord(value.route) ? value.route : null)?.channel) === "feishu") return true;
433
+ if (normalizeMetadataString((isRecord(value.deliveryContext) ? value.deliveryContext : null)?.channel) === "feishu") return true;
434
+ if (normalizeMetadataString((isRecord(value.pendingFinalDeliveryContext) ? value.pendingFinalDeliveryContext : null)?.channel) === "feishu") return true;
435
+ const origin = isRecord(value.origin) ? value.origin : null;
436
+ const originProvider = normalizeMetadataString(origin?.provider);
437
+ const originSurface = normalizeMetadataString(origin?.surface);
438
+ const originFrom = normalizeMetadataString(origin?.from);
439
+ return originProvider === "feishu" || originSurface.startsWith("feishu") || originFrom.startsWith("feishu:");
440
+ }
441
+ function collectConfiguredAgentIds(cfg) {
442
+ const ids = /* @__PURE__ */ new Set();
443
+ ids.add(resolveConfiguredDefaultAgentId(cfg));
444
+ for (const agent of cfg.agents?.list ?? []) if (typeof agent.id === "string" && agent.id.trim()) ids.add(normalizeAgentId(agent.id));
445
+ return [...ids].toSorted();
446
+ }
447
+ function resolveConfiguredDefaultAgentId(cfg) {
448
+ const agents = cfg.agents?.list ?? [];
449
+ const chosen = agents.find((agent) => agent?.default) ?? agents[0];
450
+ return normalizeAgentId(typeof chosen?.id === "string" && chosen.id.trim() ? chosen.id : "main");
451
+ }
452
+ function collectFeishuSessionTargets(params) {
453
+ const byStorePath = /* @__PURE__ */ new Map();
454
+ const addTarget = (target) => {
455
+ byStorePath.set(path.resolve(target.storePath), {
456
+ ...target,
457
+ storePath: path.resolve(target.storePath)
458
+ });
459
+ };
460
+ for (const agentId of collectConfiguredAgentIds(params.cfg)) addTarget({
461
+ agentId,
462
+ storePath: resolveStorePath(params.cfg.session?.store, {
463
+ agentId,
464
+ env: params.env
465
+ })
466
+ });
467
+ const agentsDir = path.join(params.stateDir, "agents");
468
+ for (const agentDir of safeReadDir(agentsDir)) {
469
+ if (!agentDir.isDirectory()) continue;
470
+ const agentId = normalizeAgentId(agentDir.name);
471
+ const storePath = path.join(agentsDir, agentDir.name, "sessions", "sessions.json");
472
+ if (existsFile(storePath)) addTarget({
473
+ agentId,
474
+ storePath
475
+ });
476
+ }
477
+ return [...byStorePath.values()].toSorted((left, right) => left.storePath.localeCompare(right.storePath));
478
+ }
479
+ function collectJsonFiles(rootDir, limit = 200) {
480
+ const files = [];
481
+ const visit = (dir) => {
482
+ if (files.length >= limit) return;
483
+ for (const entry of safeReadDir(dir).toSorted((left, right) => left.name.localeCompare(right.name))) {
484
+ const fullPath = path.join(dir, entry.name);
485
+ if (entry.isDirectory()) {
486
+ visit(fullPath);
487
+ continue;
488
+ }
489
+ if (entry.isFile() && entry.name.endsWith(".json")) files.push(fullPath);
490
+ if (files.length >= limit) return;
491
+ }
492
+ };
493
+ if (existsDir(rootDir)) visit(rootDir);
494
+ return files;
495
+ }
496
+ function collectCorruptFeishuStateJsonFindings(feishuStateDir) {
497
+ const findings = [];
498
+ for (const filePath of collectJsonFiles(feishuStateDir)) try {
499
+ JSON.parse(fs.readFileSync(filePath, "utf-8"));
500
+ } catch {
501
+ findings.push({
502
+ kind: "corrupt-state-json",
503
+ path: filePath
504
+ });
505
+ }
506
+ return findings;
507
+ }
508
+ function resolveSessionTranscriptCandidates(params) {
509
+ const candidates = /* @__PURE__ */ new Set();
510
+ const sessionsDir = path.dirname(params.storePath);
511
+ const addSafeCandidate = (candidate) => {
512
+ const resolved = path.isAbsolute(candidate) ? path.resolve(candidate) : path.resolve(sessionsDir, candidate);
513
+ if (resolved === sessionsDir || !isPathWithinRoot(resolved, sessionsDir)) return;
514
+ candidates.add(resolved);
515
+ };
516
+ if (typeof params.entry.sessionId === "string" && /^[a-z0-9][a-z0-9._-]{0,127}$/i.test(params.entry.sessionId)) {
517
+ candidates.add(resolveSessionFilePath(params.entry.sessionId, typeof params.entry.sessionFile === "string" ? { sessionFile: params.entry.sessionFile } : void 0, {
518
+ agentId: params.agentId,
519
+ sessionsDir
520
+ }));
521
+ return [...candidates].toSorted();
522
+ }
523
+ if (typeof params.entry.sessionFile === "string" && params.entry.sessionFile.trim()) addSafeCandidate(params.entry.sessionFile.trim());
524
+ return [...candidates].toSorted();
525
+ }
526
+ function isSessionHeader(value) {
527
+ return isRecord(value) && value.type === "session" && typeof value.id === "string";
528
+ }
529
+ function isBlankUserMessage(value) {
530
+ if (!isRecord(value) || value.type !== "message" || !isRecord(value.message)) return false;
531
+ if (value.message.role !== "user") return false;
532
+ const content = value.message.content;
533
+ if (typeof content === "string") return content.trim().length === 0;
534
+ return Array.isArray(content) && content.length === 0;
535
+ }
536
+ function isUserMessage(value) {
537
+ return isRecord(value) && value.type === "message" && isRecord(value.message) && value.message.role === "user";
538
+ }
539
+ function inspectSessionTranscript(params) {
540
+ let stat;
541
+ try {
542
+ stat = fs.statSync(params.transcriptPath);
543
+ } catch {
544
+ return null;
545
+ }
546
+ if (!stat.isFile()) return {
547
+ kind: "invalid-session-transcript",
548
+ sessionKey: params.sessionKey,
549
+ storePath: params.storePath,
550
+ path: params.transcriptPath,
551
+ reason: "not a file"
552
+ };
553
+ if (stat.size > SESSION_FILE_INSPECTION_MAX_BYTES) return null;
554
+ let raw = "";
555
+ try {
556
+ raw = fs.readFileSync(params.transcriptPath, "utf-8");
557
+ } catch {
558
+ return {
559
+ kind: "invalid-session-transcript",
560
+ sessionKey: params.sessionKey,
561
+ storePath: params.storePath,
562
+ path: params.transcriptPath,
563
+ reason: "unreadable"
564
+ };
565
+ }
566
+ const entries = [];
567
+ let malformedLines = 0;
568
+ let blankUserMessageRun = 0;
569
+ let maxBlankUserMessageRun = 0;
570
+ for (const line of raw.split(/\r?\n/)) {
571
+ if (!line.trim()) continue;
572
+ try {
573
+ const entry = JSON.parse(line);
574
+ entries.push(entry);
575
+ if (isBlankUserMessage(entry)) {
576
+ blankUserMessageRun += 1;
577
+ maxBlankUserMessageRun = Math.max(maxBlankUserMessageRun, blankUserMessageRun);
578
+ } else if (isUserMessage(entry)) blankUserMessageRun = 0;
579
+ } catch {
580
+ malformedLines += 1;
581
+ }
582
+ }
583
+ if (entries.length === 0) return {
584
+ kind: "invalid-session-transcript",
585
+ sessionKey: params.sessionKey,
586
+ storePath: params.storePath,
587
+ path: params.transcriptPath,
588
+ reason: "empty transcript"
589
+ };
590
+ if (!isSessionHeader(entries[0])) return {
591
+ kind: "invalid-session-transcript",
592
+ sessionKey: params.sessionKey,
593
+ storePath: params.storePath,
594
+ path: params.transcriptPath,
595
+ reason: "invalid session header"
596
+ };
597
+ if (malformedLines > 0) return {
598
+ kind: "invalid-session-transcript",
599
+ sessionKey: params.sessionKey,
600
+ storePath: params.storePath,
601
+ path: params.transcriptPath,
602
+ reason: `${malformedLines} malformed JSONL line(s)`
603
+ };
604
+ if (maxBlankUserMessageRun >= BLANK_USER_MESSAGE_REPAIR_THRESHOLD) return {
605
+ kind: "blank-user-message-run",
606
+ sessionKey: params.sessionKey,
607
+ storePath: params.storePath,
608
+ path: params.transcriptPath,
609
+ count: maxBlankUserMessageRun
610
+ };
611
+ return null;
612
+ }
613
+ function collectFeishuSessionFindings(params) {
614
+ const transcriptCandidates = resolveSessionTranscriptCandidates(params);
615
+ const existing = transcriptCandidates.filter(existsFile);
616
+ if (transcriptCandidates.length > 0 && existing.length === 0) return [{
617
+ kind: "missing-session-transcript",
618
+ sessionKey: params.sessionKey,
619
+ storePath: params.storePath
620
+ }];
621
+ const findings = [];
622
+ for (const transcriptPath of existing) {
623
+ const finding = inspectSessionTranscript({
624
+ sessionKey: params.sessionKey,
625
+ storePath: params.storePath,
626
+ transcriptPath
627
+ });
628
+ if (finding) findings.push(finding);
629
+ }
630
+ return findings;
631
+ }
632
+ function hasCorruptFeishuStateJsonFinding(inspection) {
633
+ return inspection.findings.some((finding) => finding.kind === "corrupt-state-json");
634
+ }
635
+ function sessionEntryId(storePath, key) {
636
+ return `${path.resolve(storePath)}\0${key}`;
637
+ }
638
+ function collectRepairSessionEntries(inspection) {
639
+ const entriesById = /* @__PURE__ */ new Map();
640
+ for (const entry of inspection.sessionEntries) entriesById.set(sessionEntryId(entry.storePath, entry.key), entry);
641
+ const repairEntries = [];
642
+ const seen = /* @__PURE__ */ new Set();
643
+ for (const finding of inspection.findings) {
644
+ if (finding.kind === "corrupt-state-json") continue;
645
+ const id = sessionEntryId(finding.storePath, finding.sessionKey);
646
+ if (seen.has(id)) continue;
647
+ const entry = entriesById.get(id);
648
+ if (entry) {
649
+ repairEntries.push(entry);
650
+ seen.add(id);
651
+ }
652
+ }
653
+ return repairEntries.toSorted((left, right) => left.storePath.localeCompare(right.storePath) || left.key.localeCompare(right.key));
654
+ }
655
+ function inspectFeishuDoctorState(params) {
656
+ const env = params.env ?? process.env;
657
+ const stateDir = resolveStateDir(env, os.homedir);
658
+ const feishuStateDir = path.join(stateDir, FEISHU_STATE_DIR);
659
+ const findings = collectCorruptFeishuStateJsonFindings(feishuStateDir);
660
+ const sessionEntries = [];
661
+ for (const target of collectFeishuSessionTargets({
662
+ cfg: params.cfg,
663
+ env,
664
+ stateDir
665
+ })) {
666
+ const store = loadSessionStore(target.storePath, { skipCache: true });
667
+ for (const [key, entry] of Object.entries(store).toSorted(([left], [right]) => left.localeCompare(right))) {
668
+ if (!isFeishuSessionEntry(key, entry)) continue;
669
+ const sessionEntry = toFeishuSessionEntry(entry);
670
+ sessionEntries.push({
671
+ key,
672
+ storePath: target.storePath,
673
+ agentId: target.agentId,
674
+ entry: sessionEntry
675
+ });
676
+ findings.push(...collectFeishuSessionFindings({
677
+ sessionKey: key,
678
+ storePath: target.storePath,
679
+ agentId: target.agentId,
680
+ entry: sessionEntry
681
+ }));
682
+ }
683
+ }
684
+ return {
685
+ stateDir,
686
+ feishuStateDir,
687
+ findings,
688
+ sessionEntries
689
+ };
690
+ }
691
+ function ensureBackupDir(stateDir, now) {
692
+ const backupDir = path.join(stateDir, "backups", `${BACKUP_PREFIX}-${timestampForPath(now)}`);
693
+ fs.mkdirSync(backupDir, {
694
+ recursive: true,
695
+ mode: 448
696
+ });
697
+ return backupDir;
698
+ }
699
+ function resolveUniquePath(candidate) {
700
+ if (!fs.existsSync(candidate)) return candidate;
701
+ for (let index = 1; index < 1e3; index += 1) {
702
+ const next = `${candidate}.${index}`;
703
+ if (!fs.existsSync(next)) return next;
704
+ }
705
+ throw new Error(`Unable to resolve unique path for ${candidate}`);
706
+ }
707
+ function movePathToBackup(params) {
708
+ if (!fs.existsSync(params.sourcePath)) return false;
709
+ const targetPath = resolveUniquePath(path.join(params.backupDir, params.relativeTarget));
710
+ fs.mkdirSync(path.dirname(targetPath), {
711
+ recursive: true,
712
+ mode: 448
713
+ });
714
+ fs.renameSync(params.sourcePath, targetPath);
715
+ return true;
716
+ }
717
+ function copyStoreBackup(params) {
718
+ if (!existsFile(params.storePath)) return;
719
+ const targetPath = path.join(params.backupDir, "session-stores", params.agentId, path.basename(params.storePath));
720
+ fs.mkdirSync(path.dirname(targetPath), {
721
+ recursive: true,
722
+ mode: 448
723
+ });
724
+ fs.copyFileSync(params.storePath, resolveUniquePath(targetPath));
725
+ }
726
+ function collectSessionArtifactPaths(params) {
727
+ const artifacts = /* @__PURE__ */ new Set();
728
+ for (const transcriptPath of resolveSessionTranscriptCandidates(params)) {
729
+ artifacts.add(transcriptPath);
730
+ if (transcriptPath.endsWith(".jsonl")) {
731
+ const base = transcriptPath.slice(0, -6);
732
+ artifacts.add(`${base}.trajectory.jsonl`);
733
+ artifacts.add(`${base}.trajectory-path.json`);
734
+ }
735
+ }
736
+ return [...artifacts].toSorted();
737
+ }
738
+ function archiveSessionArtifacts(params) {
739
+ const seen = /* @__PURE__ */ new Set();
740
+ let archived = 0;
741
+ for (const entry of params.entries) for (const artifactPath of collectSessionArtifactPaths({
742
+ storePath: params.storePath,
743
+ agentId: entry.agentId,
744
+ entry: entry.entry
745
+ })) {
746
+ if (seen.has(artifactPath) || !existsFile(artifactPath)) continue;
747
+ seen.add(artifactPath);
748
+ const archivedPath = resolveUniquePath(`${artifactPath}.deleted.${params.archiveTimestamp}`);
749
+ fs.renameSync(artifactPath, archivedPath);
750
+ archived += 1;
751
+ }
752
+ return archived;
753
+ }
754
+ async function repairFeishuDoctorState(params) {
755
+ const env = params.env ?? process.env;
756
+ const now = params.now ?? /* @__PURE__ */ new Date();
757
+ const inspection = params.inspection ?? inspectFeishuDoctorState({
758
+ cfg: params.cfg,
759
+ env
760
+ });
761
+ const backupDir = ensureBackupDir(inspection.stateDir, now);
762
+ const archiveTimestamp = timestampForPath(now);
763
+ const warnings = [];
764
+ const stateDirRepairAttempted = hasCorruptFeishuStateJsonFinding(inspection);
765
+ let rebuiltStateDir = false;
766
+ if (stateDirRepairAttempted) try {
767
+ rebuiltStateDir = movePathToBackup({
768
+ sourcePath: inspection.feishuStateDir,
769
+ backupDir,
770
+ relativeTarget: FEISHU_STATE_DIR
771
+ });
772
+ fs.mkdirSync(inspection.feishuStateDir, {
773
+ recursive: true,
774
+ mode: 448
775
+ });
776
+ } catch (error) {
777
+ warnings.push(`- Failed to rebuild Feishu local state: ${String(error)}`);
778
+ }
779
+ const entriesByStore = /* @__PURE__ */ new Map();
780
+ for (const entry of collectRepairSessionEntries(inspection)) {
781
+ const existing = entriesByStore.get(entry.storePath);
782
+ if (existing) existing.entries.push({
783
+ key: entry.key,
784
+ entry: entry.entry
785
+ });
786
+ else entriesByStore.set(entry.storePath, {
787
+ agentId: entry.agentId,
788
+ entries: [{
789
+ key: entry.key,
790
+ entry: entry.entry
791
+ }]
792
+ });
793
+ }
794
+ let removedSessionEntries = 0;
795
+ let touchedSessionStores = 0;
796
+ let archivedSessionArtifacts = 0;
797
+ for (const [storePath, group] of [...entriesByStore.entries()].toSorted(([left], [right]) => left.localeCompare(right))) try {
798
+ copyStoreBackup({
799
+ storePath,
800
+ backupDir,
801
+ agentId: group.agentId
802
+ });
803
+ const keys = new Set(group.entries.map((entry) => entry.key));
804
+ const removedEntries = await updateSessionStore(storePath, (store) => {
805
+ const removed = [];
806
+ for (const key of keys) if (Object.prototype.hasOwnProperty.call(store, key)) {
807
+ delete store[key];
808
+ const entry = group.entries.find((candidate) => candidate.key === key);
809
+ if (entry) removed.push(entry);
810
+ }
811
+ return removed;
812
+ }, {
813
+ skipMaintenance: true,
814
+ allowDropAcpMetaSessionKeys: [...keys]
815
+ });
816
+ const removed = removedEntries.length;
817
+ removedSessionEntries += removed;
818
+ if (removed > 0) {
819
+ touchedSessionStores += 1;
820
+ archivedSessionArtifacts += archiveSessionArtifacts({
821
+ storePath,
822
+ entries: removedEntries.map((entry) => ({
823
+ agentId: group.agentId,
824
+ entry: entry.entry
825
+ })),
826
+ archiveTimestamp
827
+ });
828
+ }
829
+ } catch (error) {
830
+ warnings.push(`- Failed to archive Feishu sessions in ${formatDisplayPath(storePath)}: ${String(error)}`);
831
+ }
832
+ return {
833
+ backupDir,
834
+ stateDirRepairAttempted,
835
+ rebuiltStateDir,
836
+ removedSessionEntries,
837
+ touchedSessionStores,
838
+ archivedSessionArtifacts,
839
+ warnings
840
+ };
841
+ }
842
+ function formatPreviewWarning(inspection) {
843
+ const previewFindings = inspection.findings.slice(0, 5).map(formatFinding);
844
+ const remaining = inspection.findings.length - previewFindings.length;
845
+ const repairActions = [];
846
+ if (hasCorruptFeishuStateJsonFinding(inspection)) repairActions.push(`archive ${formatDisplayPath(inspection.feishuStateDir)}`);
847
+ const repairSessionEntries = collectRepairSessionEntries(inspection);
848
+ if (repairSessionEntries.length > 0) repairActions.push(`archive artifacts and remove ${countLabel(repairSessionEntries.length, "flagged Feishu-scoped session entry", "flagged Feishu-scoped session entries")}`);
849
+ const repairSummary = repairActions.length > 0 ? repairActions.join(" and ") : "apply targeted Feishu state cleanup";
850
+ return [
851
+ "- Feishu local channel state may need repair.",
852
+ ...previewFindings,
853
+ ...remaining > 0 ? [`- ...and ${remaining} more Feishu state finding(s).`] : [],
854
+ `- Repair will ${repairSummary}, while preserving Feishu App ID/secret config and healthy session entries.`,
855
+ "- Run \"openclaw doctor --fix\" to rebuild Feishu local state."
856
+ ].join("\n");
857
+ }
858
+ function formatRepairChange(report) {
859
+ const stateRepairStatus = report.stateDirRepairAttempted ? report.rebuiltStateDir ? "yes" : "no existing state" : "not needed";
860
+ return [
861
+ "Feishu local state repaired.",
862
+ `- Backup dir: ${formatDisplayPath(report.backupDir)}`,
863
+ `- Rebuilt Feishu runtime state: ${stateRepairStatus}`,
864
+ `- Removed ${countLabel(report.removedSessionEntries, "Feishu-scoped session entry", "Feishu-scoped session entries")} from ${countLabel(report.touchedSessionStores, "session store")}.`,
865
+ `- Archived ${countLabel(report.archivedSessionArtifacts, "session artifact file")}.`,
866
+ "- Preserved Feishu App ID/secret config."
867
+ ].join("\n");
868
+ }
869
+ function hasConfiguredFeishuChannel(cfg) {
870
+ return Boolean(cfg.channels?.feishu);
871
+ }
872
+ async function runFeishuDoctorSequence(params) {
873
+ if (!hasConfiguredFeishuChannel(params.cfg)) return {
874
+ changeNotes: [],
875
+ warningNotes: []
876
+ };
877
+ const inspection = inspectFeishuDoctorState({
878
+ cfg: params.cfg,
879
+ env: params.env
880
+ });
881
+ if (inspection.findings.length === 0) return {
882
+ changeNotes: [],
883
+ warningNotes: []
884
+ };
885
+ if (!params.shouldRepair) return {
886
+ changeNotes: [],
887
+ warningNotes: [formatPreviewWarning(inspection)]
888
+ };
889
+ const report = await repairFeishuDoctorState({
890
+ cfg: params.cfg,
891
+ env: params.env,
892
+ inspection
893
+ });
894
+ return {
895
+ changeNotes: [formatRepairChange(report)],
896
+ warningNotes: report.warnings
897
+ };
898
+ }
899
+ const feishuDoctor = { runConfigSequence: async ({ cfg, env, shouldRepair }) => await runFeishuDoctorSequence({
900
+ cfg,
901
+ env,
902
+ shouldRepair
903
+ }) };
904
+ //#endregion
905
+ //#region extensions/feishu/src/session-route.ts
906
+ function resolveFeishuOutboundSessionRoute(params) {
907
+ let trimmed = stripChannelTargetPrefix(params.target, "feishu", "lark");
908
+ if (!trimmed) return null;
909
+ const lower = normalizeLowercaseStringOrEmpty(trimmed);
910
+ let isGroup = false;
911
+ let typeExplicit = false;
912
+ if (lower.startsWith("group:") || lower.startsWith("chat:") || lower.startsWith("channel:")) {
913
+ trimmed = trimmed.replace(/^(group|chat|channel):/i, "").trim();
914
+ isGroup = true;
915
+ typeExplicit = true;
916
+ } else if (lower.startsWith("user:") || lower.startsWith("dm:")) {
917
+ trimmed = trimmed.replace(/^(user|dm):/i, "").trim();
918
+ isGroup = false;
919
+ typeExplicit = true;
920
+ }
921
+ if (!typeExplicit) {
922
+ const idLower = normalizeLowercaseStringOrEmpty(trimmed);
923
+ if (idLower.startsWith("ou_") || idLower.startsWith("on_")) isGroup = false;
924
+ }
925
+ return buildChannelOutboundSessionRoute({
926
+ cfg: params.cfg,
927
+ agentId: params.agentId,
928
+ channel: "feishu",
929
+ accountId: params.accountId,
930
+ peer: {
931
+ kind: isGroup ? "group" : "direct",
932
+ id: trimmed
933
+ },
934
+ chatType: isGroup ? "group" : "direct",
935
+ from: isGroup ? `feishu:group:${trimmed}` : `feishu:${trimmed}`,
936
+ to: trimmed
937
+ });
938
+ }
939
+ //#endregion
940
+ //#region extensions/feishu/src/setup-core.ts
941
+ function setFeishuNamedAccountEnabled$1(cfg, accountId, enabled) {
942
+ const feishuCfg = cfg.channels?.feishu;
943
+ return {
944
+ ...cfg,
945
+ channels: {
946
+ ...cfg.channels,
947
+ feishu: {
948
+ ...feishuCfg,
949
+ accounts: {
950
+ ...feishuCfg?.accounts,
951
+ [accountId]: {
952
+ ...feishuCfg?.accounts?.[accountId],
953
+ enabled
954
+ }
955
+ }
956
+ }
957
+ }
958
+ };
959
+ }
960
+ const feishuSetupAdapter = {
961
+ resolveAccountId: ({ cfg, accountId }) => accountId?.trim() || resolveDefaultFeishuAccountId(cfg),
962
+ applyAccountConfig: ({ cfg, accountId }) => {
963
+ if (!accountId || accountId === "default") return {
964
+ ...cfg,
965
+ channels: {
966
+ ...cfg.channels,
967
+ feishu: {
968
+ ...cfg.channels?.feishu,
969
+ enabled: true
970
+ }
971
+ }
972
+ };
973
+ return setFeishuNamedAccountEnabled$1(cfg, accountId, true);
974
+ }
975
+ };
976
+ //#endregion
977
+ //#region extensions/feishu/src/setup-surface.ts
978
+ const t = createSetupTranslator();
979
+ const channel = "feishu";
980
+ const SCAN_TO_CREATE_TP = "ob_cli_app";
981
+ const FEISHU_SETUP_FLOW_KEY = "_flow";
982
+ function isFeishuConfigured(cfg) {
983
+ const feishuCfg = cfg.channels?.feishu;
984
+ const isAppIdConfigured = (value) => {
985
+ if (normalizeOptionalString(value)) return true;
986
+ if (!value || typeof value !== "object") return false;
987
+ const rec = value;
988
+ const source = normalizeOptionalString(rec.source)?.toLowerCase();
989
+ const id = normalizeOptionalString(rec.id);
990
+ if (source === "env" && id) return Boolean(normalizeOptionalString(process.env[id]));
991
+ return hasConfiguredSecretInput(value);
992
+ };
993
+ const topLevelConfigured = isAppIdConfigured(feishuCfg?.appId) && hasConfiguredSecretInput(feishuCfg?.appSecret);
994
+ const accountConfigured = Object.values(feishuCfg?.accounts ?? {}).some((account) => {
995
+ if (!account || typeof account !== "object") return false;
996
+ const hasOwnAppId = Object.prototype.hasOwnProperty.call(account, "appId");
997
+ const hasOwnAppSecret = Object.prototype.hasOwnProperty.call(account, "appSecret");
998
+ const accountAppIdConfigured = hasOwnAppId ? isAppIdConfigured(account.appId) : isAppIdConfigured(feishuCfg?.appId);
999
+ const accountSecretConfigured = hasOwnAppSecret ? hasConfiguredSecretInput(account.appSecret) : hasConfiguredSecretInput(feishuCfg?.appSecret);
1000
+ return accountAppIdConfigured && accountSecretConfigured;
1001
+ });
1002
+ return topLevelConfigured || accountConfigured;
1003
+ }
1004
+ function formatFeishuStatusLine(status) {
1005
+ if (status === "needs-credentials") return `Feishu: ${t("wizard.channels.statusNeedsAppCredentials")}`;
1006
+ return `Feishu: ${t("wizard.channels.statusConfiguredConnectionNotVerified")}`;
1007
+ }
1008
+ /**
1009
+ * Patch feishu config at the correct location based on accountId.
1010
+ * - DEFAULT_ACCOUNT_ID → writes to top-level channels.feishu
1011
+ * - named account → writes to channels.feishu.accounts[accountId]
1012
+ */
1013
+ function patchFeishuConfig(cfg, accountId, patch) {
1014
+ const feishuCfg = cfg.channels?.feishu;
1015
+ if (accountId === "default") return patchTopLevelChannelConfigSection({
1016
+ cfg,
1017
+ channel,
1018
+ enabled: true,
1019
+ patch
1020
+ });
1021
+ const nextAccountPatch = {
1022
+ ...feishuCfg?.accounts?.[accountId],
1023
+ enabled: true,
1024
+ ...patch
1025
+ };
1026
+ return patchTopLevelChannelConfigSection({
1027
+ cfg,
1028
+ channel,
1029
+ enabled: true,
1030
+ patch: { accounts: {
1031
+ ...feishuCfg?.accounts,
1032
+ [accountId]: nextAccountPatch
1033
+ } }
1034
+ });
1035
+ }
1036
+ async function promptFeishuAllowFrom(params) {
1037
+ const feishuCfg = params.cfg.channels?.feishu;
1038
+ const resolvedAccountId = params.accountId ?? resolveDefaultFeishuAccountId(params.cfg);
1039
+ const existingAllowFrom = (resolvedAccountId !== "default" ? feishuCfg?.accounts?.[resolvedAccountId] : void 0)?.allowFrom ?? feishuCfg?.allowFrom ?? [];
1040
+ await params.prompter.note([
1041
+ t("wizard.feishu.allowlistIntro"),
1042
+ t("wizard.feishu.allowlistFindUser"),
1043
+ t("wizard.feishu.examples"),
1044
+ "- ou_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
1045
+ "- on_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
1046
+ ].join("\n"), t("wizard.feishu.allowlistTitle"));
1047
+ const mergedAllowFrom = mergeAllowFromEntries(existingAllowFrom, splitSetupEntries(await params.prompter.text({
1048
+ message: t("wizard.feishu.allowFromPrompt"),
1049
+ placeholder: "ou_xxxxx, ou_yyyyy",
1050
+ initialValue: existingAllowFrom.length > 0 ? existingAllowFrom.map(String).join(", ") : void 0
1051
+ })));
1052
+ return patchFeishuConfig(params.cfg, resolvedAccountId, { allowFrom: mergedAllowFrom });
1053
+ }
1054
+ async function noteFeishuCredentialHelp(prompter) {
1055
+ await prompter.note([
1056
+ t("wizard.feishu.credentialsStepOpenPlatform"),
1057
+ t("wizard.feishu.credentialsStepCreateApp"),
1058
+ t("wizard.feishu.credentialsStepGetCredentials"),
1059
+ t("wizard.feishu.credentialsStepPermissions"),
1060
+ t("wizard.feishu.credentialsStepPublish"),
1061
+ t("wizard.feishu.credentialsEnvTip"),
1062
+ t("wizard.channels.docs", { link: formatDocsLink("/channels/feishu", "feishu") })
1063
+ ].join("\n"), t("wizard.feishu.credentialsTitle"));
1064
+ }
1065
+ async function promptFeishuAppId(params) {
1066
+ return (await params.prompter.text({
1067
+ message: t("wizard.feishu.appIdPrompt"),
1068
+ initialValue: params.initialValue,
1069
+ validate: (value) => value?.trim() ? void 0 : t("common.required")
1070
+ })).trim();
1071
+ }
1072
+ const feishuDmPolicy = {
1073
+ label: "Feishu",
1074
+ channel,
1075
+ policyKey: "channels.feishu.dmPolicy",
1076
+ allowFromKey: "channels.feishu.allowFrom",
1077
+ resolveConfigKeys: (_cfg, accountId) => {
1078
+ const resolvedAccountId = accountId ?? resolveDefaultFeishuAccountId(_cfg);
1079
+ return resolvedAccountId !== "default" ? {
1080
+ policyKey: `channels.feishu.accounts.${resolvedAccountId}.dmPolicy`,
1081
+ allowFromKey: `channels.feishu.accounts.${resolvedAccountId}.allowFrom`
1082
+ } : {
1083
+ policyKey: "channels.feishu.dmPolicy",
1084
+ allowFromKey: "channels.feishu.allowFrom"
1085
+ };
1086
+ },
1087
+ getCurrent: (cfg, accountId) => {
1088
+ const feishuCfg = cfg.channels?.feishu;
1089
+ const resolvedAccountId = accountId ?? resolveDefaultFeishuAccountId(cfg);
1090
+ if (resolvedAccountId !== "default") {
1091
+ const account = feishuCfg?.accounts?.[resolvedAccountId];
1092
+ if (account?.dmPolicy) return account.dmPolicy;
1093
+ }
1094
+ return feishuCfg?.dmPolicy ?? "pairing";
1095
+ },
1096
+ setPolicy: (cfg, policy, accountId) => {
1097
+ return patchFeishuConfig(cfg, accountId ?? resolveDefaultFeishuAccountId(cfg), {
1098
+ dmPolicy: policy,
1099
+ ...policy === "open" ? { allowFrom: mergeAllowFromEntries([], ["*"]) } : {}
1100
+ });
1101
+ },
1102
+ promptAllowFrom: promptFeishuAllowFrom
1103
+ };
1104
+ function applyNewAppSecurityPolicy(cfg, accountId, openId, groupPolicy) {
1105
+ let next = cfg;
1106
+ if (openId) next = patchFeishuConfig(next, accountId, {
1107
+ dmPolicy: "allowlist",
1108
+ allowFrom: [openId]
1109
+ });
1110
+ const groupPatch = { groupPolicy };
1111
+ if (groupPolicy === "open") groupPatch.requireMention = true;
1112
+ next = patchFeishuConfig(next, accountId, groupPatch);
1113
+ return next;
1114
+ }
1115
+ async function promptFeishuDomain(params) {
1116
+ return await params.prompter.select({
1117
+ message: t("wizard.feishu.domainPrompt"),
1118
+ options: [{
1119
+ value: "feishu",
1120
+ label: t("wizard.feishu.domainFeishu")
1121
+ }, {
1122
+ value: "lark",
1123
+ label: t("wizard.feishu.domainLark")
1124
+ }],
1125
+ initialValue: params.initialValue ?? "feishu"
1126
+ });
1127
+ }
1128
+ async function promptFeishuSetupMethod(prompter) {
1129
+ return await prompter.select({
1130
+ message: t("wizard.feishu.setupMethodPrompt"),
1131
+ options: [{
1132
+ value: "manual",
1133
+ label: t("wizard.feishu.setupMethodManual")
1134
+ }, {
1135
+ value: "scan",
1136
+ label: t("wizard.feishu.setupMethodScan")
1137
+ }],
1138
+ initialValue: "manual"
1139
+ });
1140
+ }
1141
+ async function runScanToCreate(prompter, domain) {
1142
+ const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await import("./app-registration-B3hiSdVb.js");
1143
+ try {
1144
+ await initAppRegistration(domain);
1145
+ } catch {
1146
+ await prompter.note(t("wizard.feishu.scanUnavailable"), t("wizard.feishu.setupTitle"));
1147
+ return null;
1148
+ }
1149
+ const begin = await beginAppRegistration(domain);
1150
+ await prompter.note(t("wizard.feishu.scanQr"), t("wizard.feishu.scanTitle"));
1151
+ await printQrCode(begin.qrUrl);
1152
+ const progress = prompter.progress(t("wizard.feishu.fetchingConfig"));
1153
+ const outcome = await pollAppRegistration({
1154
+ deviceCode: begin.deviceCode,
1155
+ interval: begin.interval,
1156
+ expireIn: begin.expireIn,
1157
+ initialDomain: domain,
1158
+ tp: SCAN_TO_CREATE_TP
1159
+ });
1160
+ switch (outcome.status) {
1161
+ case "success":
1162
+ progress.stop(t("wizard.feishu.scanCompleted"));
1163
+ return outcome.result;
1164
+ case "access_denied":
1165
+ progress.stop(t("wizard.feishu.scanDenied"));
1166
+ return null;
1167
+ case "expired":
1168
+ progress.stop(t("wizard.feishu.scanExpired"));
1169
+ return null;
1170
+ case "timeout":
1171
+ progress.stop(t("wizard.feishu.scanTimedOut"));
1172
+ return null;
1173
+ case "error":
1174
+ progress.stop(t("wizard.feishu.scanError", { error: outcome.message }));
1175
+ return null;
1176
+ }
1177
+ return null;
1178
+ }
1179
+ async function runNewAppFlow(params) {
1180
+ const { prompter, options } = params;
1181
+ let next = params.cfg;
1182
+ const targetAccountId = resolveDefaultFeishuAccountId(next);
1183
+ let appId = null;
1184
+ let appSecret = null;
1185
+ let appSecretProbeValue = null;
1186
+ let scanDomain;
1187
+ let scanOpenId;
1188
+ const currentDomain = (next.channels?.feishu)?.domain ?? "feishu";
1189
+ const setupMethod = await promptFeishuSetupMethod(prompter);
1190
+ const selectedDomain = await promptFeishuDomain({
1191
+ prompter,
1192
+ initialValue: currentDomain
1193
+ });
1194
+ scanDomain = selectedDomain;
1195
+ const scanResult = setupMethod === "scan" ? await runScanToCreate(prompter, selectedDomain) : null;
1196
+ if (scanResult) {
1197
+ appId = scanResult.appId;
1198
+ appSecret = scanResult.appSecret;
1199
+ appSecretProbeValue = scanResult.appSecret;
1200
+ scanDomain = scanResult.domain;
1201
+ scanOpenId = scanResult.openId;
1202
+ } else {
1203
+ await noteFeishuCredentialHelp(prompter);
1204
+ appId = await promptFeishuAppId({
1205
+ prompter,
1206
+ initialValue: normalizeOptionalString(process.env.FEISHU_APP_ID)
1207
+ });
1208
+ const appSecretResult = await promptSingleChannelSecretInput({
1209
+ cfg: next,
1210
+ prompter,
1211
+ providerHint: "feishu",
1212
+ credentialLabel: "App Secret",
1213
+ secretInputMode: options?.secretInputMode,
1214
+ accountConfigured: false,
1215
+ canUseEnv: false,
1216
+ hasConfigToken: false,
1217
+ envPrompt: "",
1218
+ keepPrompt: t("wizard.feishu.appSecretKeep"),
1219
+ inputPrompt: t("wizard.feishu.appSecretPrompt"),
1220
+ preferredEnvVar: "FEISHU_APP_SECRET"
1221
+ });
1222
+ if (appSecretResult.action === "set") {
1223
+ appSecret = appSecretResult.value;
1224
+ appSecretProbeValue = appSecretResult.resolvedValue;
1225
+ }
1226
+ if (appId && appSecretProbeValue) {
1227
+ const { getAppOwnerOpenId } = await import("./app-registration-B3hiSdVb.js");
1228
+ scanOpenId = await getAppOwnerOpenId({
1229
+ appId,
1230
+ appSecret: appSecretProbeValue,
1231
+ domain: selectedDomain
1232
+ });
1233
+ }
1234
+ }
1235
+ const groupPolicy = await prompter.select({
1236
+ message: t("wizard.feishu.groupPolicyPrompt"),
1237
+ options: [
1238
+ {
1239
+ value: "allowlist",
1240
+ label: t("wizard.feishu.groupPolicyAllowlist")
1241
+ },
1242
+ {
1243
+ value: "open",
1244
+ label: t("wizard.feishu.groupPolicyOpen")
1245
+ },
1246
+ {
1247
+ value: "disabled",
1248
+ label: t("wizard.feishu.groupPolicyDisabled")
1249
+ }
1250
+ ],
1251
+ initialValue: "allowlist"
1252
+ });
1253
+ const configProgress = prompter.progress(t("wizard.feishu.configuring"));
1254
+ await new Promise((resolve) => setTimeout(resolve, 50));
1255
+ if (appId && appSecret) next = patchFeishuConfig(next, targetAccountId, {
1256
+ appId,
1257
+ appSecret,
1258
+ connectionMode: "websocket",
1259
+ ...scanDomain ? { domain: scanDomain } : {}
1260
+ });
1261
+ else if (scanDomain) next = patchFeishuConfig(next, targetAccountId, { domain: scanDomain });
1262
+ next = applyNewAppSecurityPolicy(next, targetAccountId, scanOpenId, groupPolicy);
1263
+ configProgress.stop(t("wizard.feishu.botConfigured"));
1264
+ return { cfg: next };
1265
+ }
1266
+ async function runEditFlow(params) {
1267
+ const { prompter, options } = params;
1268
+ const next = params.cfg;
1269
+ const feishuCfg = next.channels?.feishu;
1270
+ const resolveAppIdLabel = (value) => {
1271
+ const asString = normalizeOptionalString(value);
1272
+ if (asString) return asString;
1273
+ if (value && typeof value === "object") {
1274
+ const rec = value;
1275
+ if (normalizeOptionalString(rec.source) && normalizeOptionalString(rec.id)) return normalizeOptionalString(process.env[rec.id]) ?? `env:${String(rec.id)}`;
1276
+ if (hasConfiguredSecretInput(value)) return "(configured)";
1277
+ }
1278
+ };
1279
+ const existingAppId = resolveAppIdLabel(feishuCfg?.appId) ?? Object.values(feishuCfg?.accounts ?? {}).reduce((found, account) => {
1280
+ if (found) return found;
1281
+ if (account && typeof account === "object") return resolveAppIdLabel(account.appId);
1282
+ }, void 0);
1283
+ if (existingAppId) {
1284
+ if (!await prompter.confirm({
1285
+ message: t("wizard.feishu.existingBotPrompt", { appId: existingAppId }),
1286
+ initialValue: true
1287
+ })) return runNewAppFlow({
1288
+ cfg: next,
1289
+ prompter,
1290
+ options
1291
+ });
1292
+ } else return runNewAppFlow({
1293
+ cfg: next,
1294
+ prompter,
1295
+ options
1296
+ });
1297
+ await prompter.note(t("wizard.feishu.botConfigured"), "");
1298
+ return { cfg: next };
1299
+ }
1300
+ async function runFeishuLogin(params) {
1301
+ const { cfg, prompter } = params;
1302
+ const options = {};
1303
+ if (isFeishuConfigured(cfg)) {
1304
+ const result = await runEditFlow({
1305
+ cfg,
1306
+ prompter,
1307
+ options
1308
+ });
1309
+ if (result === null) return cfg;
1310
+ return result.cfg;
1311
+ }
1312
+ return (await runNewAppFlow({
1313
+ cfg,
1314
+ prompter,
1315
+ options
1316
+ })).cfg;
1317
+ }
1318
+ const feishuSetupWizard = {
1319
+ channel,
1320
+ resolveAccountIdForConfigure: ({ accountOverride, defaultAccountId, cfg }) => (typeof accountOverride === "string" && accountOverride.trim() ? accountOverride.trim() : void 0) ?? resolveDefaultFeishuAccountId(cfg) ?? defaultAccountId,
1321
+ resolveShouldPromptAccountIds: () => false,
1322
+ status: {
1323
+ configuredLabel: t("wizard.channels.statusConfigured"),
1324
+ unconfiguredLabel: t("wizard.channels.statusNeedsAppCredentials"),
1325
+ configuredHint: t("wizard.channels.statusConfigured"),
1326
+ unconfiguredHint: t("wizard.channels.statusNeedsAppCreds"),
1327
+ configuredScore: 2,
1328
+ unconfiguredScore: 0,
1329
+ resolveConfigured: ({ cfg }) => isFeishuConfigured(cfg),
1330
+ resolveStatusLines: async ({ cfg, accountId, configured }) => {
1331
+ const account = resolveFeishuAccount({
1332
+ cfg,
1333
+ accountId
1334
+ });
1335
+ let probeResult = null;
1336
+ if (configured && account.configured) try {
1337
+ const { probeFeishu } = await import("./probe-Cu4eb85S.js");
1338
+ probeResult = await probeFeishu(account);
1339
+ } catch {}
1340
+ if (!configured) return [formatFeishuStatusLine("needs-credentials")];
1341
+ if (probeResult?.ok) return [`Feishu: ${t("wizard.channels.statusConnectedAs", { name: probeResult.botName ?? probeResult.botOpenId ?? "bot" })}`];
1342
+ return [formatFeishuStatusLine("configured-unverified")];
1343
+ }
1344
+ },
1345
+ prepare: async ({ cfg, credentialValues }) => {
1346
+ if (isFeishuConfigured(cfg)) return { credentialValues: {
1347
+ ...credentialValues,
1348
+ [FEISHU_SETUP_FLOW_KEY]: "edit"
1349
+ } };
1350
+ return { credentialValues: {
1351
+ ...credentialValues,
1352
+ [FEISHU_SETUP_FLOW_KEY]: "new"
1353
+ } };
1354
+ },
1355
+ credentials: [],
1356
+ finalize: async ({ cfg, prompter, options, credentialValues }) => {
1357
+ if ((credentialValues[FEISHU_SETUP_FLOW_KEY] ?? "new") === "edit") {
1358
+ const result = await runEditFlow({
1359
+ cfg,
1360
+ prompter,
1361
+ options
1362
+ });
1363
+ if (result === null) return { cfg };
1364
+ return result;
1365
+ }
1366
+ return runNewAppFlow({
1367
+ cfg,
1368
+ prompter,
1369
+ options
1370
+ });
1371
+ },
1372
+ dmPolicy: feishuDmPolicy,
1373
+ disable: (cfg) => patchTopLevelChannelConfigSection({
1374
+ cfg,
1375
+ channel,
1376
+ patch: { enabled: false }
1377
+ })
1378
+ };
1379
+ //#endregion
1380
+ //#region extensions/feishu/src/channel.ts
1381
+ function readFeishuMediaParam(params) {
1382
+ const media = params.media;
1383
+ if (typeof media !== "string") return;
1384
+ return media.trim() ? media : void 0;
1385
+ }
1386
+ function readBooleanParam(params, keys) {
1387
+ for (const key of keys) {
1388
+ const value = params[key];
1389
+ if (typeof value === "boolean") return value;
1390
+ }
1391
+ }
1392
+ function hasLegacyFeishuCardCommandValue(actionValue) {
1393
+ return isRecord$1(actionValue) && actionValue.oc !== "ocf1" && (Boolean(typeof actionValue.command === "string" && actionValue.command.trim()) || Boolean(typeof actionValue.text === "string" && actionValue.text.trim()));
1394
+ }
1395
+ function containsLegacyFeishuCardCommandValue(node) {
1396
+ if (Array.isArray(node)) return node.some((item) => containsLegacyFeishuCardCommandValue(item));
1397
+ if (!isRecord$1(node)) return false;
1398
+ if (node.tag === "button" && hasLegacyFeishuCardCommandValue(node.value)) return true;
1399
+ if (node.tag === "button" && Array.isArray(node.behaviors) && node.behaviors.some((behavior) => isRecord$1(behavior) && hasLegacyFeishuCardCommandValue(behavior.value))) return true;
1400
+ return Object.values(node).some((value) => containsLegacyFeishuCardCommandValue(value));
1401
+ }
1402
+ const meta = {
1403
+ id: "feishu",
1404
+ label: "Feishu",
1405
+ selectionLabel: "Feishu/Lark (飞书)",
1406
+ docsPath: "/channels/feishu",
1407
+ docsLabel: "feishu",
1408
+ blurb: "飞书/Lark enterprise messaging.",
1409
+ aliases: ["lark"],
1410
+ order: 70,
1411
+ preferSessionLookupForAnnounceTarget: true
1412
+ };
1413
+ const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime.js"), "feishuChannelRuntime");
1414
+ function toFeishuMessageSendResult(result, kind) {
1415
+ const receipt = result.receipt ?? createFeishuSendReceipt({
1416
+ messageId: result.messageId,
1417
+ chatId: result.chatId ?? "",
1418
+ kind
1419
+ });
1420
+ return {
1421
+ messageId: result.messageId || receipt.primaryPlatformMessageId,
1422
+ receipt
1423
+ };
1424
+ }
1425
+ const feishuMessageAdapter = defineChannelMessageAdapter({
1426
+ id: "feishu",
1427
+ durableFinal: { capabilities: {
1428
+ text: true,
1429
+ media: true
1430
+ } },
1431
+ send: {
1432
+ text: async (ctx) => {
1433
+ const sendText = (await loadFeishuChannelRuntime()).feishuOutbound.sendText;
1434
+ if (!sendText) throw new Error("Feishu text sending is not available.");
1435
+ return toFeishuMessageSendResult(await sendText(ctx), "text");
1436
+ },
1437
+ media: async (ctx) => {
1438
+ const sendMedia = (await loadFeishuChannelRuntime()).feishuOutbound.sendMedia;
1439
+ if (!sendMedia) throw new Error("Feishu media sending is not available.");
1440
+ return toFeishuMessageSendResult(await sendMedia(ctx), "media");
1441
+ }
1442
+ }
1443
+ });
1444
+ async function createFeishuActionClient(account) {
1445
+ const { createFeishuClient } = await import("./client-BVV-GMAF.js");
1446
+ return createFeishuClient(account);
1447
+ }
1448
+ const collectFeishuSecurityWarnings = createAllowlistProviderGroupPolicyWarningCollector({
1449
+ providerConfigPresent: (cfg) => cfg.channels?.feishu !== void 0,
1450
+ resolveGroupPolicy: ({ cfg, accountId }) => resolveFeishuAccount({
1451
+ cfg,
1452
+ accountId
1453
+ }).config?.groupPolicy,
1454
+ collect: ({ cfg, accountId, groupPolicy }) => {
1455
+ if (groupPolicy !== "open") return [];
1456
+ return [`- Feishu[${resolveFeishuAccount({
1457
+ cfg,
1458
+ accountId
1459
+ }).accountId}] groups: groupPolicy="open" allows any member to trigger (mention-gated). Set channels.feishu.groupPolicy="allowlist" + channels.feishu.groupAllowFrom to restrict senders.`];
1460
+ }
1461
+ });
1462
+ function describeFeishuMessageTool({ cfg, accountId }) {
1463
+ const enabledAccounts = accountId ? [resolveFeishuAccount({
1464
+ cfg,
1465
+ accountId
1466
+ })].filter((account) => account.enabled && account.configured) : listEnabledFeishuAccounts(cfg);
1467
+ const enabled = enabledAccounts.length > 0 || !accountId && cfg.channels?.feishu?.enabled !== false && Boolean(inspectFeishuCredentials(cfg.channels?.feishu));
1468
+ if (enabledAccounts.length === 0) return {
1469
+ actions: [],
1470
+ capabilities: enabled ? ["presentation"] : []
1471
+ };
1472
+ const actions = new Set([
1473
+ "send",
1474
+ "read",
1475
+ "edit",
1476
+ "thread-reply",
1477
+ "pin",
1478
+ "list-pins",
1479
+ "unpin",
1480
+ "member-info",
1481
+ "channel-info",
1482
+ "channel-list"
1483
+ ]);
1484
+ if (accountId ? enabledAccounts.some((account) => isFeishuReactionsActionEnabled({
1485
+ cfg,
1486
+ account
1487
+ })) : areAnyFeishuReactionActionsEnabled(cfg)) {
1488
+ actions.add("react");
1489
+ actions.add("reactions");
1490
+ }
1491
+ return {
1492
+ actions: Array.from(actions),
1493
+ capabilities: enabled ? ["presentation"] : []
1494
+ };
1495
+ }
1496
+ function setFeishuNamedAccountEnabled(cfg, accountId, enabled) {
1497
+ const feishuCfg = cfg.channels?.feishu;
1498
+ return {
1499
+ ...cfg,
1500
+ channels: {
1501
+ ...cfg.channels,
1502
+ feishu: {
1503
+ ...feishuCfg,
1504
+ accounts: {
1505
+ ...feishuCfg?.accounts,
1506
+ [accountId]: {
1507
+ ...feishuCfg?.accounts?.[accountId],
1508
+ enabled
1509
+ }
1510
+ }
1511
+ }
1512
+ }
1513
+ };
1514
+ }
1515
+ const feishuConfigAdapter = createHybridChannelConfigAdapter({
1516
+ sectionKey: "feishu",
1517
+ listAccountIds: listFeishuAccountIds,
1518
+ resolveAccount: adaptScopedAccountAccessor(resolveFeishuAccount),
1519
+ defaultAccountId: resolveDefaultFeishuAccountId,
1520
+ clearBaseFields: [],
1521
+ resolveAllowFrom: (account) => account.config.allowFrom,
1522
+ formatAllowFrom: (allowFrom) => formatAllowFromLowercase({ allowFrom })
1523
+ });
1524
+ function isFeishuReactionsActionEnabled(params) {
1525
+ if (!params.account.enabled || !params.account.configured) return false;
1526
+ return createActionGate(params.account.config.actions ?? (params.cfg.channels?.feishu)?.actions)("reactions");
1527
+ }
1528
+ function areAnyFeishuReactionActionsEnabled(cfg) {
1529
+ for (const account of listEnabledFeishuAccounts(cfg)) if (isFeishuReactionsActionEnabled({
1530
+ cfg,
1531
+ account
1532
+ })) return true;
1533
+ return false;
1534
+ }
1535
+ function isFeishuGroupTopicSessionKey(sessionKey) {
1536
+ if (typeof sessionKey !== "string" || !sessionKey) return false;
1537
+ const parsed = parseFeishuConversationId({ conversationId: sessionKey });
1538
+ return parsed?.scope === "group_topic" || parsed?.scope === "group_topic_sender";
1539
+ }
1540
+ function resolveFeishuTopicAutoThreadAnchor(ctx) {
1541
+ if (ctx.action !== "send") return;
1542
+ if (!isFeishuGroupTopicSessionKey(ctx.sessionKey)) return;
1543
+ const inbound = ctx.toolContext?.currentMessageId;
1544
+ return typeof inbound === "string" && inbound.length > 0 ? inbound : void 0;
1545
+ }
1546
+ function buildFeishuSendReplyAnchor(ctx) {
1547
+ if (ctx.action === "thread-reply") return {
1548
+ replyToMessageId: resolveFeishuMessageId(ctx.params),
1549
+ replyInThread: true
1550
+ };
1551
+ const autoThreadId = resolveFeishuTopicAutoThreadAnchor(ctx);
1552
+ return {
1553
+ replyToMessageId: autoThreadId,
1554
+ replyInThread: autoThreadId !== void 0
1555
+ };
1556
+ }
1557
+ function isSupportedFeishuDirectConversationId(conversationId) {
1558
+ const trimmed = conversationId.trim();
1559
+ if (!trimmed || trimmed.includes(":")) return false;
1560
+ if (trimmed.startsWith("oc_") || trimmed.startsWith("on_")) return false;
1561
+ return true;
1562
+ }
1563
+ function normalizeFeishuAcpConversationId(conversationId) {
1564
+ const parsed = parseFeishuConversationId({ conversationId });
1565
+ if (!parsed || parsed.scope !== "group_topic" && parsed.scope !== "group_topic_sender" && !isSupportedFeishuDirectConversationId(parsed.canonicalConversationId)) return null;
1566
+ return {
1567
+ conversationId: parsed.canonicalConversationId,
1568
+ parentConversationId: parsed.scope === "group_topic" || parsed.scope === "group_topic_sender" ? parsed.chatId : void 0
1569
+ };
1570
+ }
1571
+ function matchFeishuAcpConversation(params) {
1572
+ const binding = normalizeFeishuAcpConversationId(params.bindingConversationId);
1573
+ if (!binding) return null;
1574
+ const incoming = parseFeishuConversationId({
1575
+ conversationId: params.conversationId,
1576
+ parentConversationId: params.parentConversationId
1577
+ });
1578
+ if (!incoming || incoming.scope !== "group_topic" && incoming.scope !== "group_topic_sender" && !isSupportedFeishuDirectConversationId(incoming.canonicalConversationId)) return null;
1579
+ const matchesCanonicalConversation = binding.conversationId === incoming.canonicalConversationId;
1580
+ const matchesParentTopicForSenderScopedConversation = incoming.scope === "group_topic_sender" && binding.parentConversationId === incoming.chatId && binding.conversationId === `${incoming.chatId}:topic:${incoming.topicId}`;
1581
+ if (!matchesCanonicalConversation && !matchesParentTopicForSenderScopedConversation) return null;
1582
+ return {
1583
+ conversationId: matchesParentTopicForSenderScopedConversation ? binding.conversationId : incoming.canonicalConversationId,
1584
+ parentConversationId: incoming.scope === "group_topic" || incoming.scope === "group_topic_sender" ? incoming.chatId : void 0,
1585
+ matchPriority: matchesCanonicalConversation ? 2 : 1
1586
+ };
1587
+ }
1588
+ function resolveFeishuSenderScopedCommandConversation(params) {
1589
+ const parentConversationId = params.parentConversationId?.trim();
1590
+ const threadId = params.threadId?.trim();
1591
+ const senderId = params.senderId?.trim();
1592
+ if (!parentConversationId || !threadId || !senderId) return;
1593
+ const expectedScopePrefix = `feishu:group:${normalizeLowercaseStringOrEmpty(parentConversationId)}:topic:${normalizeLowercaseStringOrEmpty(threadId)}:sender:`;
1594
+ const isSenderScopedSession = [params.sessionKey, params.parentSessionKey].some((candidate) => {
1595
+ const normalized = normalizeLowercaseStringOrEmpty(candidate ?? "");
1596
+ if (!normalized) return false;
1597
+ return normalized.replace(/^agent:[^:]+:/, "").startsWith(expectedScopePrefix);
1598
+ });
1599
+ const senderScopedConversationId = buildFeishuConversationId({
1600
+ chatId: parentConversationId,
1601
+ scope: "group_topic_sender",
1602
+ topicId: threadId,
1603
+ senderOpenId: senderId
1604
+ });
1605
+ if (isSenderScopedSession) return senderScopedConversationId;
1606
+ if (!params.sessionKey?.trim()) return;
1607
+ return getSessionBindingService().listBySession(params.sessionKey).find((binding) => {
1608
+ if (binding.conversation.channel !== "feishu" || binding.conversation.accountId !== params.accountId) return false;
1609
+ return binding.conversation.conversationId === senderScopedConversationId;
1610
+ })?.conversation.conversationId;
1611
+ }
1612
+ function resolveFeishuCommandConversation(params) {
1613
+ if (params.threadId) {
1614
+ const parentConversationId = parseFeishuTargetId(params.originatingTo) ?? parseFeishuTargetId(params.commandTo) ?? parseFeishuTargetId(params.fallbackTo);
1615
+ if (!parentConversationId) return null;
1616
+ return {
1617
+ conversationId: resolveFeishuSenderScopedCommandConversation({
1618
+ accountId: params.accountId,
1619
+ parentConversationId,
1620
+ threadId: params.threadId,
1621
+ senderId: params.senderId,
1622
+ sessionKey: params.sessionKey,
1623
+ parentSessionKey: params.parentSessionKey
1624
+ }) ?? buildFeishuConversationId({
1625
+ chatId: parentConversationId,
1626
+ scope: "group_topic",
1627
+ topicId: params.threadId
1628
+ }),
1629
+ parentConversationId
1630
+ };
1631
+ }
1632
+ const conversationId = parseFeishuDirectConversationId(params.originatingTo) ?? parseFeishuDirectConversationId(params.commandTo) ?? parseFeishuDirectConversationId(params.fallbackTo);
1633
+ return conversationId ? { conversationId } : null;
1634
+ }
1635
+ function jsonActionResult(details) {
1636
+ return {
1637
+ content: [{
1638
+ type: "text",
1639
+ text: JSON.stringify(details)
1640
+ }],
1641
+ details
1642
+ };
1643
+ }
1644
+ function readFirstString(params, keys, fallback) {
1645
+ for (const key of keys) {
1646
+ const value = params[key];
1647
+ if (typeof value === "string" && value.trim()) return value.trim();
1648
+ }
1649
+ if (typeof fallback === "string" && fallback.trim()) return fallback.trim();
1650
+ }
1651
+ function readOptionalPositiveInteger(params, keys) {
1652
+ for (const key of keys) {
1653
+ const parsed = parseStrictPositiveInteger(params[key]);
1654
+ if (parsed !== void 0) return parsed;
1655
+ }
1656
+ }
1657
+ function resolveFeishuActionTarget(ctx) {
1658
+ return readFirstString(ctx.params, ["to", "target"], ctx.toolContext?.currentChannelId);
1659
+ }
1660
+ function resolveFeishuChatId(ctx) {
1661
+ const raw = readFirstString(ctx.params, [
1662
+ "chatId",
1663
+ "chat_id",
1664
+ "channelId",
1665
+ "channel_id",
1666
+ "to",
1667
+ "target"
1668
+ ], ctx.toolContext?.currentChannelId);
1669
+ if (!raw) return;
1670
+ if (/^(user|dm|open_id):/i.test(raw)) return;
1671
+ if (/^(chat|group|channel):/i.test(raw)) return normalizeFeishuTarget(raw) ?? void 0;
1672
+ return raw;
1673
+ }
1674
+ function resolveFeishuMessageId(params) {
1675
+ return readFirstString(params, [
1676
+ "messageId",
1677
+ "message_id",
1678
+ "replyTo",
1679
+ "reply_to"
1680
+ ]);
1681
+ }
1682
+ function resolveFeishuMemberId(params) {
1683
+ return readFirstString(params, [
1684
+ "memberId",
1685
+ "member_id",
1686
+ "userId",
1687
+ "user_id",
1688
+ "openId",
1689
+ "open_id",
1690
+ "unionId",
1691
+ "union_id"
1692
+ ]);
1693
+ }
1694
+ function resolveFeishuMemberIdType(params) {
1695
+ const raw = readFirstString(params, [
1696
+ "memberIdType",
1697
+ "member_id_type",
1698
+ "userIdType",
1699
+ "user_id_type"
1700
+ ]);
1701
+ if (raw === "open_id" || raw === "user_id" || raw === "union_id") return raw;
1702
+ if (readFirstString(params, ["userId", "user_id"]) && !readFirstString(params, [
1703
+ "openId",
1704
+ "open_id",
1705
+ "unionId",
1706
+ "union_id"
1707
+ ])) return "user_id";
1708
+ if (readFirstString(params, ["unionId", "union_id"]) && !readFirstString(params, ["openId", "open_id"])) return "union_id";
1709
+ return "open_id";
1710
+ }
1711
+ const feishuPlugin = createChatChannelPlugin({
1712
+ base: {
1713
+ id: "feishu",
1714
+ meta: { ...meta },
1715
+ capabilities: {
1716
+ chatTypes: ["direct", "channel"],
1717
+ polls: false,
1718
+ threads: true,
1719
+ media: true,
1720
+ tts: { voice: {
1721
+ synthesisTarget: "voice-note",
1722
+ transcodesAudio: true
1723
+ } },
1724
+ reactions: true,
1725
+ edit: true,
1726
+ reply: true
1727
+ },
1728
+ agentPrompt: { messageToolHints: () => [
1729
+ "- Feishu targeting: omit `target` to reply to the current conversation (auto-inferred). Explicit targets: `user:open_id` or `chat:chat_id`.",
1730
+ "- Feishu supports interactive cards plus native image, file, audio, and video/media delivery.",
1731
+ "- Feishu supports `send`, `read`, `edit`, `thread-reply`, pins, and channel/member lookup, plus reactions when enabled."
1732
+ ] },
1733
+ groups: { resolveToolPolicy: resolveFeishuGroupToolPolicy },
1734
+ conversationBindings: {
1735
+ defaultTopLevelPlacement: "current",
1736
+ buildModelOverrideParentCandidates: ({ parentConversationId }) => buildFeishuModelOverrideParentCandidates(parentConversationId)
1737
+ },
1738
+ mentions: { stripPatterns: () => ["<at user_id=\"[^\"]*\">[^<]*</at>"] },
1739
+ reload: { configPrefixes: ["channels.feishu"] },
1740
+ doctor: feishuDoctor,
1741
+ configSchema: buildChannelConfigSchema(FeishuConfigSchema),
1742
+ config: {
1743
+ ...feishuConfigAdapter,
1744
+ setAccountEnabled: ({ cfg, accountId, enabled }) => {
1745
+ if (accountId === "default") return {
1746
+ ...cfg,
1747
+ channels: {
1748
+ ...cfg.channels,
1749
+ feishu: {
1750
+ ...cfg.channels?.feishu,
1751
+ enabled
1752
+ }
1753
+ }
1754
+ };
1755
+ return setFeishuNamedAccountEnabled(cfg, accountId, enabled);
1756
+ },
1757
+ deleteAccount: ({ cfg, accountId }) => {
1758
+ if (accountId === "default") {
1759
+ const next = { ...cfg };
1760
+ const nextChannels = { ...cfg.channels };
1761
+ delete nextChannels.feishu;
1762
+ if (Object.keys(nextChannels).length > 0) next.channels = nextChannels;
1763
+ else delete next.channels;
1764
+ return next;
1765
+ }
1766
+ const feishuCfg = cfg.channels?.feishu;
1767
+ const accounts = { ...feishuCfg?.accounts };
1768
+ delete accounts[accountId];
1769
+ return {
1770
+ ...cfg,
1771
+ channels: {
1772
+ ...cfg.channels,
1773
+ feishu: {
1774
+ ...feishuCfg,
1775
+ accounts: Object.keys(accounts).length > 0 ? accounts : void 0
1776
+ }
1777
+ }
1778
+ };
1779
+ },
1780
+ isConfigured: (account) => account.configured,
1781
+ describeAccount: (account) => describeAccountSnapshot({
1782
+ account,
1783
+ configured: account.configured,
1784
+ extra: {
1785
+ appId: account.appId,
1786
+ domain: account.domain
1787
+ }
1788
+ })
1789
+ },
1790
+ approvalCapability: feishuApprovalAuth,
1791
+ secrets: {
1792
+ secretTargetRegistryEntries,
1793
+ collectRuntimeConfigAssignments
1794
+ },
1795
+ actions: {
1796
+ messageActionTargetAliases,
1797
+ describeMessageTool: describeFeishuMessageTool,
1798
+ handleAction: async (ctx) => {
1799
+ const account = resolveFeishuAccount({
1800
+ cfg: ctx.cfg,
1801
+ accountId: ctx.accountId ?? void 0
1802
+ });
1803
+ if ((ctx.action === "react" || ctx.action === "reactions") && !isFeishuReactionsActionEnabled({
1804
+ cfg: ctx.cfg,
1805
+ account
1806
+ })) throw new Error("Feishu reactions are disabled via actions.reactions.");
1807
+ if (ctx.action === "send" || ctx.action === "thread-reply") {
1808
+ const to = resolveFeishuActionTarget(ctx);
1809
+ if (!to) throw new Error(`Feishu ${ctx.action} requires a target (to).`);
1810
+ const { replyToMessageId, replyInThread } = buildFeishuSendReplyAnchor(ctx);
1811
+ if (ctx.action === "thread-reply" && !replyToMessageId) throw new Error("Feishu thread-reply requires messageId.");
1812
+ const presentation = normalizeMessagePresentation(ctx.params.presentation);
1813
+ const text = readFirstString(ctx.params, ["text", "message"]);
1814
+ const mediaUrl = readFeishuMediaParam(ctx.params);
1815
+ const audioAsVoice = readBooleanParam(ctx.params, ["asVoice", "audioAsVoice"]);
1816
+ const card = presentation ? buildFeishuPresentationCard({
1817
+ presentation,
1818
+ fallbackText: text
1819
+ }) : void 0;
1820
+ if (card && mediaUrl) throw new Error(`Feishu ${ctx.action} does not support card with media.`);
1821
+ if (!card && !text && !mediaUrl) throw new Error(`Feishu ${ctx.action} requires text/message, media, or card.`);
1822
+ const runtime = await loadFeishuChannelRuntime();
1823
+ const maybeSendMedia = runtime.feishuOutbound.sendMedia;
1824
+ if (mediaUrl && !maybeSendMedia) throw new Error("Feishu media sending is not available.");
1825
+ const sendMedia = maybeSendMedia;
1826
+ let result;
1827
+ if (card) {
1828
+ if (containsLegacyFeishuCardCommandValue(card)) throw new Error("Feishu card buttons that trigger text or commands must use structured interaction envelopes.");
1829
+ result = await runtime.sendCardFeishu({
1830
+ cfg: ctx.cfg,
1831
+ to,
1832
+ card,
1833
+ accountId: ctx.accountId ?? void 0,
1834
+ replyToMessageId,
1835
+ replyInThread
1836
+ });
1837
+ } else if (mediaUrl) result = await sendMedia({
1838
+ cfg: ctx.cfg,
1839
+ to,
1840
+ text: text ?? "",
1841
+ mediaUrl,
1842
+ accountId: ctx.accountId ?? void 0,
1843
+ mediaLocalRoots: ctx.mediaLocalRoots,
1844
+ ...replyInThread ? { threadId: replyToMessageId } : { replyToId: replyToMessageId },
1845
+ ...audioAsVoice === true ? { audioAsVoice: true } : {}
1846
+ });
1847
+ else result = await runtime.sendMessageFeishu({
1848
+ cfg: ctx.cfg,
1849
+ to,
1850
+ text,
1851
+ accountId: ctx.accountId ?? void 0,
1852
+ replyToMessageId,
1853
+ replyInThread
1854
+ });
1855
+ return jsonActionResult({
1856
+ ok: true,
1857
+ channel: "feishu",
1858
+ action: ctx.action,
1859
+ ...result
1860
+ });
1861
+ }
1862
+ if (ctx.action === "read") {
1863
+ const messageId = resolveFeishuMessageId(ctx.params);
1864
+ if (!messageId) throw new Error("Feishu read requires messageId.");
1865
+ const { getMessageFeishu } = await loadFeishuChannelRuntime();
1866
+ const message = await getMessageFeishu({
1867
+ cfg: ctx.cfg,
1868
+ messageId,
1869
+ accountId: ctx.accountId ?? void 0
1870
+ });
1871
+ if (!message) return {
1872
+ isError: true,
1873
+ content: [{
1874
+ type: "text",
1875
+ text: JSON.stringify({ error: `Feishu read failed or message not found: ${messageId}` })
1876
+ }],
1877
+ details: { error: `Feishu read failed or message not found: ${messageId}` }
1878
+ };
1879
+ return jsonActionResult({
1880
+ ok: true,
1881
+ channel: "feishu",
1882
+ action: "read",
1883
+ message
1884
+ });
1885
+ }
1886
+ if (ctx.action === "edit") {
1887
+ const messageId = resolveFeishuMessageId(ctx.params);
1888
+ if (!messageId) throw new Error("Feishu edit requires messageId.");
1889
+ const text = readFirstString(ctx.params, ["text", "message"]);
1890
+ const card = ctx.params.card && typeof ctx.params.card === "object" ? ctx.params.card : void 0;
1891
+ const { editMessageFeishu } = await loadFeishuChannelRuntime();
1892
+ return jsonActionResult({
1893
+ ok: true,
1894
+ channel: "feishu",
1895
+ action: "edit",
1896
+ ...await editMessageFeishu({
1897
+ cfg: ctx.cfg,
1898
+ messageId,
1899
+ text,
1900
+ card,
1901
+ accountId: ctx.accountId ?? void 0
1902
+ })
1903
+ });
1904
+ }
1905
+ if (ctx.action === "pin") {
1906
+ const messageId = resolveFeishuMessageId(ctx.params);
1907
+ if (!messageId) throw new Error("Feishu pin requires messageId.");
1908
+ const { createPinFeishu } = await loadFeishuChannelRuntime();
1909
+ return jsonActionResult({
1910
+ ok: true,
1911
+ channel: "feishu",
1912
+ action: "pin",
1913
+ pin: await createPinFeishu({
1914
+ cfg: ctx.cfg,
1915
+ messageId,
1916
+ accountId: ctx.accountId ?? void 0
1917
+ })
1918
+ });
1919
+ }
1920
+ if (ctx.action === "unpin") {
1921
+ const messageId = resolveFeishuMessageId(ctx.params);
1922
+ if (!messageId) throw new Error("Feishu unpin requires messageId.");
1923
+ const { removePinFeishu } = await loadFeishuChannelRuntime();
1924
+ await removePinFeishu({
1925
+ cfg: ctx.cfg,
1926
+ messageId,
1927
+ accountId: ctx.accountId ?? void 0
1928
+ });
1929
+ return jsonActionResult({
1930
+ ok: true,
1931
+ channel: "feishu",
1932
+ action: "unpin",
1933
+ messageId
1934
+ });
1935
+ }
1936
+ if (ctx.action === "list-pins") {
1937
+ const chatId = resolveFeishuChatId(ctx);
1938
+ if (!chatId) throw new Error("Feishu list-pins requires chatId or channelId.");
1939
+ const { listPinsFeishu } = await loadFeishuChannelRuntime();
1940
+ return jsonActionResult({
1941
+ ok: true,
1942
+ channel: "feishu",
1943
+ action: "list-pins",
1944
+ ...await listPinsFeishu({
1945
+ cfg: ctx.cfg,
1946
+ chatId,
1947
+ startTime: readFirstString(ctx.params, ["startTime", "start_time"]),
1948
+ endTime: readFirstString(ctx.params, ["endTime", "end_time"]),
1949
+ pageSize: readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]),
1950
+ pageToken: readFirstString(ctx.params, ["pageToken", "page_token"]),
1951
+ accountId: ctx.accountId ?? void 0
1952
+ })
1953
+ });
1954
+ }
1955
+ if (ctx.action === "channel-info") {
1956
+ const chatId = resolveFeishuChatId(ctx);
1957
+ if (!chatId) throw new Error("Feishu channel-info requires chatId or channelId.");
1958
+ const runtime = await loadFeishuChannelRuntime();
1959
+ const client = await createFeishuActionClient(account);
1960
+ const channel = await runtime.getChatInfo(client, chatId);
1961
+ if (!(ctx.params.includeMembers === true || ctx.params.members === true)) return jsonActionResult({
1962
+ ok: true,
1963
+ provider: "feishu",
1964
+ action: "channel-info",
1965
+ channel
1966
+ });
1967
+ return jsonActionResult({
1968
+ ok: true,
1969
+ provider: "feishu",
1970
+ action: "channel-info",
1971
+ channel,
1972
+ members: await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
1973
+ });
1974
+ }
1975
+ if (ctx.action === "member-info") {
1976
+ const runtime = await loadFeishuChannelRuntime();
1977
+ const client = await createFeishuActionClient(account);
1978
+ const memberId = resolveFeishuMemberId(ctx.params);
1979
+ if (memberId) return jsonActionResult({
1980
+ ok: true,
1981
+ channel: "feishu",
1982
+ action: "member-info",
1983
+ member: await runtime.getFeishuMemberInfo(client, memberId, resolveFeishuMemberIdType(ctx.params))
1984
+ });
1985
+ const chatId = resolveFeishuChatId(ctx);
1986
+ if (!chatId) throw new Error("Feishu member-info requires memberId or chatId/channelId.");
1987
+ return jsonActionResult({
1988
+ ok: true,
1989
+ channel: "feishu",
1990
+ action: "member-info",
1991
+ ...await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
1992
+ });
1993
+ }
1994
+ if (ctx.action === "channel-list") {
1995
+ const runtime = await loadFeishuChannelRuntime();
1996
+ const query = readFirstString(ctx.params, ["query"]);
1997
+ const limit = readOptionalPositiveInteger(ctx.params, ["limit"]);
1998
+ const scope = readFirstString(ctx.params, ["scope", "kind"]) ?? "all";
1999
+ if (scope === "groups" || scope === "group" || scope === "channels" || scope === "channel") return jsonActionResult({
2000
+ ok: true,
2001
+ channel: "feishu",
2002
+ action: "channel-list",
2003
+ groups: await runtime.listFeishuDirectoryGroupsLive({
2004
+ cfg: ctx.cfg,
2005
+ query,
2006
+ limit,
2007
+ fallbackToStatic: false,
2008
+ accountId: ctx.accountId ?? void 0
2009
+ })
2010
+ });
2011
+ if (scope === "peers" || scope === "peer" || scope === "members" || scope === "member" || scope === "users" || scope === "user") return jsonActionResult({
2012
+ ok: true,
2013
+ channel: "feishu",
2014
+ action: "channel-list",
2015
+ peers: await runtime.listFeishuDirectoryPeersLive({
2016
+ cfg: ctx.cfg,
2017
+ query,
2018
+ limit,
2019
+ fallbackToStatic: false,
2020
+ accountId: ctx.accountId ?? void 0
2021
+ })
2022
+ });
2023
+ const [groups, peers] = await Promise.all([runtime.listFeishuDirectoryGroupsLive({
2024
+ cfg: ctx.cfg,
2025
+ query,
2026
+ limit,
2027
+ fallbackToStatic: false,
2028
+ accountId: ctx.accountId ?? void 0
2029
+ }), runtime.listFeishuDirectoryPeersLive({
2030
+ cfg: ctx.cfg,
2031
+ query,
2032
+ limit,
2033
+ fallbackToStatic: false,
2034
+ accountId: ctx.accountId ?? void 0
2035
+ })]);
2036
+ return jsonActionResult({
2037
+ ok: true,
2038
+ channel: "feishu",
2039
+ action: "channel-list",
2040
+ groups,
2041
+ peers
2042
+ });
2043
+ }
2044
+ if (ctx.action === "react") {
2045
+ const messageId = resolveFeishuMessageId(ctx.params);
2046
+ if (!messageId) throw new Error("Feishu reaction requires messageId.");
2047
+ const emoji = typeof ctx.params.emoji === "string" ? ctx.params.emoji.trim() : "";
2048
+ const remove = ctx.params.remove === true;
2049
+ const clearAll = ctx.params.clearAll === true;
2050
+ if (remove) {
2051
+ if (!emoji) throw new Error("Emoji is required to remove a Feishu reaction.");
2052
+ const { listReactionsFeishu, removeReactionFeishu } = await loadFeishuChannelRuntime();
2053
+ const ownReaction = (await listReactionsFeishu({
2054
+ cfg: ctx.cfg,
2055
+ messageId,
2056
+ emojiType: emoji,
2057
+ accountId: ctx.accountId ?? void 0
2058
+ })).find((entry) => entry.operatorType === "app");
2059
+ if (!ownReaction) return jsonActionResult({
2060
+ ok: true,
2061
+ removed: null
2062
+ });
2063
+ await removeReactionFeishu({
2064
+ cfg: ctx.cfg,
2065
+ messageId,
2066
+ reactionId: ownReaction.reactionId,
2067
+ accountId: ctx.accountId ?? void 0
2068
+ });
2069
+ return jsonActionResult({
2070
+ ok: true,
2071
+ removed: emoji
2072
+ });
2073
+ }
2074
+ if (!emoji) {
2075
+ if (!clearAll) throw new Error("Emoji is required to add a Feishu reaction. Set clearAll=true to remove all bot reactions.");
2076
+ const { listReactionsFeishu, removeReactionFeishu } = await loadFeishuChannelRuntime();
2077
+ const reactions = await listReactionsFeishu({
2078
+ cfg: ctx.cfg,
2079
+ messageId,
2080
+ accountId: ctx.accountId ?? void 0
2081
+ });
2082
+ let removed = 0;
2083
+ for (const reaction of reactions.filter((entry) => entry.operatorType === "app")) {
2084
+ await removeReactionFeishu({
2085
+ cfg: ctx.cfg,
2086
+ messageId,
2087
+ reactionId: reaction.reactionId,
2088
+ accountId: ctx.accountId ?? void 0
2089
+ });
2090
+ removed += 1;
2091
+ }
2092
+ return jsonActionResult({
2093
+ ok: true,
2094
+ removed
2095
+ });
2096
+ }
2097
+ const { addReactionFeishu } = await loadFeishuChannelRuntime();
2098
+ await addReactionFeishu({
2099
+ cfg: ctx.cfg,
2100
+ messageId,
2101
+ emojiType: emoji,
2102
+ accountId: ctx.accountId ?? void 0
2103
+ });
2104
+ return jsonActionResult({
2105
+ ok: true,
2106
+ added: emoji
2107
+ });
2108
+ }
2109
+ if (ctx.action === "reactions") {
2110
+ const messageId = resolveFeishuMessageId(ctx.params);
2111
+ if (!messageId) throw new Error("Feishu reactions lookup requires messageId.");
2112
+ const { listReactionsFeishu } = await loadFeishuChannelRuntime();
2113
+ return jsonActionResult({
2114
+ ok: true,
2115
+ reactions: await listReactionsFeishu({
2116
+ cfg: ctx.cfg,
2117
+ messageId,
2118
+ accountId: ctx.accountId ?? void 0
2119
+ })
2120
+ });
2121
+ }
2122
+ throw new Error(`Unsupported Feishu action: "${ctx.action}"`);
2123
+ }
2124
+ },
2125
+ bindings: {
2126
+ compileConfiguredBinding: ({ conversationId }) => normalizeFeishuAcpConversationId(conversationId),
2127
+ matchInboundConversation: ({ compiledBinding, conversationId, parentConversationId }) => matchFeishuAcpConversation({
2128
+ bindingConversationId: compiledBinding.conversationId,
2129
+ conversationId,
2130
+ parentConversationId
2131
+ }),
2132
+ resolveCommandConversation: ({ accountId, threadId, senderId, sessionKey, parentSessionKey, originatingTo, commandTo, fallbackTo }) => resolveFeishuCommandConversation({
2133
+ accountId,
2134
+ threadId,
2135
+ senderId,
2136
+ sessionKey,
2137
+ parentSessionKey,
2138
+ originatingTo,
2139
+ commandTo,
2140
+ fallbackTo
2141
+ })
2142
+ },
2143
+ auth: { login: async ({ cfg }) => {
2144
+ const { createClackPrompter } = await import("./plugin-sdk/setup-runtime.js");
2145
+ const { replaceConfigFile } = await import("./plugin-sdk/config-mutation.js");
2146
+ const nextCfg = await runFeishuLogin({
2147
+ cfg,
2148
+ prompter: createClackPrompter()
2149
+ });
2150
+ if (nextCfg !== cfg) await replaceConfigFile({
2151
+ nextConfig: nextCfg,
2152
+ afterWrite: { mode: "auto" }
2153
+ });
2154
+ } },
2155
+ setup: feishuSetupAdapter,
2156
+ setupWizard: feishuSetupWizard,
2157
+ messaging: {
2158
+ targetPrefixes: ["feishu", "lark"],
2159
+ normalizeTarget: (raw) => normalizeFeishuTarget(raw) ?? void 0,
2160
+ resolveDeliveryTarget: ({ conversationId, parentConversationId }) => {
2161
+ const directId = parseFeishuDirectConversationId(conversationId);
2162
+ if (directId) return { to: `user:${directId}` };
2163
+ const parsed = parseFeishuConversationId({
2164
+ conversationId,
2165
+ parentConversationId
2166
+ });
2167
+ if (parsed?.topicId) return {
2168
+ to: `chat:${parentConversationId?.trim() || parsed.chatId}`,
2169
+ threadId: parsed.topicId
2170
+ };
2171
+ return { to: `chat:${parsed?.chatId ?? conversationId.trim()}` };
2172
+ },
2173
+ resolveSessionConversation: ({ kind, rawId }) => resolveFeishuSessionConversation({
2174
+ kind,
2175
+ rawId
2176
+ }),
2177
+ resolveOutboundSessionRoute: (params) => resolveFeishuOutboundSessionRoute(params),
2178
+ targetResolver: {
2179
+ looksLikeId: looksLikeFeishuId,
2180
+ hint: "<chatId|user:openId|chat:chatId>"
2181
+ }
2182
+ },
2183
+ directory: createChannelDirectoryAdapter({
2184
+ listPeers: async ({ cfg, query, limit, accountId }) => listFeishuDirectoryPeers({
2185
+ cfg,
2186
+ query: query ?? void 0,
2187
+ limit: limit ?? void 0,
2188
+ accountId: accountId ?? void 0
2189
+ }),
2190
+ listGroups: async ({ cfg, query, limit, accountId }) => listFeishuDirectoryGroups({
2191
+ cfg,
2192
+ query: query ?? void 0,
2193
+ limit: limit ?? void 0,
2194
+ accountId: accountId ?? void 0
2195
+ }),
2196
+ ...createRuntimeDirectoryLiveAdapter({
2197
+ getRuntime: loadFeishuChannelRuntime,
2198
+ listPeersLive: (runtime) => async ({ cfg, query, limit, accountId }) => await runtime.listFeishuDirectoryPeersLive({
2199
+ cfg,
2200
+ query: query ?? void 0,
2201
+ limit: limit ?? void 0,
2202
+ accountId: accountId ?? void 0
2203
+ }),
2204
+ listGroupsLive: (runtime) => async ({ cfg, query, limit, accountId }) => await runtime.listFeishuDirectoryGroupsLive({
2205
+ cfg,
2206
+ query: query ?? void 0,
2207
+ limit: limit ?? void 0,
2208
+ accountId: accountId ?? void 0
2209
+ })
2210
+ })
2211
+ }),
2212
+ status: createComputedAccountStatusAdapter({
2213
+ defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID, { port: null }),
2214
+ buildChannelSummary: ({ snapshot }) => buildProbeChannelStatusSummary(snapshot, { port: snapshot.port ?? null }),
2215
+ probeAccount: async ({ account }) => await (await loadFeishuChannelRuntime()).probeFeishu(account),
2216
+ resolveAccountSnapshot: ({ account, runtime }) => ({
2217
+ accountId: account.accountId,
2218
+ enabled: account.enabled,
2219
+ configured: account.configured,
2220
+ name: account.name,
2221
+ extra: {
2222
+ appId: account.appId,
2223
+ domain: account.domain,
2224
+ port: runtime?.port ?? null
2225
+ }
2226
+ })
2227
+ }),
2228
+ gateway: { startAccount: async (ctx) => {
2229
+ const { monitorFeishuProvider } = await import("./monitor-d0eyE2k0.js");
2230
+ const account = resolveFeishuRuntimeAccount({
2231
+ cfg: ctx.cfg,
2232
+ accountId: ctx.accountId
2233
+ }, { requireEventSecrets: true });
2234
+ const port = account.config?.webhookPort ?? null;
2235
+ ctx.setStatus({
2236
+ accountId: ctx.accountId,
2237
+ port
2238
+ });
2239
+ ctx.log?.info(`starting feishu[${ctx.accountId}] (mode: ${account.config?.connectionMode ?? "websocket"})`);
2240
+ return monitorFeishuProvider({
2241
+ config: ctx.cfg,
2242
+ runtime: ctx.runtime,
2243
+ abortSignal: ctx.abortSignal,
2244
+ accountId: ctx.accountId
2245
+ });
2246
+ } },
2247
+ message: feishuMessageAdapter
2248
+ },
2249
+ security: {
2250
+ collectWarnings: projectConfigAccountIdWarningCollector(collectFeishuSecurityWarnings),
2251
+ collectAuditFindings: ({ cfg }) => collectFeishuSecurityAuditFindings({ cfg })
2252
+ },
2253
+ pairing: { text: {
2254
+ idLabel: "feishuUserId",
2255
+ message: PAIRING_APPROVED_MESSAGE,
2256
+ normalizeAllowEntry: createPairingPrefixStripper(/^(feishu|user|open_id):/i),
2257
+ notify: async ({ cfg, id, message, accountId }) => {
2258
+ const { sendMessageFeishu } = await loadFeishuChannelRuntime();
2259
+ await sendMessageFeishu({
2260
+ cfg,
2261
+ to: id,
2262
+ text: message,
2263
+ accountId
2264
+ });
2265
+ }
2266
+ } },
2267
+ outbound: {
2268
+ deliveryMode: "direct",
2269
+ chunker: chunkTextForOutbound,
2270
+ chunkerMode: "markdown",
2271
+ textChunkLimit: 4e3,
2272
+ presentationCapabilities: {
2273
+ supported: true,
2274
+ buttons: true,
2275
+ selects: false,
2276
+ context: true,
2277
+ divider: true,
2278
+ limits: {
2279
+ actions: {
2280
+ maxActions: 20,
2281
+ maxActionsPerRow: 5,
2282
+ maxLabelLength: 40,
2283
+ maxValueBytes: 1024
2284
+ },
2285
+ text: {
2286
+ maxLength: 4e3,
2287
+ encoding: "characters",
2288
+ markdownDialect: "markdown"
2289
+ }
2290
+ }
2291
+ },
2292
+ renderPresentation: async (ctx) => {
2293
+ const renderPresentation = (await loadFeishuChannelRuntime()).feishuOutbound.renderPresentation;
2294
+ return renderPresentation ? await renderPresentation(ctx) : null;
2295
+ },
2296
+ sendPayload: async (ctx) => {
2297
+ const sendPayload = (await loadFeishuChannelRuntime()).feishuOutbound.sendPayload;
2298
+ if (!sendPayload) throw new Error("Feishu payload sending is not available.");
2299
+ return await sendPayload(ctx);
2300
+ },
2301
+ ...createRuntimeOutboundDelegates({
2302
+ getRuntime: loadFeishuChannelRuntime,
2303
+ sendText: { resolve: (runtime) => runtime.feishuOutbound.sendText },
2304
+ sendMedia: { resolve: (runtime) => runtime.feishuOutbound.sendMedia }
2305
+ })
2306
+ }
2307
+ });
2308
+ //#endregion
2309
+ export { setFeishuNamedAccountEnabled$1 as a, feishuSetupAdapter as i, feishuSetupWizard as n, runFeishuLogin as r, feishuPlugin as t };