@xopcai/xopc 0.0.350 → 0.0.352

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 (406) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  3. package/dist/browser-ext/dist/sidepanel.js +1 -1
  4. package/dist/browser-ext/manifest.json +1 -1
  5. package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
  6. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  7. package/dist/extensions/telegram/src/inbound-processor.js +2 -2
  8. package/dist/extensions/telegram/src/outbound-sender.js +1 -1
  9. package/dist/extensions/telegram/src/plugin.js +2 -2
  10. package/dist/extensions/telegram/xopc.extension.json +1 -1
  11. package/dist/extensions/weixin/src/api/api.js +2 -2
  12. package/dist/extensions/weixin/src/auth/accounts.js +12 -12
  13. package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
  14. package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
  15. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-GAs9LrbD.js → agent-avatar-dicebear-ChlaFmiD.js} +1 -1
  16. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-q6mFje6y.js → agent-defaults-settings-panel-CgNagNMG.js} +1 -1
  17. package/dist/gateway/static/root/assets/{agent-plugin-dialog-vR-3YU8w.js → agent-plugin-dialog-CDhtsMpV.js} +1 -1
  18. package/dist/gateway/static/root/assets/{agents-DZXa_QVc.js → agents-BLP0zRru.js} +3 -3
  19. package/dist/gateway/static/root/assets/{agents-admin-api-yUALtmym.js → agents-admin-api-C_3ucZGI.js} +1 -1
  20. package/dist/gateway/static/root/assets/{app-management-settings-panel-5GU28Q-V.js → app-management-settings-panel-DqC-oj5_.js} +1 -1
  21. package/dist/gateway/static/root/assets/{appearance-settings-uxEo59iJ.js → appearance-settings-Cfhepf6U.js} +1 -1
  22. package/dist/gateway/static/root/assets/{apps-page-06LrJSYf.js → apps-page-C6n5r8AP.js} +1 -1
  23. package/dist/gateway/static/root/assets/{archive-plugin-B4z8_4sq.js → archive-plugin-D4EiLLyl.js} +1 -1
  24. package/dist/gateway/static/root/assets/{automations-page-Cap0FMSp.js → automations-page-CMxBpT5v.js} +1 -1
  25. package/dist/gateway/static/root/assets/{automations-workspace-DEsdkcup.js → automations-workspace-DJ_-_kGh.js} +1 -1
  26. package/dist/gateway/static/root/assets/{binary-plugins-PKMXJixJ.js → binary-plugins-DQc_BlYP.js} +1 -1
  27. package/dist/gateway/static/root/assets/{block-editor-Dv83e7vb.js → block-editor-C3S6gqnS.js} +1 -1
  28. package/dist/gateway/static/root/assets/{browser-automation-inputs-B0TlAcoB.js → browser-automation-inputs-D2SwaQ2F.js} +1 -1
  29. package/dist/gateway/static/root/assets/{browser-automations-page-C1mBYS2x.js → browser-automations-page-CGG1740U.js} +1 -1
  30. package/dist/gateway/static/root/assets/{browser-settings-page-Co2D8mug.js → browser-settings-page-COTo7btH.js} +1 -1
  31. package/dist/gateway/static/root/assets/{capabilities-e-fO70DK.js → capabilities-D4qdO980.js} +1 -1
  32. package/dist/gateway/static/root/assets/{capabilities-page-nIIqZJuL.js → capabilities-page-BsC346Ym.js} +2 -2
  33. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BrXWQIs7.js → capabilities-settings-panel-CRL4gfk5.js} +1 -1
  34. package/dist/gateway/static/root/assets/{capability-header-actions-C6d_GsqD.js → capability-header-actions-B_60-buR.js} +1 -1
  35. package/dist/gateway/static/root/assets/{channels-EUbBfvHY.js → channels-DNxr72oD.js} +1 -1
  36. package/dist/gateway/static/root/assets/{chat-terminal-dock-CZTrJ5Do.js → chat-terminal-dock-DfTUgrey.js} +1 -1
  37. package/dist/gateway/static/root/assets/{computer-settings-page-CWBZwtYT.js → computer-settings-page-Bk84TKyF.js} +1 -1
  38. package/dist/gateway/static/root/assets/{connector-service-page-B5pF87fY.js → connector-service-page-B2pC--2X.js} +1 -1
  39. package/dist/gateway/static/root/assets/{connectors-page-9ztbuGCI.js → connectors-page-Bu15_14O.js} +1 -1
  40. package/dist/gateway/static/root/assets/{date-picker-xb5w8iAa.js → date-picker-CCN30yiy.js} +1 -1
  41. package/dist/gateway/static/root/assets/{dependency-picker-D7B6s4d4.js → dependency-picker-CV2ybJJd.js} +1 -1
  42. package/dist/gateway/static/root/assets/{desktop-pet-Bt5JatKm.js → desktop-pet-DipFHe4X.js} +1 -1
  43. package/dist/gateway/static/root/assets/{desktop-pet-settings-BdgUJk-e.js → desktop-pet-settings-Dg3RM_vY.js} +1 -1
  44. package/dist/gateway/static/root/assets/{device-pairing-wizard-DQ7LNTKz.js → device-pairing-wizard-DUy1HymM.js} +1 -1
  45. package/dist/gateway/static/root/assets/{directory-picker-path-field-_PcWmfRH.js → directory-picker-path-field-BTuFpGIK.js} +1 -1
  46. package/dist/gateway/static/root/assets/{extension-debug-page-BhXwxHMP.js → extension-debug-page-xM8vfbRZ.js} +1 -1
  47. package/dist/gateway/static/root/assets/{extension-page-CIXPBzGU.js → extension-page-Cl8zlion.js} +1 -1
  48. package/dist/gateway/static/root/assets/{extension-settings-page-DE4UUMD-.js → extension-settings-page-DODk0nOi.js} +1 -1
  49. package/dist/gateway/static/root/assets/{gateway-config-swr-CmjHbMj7.js → gateway-config-swr-DZWFlfJr.js} +1 -1
  50. package/dist/gateway/static/root/assets/{gateway-realtime-DzyR6LYb.js → gateway-realtime-HO9tL9xo.js} +1 -1
  51. package/dist/gateway/static/root/assets/gateway-realtime-store-B01fiKrV.js +1 -0
  52. package/dist/gateway/static/root/assets/{gateway-settings-CI2oGZEg.js → gateway-settings-BL3C7Q9w.js} +1 -1
  53. package/dist/gateway/static/root/assets/{gateway-startup-retry-CbOUnKv5.js → gateway-startup-retry-Cg1nbxJR.js} +1 -1
  54. package/dist/gateway/static/root/assets/{home-page-DfJvuWC-.js → home-page-CjJVq_Ff.js} +1 -1
  55. package/dist/gateway/static/root/assets/{image-generation-api-BmLpVntI.js → image-generation-api-DSnPfr_U.js} +1 -1
  56. package/dist/gateway/static/root/assets/{imports-page-DRG-aahH.js → imports-page-By9oc8sD.js} +1 -1
  57. package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +1 -0
  58. package/dist/gateway/static/root/assets/{index-Z6i4GDcT.js → index-S4z-eKe-.js} +9 -9
  59. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CSwc_Olv.js → keyboard-shortcuts-settings-ixQ8_6ad.js} +1 -1
  60. package/dist/gateway/static/root/assets/{local-app-workbench-page-DsSCCThS.js → local-app-workbench-page-Bnz5YOks.js} +1 -1
  61. package/dist/gateway/static/root/assets/{local-apps-page-C4psaPz5.js → local-apps-page-BV3NFUJQ.js} +1 -1
  62. package/dist/gateway/static/root/assets/local-session-drafts-CuyTzbfW.js +1 -0
  63. package/dist/gateway/static/root/assets/{locale-store-WMaCMm3_.js → locale-store-qcYD05PF.js} +1 -1
  64. package/dist/gateway/static/root/assets/{logs-page-kx7ama7K.js → logs-page-DVqwybaT.js} +1 -1
  65. package/dist/gateway/static/root/assets/{management-settings-BqcrFVsF.js → management-settings-CUoDWFg7.js} +1 -1
  66. package/dist/gateway/static/root/assets/{markdown-view-Oe4rXk1N.js → markdown-view-BhFHoVtG.js} +1 -1
  67. package/dist/gateway/static/root/assets/{media-plugins-BCMV9heb.js → media-plugins-cpalRgVI.js} +1 -1
  68. package/dist/gateway/static/root/assets/messages-vL3EpIrL.js +3 -0
  69. package/dist/gateway/static/root/assets/{note-detail-panel-Bvjc5JNM.js → note-detail-panel-CxbZWvj1.js} +3 -3
  70. package/dist/gateway/static/root/assets/{notes-page-Dak5PuTq.js → notes-page-DkEOEza6.js} +1 -1
  71. package/dist/gateway/static/root/assets/{page-context-capture-button-BYQnvTni.js → page-context-capture-button-CjCYNkVb.js} +1 -1
  72. package/dist/gateway/static/root/assets/{page-tabs--d3GEnvY.js → page-tabs-Dnzie6QW.js} +1 -1
  73. package/dist/gateway/static/root/assets/{preview-open-alternatives-ByuWaDEv.js → preview-open-alternatives-D1H4_Nfl.js} +1 -1
  74. package/dist/gateway/static/root/assets/{product-open-page-CMvjGjTz.js → product-open-page-BJwEshPw.js} +1 -1
  75. package/dist/gateway/static/root/assets/{project-detail-page-m8ybJpJ_.js → project-detail-page-BWC89e7l.js} +1 -1
  76. package/dist/gateway/static/root/assets/{projects-page-i00ns68r.js → projects-page-BYmHC91B.js} +1 -1
  77. package/dist/gateway/static/root/assets/{registry-api-DEePN1Rc.js → registry-api-C0j3sKT4.js} +1 -1
  78. package/dist/gateway/static/root/assets/{remote-access-hub-CY4kQa1Z.js → remote-access-hub-DuVzpZ9R.js} +1 -1
  79. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D-gA6BW9.js → runtime-tools-settings-panel-SbIgL9Ya.js} +1 -1
  80. package/dist/gateway/static/root/assets/{scenes-page--sExi9Fz.js → scenes-page-BBl_4U1U.js} +1 -1
  81. package/dist/gateway/static/root/assets/{schema-form-B8Zns_Se.js → schema-form-Rj-wi9sm.js} +1 -1
  82. package/dist/gateway/static/root/assets/{session-api-Bv-hCMKS.js → session-api-iR1SFNHe.js} +1 -1
  83. package/dist/gateway/static/root/assets/{session-manager-BcDptzCN.js → session-manager-3YOU74jt.js} +5 -5
  84. package/dist/gateway/static/root/assets/{sessions-page-BzW33zp4.js → sessions-page-BnipzwJ6.js} +1 -1
  85. package/dist/gateway/static/root/assets/settings-advanced-gate-C7oNKVxC.js +1 -0
  86. package/dist/gateway/static/root/assets/{settings-form-section-Lpep8yx-.js → settings-form-section-6gOr-ype.js} +1 -1
  87. package/dist/gateway/static/root/assets/{settings-page-Cl_KOVsG.js → settings-page-D1tVcmlR.js} +1 -1
  88. package/dist/gateway/static/root/assets/{setup-status-panel-mWQaql5h.js → setup-status-panel-CR0VBBw3.js} +1 -1
  89. package/dist/gateway/static/root/assets/{share-preview-page-ZZ6qg3xL.js → share-preview-page-CK0Bg_-o.js} +1 -1
  90. package/dist/gateway/static/root/assets/{shares-settings-DhQRwYYL.js → shares-settings-B3Ghvh3c.js} +1 -1
  91. package/dist/gateway/static/root/assets/{skill-api-DC3EXeUS.js → skill-api-CoIsCPbI.js} +1 -1
  92. package/dist/gateway/static/root/assets/skill-reload-api-DMIwfISw.js +1 -0
  93. package/dist/gateway/static/root/assets/{skills-page-ThkBmKew.js → skills-page-CDkm7yig.js} +1 -1
  94. package/dist/gateway/static/root/assets/{system-settings-panel-C93mkvML.js → system-settings-panel-Cfv-jDmY.js} +1 -1
  95. package/dist/gateway/static/root/assets/{task-detail-page-DWqYIP_j.js → task-detail-page-eYs6qgcW.js} +1 -1
  96. package/dist/gateway/static/root/assets/{tunnel-api-DI4NcRc8.js → tunnel-api-CpOQaCFN.js} +1 -1
  97. package/dist/gateway/static/root/assets/{usage-page-C--1ibDb.js → usage-page-Cye-2eKA.js} +1 -1
  98. package/dist/gateway/static/root/assets/{use-autosave-83u3Kf_7.js → use-autosave-o6YLrkpO.js} +1 -1
  99. package/dist/gateway/static/root/assets/{user-model-page-DasK0_MY.js → user-model-page-Bg-jeU7W.js} +1 -1
  100. package/dist/gateway/static/root/assets/{voice-api-key-field-D4SxKV47.js → voice-api-key-field-FMNwQIho.js} +1 -1
  101. package/dist/gateway/static/root/assets/{voice-config-api-DbjjZkIg.js → voice-config-api-CylVelIb.js} +1 -1
  102. package/dist/gateway/static/root/assets/{work-discovery-overlay-RSWjSoEp.js → work-discovery-overlay-9bULjfGk.js} +1 -1
  103. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BINT9Shl.js → workflow-run-setup-panel-VYQHBiz3.js} +1 -1
  104. package/dist/gateway/static/root/assets/{workflows-page-Bj3K-lxR.js → workflows-page-KnoMMEDN.js} +1 -1
  105. package/dist/gateway/static/root/index.html +15 -15
  106. package/dist/package.js +1 -1
  107. package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
  108. package/dist/src/agent/agent-manager.js +31 -22
  109. package/dist/src/agent/agent-scope.js +2 -2
  110. package/dist/src/agent/background-review/prompts.js +1 -1
  111. package/dist/src/agent/background-review/run-background-review.js +4 -4
  112. package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
  113. package/dist/src/agent/coding/repository-instructions.js +1 -1
  114. package/dist/src/agent/context/coordinator.js +2 -2
  115. package/dist/src/agent/context/execution-context.js +4 -4
  116. package/dist/src/agent/context/execution-scope.js +2 -2
  117. package/dist/src/agent/context/project-context.js +3 -3
  118. package/dist/src/agent/data-acquisition/service.js +1 -1
  119. package/dist/src/agent/embedded/index.js +2 -2
  120. package/dist/src/agent/embedded/model-runtime.js +1 -1
  121. package/dist/src/agent/embedded/run-for-session.js +4 -4
  122. package/dist/src/agent/embedded/run-turn.js +4 -4
  123. package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
  124. package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
  125. package/dist/src/agent/external-tools/cliProvider.js +3 -3
  126. package/dist/src/agent/external-tools/composio-provider.js +3 -3
  127. package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
  128. package/dist/src/agent/external-tools/gateway-tools.js +1 -1
  129. package/dist/src/agent/external-tools/mcp-provider.js +3 -3
  130. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  131. package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
  132. package/dist/src/agent/image/generation/providers/fal.js +1 -1
  133. package/dist/src/agent/image/generation/providers/google.js +1 -1
  134. package/dist/src/agent/image/generation/runtime.js +1 -1
  135. package/dist/src/agent/image/index.js +1 -1
  136. package/dist/src/agent/image/load-image-media.js +1 -1
  137. package/dist/src/agent/image/tool-model-config.js +2 -2
  138. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  139. package/dist/src/agent/inbound/inbound-loop.js +2 -2
  140. package/dist/src/agent/index.js +1 -1
  141. package/dist/src/agent/mcp/bundle-mcp-config.js +1 -1
  142. package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
  143. package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
  144. package/dist/src/agent/mcp/index.js +2 -2
  145. package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
  146. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  147. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
  148. package/dist/src/agent/mcp/plugin-http-fetch.js +1 -1
  149. package/dist/src/agent/memory/context-recovery.js +1 -1
  150. package/dist/src/agent/memory/index.js +1 -1
  151. package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
  152. package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
  153. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  154. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  155. package/dist/src/agent/service/direct-turn-helpers.js +4 -4
  156. package/dist/src/agent/service/process-direct-one-shot.js +1 -1
  157. package/dist/src/agent/service/process-direct-streaming.js +5 -5
  158. package/dist/src/agent/service/webchat-tts.js +2 -2
  159. package/dist/src/agent/service.js +21 -21
  160. package/dist/src/agent/session/session-inspector.js +1 -1
  161. package/dist/src/agent/source-context/index.js +2 -2
  162. package/dist/src/agent/starter-agents.d.ts +3 -0
  163. package/dist/src/agent/starter-agents.js +57 -2
  164. package/dist/src/agent/tasks/task-judge-service.js +4 -4
  165. package/dist/src/agent/tools/create-share-tool.js +3 -3
  166. package/dist/src/agent/tools/dataBatch.js +1 -1
  167. package/dist/src/agent/tools/delegate-tool.js +3 -3
  168. package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
  169. package/dist/src/agent/tools/executor.js +1 -1
  170. package/dist/src/agent/tools/factory.d.ts +3 -1
  171. package/dist/src/agent/tools/factory.js +22 -19
  172. package/dist/src/agent/tools/fetch-text.js +1 -1
  173. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  174. package/dist/src/agent/tools/index.js +6 -6
  175. package/dist/src/agent/tools/list-dir.js +1 -1
  176. package/dist/src/agent/tools/publish-artifacts.js +2 -2
  177. package/dist/src/agent/tools/read.js +2 -2
  178. package/dist/src/agent/tools/review-workspace.js +1 -1
  179. package/dist/src/agent/tools/send-media.js +2 -2
  180. package/dist/src/agent/tools/skills-tools.js +1 -1
  181. package/dist/src/agent/tools/tts-tool.js +1 -1
  182. package/dist/src/agent/tools/user-context-tool.js +1 -1
  183. package/dist/src/agent/tools/write.js +2 -2
  184. package/dist/src/agent/tools/xopc-use-tool.js +5 -5
  185. package/dist/src/agent/workflow/subagent-runner.js +1 -1
  186. package/dist/src/agent/workflow/workflow-child-tools.js +2 -1
  187. package/dist/src/agent-catalog/capabilities.js +2 -2
  188. package/dist/src/agent-config/resolver.js +2 -0
  189. package/dist/src/agent-config/schema.d.ts +2 -0
  190. package/dist/src/agent-config/schema.js +2 -0
  191. package/dist/src/ai-assist/text-assist.js +1 -1
  192. package/dist/src/auth/credentials.js +1 -1
  193. package/dist/src/auth/oauth-provider-lock.js +1 -1
  194. package/dist/src/auth/sync-provider-auth.js +1 -1
  195. package/dist/src/automations/capabilities/drafts.js +1 -1
  196. package/dist/src/automations/domain/index.js +2 -2
  197. package/dist/src/automations/events/event-repository.js +2 -1
  198. package/dist/src/automations/index.js +4 -4
  199. package/dist/src/automations/service/automation-service.js +2 -2
  200. package/dist/src/backup/archive.js +1 -1
  201. package/dist/src/bootstrap/application-state.js +1 -1
  202. package/dist/src/browser/native-messaging-host.js +1 -1
  203. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  204. package/dist/src/capabilities/runtime/product.js +1 -1
  205. package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
  206. package/dist/src/channels/index.js +2 -2
  207. package/dist/src/channels/outbound-sender.js +1 -1
  208. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  209. package/dist/src/channels/pairing/pairing-store.js +6 -6
  210. package/dist/src/chat-commands/agent-edit.js +1 -1
  211. package/dist/src/chat-commands/builtins/config.js +4 -4
  212. package/dist/src/chat-commands/builtins/review.js +1 -1
  213. package/dist/src/chat-commands/builtins/session.js +1 -1
  214. package/dist/src/chat-commands/builtins/thinking.js +1 -1
  215. package/dist/src/chat-commands/builtins/tts.js +1 -1
  216. package/dist/src/chat-commands/builtins/understanding.js +1 -1
  217. package/dist/src/chat-commands/builtins/workflow.js +2 -2
  218. package/dist/src/chat-commands/context.js +3 -3
  219. package/dist/src/chat-commands/index.js +3 -3
  220. package/dist/src/cli/commands/agent.js +7 -7
  221. package/dist/src/cli/commands/agents.js +1 -1
  222. package/dist/src/cli/commands/config.js +1 -1
  223. package/dist/src/cli/commands/connectors.js +1 -1
  224. package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
  225. package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
  226. package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
  227. package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
  228. package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
  229. package/dist/src/cli/commands/extension-dev.js +1 -1
  230. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  231. package/dist/src/cli/commands/extension.js +4 -4
  232. package/dist/src/cli/commands/gateway/shared.js +1 -1
  233. package/dist/src/cli/commands/gateway/token.js +1 -1
  234. package/dist/src/cli/commands/image.js +1 -1
  235. package/dist/src/cli/commands/init.js +1 -1
  236. package/dist/src/cli/commands/models.js +1 -1
  237. package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
  238. package/dist/src/cli/commands/onboard/model.js +2 -2
  239. package/dist/src/cli/commands/onboard.js +1 -1
  240. package/dist/src/cli/commands/project.js +2 -2
  241. package/dist/src/cli/commands/runtime.js +1 -1
  242. package/dist/src/cli/commands/skills.js +2 -2
  243. package/dist/src/cli/commands/tunnel.js +4 -4
  244. package/dist/src/cli/extension-cli-register.js +5 -5
  245. package/dist/src/cli/utils/gateway-client.js +1 -1
  246. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  247. package/dist/src/cli/utils/session.js +1 -1
  248. package/dist/src/computer/runtime.js +2 -2
  249. package/dist/src/config/index.js +7 -7
  250. package/dist/src/config/loader.js +3 -3
  251. package/dist/src/config/models-json.js +1 -1
  252. package/dist/src/config/schema.js +1 -1
  253. package/dist/src/connectors/cli/authorization.js +1 -1
  254. package/dist/src/connectors/cli/runtime.js +1 -1
  255. package/dist/src/connectors/composio-sessions.js +1 -1
  256. package/dist/src/connectors/composio.js +1 -1
  257. package/dist/src/connectors/connected-source-understanding.js +3 -3
  258. package/dist/src/connectors/connection-recovery-service.js +10 -5
  259. package/dist/src/connectors/health.js +1 -1
  260. package/dist/src/connectors/plugin-mcp-recovery.js +1 -1
  261. package/dist/src/discussions/live-worker.js +1 -1
  262. package/dist/src/discussions/recording.js +1 -1
  263. package/dist/src/discussions/sealer.js +1 -1
  264. package/dist/src/extensions/activation-context.js +3 -3
  265. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  266. package/dist/src/extensions/api.js +4 -4
  267. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  268. package/dist/src/extensions/index.js +3 -3
  269. package/dist/src/extensions/install.js +1 -1
  270. package/dist/src/extensions/loader.js +2 -2
  271. package/dist/src/extensions/sdk/index.js +1 -1
  272. package/dist/src/extensions/sdk/media.js +1 -1
  273. package/dist/src/extensions/update.js +1 -1
  274. package/dist/src/gateway/agents-admin.d.ts +1 -0
  275. package/dist/src/gateway/agents-admin.js +3 -2
  276. package/dist/src/gateway/device-routes.js +2 -2
  277. package/dist/src/gateway/file-path-classifier.js +2 -2
  278. package/dist/src/gateway/global-defaults-admin.js +1 -1
  279. package/dist/src/gateway/hono/app.js +3 -3
  280. package/dist/src/gateway/hono/lib/config-payload.js +4 -4
  281. package/dist/src/gateway/hono/routes/agents.js +9 -2
  282. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  283. package/dist/src/gateway/hono/routes/browser.js +1 -1
  284. package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
  285. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  286. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
  287. package/dist/src/gateway/hono/routes/device-push.js +1 -1
  288. package/dist/src/gateway/hono/routes/home.js +1 -1
  289. package/dist/src/gateway/hono/routes/mcp.js +2 -2
  290. package/dist/src/gateway/hono/routes/media.js +1 -1
  291. package/dist/src/gateway/hono/routes/models.js +5 -5
  292. package/dist/src/gateway/hono/routes/notes.js +3 -3
  293. package/dist/src/gateway/hono/routes/projects.js +4 -4
  294. package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
  295. package/dist/src/gateway/hono/routes/session-input-handler.js +3 -3
  296. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  297. package/dist/src/gateway/hono/routes/shares.js +3 -3
  298. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  299. package/dist/src/gateway/hono/routes/tasks.js +2 -2
  300. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  301. package/dist/src/gateway/hono/routes/user-model.js +5 -5
  302. package/dist/src/gateway/hono/routes/voice.js +6 -6
  303. package/dist/src/gateway/hono/routes/workflows.js +2 -2
  304. package/dist/src/gateway/host.d.ts +0 -2
  305. package/dist/src/gateway/host.js +2 -5
  306. package/dist/src/gateway/image-generation-setup.js +3 -3
  307. package/dist/src/gateway/index.js +1 -1
  308. package/dist/src/gateway/lock.js +11 -11
  309. package/dist/src/gateway/media-access.js +1 -1
  310. package/dist/src/gateway/mobile-privacy.js +2 -2
  311. package/dist/src/gateway/ports.js +6 -6
  312. package/dist/src/gateway/run-loop.js +1 -1
  313. package/dist/src/gateway/scenes/mailContext.js +1 -1
  314. package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
  315. package/dist/src/gateway/server.js +1 -1
  316. package/dist/src/gateway/service/config-coordinator.js +3 -3
  317. package/dist/src/gateway/service/run-gateway-agent.js +3 -3
  318. package/dist/src/gateway/service/sessions-api.js +1 -1
  319. package/dist/src/gateway/service.js +37 -37
  320. package/dist/src/gateway/session-context-summary.js +2 -2
  321. package/dist/src/gateway/workspace-editor-path.js +2 -2
  322. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  323. package/dist/src/home-intelligence/generator.js +1 -1
  324. package/dist/src/infra/gateway-processes.js +2 -2
  325. package/dist/src/infra/path-env.js +3 -3
  326. package/dist/src/infra/update-global.js +10 -10
  327. package/dist/src/local-apps/service.js +2 -2
  328. package/dist/src/mcp/gateway-http-client.js +1 -1
  329. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  330. package/dist/src/notes/agent-context.js +4 -4
  331. package/dist/src/notes/index.js +1 -1
  332. package/dist/src/notes/service.js +1 -1
  333. package/dist/src/notes/store.js +1 -1
  334. package/dist/src/notifications/device-store.d.ts +0 -1
  335. package/dist/src/notifications/device-store.js +2 -7
  336. package/dist/src/notifications/service.d.ts +0 -1
  337. package/dist/src/notifications/service.js +13 -82
  338. package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
  339. package/dist/src/providers/index.js +2 -2
  340. package/dist/src/providers/model-catalog-persistence.js +1 -1
  341. package/dist/src/providers/model-reference-auditor.js +1 -1
  342. package/dist/src/providers/register-runtime-providers.js +1 -1
  343. package/dist/src/remote-access/exposure-manager.js +1 -1
  344. package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
  345. package/dist/src/scenes/taskFollowUp/resources.js +1 -1
  346. package/dist/src/scenes/taskFollowUp/service.js +4 -4
  347. package/dist/src/session/execution-detail.js +16 -0
  348. package/dist/src/session/index.js +2 -2
  349. package/dist/src/session/session-title.js +1 -1
  350. package/dist/src/session/store.js +4 -4
  351. package/dist/src/session/thinking-resolve.js +1 -1
  352. package/dist/src/share/share-store.js +1 -1
  353. package/dist/src/share/share-thumbnail.js +1 -1
  354. package/dist/src/share/share-zip.js +1 -1
  355. package/dist/src/share/site-proxy.js +1 -1
  356. package/dist/src/share/site-share-store.js +1 -1
  357. package/dist/src/storage/sqlite/connection.js +9 -9
  358. package/dist/src/storage/sqlite/notes-repository.js +19 -4
  359. package/dist/src/tasks/capabilities/read.js +2 -2
  360. package/dist/src/tasks/capabilities/write.js +1 -1
  361. package/dist/src/tasks/execution-context.js +1 -1
  362. package/dist/src/tasks/home-query-service.js +3 -3
  363. package/dist/src/tasks/index.js +4 -4
  364. package/dist/src/tasks/task-application-service.js +2 -2
  365. package/dist/src/tasks/task-collaboration-delivery.js +1 -1
  366. package/dist/src/tasks/task-context-assembler.js +1 -1
  367. package/dist/src/tasks/task-handoff-service.js +1 -1
  368. package/dist/src/tasks/task-main-update-decision-service.js +1 -1
  369. package/dist/src/tui/backends/embedded-backend.js +12 -12
  370. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
  371. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  372. package/dist/src/tui/tui-command-formatters.js +1 -1
  373. package/dist/src/tui/tui-commands.js +6 -6
  374. package/dist/src/tui/tui-picker-overlay.js +1 -1
  375. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  376. package/dist/src/tui/tui-startup-resources.js +4 -4
  377. package/dist/src/tui/tui.js +7 -7
  378. package/dist/src/tunnel/frpc-binary.js +1 -1
  379. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  380. package/dist/src/voice/audio/normalize.js +34 -1
  381. package/dist/src/voice/realtime/memory-context.js +3 -3
  382. package/dist/src/voice/realtime/persona-context.js +1 -1
  383. package/dist/src/voice/realtime/runtime.js +4 -4
  384. package/dist/src/voice/stt/index.js +2 -2
  385. package/dist/src/voice/stt/preflight.js +1 -1
  386. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  387. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  388. package/dist/src/voice/stt/transcribe-core.js +1 -1
  389. package/dist/src/voice/tts/index.js +3 -3
  390. package/dist/src/voice/tts/merge-config.js +1 -1
  391. package/dist/src/voice/tts/payload.js +1 -1
  392. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  393. package/dist/src/voice/tts/speak-core.js +1 -1
  394. package/dist/src/work-discovery/incremental-repository.js +1 -1
  395. package/dist/src/work-discovery/index.js +1 -1
  396. package/dist/src/work-discovery/service.js +5 -5
  397. package/dist/src/workflows/engine/workflow-engine.js +1 -1
  398. package/dist/src/workflows/service/workflow-run-service.js +8 -8
  399. package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
  400. package/package.json +10 -11
  401. package/dist/gateway/static/root/assets/gateway-realtime-store-KyhksZSM.js +0 -1
  402. package/dist/gateway/static/root/assets/index-CPi50n0l.css +0 -1
  403. package/dist/gateway/static/root/assets/local-session-drafts-CxXjQ5Du.js +0 -1
  404. package/dist/gateway/static/root/assets/messages-sXePe3LQ.js +0 -3
  405. package/dist/gateway/static/root/assets/settings-advanced-gate-CVnn1f7J.js +0 -1
  406. package/dist/gateway/static/root/assets/skill-reload-api-C-Dn5hSx.js +0 -1
