ForcomeBot 2.0.2__tar.gz

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 (399) hide show
  1. forcomebot-2.0.2/.gitignore +42 -0
  2. forcomebot-2.0.2/PKG-INFO +342 -0
  3. forcomebot-2.0.2/README.md +309 -0
  4. forcomebot-2.0.2/config.example.yaml +48 -0
  5. forcomebot-2.0.2/pyproject.toml +69 -0
  6. forcomebot-2.0.2/src/__init__.py +68 -0
  7. forcomebot-2.0.2/src/__main__.py +442 -0
  8. forcomebot-2.0.2/src/api/__init__.py +21 -0
  9. forcomebot-2.0.2/src/api/routes.py +662 -0
  10. forcomebot-2.0.2/src/api/websocket.py +280 -0
  11. forcomebot-2.0.2/src/clients/__init__.py +7 -0
  12. forcomebot-2.0.2/src/clients/langbot.py +710 -0
  13. forcomebot-2.0.2/src/clients/qianxun.py +637 -0
  14. forcomebot-2.0.2/src/core/__init__.py +16 -0
  15. forcomebot-2.0.2/src/core/config_manager.py +307 -0
  16. forcomebot-2.0.2/src/core/log_collector.py +167 -0
  17. forcomebot-2.0.2/src/core/state_store.py +382 -0
  18. forcomebot-2.0.2/src/handlers/__init__.py +8 -0
  19. forcomebot-2.0.2/src/handlers/message_handler.py +678 -0
  20. forcomebot-2.0.2/src/handlers/message_parser.py +333 -0
  21. forcomebot-2.0.2/src/handlers/scheduler.py +451 -0
  22. forcomebot-2.0.2/src/models.py +77 -0
  23. forcomebot-2.0.2/src/static/assets/index-BxIxIJLW.css +2 -0
  24. forcomebot-2.0.2/src/static/assets/index-CQLQaqOM.js +52 -0
  25. forcomebot-2.0.2/src/static/assets/index-Dw9M-pfY.js +50 -0
  26. forcomebot-2.0.2/src/static/assets/index-i4QFZr9X.css +2 -0
  27. forcomebot-2.0.2/src/static/index.html +14 -0
  28. forcomebot-2.0.2/src/static/vite.svg +1 -0
  29. forcomebot-2.0.2/src/utils/__init__.py +13 -0
  30. forcomebot-2.0.2/src/utils/text_processor.py +166 -0
  31. forcomebot-2.0.2/src/utils/xml_parser.py +215 -0
  32. forcomebot-2.0.2/src/web.py +257 -0
  33. forcomebot-2.0.2/web/README.md +73 -0
  34. forcomebot-2.0.2/web/node_modules/@babel/code-frame/LICENSE +22 -0
  35. forcomebot-2.0.2/web/node_modules/@babel/code-frame/README.md +19 -0
  36. forcomebot-2.0.2/web/node_modules/@babel/compat-data/LICENSE +22 -0
  37. forcomebot-2.0.2/web/node_modules/@babel/compat-data/README.md +19 -0
  38. forcomebot-2.0.2/web/node_modules/@babel/core/LICENSE +22 -0
  39. forcomebot-2.0.2/web/node_modules/@babel/core/README.md +19 -0
  40. forcomebot-2.0.2/web/node_modules/@babel/generator/LICENSE +22 -0
  41. forcomebot-2.0.2/web/node_modules/@babel/generator/README.md +19 -0
  42. forcomebot-2.0.2/web/node_modules/@babel/helper-compilation-targets/LICENSE +22 -0
  43. forcomebot-2.0.2/web/node_modules/@babel/helper-compilation-targets/README.md +19 -0
  44. forcomebot-2.0.2/web/node_modules/@babel/helper-globals/LICENSE +22 -0
  45. forcomebot-2.0.2/web/node_modules/@babel/helper-globals/README.md +19 -0
  46. forcomebot-2.0.2/web/node_modules/@babel/helper-module-imports/LICENSE +22 -0
  47. forcomebot-2.0.2/web/node_modules/@babel/helper-module-imports/README.md +19 -0
  48. forcomebot-2.0.2/web/node_modules/@babel/helper-module-transforms/LICENSE +22 -0
  49. forcomebot-2.0.2/web/node_modules/@babel/helper-module-transforms/README.md +19 -0
  50. forcomebot-2.0.2/web/node_modules/@babel/helper-plugin-utils/LICENSE +22 -0
  51. forcomebot-2.0.2/web/node_modules/@babel/helper-plugin-utils/README.md +19 -0
  52. forcomebot-2.0.2/web/node_modules/@babel/helper-string-parser/LICENSE +22 -0
  53. forcomebot-2.0.2/web/node_modules/@babel/helper-string-parser/README.md +19 -0
  54. forcomebot-2.0.2/web/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
  55. forcomebot-2.0.2/web/node_modules/@babel/helper-validator-identifier/README.md +19 -0
  56. forcomebot-2.0.2/web/node_modules/@babel/helper-validator-option/LICENSE +22 -0
  57. forcomebot-2.0.2/web/node_modules/@babel/helper-validator-option/README.md +19 -0
  58. forcomebot-2.0.2/web/node_modules/@babel/helpers/LICENSE +23 -0
  59. forcomebot-2.0.2/web/node_modules/@babel/helpers/README.md +19 -0
  60. forcomebot-2.0.2/web/node_modules/@babel/parser/LICENSE +19 -0
  61. forcomebot-2.0.2/web/node_modules/@babel/parser/README.md +19 -0
  62. forcomebot-2.0.2/web/node_modules/@babel/plugin-transform-react-jsx-self/LICENSE +22 -0
  63. forcomebot-2.0.2/web/node_modules/@babel/plugin-transform-react-jsx-self/README.md +19 -0
  64. forcomebot-2.0.2/web/node_modules/@babel/plugin-transform-react-jsx-source/LICENSE +22 -0
  65. forcomebot-2.0.2/web/node_modules/@babel/plugin-transform-react-jsx-source/README.md +19 -0
  66. forcomebot-2.0.2/web/node_modules/@babel/template/LICENSE +22 -0
  67. forcomebot-2.0.2/web/node_modules/@babel/template/README.md +19 -0
  68. forcomebot-2.0.2/web/node_modules/@babel/traverse/LICENSE +22 -0
  69. forcomebot-2.0.2/web/node_modules/@babel/traverse/README.md +19 -0
  70. forcomebot-2.0.2/web/node_modules/@babel/types/LICENSE +22 -0
  71. forcomebot-2.0.2/web/node_modules/@babel/types/README.md +19 -0
  72. forcomebot-2.0.2/web/node_modules/@emnapi/core/LICENSE +21 -0
  73. forcomebot-2.0.2/web/node_modules/@emnapi/core/README.md +1 -0
  74. forcomebot-2.0.2/web/node_modules/@emnapi/runtime/LICENSE +21 -0
  75. forcomebot-2.0.2/web/node_modules/@emnapi/runtime/README.md +1 -0
  76. forcomebot-2.0.2/web/node_modules/@emnapi/wasi-threads/LICENSE +21 -0
  77. forcomebot-2.0.2/web/node_modules/@emnapi/wasi-threads/README.md +203 -0
  78. forcomebot-2.0.2/web/node_modules/@eslint/config-array/LICENSE +201 -0
  79. forcomebot-2.0.2/web/node_modules/@eslint/config-array/README.md +368 -0
  80. forcomebot-2.0.2/web/node_modules/@eslint/config-helpers/LICENSE +201 -0
  81. forcomebot-2.0.2/web/node_modules/@eslint/config-helpers/README.md +97 -0
  82. forcomebot-2.0.2/web/node_modules/@eslint/core/LICENSE +201 -0
  83. forcomebot-2.0.2/web/node_modules/@eslint/core/README.md +29 -0
  84. forcomebot-2.0.2/web/node_modules/@eslint/eslintrc/LICENSE +19 -0
  85. forcomebot-2.0.2/web/node_modules/@eslint/eslintrc/README.md +145 -0
  86. forcomebot-2.0.2/web/node_modules/@eslint/js/LICENSE +19 -0
  87. forcomebot-2.0.2/web/node_modules/@eslint/js/README.md +103 -0
  88. forcomebot-2.0.2/web/node_modules/@eslint/object-schema/LICENSE +201 -0
  89. forcomebot-2.0.2/web/node_modules/@eslint/object-schema/README.md +242 -0
  90. forcomebot-2.0.2/web/node_modules/@eslint/plugin-kit/LICENSE +201 -0
  91. forcomebot-2.0.2/web/node_modules/@eslint/plugin-kit/README.md +273 -0
  92. forcomebot-2.0.2/web/node_modules/@eslint-community/eslint-utils/LICENSE +21 -0
  93. forcomebot-2.0.2/web/node_modules/@eslint-community/eslint-utils/README.md +37 -0
  94. forcomebot-2.0.2/web/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE +201 -0
  95. forcomebot-2.0.2/web/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md +105 -0
  96. forcomebot-2.0.2/web/node_modules/@eslint-community/regexpp/LICENSE +21 -0
  97. forcomebot-2.0.2/web/node_modules/@eslint-community/regexpp/README.md +177 -0
  98. forcomebot-2.0.2/web/node_modules/@humanfs/core/LICENSE +201 -0
  99. forcomebot-2.0.2/web/node_modules/@humanfs/core/README.md +140 -0
  100. forcomebot-2.0.2/web/node_modules/@humanfs/node/LICENSE +201 -0
  101. forcomebot-2.0.2/web/node_modules/@humanfs/node/README.md +141 -0
  102. forcomebot-2.0.2/web/node_modules/@humanwhocodes/module-importer/LICENSE +201 -0
  103. forcomebot-2.0.2/web/node_modules/@humanwhocodes/module-importer/README.md +80 -0
  104. forcomebot-2.0.2/web/node_modules/@humanwhocodes/retry/LICENSE +201 -0
  105. forcomebot-2.0.2/web/node_modules/@humanwhocodes/retry/README.md +177 -0
  106. forcomebot-2.0.2/web/node_modules/@jridgewell/gen-mapping/LICENSE +19 -0
  107. forcomebot-2.0.2/web/node_modules/@jridgewell/gen-mapping/README.md +227 -0
  108. forcomebot-2.0.2/web/node_modules/@jridgewell/remapping/LICENSE +19 -0
  109. forcomebot-2.0.2/web/node_modules/@jridgewell/remapping/README.md +218 -0
  110. forcomebot-2.0.2/web/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
  111. forcomebot-2.0.2/web/node_modules/@jridgewell/resolve-uri/README.md +40 -0
  112. forcomebot-2.0.2/web/node_modules/@jridgewell/sourcemap-codec/LICENSE +19 -0
  113. forcomebot-2.0.2/web/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
  114. forcomebot-2.0.2/web/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
  115. forcomebot-2.0.2/web/node_modules/@jridgewell/trace-mapping/README.md +348 -0
  116. forcomebot-2.0.2/web/node_modules/@oxc-project/runtime/LICENSE +22 -0
  117. forcomebot-2.0.2/web/node_modules/@oxc-project/runtime/README.md +5 -0
  118. forcomebot-2.0.2/web/node_modules/@oxc-project/types/LICENSE +22 -0
  119. forcomebot-2.0.2/web/node_modules/@oxc-project/types/README.md +3 -0
  120. forcomebot-2.0.2/web/node_modules/@rolldown/binding-win32-x64-msvc/README.md +3 -0
  121. forcomebot-2.0.2/web/node_modules/@rolldown/pluginutils/LICENSE +25 -0
  122. forcomebot-2.0.2/web/node_modules/@rolldown/pluginutils/README.md +85 -0
  123. forcomebot-2.0.2/web/node_modules/@tailwindcss/node/LICENSE +21 -0
  124. forcomebot-2.0.2/web/node_modules/@tailwindcss/node/README.md +36 -0
  125. forcomebot-2.0.2/web/node_modules/@tailwindcss/oxide/LICENSE +21 -0
  126. forcomebot-2.0.2/web/node_modules/@tailwindcss/oxide-win32-x64-msvc/LICENSE +21 -0
  127. forcomebot-2.0.2/web/node_modules/@tailwindcss/oxide-win32-x64-msvc/README.md +3 -0
  128. forcomebot-2.0.2/web/node_modules/@tailwindcss/vite/LICENSE +21 -0
  129. forcomebot-2.0.2/web/node_modules/@tailwindcss/vite/README.md +76 -0
  130. forcomebot-2.0.2/web/node_modules/@tanstack/query-core/LICENSE +21 -0
  131. forcomebot-2.0.2/web/node_modules/@tanstack/react-query/LICENSE +21 -0
  132. forcomebot-2.0.2/web/node_modules/@tanstack/react-query/README.md +48 -0
  133. forcomebot-2.0.2/web/node_modules/@tybys/wasm-util/README.md +193 -0
  134. forcomebot-2.0.2/web/node_modules/@types/babel__core/LICENSE +21 -0
  135. forcomebot-2.0.2/web/node_modules/@types/babel__core/README.md +15 -0
  136. forcomebot-2.0.2/web/node_modules/@types/babel__generator/LICENSE +21 -0
  137. forcomebot-2.0.2/web/node_modules/@types/babel__generator/README.md +15 -0
  138. forcomebot-2.0.2/web/node_modules/@types/babel__template/LICENSE +21 -0
  139. forcomebot-2.0.2/web/node_modules/@types/babel__template/README.md +15 -0
  140. forcomebot-2.0.2/web/node_modules/@types/babel__traverse/LICENSE +21 -0
  141. forcomebot-2.0.2/web/node_modules/@types/babel__traverse/README.md +15 -0
  142. forcomebot-2.0.2/web/node_modules/@types/estree/LICENSE +21 -0
  143. forcomebot-2.0.2/web/node_modules/@types/estree/README.md +15 -0
  144. forcomebot-2.0.2/web/node_modules/@types/json-schema/LICENSE +21 -0
  145. forcomebot-2.0.2/web/node_modules/@types/json-schema/README.md +15 -0
  146. forcomebot-2.0.2/web/node_modules/@types/node/LICENSE +21 -0
  147. forcomebot-2.0.2/web/node_modules/@types/node/README.md +15 -0
  148. forcomebot-2.0.2/web/node_modules/@types/react/LICENSE +21 -0
  149. forcomebot-2.0.2/web/node_modules/@types/react/README.md +15 -0
  150. forcomebot-2.0.2/web/node_modules/@types/react-dom/LICENSE +21 -0
  151. forcomebot-2.0.2/web/node_modules/@types/react-dom/README.md +16 -0
  152. forcomebot-2.0.2/web/node_modules/@typescript-eslint/eslint-plugin/LICENSE +21 -0
  153. forcomebot-2.0.2/web/node_modules/@typescript-eslint/eslint-plugin/README.md +12 -0
  154. forcomebot-2.0.2/web/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/README.md +452 -0
  155. forcomebot-2.0.2/web/node_modules/@typescript-eslint/parser/LICENSE +21 -0
  156. forcomebot-2.0.2/web/node_modules/@typescript-eslint/parser/README.md +12 -0
  157. forcomebot-2.0.2/web/node_modules/@typescript-eslint/project-service/LICENSE +21 -0
  158. forcomebot-2.0.2/web/node_modules/@typescript-eslint/project-service/README.md +12 -0
  159. forcomebot-2.0.2/web/node_modules/@typescript-eslint/scope-manager/LICENSE +21 -0
  160. forcomebot-2.0.2/web/node_modules/@typescript-eslint/scope-manager/README.md +10 -0
  161. forcomebot-2.0.2/web/node_modules/@typescript-eslint/tsconfig-utils/LICENSE +21 -0
  162. forcomebot-2.0.2/web/node_modules/@typescript-eslint/tsconfig-utils/README.md +12 -0
  163. forcomebot-2.0.2/web/node_modules/@typescript-eslint/type-utils/LICENSE +21 -0
  164. forcomebot-2.0.2/web/node_modules/@typescript-eslint/type-utils/README.md +12 -0
  165. forcomebot-2.0.2/web/node_modules/@typescript-eslint/types/LICENSE +21 -0
  166. forcomebot-2.0.2/web/node_modules/@typescript-eslint/types/README.md +12 -0
  167. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/LICENSE +21 -0
  168. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/README.md +14 -0
  169. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE +21 -0
  170. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md +135 -0
  171. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE +15 -0
  172. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md +454 -0
  173. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/node_modules/semver/LICENSE +15 -0
  174. forcomebot-2.0.2/web/node_modules/@typescript-eslint/typescript-estree/node_modules/semver/README.md +664 -0
  175. forcomebot-2.0.2/web/node_modules/@typescript-eslint/utils/LICENSE +21 -0
  176. forcomebot-2.0.2/web/node_modules/@typescript-eslint/utils/README.md +12 -0
  177. forcomebot-2.0.2/web/node_modules/@typescript-eslint/visitor-keys/LICENSE +21 -0
  178. forcomebot-2.0.2/web/node_modules/@typescript-eslint/visitor-keys/README.md +10 -0
  179. forcomebot-2.0.2/web/node_modules/@vitejs/plugin-react/LICENSE +21 -0
  180. forcomebot-2.0.2/web/node_modules/@vitejs/plugin-react/README.md +143 -0
  181. forcomebot-2.0.2/web/node_modules/acorn/LICENSE +21 -0
  182. forcomebot-2.0.2/web/node_modules/acorn/README.md +282 -0
  183. forcomebot-2.0.2/web/node_modules/acorn-jsx/LICENSE +19 -0
  184. forcomebot-2.0.2/web/node_modules/acorn-jsx/README.md +40 -0
  185. forcomebot-2.0.2/web/node_modules/ajv/LICENSE +22 -0
  186. forcomebot-2.0.2/web/node_modules/ajv/README.md +1497 -0
  187. forcomebot-2.0.2/web/node_modules/argparse/LICENSE +254 -0
  188. forcomebot-2.0.2/web/node_modules/argparse/README.md +84 -0
  189. forcomebot-2.0.2/web/node_modules/asynckit/LICENSE +21 -0
  190. forcomebot-2.0.2/web/node_modules/asynckit/README.md +233 -0
  191. forcomebot-2.0.2/web/node_modules/axios/LICENSE +7 -0
  192. forcomebot-2.0.2/web/node_modules/axios/README.md +1784 -0
  193. forcomebot-2.0.2/web/node_modules/balanced-match/README.md +97 -0
  194. forcomebot-2.0.2/web/node_modules/baseline-browser-mapping/README.md +463 -0
  195. forcomebot-2.0.2/web/node_modules/brace-expansion/LICENSE +21 -0
  196. forcomebot-2.0.2/web/node_modules/brace-expansion/README.md +129 -0
  197. forcomebot-2.0.2/web/node_modules/browserslist/LICENSE +20 -0
  198. forcomebot-2.0.2/web/node_modules/browserslist/README.md +65 -0
  199. forcomebot-2.0.2/web/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  200. forcomebot-2.0.2/web/node_modules/call-bind-apply-helpers/README.md +62 -0
  201. forcomebot-2.0.2/web/node_modules/caniuse-lite/LICENSE +395 -0
  202. forcomebot-2.0.2/web/node_modules/caniuse-lite/README.md +6 -0
  203. forcomebot-2.0.2/web/node_modules/color-convert/LICENSE +21 -0
  204. forcomebot-2.0.2/web/node_modules/color-convert/README.md +68 -0
  205. forcomebot-2.0.2/web/node_modules/color-name/LICENSE +8 -0
  206. forcomebot-2.0.2/web/node_modules/color-name/README.md +11 -0
  207. forcomebot-2.0.2/web/node_modules/concat-map/LICENSE +18 -0
  208. forcomebot-2.0.2/web/node_modules/convert-source-map/LICENSE +23 -0
  209. forcomebot-2.0.2/web/node_modules/convert-source-map/README.md +206 -0
  210. forcomebot-2.0.2/web/node_modules/cookie/LICENSE +24 -0
  211. forcomebot-2.0.2/web/node_modules/cookie/README.md +295 -0
  212. forcomebot-2.0.2/web/node_modules/cross-spawn/LICENSE +21 -0
  213. forcomebot-2.0.2/web/node_modules/cross-spawn/README.md +89 -0
  214. forcomebot-2.0.2/web/node_modules/csstype/LICENSE +19 -0
  215. forcomebot-2.0.2/web/node_modules/csstype/README.md +291 -0
  216. forcomebot-2.0.2/web/node_modules/debug/LICENSE +20 -0
  217. forcomebot-2.0.2/web/node_modules/debug/README.md +481 -0
  218. forcomebot-2.0.2/web/node_modules/deep-is/LICENSE +22 -0
  219. forcomebot-2.0.2/web/node_modules/detect-libc/LICENSE +201 -0
  220. forcomebot-2.0.2/web/node_modules/detect-libc/README.md +163 -0
  221. forcomebot-2.0.2/web/node_modules/dunder-proto/LICENSE +21 -0
  222. forcomebot-2.0.2/web/node_modules/dunder-proto/README.md +54 -0
  223. forcomebot-2.0.2/web/node_modules/electron-to-chromium/LICENSE +5 -0
  224. forcomebot-2.0.2/web/node_modules/electron-to-chromium/README.md +186 -0
  225. forcomebot-2.0.2/web/node_modules/enhanced-resolve/LICENSE +20 -0
  226. forcomebot-2.0.2/web/node_modules/enhanced-resolve/README.md +186 -0
  227. forcomebot-2.0.2/web/node_modules/es-define-property/LICENSE +21 -0
  228. forcomebot-2.0.2/web/node_modules/es-define-property/README.md +49 -0
  229. forcomebot-2.0.2/web/node_modules/es-errors/LICENSE +21 -0
  230. forcomebot-2.0.2/web/node_modules/es-errors/README.md +55 -0
  231. forcomebot-2.0.2/web/node_modules/es-object-atoms/LICENSE +21 -0
  232. forcomebot-2.0.2/web/node_modules/es-object-atoms/README.md +63 -0
  233. forcomebot-2.0.2/web/node_modules/es-set-tostringtag/LICENSE +21 -0
  234. forcomebot-2.0.2/web/node_modules/es-set-tostringtag/README.md +53 -0
  235. forcomebot-2.0.2/web/node_modules/eslint/LICENSE +19 -0
  236. forcomebot-2.0.2/web/node_modules/eslint/README.md +354 -0
  237. forcomebot-2.0.2/web/node_modules/eslint-plugin-react-hooks/LICENSE +21 -0
  238. forcomebot-2.0.2/web/node_modules/eslint-plugin-react-hooks/README.md +152 -0
  239. forcomebot-2.0.2/web/node_modules/eslint-plugin-react-refresh/LICENSE +21 -0
  240. forcomebot-2.0.2/web/node_modules/eslint-plugin-react-refresh/README.md +233 -0
  241. forcomebot-2.0.2/web/node_modules/eslint-scope/LICENSE +22 -0
  242. forcomebot-2.0.2/web/node_modules/eslint-scope/README.md +198 -0
  243. forcomebot-2.0.2/web/node_modules/eslint-visitor-keys/LICENSE +201 -0
  244. forcomebot-2.0.2/web/node_modules/eslint-visitor-keys/README.md +121 -0
  245. forcomebot-2.0.2/web/node_modules/espree/LICENSE +25 -0
  246. forcomebot-2.0.2/web/node_modules/espree/README.md +262 -0
  247. forcomebot-2.0.2/web/node_modules/esquery/README.md +27 -0
  248. forcomebot-2.0.2/web/node_modules/esrecurse/README.md +171 -0
  249. forcomebot-2.0.2/web/node_modules/estraverse/README.md +153 -0
  250. forcomebot-2.0.2/web/node_modules/esutils/README.md +174 -0
  251. forcomebot-2.0.2/web/node_modules/fast-deep-equal/LICENSE +21 -0
  252. forcomebot-2.0.2/web/node_modules/fast-deep-equal/README.md +96 -0
  253. forcomebot-2.0.2/web/node_modules/fast-json-stable-stringify/LICENSE +21 -0
  254. forcomebot-2.0.2/web/node_modules/fast-json-stable-stringify/README.md +131 -0
  255. forcomebot-2.0.2/web/node_modules/fast-levenshtein/README.md +104 -0
  256. forcomebot-2.0.2/web/node_modules/fdir/LICENSE +7 -0
  257. forcomebot-2.0.2/web/node_modules/fdir/README.md +91 -0
  258. forcomebot-2.0.2/web/node_modules/file-entry-cache/LICENSE +22 -0
  259. forcomebot-2.0.2/web/node_modules/file-entry-cache/README.md +115 -0
  260. forcomebot-2.0.2/web/node_modules/flat-cache/LICENSE +22 -0
  261. forcomebot-2.0.2/web/node_modules/flat-cache/README.md +77 -0
  262. forcomebot-2.0.2/web/node_modules/flatted/LICENSE +15 -0
  263. forcomebot-2.0.2/web/node_modules/flatted/README.md +115 -0
  264. forcomebot-2.0.2/web/node_modules/follow-redirects/LICENSE +18 -0
  265. forcomebot-2.0.2/web/node_modules/follow-redirects/README.md +155 -0
  266. forcomebot-2.0.2/web/node_modules/form-data/README.md +355 -0
  267. forcomebot-2.0.2/web/node_modules/function-bind/LICENSE +20 -0
  268. forcomebot-2.0.2/web/node_modules/function-bind/README.md +46 -0
  269. forcomebot-2.0.2/web/node_modules/gensync/LICENSE +7 -0
  270. forcomebot-2.0.2/web/node_modules/gensync/README.md +196 -0
  271. forcomebot-2.0.2/web/node_modules/get-intrinsic/LICENSE +21 -0
  272. forcomebot-2.0.2/web/node_modules/get-intrinsic/README.md +71 -0
  273. forcomebot-2.0.2/web/node_modules/get-proto/LICENSE +21 -0
  274. forcomebot-2.0.2/web/node_modules/get-proto/README.md +50 -0
  275. forcomebot-2.0.2/web/node_modules/glob-parent/LICENSE +15 -0
  276. forcomebot-2.0.2/web/node_modules/glob-parent/README.md +134 -0
  277. forcomebot-2.0.2/web/node_modules/gopd/LICENSE +21 -0
  278. forcomebot-2.0.2/web/node_modules/gopd/README.md +40 -0
  279. forcomebot-2.0.2/web/node_modules/graceful-fs/LICENSE +15 -0
  280. forcomebot-2.0.2/web/node_modules/graceful-fs/README.md +143 -0
  281. forcomebot-2.0.2/web/node_modules/has-symbols/LICENSE +21 -0
  282. forcomebot-2.0.2/web/node_modules/has-symbols/README.md +46 -0
  283. forcomebot-2.0.2/web/node_modules/has-tostringtag/LICENSE +21 -0
  284. forcomebot-2.0.2/web/node_modules/has-tostringtag/README.md +46 -0
  285. forcomebot-2.0.2/web/node_modules/hasown/LICENSE +21 -0
  286. forcomebot-2.0.2/web/node_modules/hasown/README.md +40 -0
  287. forcomebot-2.0.2/web/node_modules/hermes-estree/LICENSE +21 -0
  288. forcomebot-2.0.2/web/node_modules/hermes-estree/README.md +3 -0
  289. forcomebot-2.0.2/web/node_modules/hermes-parser/LICENSE +21 -0
  290. forcomebot-2.0.2/web/node_modules/hermes-parser/README.md +11 -0
  291. forcomebot-2.0.2/web/node_modules/ignore/README.md +412 -0
  292. forcomebot-2.0.2/web/node_modules/imurmurhash/README.md +122 -0
  293. forcomebot-2.0.2/web/node_modules/is-extglob/LICENSE +21 -0
  294. forcomebot-2.0.2/web/node_modules/is-extglob/README.md +107 -0
  295. forcomebot-2.0.2/web/node_modules/is-glob/LICENSE +21 -0
  296. forcomebot-2.0.2/web/node_modules/is-glob/README.md +206 -0
  297. forcomebot-2.0.2/web/node_modules/isexe/LICENSE +15 -0
  298. forcomebot-2.0.2/web/node_modules/isexe/README.md +51 -0
  299. forcomebot-2.0.2/web/node_modules/jiti/LICENSE +21 -0
  300. forcomebot-2.0.2/web/node_modules/jiti/README.md +243 -0
  301. forcomebot-2.0.2/web/node_modules/js-tokens/LICENSE +21 -0
  302. forcomebot-2.0.2/web/node_modules/js-tokens/README.md +240 -0
  303. forcomebot-2.0.2/web/node_modules/js-yaml/LICENSE +21 -0
  304. forcomebot-2.0.2/web/node_modules/js-yaml/README.md +247 -0
  305. forcomebot-2.0.2/web/node_modules/jsesc/README.md +422 -0
  306. forcomebot-2.0.2/web/node_modules/json-buffer/LICENSE +22 -0
  307. forcomebot-2.0.2/web/node_modules/json-buffer/README.md +24 -0
  308. forcomebot-2.0.2/web/node_modules/json-schema-traverse/LICENSE +21 -0
  309. forcomebot-2.0.2/web/node_modules/json-schema-traverse/README.md +83 -0
  310. forcomebot-2.0.2/web/node_modules/json-stable-stringify-without-jsonify/LICENSE +18 -0
  311. forcomebot-2.0.2/web/node_modules/json5/README.md +282 -0
  312. forcomebot-2.0.2/web/node_modules/keyv/README.md +429 -0
  313. forcomebot-2.0.2/web/node_modules/levn/LICENSE +22 -0
  314. forcomebot-2.0.2/web/node_modules/levn/README.md +196 -0
  315. forcomebot-2.0.2/web/node_modules/lightningcss/LICENSE +373 -0
  316. forcomebot-2.0.2/web/node_modules/lightningcss/README.md +105 -0
  317. forcomebot-2.0.2/web/node_modules/lightningcss-win32-x64-msvc/LICENSE +373 -0
  318. forcomebot-2.0.2/web/node_modules/lightningcss-win32-x64-msvc/README.md +1 -0
  319. forcomebot-2.0.2/web/node_modules/lodash.merge/LICENSE +47 -0
  320. forcomebot-2.0.2/web/node_modules/lodash.merge/README.md +18 -0
  321. forcomebot-2.0.2/web/node_modules/lru-cache/LICENSE +15 -0
  322. forcomebot-2.0.2/web/node_modules/lru-cache/README.md +166 -0
  323. forcomebot-2.0.2/web/node_modules/magic-string/LICENSE +7 -0
  324. forcomebot-2.0.2/web/node_modules/magic-string/README.md +325 -0
  325. forcomebot-2.0.2/web/node_modules/math-intrinsics/LICENSE +21 -0
  326. forcomebot-2.0.2/web/node_modules/math-intrinsics/README.md +50 -0
  327. forcomebot-2.0.2/web/node_modules/mime-db/LICENSE +23 -0
  328. forcomebot-2.0.2/web/node_modules/mime-db/README.md +100 -0
  329. forcomebot-2.0.2/web/node_modules/mime-types/LICENSE +23 -0
  330. forcomebot-2.0.2/web/node_modules/mime-types/README.md +113 -0
  331. forcomebot-2.0.2/web/node_modules/minimatch/LICENSE +15 -0
  332. forcomebot-2.0.2/web/node_modules/minimatch/README.md +230 -0
  333. forcomebot-2.0.2/web/node_modules/nanoid/LICENSE +20 -0
  334. forcomebot-2.0.2/web/node_modules/nanoid/README.md +39 -0
  335. forcomebot-2.0.2/web/node_modules/natural-compare/README.md +125 -0
  336. forcomebot-2.0.2/web/node_modules/node-releases/LICENSE +21 -0
  337. forcomebot-2.0.2/web/node_modules/node-releases/README.md +12 -0
  338. forcomebot-2.0.2/web/node_modules/optionator/LICENSE +22 -0
  339. forcomebot-2.0.2/web/node_modules/optionator/README.md +238 -0
  340. forcomebot-2.0.2/web/node_modules/picocolors/LICENSE +15 -0
  341. forcomebot-2.0.2/web/node_modules/picocolors/README.md +21 -0
  342. forcomebot-2.0.2/web/node_modules/picomatch/LICENSE +21 -0
  343. forcomebot-2.0.2/web/node_modules/picomatch/README.md +738 -0
  344. forcomebot-2.0.2/web/node_modules/postcss/LICENSE +20 -0
  345. forcomebot-2.0.2/web/node_modules/postcss/README.md +29 -0
  346. forcomebot-2.0.2/web/node_modules/prelude-ls/LICENSE +22 -0
  347. forcomebot-2.0.2/web/node_modules/prelude-ls/README.md +15 -0
  348. forcomebot-2.0.2/web/node_modules/proxy-from-env/LICENSE +20 -0
  349. forcomebot-2.0.2/web/node_modules/proxy-from-env/README.md +131 -0
  350. forcomebot-2.0.2/web/node_modules/punycode/README.md +148 -0
  351. forcomebot-2.0.2/web/node_modules/react/LICENSE +21 -0
  352. forcomebot-2.0.2/web/node_modules/react/README.md +37 -0
  353. forcomebot-2.0.2/web/node_modules/react-dom/LICENSE +21 -0
  354. forcomebot-2.0.2/web/node_modules/react-dom/README.md +60 -0
  355. forcomebot-2.0.2/web/node_modules/react-refresh/LICENSE +21 -0
  356. forcomebot-2.0.2/web/node_modules/react-refresh/README.md +5 -0
  357. forcomebot-2.0.2/web/node_modules/react-router/README.md +7 -0
  358. forcomebot-2.0.2/web/node_modules/react-router-dom/README.md +6 -0
  359. forcomebot-2.0.2/web/node_modules/rolldown/LICENSE +25 -0
  360. forcomebot-2.0.2/web/node_modules/rolldown/node_modules/@rolldown/pluginutils/LICENSE +25 -0
  361. forcomebot-2.0.2/web/node_modules/rolldown/node_modules/@rolldown/pluginutils/README.md +85 -0
  362. forcomebot-2.0.2/web/node_modules/scheduler/LICENSE +21 -0
  363. forcomebot-2.0.2/web/node_modules/scheduler/README.md +9 -0
  364. forcomebot-2.0.2/web/node_modules/semver/LICENSE +15 -0
  365. forcomebot-2.0.2/web/node_modules/semver/README.md +443 -0
  366. forcomebot-2.0.2/web/node_modules/set-cookie-parser/LICENSE +21 -0
  367. forcomebot-2.0.2/web/node_modules/set-cookie-parser/README.md +202 -0
  368. forcomebot-2.0.2/web/node_modules/source-map-js/LICENSE +28 -0
  369. forcomebot-2.0.2/web/node_modules/source-map-js/README.md +765 -0
  370. forcomebot-2.0.2/web/node_modules/tailwindcss/LICENSE +21 -0
  371. forcomebot-2.0.2/web/node_modules/tailwindcss/README.md +36 -0
  372. forcomebot-2.0.2/web/node_modules/tapable/LICENSE +21 -0
  373. forcomebot-2.0.2/web/node_modules/tapable/README.md +332 -0
  374. forcomebot-2.0.2/web/node_modules/tinyglobby/LICENSE +21 -0
  375. forcomebot-2.0.2/web/node_modules/tinyglobby/README.md +25 -0
  376. forcomebot-2.0.2/web/node_modules/ts-api-utils/README.md +40 -0
  377. forcomebot-2.0.2/web/node_modules/tslib/README.md +164 -0
  378. forcomebot-2.0.2/web/node_modules/type-check/LICENSE +22 -0
  379. forcomebot-2.0.2/web/node_modules/type-check/README.md +210 -0
  380. forcomebot-2.0.2/web/node_modules/typescript/README.md +50 -0
  381. forcomebot-2.0.2/web/node_modules/typescript-eslint/LICENSE +21 -0
  382. forcomebot-2.0.2/web/node_modules/typescript-eslint/README.md +12 -0
  383. forcomebot-2.0.2/web/node_modules/undici-types/LICENSE +21 -0
  384. forcomebot-2.0.2/web/node_modules/undici-types/README.md +6 -0
  385. forcomebot-2.0.2/web/node_modules/update-browserslist-db/LICENSE +20 -0
  386. forcomebot-2.0.2/web/node_modules/update-browserslist-db/README.md +30 -0
  387. forcomebot-2.0.2/web/node_modules/uri-js/LICENSE +11 -0
  388. forcomebot-2.0.2/web/node_modules/uri-js/README.md +203 -0
  389. forcomebot-2.0.2/web/node_modules/vite/README.md +20 -0
  390. forcomebot-2.0.2/web/node_modules/which/LICENSE +15 -0
  391. forcomebot-2.0.2/web/node_modules/which/README.md +54 -0
  392. forcomebot-2.0.2/web/node_modules/word-wrap/LICENSE +21 -0
  393. forcomebot-2.0.2/web/node_modules/word-wrap/README.md +201 -0
  394. forcomebot-2.0.2/web/node_modules/yallist/LICENSE +15 -0
  395. forcomebot-2.0.2/web/node_modules/yallist/README.md +204 -0
  396. forcomebot-2.0.2/web/node_modules/zod/LICENSE +21 -0
  397. forcomebot-2.0.2/web/node_modules/zod/README.md +208 -0
  398. forcomebot-2.0.2/web/node_modules/zod-validation-error/LICENSE +9 -0
  399. forcomebot-2.0.2/web/node_modules/zod-validation-error/README.md +504 -0