package/README.md CHANGED
@@ -167,7 +167,7 @@ Windows git install: `& ([scriptblock]::Create((irm https://xopc.ai/install.ps1)
167
167
  | **TUI** | `xopc` or `xopc tui` (remote: `xopc tui --url …`) | Full keyboard, streaming, fastest terminal path |
168
168
  | **CLI** | `xopc agent -i` / `xopc agent -m "…"` | Scripts and minimal TTY |
169
169
  | **Web** | `xopc gateway` → open console URL | Chat, settings, logs in the browser |
170
- | **Mobile** | [mobile app](./apps/mobile-expo) + QR gateway pairing ([mobile app](https://xopcai.github.io/xopc/mobile-app), [remote access](https://xopcai.github.io/xopc/remote-access)) | Chat, record notes, and capture ideas from iOS/Android while the agent keeps running on your computer |
170
+ | **Mobile** | [native Android and iOS apps](./docs/design/release/mobile-build-release.md) + QR gateway pairing ([mobile app](https://xopcai.github.io/xopc/mobile-app), [remote access](https://xopcai.github.io/xopc/remote-access)) | Chat, record notes, and capture ideas from iOS/Android while the agent keeps running on your computer |
171
171
  | **Messengers** | `channels.*` + gateway | Telegram, WeChat, Feishu/Lark |
172
172
 
173
173
  ---
@@ -261,7 +261,7 @@ Read the [community guide](https://xopcai.github.io/xopc/community) and [Code of
261
261
 
262
262
  **How is this different from another chat UI?** — Chat is only one surface. xopc preserves understanding, long-term goals, projects, tasks, decisions, and run history so the same assistant can continue working across time and surfaces.
263
263
 
264
- **Can I use it from my phone or messengers?** — Yes. Pair the [mobile app](./apps/mobile-expo) by QR code, or configure Telegram, WeChat, or Feishu/Lark via the gateway.
264
+ **Can I use it from my phone or messengers?** — Yes. Pair the [native mobile app](./docs/design/release/mobile-build-release.md) by QR code, or configure Telegram, WeChat, or Feishu/Lark via the gateway.
265
265
 
266
266
  **Have a question?** — Ask on [GitHub Discussions](https://github.com/xopcai/xopc/discussions/categories/q-a).
267
267
 
package/README.zh-CN.md CHANGED
@@ -167,7 +167,7 @@ Windows 源码安装:`& ([scriptblock]::Create((irm https://xopc.ai/install.ps
167
167
  | **TUI** | `xopc` 或 `xopc tui`(远程:`xopc tui --url …`) | 全键盘、流式输出,最快终端路径 |
168
168
  | **CLI** | `xopc agent -i` / `xopc agent -m "…"` | 脚本、最小终端环境 |
169
169
  | **网页** | `xopc gateway` → 打开控制台地址 | 聊天、设置、日志 |
170
- | **手机** | [移动端 App](./apps/mobile-expo) + 网关扫码配对([移动端 App](https://xopcai.github.io/xopc/zh/mobile-app)、[远程访问](https://xopcai.github.io/xopc/zh/remote-access)) | 在 iOS/Android 上继续对话,记录文字、语音、图片和附件;Agent 仍运行在你的电脑或本地环境里 |
170
+ | **手机** | [原生 Android 与 iOS App](./docs/design/release/mobile-build-release.md) + 网关扫码配对([移动端 App](https://xopcai.github.io/xopc/zh/mobile-app)、[远程访问](https://xopcai.github.io/xopc/zh/remote-access)) | 在 iOS/Android 上继续对话,记录文字、语音、图片和附件;Agent 仍运行在你的电脑或本地环境里 |
171
171
  | **即时通讯** | 配置 `channels.*` 并启动网关 | Telegram、微信、飞书/Lark |
172
172
 
173
173
  ---
@@ -261,7 +261,7 @@ xopc extensions dev ./my-extension
261
261
 
262
262
  **它和普通聊天 UI 有什么区别?** — 聊天只是入口。xopc 会把对你的理解、长期目标、项目、Task、决定和执行记录保留下来,让同一个助手可以跨越时间和入口继续工作。
263
263
 
264
- **能在手机或即时通讯里用吗?** — 可以。用 [移动端 App](./apps/mobile-expo) 扫码连接,或配置 Telegram、微信、飞书/Lark。
264
+ **能在手机或即时通讯里用吗?** — 可以。用 [原生移动端 App](./docs/design/release/mobile-build-release.md) 扫码连接,或配置 Telegram、微信、飞书/Lark。
265
265
 
266
266
  **还有问题?** — 去 [GitHub Discussions](https://github.com/xopcai/xopc/discussions/categories/q-a) 提问。
267
267
 
@@ -55,7 +55,7 @@ const sessionInputContentSchema = strictObject({
55
55
  content: string(),
56
56
  attachments: array(attachmentSchema).optional(),
57
57
  contextRefs: array(strictObject({
58
- kind: _enum(["note", "task", "file", "session", "browser_tab", "mcp_resource"]),
58
+ kind: _enum(["note", "task", "file", "session", "browser_tab", "mcp_resource", "user_assertion"]),
59
59
  sourceId: string().trim().min(1),
60
60
  refId: string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional(),
61
61
  expectedVersion: string().optional()
@@ -3,7 +3,7 @@
3
3
  "minimum_chrome_version": "120",
4
4
  "default_locale": "en",
5
5
  "name": "__MSG_appName__",
6
- "version": "0.0.350",
6
+ "version": "0.0.352",
7
7
  "description": "__MSG_appDescription__",
8
8
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqnpr4vpLC/nmvy+wiOWk3SWlp2nEZkFijfk8ivGw7StNZgCK90nOMvwhdEtlkk3GOWDvdVnq8HxCsM3UNQ8FnGUyerpH1FJXqXuradxeHf8ZxFjiQU/mIWfnKbUuONWQORon3/pigyoXoK/VUXgg0Wbm/rbVwsS0bv+25R6m+mZgBspOLeKuoH7ivhL+48WV6POtMBsFPZweY26477EM7ukh+56Ff5ENevB8ymxBBn7qK5ZoeZd2a23U8ioX5TsHfe6fnrjitPWjIxD8G0NoKQxcaa/Mo+xs+T6UiLKxP0wjz5bm7jB5H+CXtkRJqzBWUB0h+RSLJckzZfA8BAJrRwIDAQAB",
9
9
  "permissions": [
@@ -1,6 +1,6 @@
1
1
  import { mergeDistinctSenderIds } from "../../../../src/channels/pairing/preseed-allow-from.js";
2
2
  import { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } from "../auth/app-registration.js";
3
- import fs from "node:fs";
3
+ import fsSync from "node:fs";
4
4
  import { confirm, input, select } from "@inquirer/prompts";
5
5
  //#region extensions/feishu/src/adapters/cli-login.ts
6
6
  /**
@@ -11,14 +11,14 @@ import { confirm, input, select } from "@inquirer/prompts";
11
11
  */
12
12
  function loadConfigFromPath(configPath) {
13
13
  try {
14
- const raw = fs.readFileSync(configPath, "utf8");
14
+ const raw = fsSync.readFileSync(configPath, "utf8");
15
15
  return JSON.parse(raw);
16
16
  } catch {
17
17
  return {};
18
18
  }
19
19
  }
20
20
  function writeConfigToPath(configPath, config) {
21
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
21
+ fsSync.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
22
22
  }
23
23
  function isFeishuConfigured(config) {
24
24
  const feishu = config.channels?.feishu;
@@ -1,6 +1,6 @@
1
- import { checkFileSafety } from "../../../../src/agent/prompt/safety.js";
2
1
  import { getMimeType } from "../../../../src/channels/media.js";
3
2
  import { getWorkspacePath } from "../../../../src/config/workspace-path-helpers.js";
3
+ import { checkFileSafety } from "../../../../src/agent/prompt/safety.js";
4
4
  import path from "node:path";
5
5
  import { promises } from "node:fs";
6
6
  import { Readable } from "node:stream";
@@ -1,14 +1,14 @@
1
1
  import { createLogger } from "../../../src/utils/logger/index.js";
2
2
  import { init_logger } from "../../../src/utils/logger.js";
3
3
  import { resolveRoute } from "../../../src/routing/resolve-route.js";
4
- import { checkMentionInTranscription } from "../../../src/voice/stt/mention.js";
5
- import { normalizeTelegramCommandName, parseSlashCommand } from "../../../src/chat-commands/command-parse.js";
6
4
  import { answerClarificationTextFromChannel } from "../../../src/gateway/clarify-runtime.js";
7
5
  import { buildTelegramUpdateKey, telegramUpdateDedupe } from "./dedupe.js";
6
+ import { normalizeTelegramCommandName, parseSlashCommand } from "../../../src/chat-commands/command-parse.js";
8
7
  import "../../../src/routing/index.js";
9
8
  import { resolveTelegramGroupContext } from "./group-config-resolver.js";
10
9
  import { buildTelegramConversationId } from "./conversation-id.js";
11
10
  import { resolveTelegramFocusedConversationId } from "./focus-handler.js";
11
+ import { checkMentionInTranscription } from "../../../src/voice/stt/mention.js";
12
12
  //#region extensions/telegram/src/inbound-processor.ts
13
13
  init_logger();
14
14
  const log = createLogger("TelegramInboundProcessor");
@@ -1,10 +1,10 @@
1
1
  import { createLogger } from "../../../src/utils/logger/index.js";
2
2
  import { init_logger } from "../../../src/utils/logger.js";
3
- import { createRetryRunner, isRecoverableNetworkError } from "../../../src/infra/retry.js";
4
3
  import { buildSendOptions, parseDataUrl, resolveMediaMethod } from "./send-options.js";
5
4
  import { splitTelegramCaption } from "./caption.js";
6
5
  import { markdownToTelegramChunks, renderTelegramHtmlText } from "./format.js";
7
6
  import { sentMessageCache } from "./sent-cache.js";
7
+ import { createRetryRunner, isRecoverableNetworkError } from "../../../src/infra/retry.js";
8
8
  import { isTelegramHtmlParseError } from "./errors.js";
9
9
  import { InputFile } from "grammy";
10
10
  //#region extensions/telegram/src/outbound-sender.ts
@@ -1,17 +1,17 @@
1
1
  import { createLogger } from "../../../src/utils/logger/index.js";
2
2
  import { init_logger } from "../../../src/utils/logger.js";
3
3
  import { TelegramConfigSchema, init_config_schema } from "./config-schema.js";
4
- import { isSTTAvailable } from "../../../src/voice/stt/availability.js";
5
4
  import { registerChannelExecApprovalHandler } from "../../../src/channels/exec-approval-runtime.js";
6
- import { generateConversationId } from "../../../src/chat-commands/session-key.js";
7
5
  import { resolveStandardPairingPath } from "../../../src/channels/pairing/paths.js";
8
6
  import { issuePairingChallenge } from "../../../src/channels/pairing/pairing-challenge.js";
9
7
  import { createStandardPairingAdapter } from "../../../src/channels/pairing/pairing-store-adapter.js";
10
8
  import "./pairing-config-resolver.js";
9
+ import { generateConversationId } from "../../../src/chat-commands/session-key.js";
11
10
  import { answerClarificationChoiceFromChannel } from "../../../src/gateway/clarify-runtime.js";
12
11
  import { createTimeoutAbortSignal } from "./timeout-abort.js";
13
12
  import { createInboundDebouncer } from "../../../src/infra/debounce.js";
14
13
  import { getMimeType } from "../../../src/channels/media.js";
14
+ import { isSTTAvailable } from "../../../src/voice/stt/availability.js";
15
15
  import { TelegramAccountManager } from "./account-manager.js";
16
16
  import { createOutboundSender } from "./outbound-sender.js";
17
17
  import { createTelegramCommandHandler } from "./command-handler.js";
@@ -2,7 +2,7 @@
2
2
  "id": "telegram",
3
3
  "name": "Telegram Channel",
4
4
  "description": "Bundled Telegram Bot channel (private workspace sources; ships inside @xopcai/xopc dist/)",
5
- "version": "0.0.350",
5
+ "version": "0.0.352",
6
6
  "kind": "channel",
7
7
  "main": "src/index.js",
8
8
  "channels": [
@@ -2,7 +2,7 @@ import { hasProxyEnv } from "../../../../src/infra/http-proxy-env.js";
2
2
  import { logger } from "../util/logger.js";
3
3
  import { redactBody, redactUrl } from "../util/redact.js";
4
4
  import path from "node:path";
5
- import fs from "node:fs";
5
+ import fsSync from "node:fs";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import crypto from "node:crypto";
8
8
  import { Agent, EnvHttpProxyAgent, fetch as fetch$1 } from "undici";
@@ -11,7 +11,7 @@ function readPackageJson() {
11
11
  try {
12
12
  const dir = path.dirname(fileURLToPath(import.meta.url));
13
13
  const pkgPath = path.resolve(dir, "..", "..", "package.json");
14
- return JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
14
+ return JSON.parse(fsSync.readFileSync(pkgPath, "utf-8"));
15
15
  } catch {
16
16
  return {};
17
17
  }
@@ -3,7 +3,7 @@ import { normalizeWeixinAccountId } from "./weixin-account-id.js";
3
3
  import { resolveWeixinRootDir } from "../storage/state-dir.js";
4
4
  import { deleteGetUpdatesBuf } from "../storage/sync-buf.js";
5
5
  import path from "node:path";
6
- import fs from "node:fs";
6
+ import fsSync from "node:fs";
7
7
  //#region extensions/weixin/src/auth/accounts.ts
8
8
  const DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com";
9
9
  const CDN_BASE_URL = "https://novac2c.cdn.weixin.qq.com/c2c";
@@ -16,8 +16,8 @@ function resolveAccountIndexPath() {
16
16
  function listIndexedWeixinAccountIds() {
17
17
  const filePath = resolveAccountIndexPath();
18
18
  try {
19
- if (!fs.existsSync(filePath)) return [];
20
- const raw = fs.readFileSync(filePath, "utf-8");
19
+ if (!fsSync.existsSync(filePath)) return [];
20
+ const raw = fsSync.readFileSync(filePath, "utf-8");
21
21
  const parsed = JSON.parse(raw);
22
22
  if (!Array.isArray(parsed)) return [];
23
23
  return parsed.filter((id) => typeof id === "string" && id.trim() !== "");
@@ -27,16 +27,16 @@ function listIndexedWeixinAccountIds() {
27
27
  }
28
28
  function registerWeixinAccountId(accountId) {
29
29
  const dir = resolveWeixinStateDir();
30
- fs.mkdirSync(dir, { recursive: true });
30
+ fsSync.mkdirSync(dir, { recursive: true });
31
31
  const existing = listIndexedWeixinAccountIds();
32
32
  if (existing.includes(accountId)) return;
33
33
  const updated = [...existing, accountId];
34
- fs.writeFileSync(resolveAccountIndexPath(), JSON.stringify(updated, null, 2), "utf-8");
34
+ fsSync.writeFileSync(resolveAccountIndexPath(), JSON.stringify(updated, null, 2), "utf-8");
35
35
  }
36
36
  function unregisterWeixinAccountId(accountId) {
37
37
  const existing = listIndexedWeixinAccountIds();
38
38
  const updated = existing.filter((id) => id !== accountId);
39
- if (updated.length !== existing.length) fs.writeFileSync(resolveAccountIndexPath(), JSON.stringify(updated, null, 2), "utf-8");
39
+ if (updated.length !== existing.length) fsSync.writeFileSync(resolveAccountIndexPath(), JSON.stringify(updated, null, 2), "utf-8");
40
40
  }
41
41
  function clearStaleAccountsForUserId(currentAccountId, userId, onClearContextTokens) {
42
42
  if (!userId) return;
@@ -59,7 +59,7 @@ function resolveAccountPath(accountId) {
59
59
  }
60
60
  function readAccountFile(filePath) {
61
61
  try {
62
- if (fs.existsSync(filePath)) return JSON.parse(fs.readFileSync(filePath, "utf-8"));
62
+ if (fsSync.existsSync(filePath)) return JSON.parse(fsSync.readFileSync(filePath, "utf-8"));
63
63
  } catch {}
64
64
  return null;
65
65
  }
@@ -68,7 +68,7 @@ function loadWeixinAccount(accountId) {
68
68
  }
69
69
  function saveWeixinAccount(accountId, update) {
70
70
  const dir = resolveAccountsDir();
71
- fs.mkdirSync(dir, { recursive: true });
71
+ fsSync.mkdirSync(dir, { recursive: true });
72
72
  const existing = loadWeixinAccount(accountId) ?? {};
73
73
  const token = update.token?.trim() || existing.token;
74
74
  const baseUrl = update.baseUrl?.trim() || existing.baseUrl;
@@ -82,9 +82,9 @@ function saveWeixinAccount(accountId, update) {
82
82
  ...userId ? { userId } : {}
83
83
  };
84
84
  const filePath = resolveAccountPath(accountId);
85
- fs.writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
85
+ fsSync.writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
86
86
  try {
87
- fs.chmodSync(filePath, 384);
87
+ fsSync.chmodSync(filePath, 384);
88
88
  } catch {}
89
89
  }
90
90
  function clearWeixinAccount(accountId) {
@@ -92,10 +92,10 @@ function clearWeixinAccount(accountId) {
92
92
  const dir = resolveAccountsDir();
93
93
  const accountFiles = [`${accountId}.json`, `${accountId}.context-tokens.json`];
94
94
  for (const file of accountFiles) try {
95
- fs.unlinkSync(path.join(dir, file));
95
+ fsSync.unlinkSync(path.join(dir, file));
96
96
  } catch {}
97
97
  try {
98
- fs.unlinkSync(resolveFrameworkAllowFromPath(accountId));
98
+ fsSync.unlinkSync(resolveFrameworkAllowFromPath(accountId));
99
99
  } catch {}
100
100
  }
101
101
  function weixinSection(cfg) {
@@ -1,7 +1,7 @@
1
1
  import { logger } from "../util/logger.js";
2
2
  import { resolveWeixinRootDir } from "../storage/state-dir.js";
3
3
  import path from "node:path";
4
- import fs from "node:fs";
4
+ import fsSync from "node:fs";
5
5
  //#region extensions/weixin/src/messaging/debug-mode.ts
6
6
  /**
7
7
  * Per-bot debug mode toggle, persisted to disk so it survives gateway restarts.
@@ -17,7 +17,7 @@ function resolveDebugModePath() {
17
17
  }
18
18
  function loadState() {
19
19
  try {
20
- const raw = fs.readFileSync(resolveDebugModePath(), "utf-8");
20
+ const raw = fsSync.readFileSync(resolveDebugModePath(), "utf-8");
21
21
  const parsed = JSON.parse(raw);
22
22
  if (parsed && typeof parsed.accounts === "object") return parsed;
23
23
  } catch {}
@@ -25,8 +25,8 @@ function loadState() {
25
25
  }
26
26
  function saveState(state) {
27
27
  const filePath = resolveDebugModePath();
28
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
29
- fs.writeFileSync(filePath, JSON.stringify(state, null, 2), "utf-8");
28
+ fsSync.mkdirSync(path.dirname(filePath), { recursive: true });
29
+ fsSync.writeFileSync(filePath, JSON.stringify(state, null, 2), "utf-8");
30
30
  }
31
31
  /** Toggle debug mode for a bot account. Returns the new state. */
32
32
  function toggleDebugMode(accountId) {
@@ -50,7 +50,7 @@ function isDebugMode(accountId) {
50
50
  */
51
51
  function _resetForTest() {
52
52
  try {
53
- fs.unlinkSync(resolveDebugModePath());
53
+ fsSync.unlinkSync(resolveDebugModePath());
54
54
  } catch {}
55
55
  }
56
56
  //#endregion
@@ -4,7 +4,7 @@ import { MessageItemType } from "../api/types.js";
4
4
  import { canonicalWeixinPeerId, normalizeWeixinAccountId } from "../auth/weixin-account-id.js";
5
5
  import { resolveWeixinRootDir } from "../storage/state-dir.js";
6
6
  import path from "node:path";
7
- import fs from "node:fs";
7
+ import fsSync from "node:fs";
8
8
  //#region extensions/weixin/src/messaging/inbound.ts
9
9
  /**
10
10
  * contextToken is issued per-message by the Weixin getupdates API and must
@@ -66,8 +66,8 @@ function persistContextTokens(accountId) {
66
66
  const filePath = canonicalContextTokenFilePath(accountId);
67
67
  try {
68
68
  const dir = path.dirname(filePath);
69
- fs.mkdirSync(dir, { recursive: true });
70
- fs.writeFileSync(filePath, JSON.stringify(tokens, null, 0), "utf-8");
69
+ fsSync.mkdirSync(dir, { recursive: true });
70
+ fsSync.writeFileSync(filePath, JSON.stringify(tokens, null, 0), "utf-8");
71
71
  } catch (err) {
72
72
  logger.warn(`persistContextTokens: failed to write ${filePath}: ${String(err)}`);
73
73
  }
@@ -81,8 +81,8 @@ function restoreContextTokens(accountId) {
81
81
  const norm = normalizeWeixinAccountId(accountId);
82
82
  const filePath = canonicalContextTokenFilePath(accountId);
83
83
  try {
84
- if (fs.existsSync(filePath)) {
85
- const raw = fs.readFileSync(filePath, "utf-8");
84
+ if (fsSync.existsSync(filePath)) {
85
+ const raw = fsSync.readFileSync(filePath, "utf-8");
86
86
  const tokens = JSON.parse(raw);
87
87
  for (const [userId, val] of Object.entries(tokens)) {
88
88
  const entry = parsePersistedPeerVal(val);
@@ -104,7 +104,7 @@ function clearContextTokensForAccount(accountId) {
104
104
  for (const k of [...contextTokenStore.keys()]) if (k.startsWith(prefix)) contextTokenStore.delete(k);
105
105
  try {
106
106
  const filePath = canonicalContextTokenFilePath(accountId);
107
- if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
107
+ if (fsSync.existsSync(filePath)) fsSync.unlinkSync(filePath);
108
108
  } catch (err) {
109
109
  logger.warn(`clearContextTokensForAccount: failed to remove context tokens file: ${String(err)}`);
110
110
  }
@@ -114,9 +114,9 @@ function tryHydratePeerEntryFromDisk(accountId, userId) {
114
114
  const peer = normalizeIlinkUserIdForContext(userId);
115
115
  const norm = normalizeWeixinAccountId(accountId);
116
116
  const filePath = canonicalContextTokenFilePath(accountId);
117
- if (!fs.existsSync(filePath)) return void 0;
117
+ if (!fsSync.existsSync(filePath)) return void 0;
118
118
  try {
119
- const raw = fs.readFileSync(filePath, "utf-8");
119
+ const raw = fsSync.readFileSync(filePath, "utf-8");
120
120
  const tokens = JSON.parse(raw);
121
121
  for (const [jsonKey, val] of Object.entries(tokens)) {
122
122
  const entry = parsePersistedPeerVal(val);
@@ -198,11 +198,11 @@ function findContextTokenEntriesByPeer(peerUserId) {
198
198
  function tryHydrateAnyAccountContextTokenFromDisk(peerUserId) {
199
199
  const peer = normalizeIlinkUserIdForContext(peerUserId);
200
200
  const accountsDir = path.join(resolveWeixinRootDir(), "accounts");
201
- if (!fs.existsSync(accountsDir)) return void 0;
201
+ if (!fsSync.existsSync(accountsDir)) return void 0;
202
202
  const hits = [];
203
203
  let names;
204
204
  try {
205
- names = fs.readdirSync(accountsDir);
205
+ names = fsSync.readdirSync(accountsDir);
206
206
  } catch {
207
207
  return;
208
208
  }
@@ -212,7 +212,7 @@ function tryHydrateAnyAccountContextTokenFromDisk(peerUserId) {
212
212
  const accountFromFile = name.slice(0, -20);
213
213
  const filePath = path.join(accountsDir, name);
214
214
  try {
215
- const raw = fs.readFileSync(filePath, "utf-8");
215
+ const raw = fsSync.readFileSync(filePath, "utf-8");
216
216
  const tokens = JSON.parse(raw);
217
217
  for (const [jsonKey, val] of Object.entries(tokens)) {
218
218
  const entry = parsePersistedPeerVal(val);