@@ -0,0 +1,42 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+
28
+ # IDE
29
+ .idea/
30
+ .vscode/
31
+ *.swp
32
+ *.swo
33
+
34
+ # Config with secrets
35
+ config.yaml
36
+
37
+ # Logs
38
+ *.log
39
+
40
+ # OS
41
+ .DS_Store
42
+ Thumbs.db
@@ -0,0 +1,342 @@
1
+ Metadata-Version: 2.4
2
+ Name: ForcomeBot
3
+ Version: 2.0.2
4
+ Summary: FORCOME 康康 - 千寻微信框架Pro与LangBot的中间件
5
+ Project-URL: Homepage, https://github.com/yourname/ForcomeBot
6
+ Project-URL: Documentation, https://github.com/yourname/ForcomeBot#readme
7
+ Project-URL: Repository, https://github.com/yourname/ForcomeBot
8
+ Author-email: Your Name <your@email.com>
9
+ License-Expression: MIT
10
+ Keywords: chatbot,langbot,middleware,onebot,qianxun,wechat
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Communications :: Chat
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: apscheduler>=3.10.0
21
+ Requires-Dist: fastapi>=0.104.0
22
+ Requires-Dist: httpx>=0.25.0
23
+ Requires-Dist: pydantic>=2.0
24
+ Requires-Dist: python-multipart>=0.0.6
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: uvicorn>=0.24.0
27
+ Requires-Dist: websockets>=11.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: hypothesis>=6.0.0; extra == 'dev'
30
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
31
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # FORCOME 康康
35
+
36
+ 这是一个用于连接千寻微信框架Pro和LangBot的中间件,实现微信消息与LangBot AI对话的双向通信。
37
+
38
+ ## 架构
39
+
40
+ ```
41
+ 微信用户 <-> 千寻框架Pro <-> 本中间件 <-> LangBot (OneBot v11)
42
+ ```
43
+
44
+ ## 功能特性
45
+
46
+ - 支持私聊消息
47
+ - 支持群聊消息(@机器人触发)
48
+ - 支持多轮对话(基于用户ID维护会话)
49
+ - 支持图片消息(发送和接收)
50
+ - 支持语音消息(接收)
51
+ - 支持引用消息
52
+ - 支持拍一拍消息
53
+ - 支持多微信账号
54
+ - 入群欢迎功能
55
+ - 昵称检测功能
56
+ - 定时提醒功能
57
+ - 群发功能(文本、图片、文件、分享链接、小程序)
58
+ - Web管理界面(React前端)
59
+ - 配置热更新
60
+ - 指数退避重连机制
61
+ - API重试机制
62
+ - 状态持久化
63
+
64
+ ## 📦 快速开始
65
+
66
+ ### 方式一:uvx 一键启动(推荐)
67
+
68
+ 需要先安装 [uv](https://docs.astral.sh/uv/getting-started/installation/)
69
+
70
+ ```bash
71
+ # 从 PyPI 一键启动(发布后可用)
72
+ uvx ForcomeBot
73
+
74
+ # 或指定 Python 版本
75
+ uvx --python 3.12 ForcomeBot
76
+ ```
77
+
78
+ 首次运行会自动在当前目录创建 `config.yaml` 配置文件,修改配置后重新运行即可。
79
+
80
+ ### 方式二:从源码使用 uvx 启动
81
+
82
+ ```bash
83
+ # 克隆项目
84
+ git clone https://github.com/yourname/ForcomeBot.git
85
+ cd ForcomeBot
86
+
87
+ # 创建并编辑配置文件
88
+ cp config.example.yaml config.yaml
89
+ # 编辑 config.yaml 填入你的配置
90
+
91
+ # 使用 uvx 从本地源码启动
92
+ uvx --from . ForcomeBot
93
+ ```
94
+
95
+ ### 方式三:pip 安装后启动
96
+
97
+ ```bash
98
+ # 从 PyPI 安装(发布后可用)
99
+ pip install ForcomeBot
100
+
101
+ # 或从源码安装
102
+ git clone https://github.com/yourname/ForcomeBot.git
103
+ cd ForcomeBot
104
+ pip install .
105
+
106
+ # 启动
107
+ ForcomeBot
108
+ ```
109
+
110
+ ### 方式四:直接运行 Python
111
+
112
+ ```bash
113
+ git clone https://github.com/yourname/ForcomeBot.git
114
+ cd ForcomeBot
115
+ pip install -r requirements.txt
116
+ python main.py
117
+ ```
118
+
119
+ ### 配置千寻框架
120
+
121
+ 在千寻框架Pro中设置HTTP事件回调地址为:
122
+
123
+ ```
124
+ http://你的IP:8000/qianxun/callback
125
+ ```
126
+
127
+ ## 访问地址
128
+
129
+ 启动后可访问以下地址:
130
+
131
+ | 地址 | 说明 |
132
+ |------|------|
133
+ | `http://IP:8000/app/` | React管理界面 |
134
+ | `http://IP:8000/docs` | API文档(Swagger) |
135
+ | `http://IP:8000/health` | 健康检查 |
136
+ | `ws://IP:8000/api/ws` | WebSocket实时推送 |
137
+
138
+ ## 配置说明
139
+
140
+ ```yaml
141
+ # 中间件服务配置
142
+ server:
143
+ host: "0.0.0.0"
144
+ port: 8000
145
+
146
+ # 千寻框架配置
147
+ qianxun:
148
+ api_url: "http://127.0.0.1:7777/qianxun/httpapi"
149
+ robot_wxid: "wxid_xxx" # 机器人微信ID
150
+
151
+ # LangBot配置(OneBot v11 WebSocket)
152
+ langbot:
153
+ ws_host: "127.0.0.1"
154
+ ws_port: 2280
155
+ access_token: "" # 可选
156
+
157
+ # 消息限流配置
158
+ rate_limit:
159
+ min_interval: 1 # 最小发送间隔(秒)
160
+ max_interval: 3 # 最大发送间隔(秒)
161
+
162
+ # 消息分段发送
163
+ message_split:
164
+ enabled: false
165
+ separator: "/!"
166
+ min_delay: 1
167
+ max_delay: 3
168
+
169
+ # 过滤配置
170
+ filter:
171
+ ignore_wxids: [] # 忽略的wxid列表
172
+ reply_at_all: false # 是否回复@所有人
173
+
174
+ # 入群欢迎配置
175
+ welcome:
176
+ - target_groups: ["xxx@chatroom"]
177
+ message: "欢迎加入!"
178
+
179
+ # 昵称检测配置
180
+ nickname_check:
181
+ - task_id: "check1"
182
+ enabled: true
183
+ cron: "0 9 * * *"
184
+ target_groups: ["xxx@chatroom"]
185
+ regex: "^[\\u4e00-\\u9fa5]+$"
186
+ message_tpl: "⚠️ @{user} 请修改昵称"
187
+ exclude_users: []
188
+
189
+ # 定时提醒配置
190
+ scheduled_reminders:
191
+ - task_name: "daily_reminder"
192
+ enabled: true
193
+ cron: "0 9 * * *"
194
+ target_groups: ["xxx@chatroom"]
195
+ mention_users: ["all"]
196
+ content: "早上好!"
197
+
198
+ # 日志配置
199
+ logging:
200
+ level: "INFO"
201
+ ```
202
+
203
+ ## 目录结构
204
+
205
+ ```
206
+ forcome-kangkang/
207
+ ├── main.py # 主程序入口
208
+ ├── config.yaml # 配置文件
209
+ ├── config.example.yaml # 配置文件示例
210
+ ├── pyproject.toml # 项目配置
211
+ ├── requirements.txt # Python依赖
212
+ ├── data/ # 持久化数据目录
213
+ │ └── state.json # 状态数据
214
+ ├── src/
215
+ │ ├── __init__.py # 模块导出
216
+ │ ├── models.py # 数据模型
217
+ │ ├── web.py # 旧版Web路由(兼容)
218
+ │ │
219
+ │ ├── core/ # 核心服务层
220
+ │ │ ├── config_manager.py # 配置管理器
221
+ │ │ ├── state_store.py # 状态存储器
222
+ │ │ └── log_collector.py # 日志收集器
223
+ │ │
224
+ │ ├── clients/ # 客户端层
225
+ │ │ ├── qianxun.py # 千寻客户端(带重试)
226
+ │ │ └── langbot.py # LangBot客户端(带重连)
227
+ │ │
228
+ │ ├── handlers/ # 业务处理层
229
+ │ │ ├── message_handler.py # 消息处理器
230
+ │ │ ├── message_parser.py # 消息解析器
231
+ │ │ └── scheduler.py # 定时任务调度器
232
+ │ │
233
+ │ ├── utils/ # 工具模块
234
+ │ │ ├── text_processor.py # 文本处理(换行符、emoji)
235
+ │ │ └── xml_parser.py # XML解析工具
236
+ │ │
237
+ │ └── api/ # API层
238
+ │ ├── routes.py # RESTful API路由
239
+ │ └── websocket.py # WebSocket处理
240
+
241
+ ├── web/ # React前端
242
+ │ ├── src/
243
+ │ │ ├── api/ # API调用
244
+ │ │ ├── components/ # 组件
245
+ │ │ ├── pages/ # 页面
246
+ │ │ └── hooks/ # 自定义hooks
247
+ │ └── dist/ # 构建产物
248
+
249
+ └── tests/ # 测试
250
+ ├── test_infrastructure.py # 基础设施测试
251
+ ├── test_clients.py # 客户端测试
252
+ └── test_handlers.py # 处理器测试
253
+ ```
254
+
255
+ ## 模块说明
256
+
257
+ ### 核心服务层 (src/core/)
258
+
259
+ | 模块 | 说明 |
260
+ |------|------|
261
+ | ConfigManager | 配置管理器,支持热更新、验证、观察者模式 |
262
+ | StateStore | 状态存储器,管理消息去重、图片缓存、ID映射,支持持久化 |
263
+ | LogCollector | 日志收集器,支持WebSocket实时推送 |
264
+
265
+ ### 客户端层 (src/clients/)
266
+
267
+ | 模块 | 说明 |
268
+ |------|------|
269
+ | QianXunClient | 千寻框架HTTP API客户端,带自动重试(最多3次) |
270
+ | LangBotClient | LangBot OneBot v11 WebSocket客户端,带指数退避重连 |
271
+
272
+ ### 业务处理层 (src/handlers/)
273
+
274
+ | 模块 | 说明 |
275
+ |------|------|
276
+ | MessageParser | 消息解析器,统一处理各种消息类型 |
277
+ | MessageHandler | 消息处理器,处理私聊/群聊消息 |
278
+ | TaskScheduler | 定时任务调度器,支持昵称检测和定时提醒 |
279
+
280
+ ### 工具模块 (src/utils/)
281
+
282
+ | 模块 | 说明 |
283
+ |------|------|
284
+ | TextProcessor | 文本处理,换行符转换、emoji编解码 |
285
+ | XMLParser | XML解析,处理引用消息、拍一拍、语音等 |
286
+
287
+ ## API接口
288
+
289
+ ### RESTful API
290
+
291
+ | 方法 | 路径 | 说明 |
292
+ |------|------|------|
293
+ | GET | /api/config | 获取配置 |
294
+ | POST | /api/config | 更新配置 |
295
+ | POST | /api/config/validate | 验证配置 |
296
+ | GET | /api/status | 获取系统状态 |
297
+ | GET | /api/status/langbot | 获取LangBot连接状态 |
298
+ | GET | /api/status/memory | 获取内存使用情况 |
299
+ | GET | /api/logs | 获取消息日志 |
300
+ | GET | /api/tasks | 获取定时任务列表 |
301
+ | POST | /api/tasks/{id}/run | 手动执行任务 |
302
+ | GET | /api/tasks/history | 获取任务执行历史 |
303
+ | POST | /api/cache/clear | 清理缓存 |
304
+ | GET | /api/chatrooms | 获取群聊列表 |
305
+ | GET | /api/friends | 获取好友列表 |
306
+ | GET | /api/group_members/{id} | 获取群成员列表 |
307
+ | GET | /api/robot_info | 获取机器人信息 |
308
+
309
+ ### WebSocket
310
+
311
+ 连接 `ws://IP:8000/api/ws` 可接收实时推送:
312
+
313
+ ```json
314
+ {"type": "log", "data": {...}} // 消息日志
315
+ {"type": "status", "data": {...}} // 状态变更
316
+ ```
317
+
318
+ ## 开发
319
+
320
+ ### 安装开发依赖
321
+
322
+ ```bash
323
+ pip install -e ".[dev]"
324
+ ```
325
+
326
+ ### 运行测试
327
+
328
+ ```bash
329
+ pytest
330
+ ```
331
+
332
+ ### 构建前端
333
+
334
+ ```bash
335
+ cd web
336
+ npm install
337
+ npm run build
338
+ ```
339
+
340
+ ## License
341
+
342
+ MIT
@@ -0,0 +1,309 @@
1
+ # FORCOME 康康
2
+
3
+ 这是一个用于连接千寻微信框架Pro和LangBot的中间件,实现微信消息与LangBot AI对话的双向通信。
4
+
5
+ ## 架构
6
+
7
+ ```
8
+ 微信用户 <-> 千寻框架Pro <-> 本中间件 <-> LangBot (OneBot v11)
9
+ ```
10
+
11
+ ## 功能特性
12
+
13
+ - 支持私聊消息
14
+ - 支持群聊消息(@机器人触发)
15
+ - 支持多轮对话(基于用户ID维护会话)
16
+ - 支持图片消息(发送和接收)
17
+ - 支持语音消息(接收)
18
+ - 支持引用消息
19
+ - 支持拍一拍消息
20
+ - 支持多微信账号
21
+ - 入群欢迎功能
22
+ - 昵称检测功能
23
+ - 定时提醒功能
24
+ - 群发功能(文本、图片、文件、分享链接、小程序)
25
+ - Web管理界面(React前端)
26
+ - 配置热更新
27
+ - 指数退避重连机制
28
+ - API重试机制
29
+ - 状态持久化
30
+
31
+ ## 📦 快速开始
32
+
33
+ ### 方式一:uvx 一键启动(推荐)
34
+
35
+ 需要先安装 [uv](https://docs.astral.sh/uv/getting-started/installation/)
36
+
37
+ ```bash
38
+ # 从 PyPI 一键启动(发布后可用)
39
+ uvx ForcomeBot
40
+
41
+ # 或指定 Python 版本
42
+ uvx --python 3.12 ForcomeBot
43
+ ```
44
+
45
+ 首次运行会自动在当前目录创建 `config.yaml` 配置文件,修改配置后重新运行即可。
46
+
47
+ ### 方式二:从源码使用 uvx 启动
48
+
49
+ ```bash
50
+ # 克隆项目
51
+ git clone https://github.com/yourname/ForcomeBot.git
52
+ cd ForcomeBot
53
+
54
+ # 创建并编辑配置文件
55
+ cp config.example.yaml config.yaml
56
+ # 编辑 config.yaml 填入你的配置
57
+
58
+ # 使用 uvx 从本地源码启动
59
+ uvx --from . ForcomeBot
60
+ ```
61
+
62
+ ### 方式三:pip 安装后启动
63
+
64
+ ```bash
65
+ # 从 PyPI 安装(发布后可用)
66
+ pip install ForcomeBot
67
+
68
+ # 或从源码安装
69
+ git clone https://github.com/yourname/ForcomeBot.git
70
+ cd ForcomeBot
71
+ pip install .
72
+
73
+ # 启动
74
+ ForcomeBot
75
+ ```
76
+
77
+ ### 方式四:直接运行 Python
78
+
79
+ ```bash
80
+ git clone https://github.com/yourname/ForcomeBot.git
81
+ cd ForcomeBot
82
+ pip install -r requirements.txt
83
+ python main.py
84
+ ```
85
+
86
+ ### 配置千寻框架
87
+
88
+ 在千寻框架Pro中设置HTTP事件回调地址为:
89
+
90
+ ```
91
+ http://你的IP:8000/qianxun/callback
92
+ ```
93
+
94
+ ## 访问地址
95
+
96
+ 启动后可访问以下地址:
97
+
98
+ | 地址 | 说明 |
99
+ |------|------|
100
+ | `http://IP:8000/app/` | React管理界面 |
101
+ | `http://IP:8000/docs` | API文档(Swagger) |
102
+ | `http://IP:8000/health` | 健康检查 |
103
+ | `ws://IP:8000/api/ws` | WebSocket实时推送 |
104
+
105
+ ## 配置说明
106
+
107
+ ```yaml
108
+ # 中间件服务配置
109
+ server:
110
+ host: "0.0.0.0"
111
+ port: 8000
112
+
113
+ # 千寻框架配置
114
+ qianxun:
115
+ api_url: "http://127.0.0.1:7777/qianxun/httpapi"
116
+ robot_wxid: "wxid_xxx" # 机器人微信ID
117
+
118
+ # LangBot配置(OneBot v11 WebSocket)
119
+ langbot:
120
+ ws_host: "127.0.0.1"
121
+ ws_port: 2280
122
+ access_token: "" # 可选
123
+
124
+ # 消息限流配置
125
+ rate_limit:
126
+ min_interval: 1 # 最小发送间隔(秒)
127
+ max_interval: 3 # 最大发送间隔(秒)
128
+
129
+ # 消息分段发送
130
+ message_split:
131
+ enabled: false
132
+ separator: "/!"
133
+ min_delay: 1
134
+ max_delay: 3
135
+
136
+ # 过滤配置
137
+ filter:
138
+ ignore_wxids: [] # 忽略的wxid列表
139
+ reply_at_all: false # 是否回复@所有人
140
+
141
+ # 入群欢迎配置
142
+ welcome:
143
+ - target_groups: ["xxx@chatroom"]
144
+ message: "欢迎加入!"
145
+
146
+ # 昵称检测配置
147
+ nickname_check:
148
+ - task_id: "check1"
149
+ enabled: true
150
+ cron: "0 9 * * *"
151
+ target_groups: ["xxx@chatroom"]
152
+ regex: "^[\\u4e00-\\u9fa5]+$"
153
+ message_tpl: "⚠️ @{user} 请修改昵称"
154
+ exclude_users: []
155
+
156
+ # 定时提醒配置
157
+ scheduled_reminders:
158
+ - task_name: "daily_reminder"
159
+ enabled: true
160
+ cron: "0 9 * * *"
161
+ target_groups: ["xxx@chatroom"]
162
+ mention_users: ["all"]
163
+ content: "早上好!"
164
+
165
+ # 日志配置
166
+ logging:
167
+ level: "INFO"
168
+ ```
169
+
170
+ ## 目录结构
171
+
172
+ ```
173
+ forcome-kangkang/
174
+ ├── main.py # 主程序入口
175
+ ├── config.yaml # 配置文件
176
+ ├── config.example.yaml # 配置文件示例
177
+ ├── pyproject.toml # 项目配置
178
+ ├── requirements.txt # Python依赖
179
+ ├── data/ # 持久化数据目录
180
+ │ └── state.json # 状态数据
181
+ ├── src/
182
+ │ ├── __init__.py # 模块导出
183
+ │ ├── models.py # 数据模型
184
+ │ ├── web.py # 旧版Web路由(兼容)
185
+ │ │
186
+ │ ├── core/ # 核心服务层
187
+ │ │ ├── config_manager.py # 配置管理器
188
+ │ │ ├── state_store.py # 状态存储器
189
+ │ │ └── log_collector.py # 日志收集器
190
+ │ │
191
+ │ ├── clients/ # 客户端层
192
+ │ │ ├── qianxun.py # 千寻客户端(带重试)
193
+ │ │ └── langbot.py # LangBot客户端(带重连)
194
+ │ │
195
+ │ ├── handlers/ # 业务处理层
196
+ │ │ ├── message_handler.py # 消息处理器
197
+ │ │ ├── message_parser.py # 消息解析器
198
+ │ │ └── scheduler.py # 定时任务调度器
199
+ │ │
200
+ │ ├── utils/ # 工具模块
201
+ │ │ ├── text_processor.py # 文本处理(换行符、emoji)
202
+ │ │ └── xml_parser.py # XML解析工具
203
+ │ │
204
+ │ └── api/ # API层
205
+ │ ├── routes.py # RESTful API路由
206
+ │ └── websocket.py # WebSocket处理
207
+
208
+ ├── web/ # React前端
209
+ │ ├── src/
210
+ │ │ ├── api/ # API调用
211
+ │ │ ├── components/ # 组件
212
+ │ │ ├── pages/ # 页面
213
+ │ │ └── hooks/ # 自定义hooks
214
+ │ └── dist/ # 构建产物
215
+
216
+ └── tests/ # 测试
217
+ ├── test_infrastructure.py # 基础设施测试
218
+ ├── test_clients.py # 客户端测试
219
+ └── test_handlers.py # 处理器测试
220
+ ```
221
+
222
+ ## 模块说明
223
+
224
+ ### 核心服务层 (src/core/)
225
+
226
+ | 模块 | 说明 |
227
+ |------|------|
228
+ | ConfigManager | 配置管理器,支持热更新、验证、观察者模式 |
229
+ | StateStore | 状态存储器,管理消息去重、图片缓存、ID映射,支持持久化 |
230
+ | LogCollector | 日志收集器,支持WebSocket实时推送 |
231
+
232
+ ### 客户端层 (src/clients/)
233
+
234
+ | 模块 | 说明 |
235
+ |------|------|
236
+ | QianXunClient | 千寻框架HTTP API客户端,带自动重试(最多3次) |
237
+ | LangBotClient | LangBot OneBot v11 WebSocket客户端,带指数退避重连 |
238
+
239
+ ### 业务处理层 (src/handlers/)
240
+
241
+ | 模块 | 说明 |
242
+ |------|------|
243
+ | MessageParser | 消息解析器,统一处理各种消息类型 |
244
+ | MessageHandler | 消息处理器,处理私聊/群聊消息 |
245
+ | TaskScheduler | 定时任务调度器,支持昵称检测和定时提醒 |
246
+
247
+ ### 工具模块 (src/utils/)
248
+
249
+ | 模块 | 说明 |
250
+ |------|------|
251
+ | TextProcessor | 文本处理,换行符转换、emoji编解码 |
252
+ | XMLParser | XML解析,处理引用消息、拍一拍、语音等 |
253
+
254
+ ## API接口
255
+
256
+ ### RESTful API
257
+
258
+ | 方法 | 路径 | 说明 |
259
+ |------|------|------|
260
+ | GET | /api/config | 获取配置 |
261
+ | POST | /api/config | 更新配置 |
262
+ | POST | /api/config/validate | 验证配置 |
263
+ | GET | /api/status | 获取系统状态 |
264
+ | GET | /api/status/langbot | 获取LangBot连接状态 |
265
+ | GET | /api/status/memory | 获取内存使用情况 |
266
+ | GET | /api/logs | 获取消息日志 |
267
+ | GET | /api/tasks | 获取定时任务列表 |
268
+ | POST | /api/tasks/{id}/run | 手动执行任务 |
269
+ | GET | /api/tasks/history | 获取任务执行历史 |
270
+ | POST | /api/cache/clear | 清理缓存 |
271
+ | GET | /api/chatrooms | 获取群聊列表 |
272
+ | GET | /api/friends | 获取好友列表 |
273
+ | GET | /api/group_members/{id} | 获取群成员列表 |
274
+ | GET | /api/robot_info | 获取机器人信息 |
275
+
276
+ ### WebSocket
277
+
278
+ 连接 `ws://IP:8000/api/ws` 可接收实时推送:
279
+
280
+ ```json
281
+ {"type": "log", "data": {...}} // 消息日志
282
+ {"type": "status", "data": {...}} // 状态变更
283
+ ```
284
+
285
+ ## 开发
286
+
287
+ ### 安装开发依赖
288
+
289
+ ```bash
290
+ pip install -e ".[dev]"
291
+ ```
292
+
293
+ ### 运行测试
294
+
295
+ ```bash
296
+ pytest
297
+ ```
298
+
299
+ ### 构建前端
300
+
301
+ ```bash
302
+ cd web
303
+ npm install
304
+ npm run build
305
+ ```
306
+
307
+ ## License
308
+
309
+ MIT