foxclaw 0.1.0__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 (280) hide show
  1. foxclaw-0.1.0/PKG-INFO +46 -0
  2. foxclaw-0.1.0/README.md +130 -0
  3. foxclaw-0.1.0/foxclaw/__init__.py +526 -0
  4. foxclaw-0.1.0/foxclaw/agents/__init__.py +12 -0
  5. foxclaw-0.1.0/foxclaw/agents/agents.py +35 -0
  6. foxclaw-0.1.0/foxclaw/agents/base.py +856 -0
  7. foxclaw-0.1.0/foxclaw/agents/impl/__init__.py +1 -0
  8. foxclaw-0.1.0/foxclaw/agents/impl/_helpers.py +78 -0
  9. foxclaw-0.1.0/foxclaw/agents/impl/finance.py +248 -0
  10. foxclaw-0.1.0/foxclaw/agents/impl/office.py +367 -0
  11. foxclaw-0.1.0/foxclaw/agents/impl/supervisor.py +659 -0
  12. foxclaw-0.1.0/foxclaw/agents/mixins/_context.py +130 -0
  13. foxclaw-0.1.0/foxclaw/agents/mixins/augment.py +149 -0
  14. foxclaw-0.1.0/foxclaw/agents/mixins/llm.py +66 -0
  15. foxclaw-0.1.0/foxclaw/agents/mixins/memory.py +35 -0
  16. foxclaw-0.1.0/foxclaw/agents/mixins/preference.py +81 -0
  17. foxclaw-0.1.0/foxclaw/agents/mixins/prompt.py +77 -0
  18. foxclaw-0.1.0/foxclaw/agents/mixins/skillbox.py +48 -0
  19. foxclaw-0.1.0/foxclaw/agents/mixins/tool_exec.py +431 -0
  20. foxclaw-0.1.0/foxclaw/api/__init__.py +280 -0
  21. foxclaw-0.1.0/foxclaw/api/app.py +123 -0
  22. foxclaw-0.1.0/foxclaw/api/middleware.py +281 -0
  23. foxclaw-0.1.0/foxclaw/api/routes/ahs.py +417 -0
  24. foxclaw-0.1.0/foxclaw/api/routes/attachments.py +117 -0
  25. foxclaw-0.1.0/foxclaw/api/routes/browser.py +39 -0
  26. foxclaw-0.1.0/foxclaw/api/routes/domain.py +297 -0
  27. foxclaw-0.1.0/foxclaw/api/routes/knowledge.py +163 -0
  28. foxclaw-0.1.0/foxclaw/api/routes/llm_admin.py +449 -0
  29. foxclaw-0.1.0/foxclaw/api/routes/memory.py +89 -0
  30. foxclaw-0.1.0/foxclaw/api/routes/orchestration.py +41 -0
  31. foxclaw-0.1.0/foxclaw/api/routes/recovery.py +43 -0
  32. foxclaw-0.1.0/foxclaw/api/routes/review.py +275 -0
  33. foxclaw-0.1.0/foxclaw/api/routes/search.py +37 -0
  34. foxclaw-0.1.0/foxclaw/api/routes/system.py +327 -0
  35. foxclaw-0.1.0/foxclaw/api/routes/task.py +281 -0
  36. foxclaw-0.1.0/foxclaw/api/routes/ws.py +68 -0
  37. foxclaw-0.1.0/foxclaw/api/spine.py +55 -0
  38. foxclaw-0.1.0/foxclaw/browser/__init__.py +13 -0
  39. foxclaw-0.1.0/foxclaw/browser/action/__init__.py +1 -0
  40. foxclaw-0.1.0/foxclaw/browser/action/action_executor.py +54 -0
  41. foxclaw-0.1.0/foxclaw/browser/action/action_types.py +45 -0
  42. foxclaw-0.1.0/foxclaw/browser/action/action_verifier.py +68 -0
  43. foxclaw-0.1.0/foxclaw/browser/action/url_policy.py +77 -0
  44. foxclaw-0.1.0/foxclaw/browser/adapter/__init__.py +1 -0
  45. foxclaw-0.1.0/foxclaw/browser/adapter/base_adapter.py +23 -0
  46. foxclaw-0.1.0/foxclaw/browser/adapter/web_adapter.py +46 -0
  47. foxclaw-0.1.0/foxclaw/browser/driver/__init__.py +1 -0
  48. foxclaw-0.1.0/foxclaw/browser/driver/base_driver.py +61 -0
  49. foxclaw-0.1.0/foxclaw/browser/driver/playwright_driver.py +123 -0
  50. foxclaw-0.1.0/foxclaw/browser/perception/__init__.py +1 -0
  51. foxclaw-0.1.0/foxclaw/browser/perception/dom_extractor.py +43 -0
  52. foxclaw-0.1.0/foxclaw/browser/perception/element_indexer.py +57 -0
  53. foxclaw-0.1.0/foxclaw/browser/perception/semantic_reducer.py +33 -0
  54. foxclaw-0.1.0/foxclaw/browser/perception/snapshot.py +29 -0
  55. foxclaw-0.1.0/foxclaw/browser/service.py +148 -0
  56. foxclaw-0.1.0/foxclaw/browser/session/__init__.py +1 -0
  57. foxclaw-0.1.0/foxclaw/browser/session/session_manager.py +57 -0
  58. foxclaw-0.1.0/foxclaw/capability/__init__.py +12 -0
  59. foxclaw-0.1.0/foxclaw/capability/embedding_service.py +67 -0
  60. foxclaw-0.1.0/foxclaw/channels/__init__.py +140 -0
  61. foxclaw-0.1.0/foxclaw/channels/discord.py +184 -0
  62. foxclaw-0.1.0/foxclaw/channels/dispatcher.py +190 -0
  63. foxclaw-0.1.0/foxclaw/channels/feishu.py +225 -0
  64. foxclaw-0.1.0/foxclaw/channels/openclaw_bridge.py +156 -0
  65. foxclaw-0.1.0/foxclaw/channels/signing.py +187 -0
  66. foxclaw-0.1.0/foxclaw/channels/telegram.py +121 -0
  67. foxclaw-0.1.0/foxclaw/channels/weixin.py +225 -0
  68. foxclaw-0.1.0/foxclaw/cli.py +154 -0
  69. foxclaw-0.1.0/foxclaw/cognitive/__init__.py +4 -0
  70. foxclaw-0.1.0/foxclaw/cognitive/reasoner.py +82 -0
  71. foxclaw-0.1.0/foxclaw/cognitive/state.py +147 -0
  72. foxclaw-0.1.0/foxclaw/core/__init__.py +9 -0
  73. foxclaw-0.1.0/foxclaw/core/audit_sink.py +90 -0
  74. foxclaw-0.1.0/foxclaw/core/compaction.py +283 -0
  75. foxclaw-0.1.0/foxclaw/core/config.py +65 -0
  76. foxclaw-0.1.0/foxclaw/core/confirm_nonce.py +157 -0
  77. foxclaw-0.1.0/foxclaw/core/dispatch.py +27 -0
  78. foxclaw-0.1.0/foxclaw/core/failure_policy.py +151 -0
  79. foxclaw-0.1.0/foxclaw/core/gateway.py +85 -0
  80. foxclaw-0.1.0/foxclaw/core/governance_audit.py +153 -0
  81. foxclaw-0.1.0/foxclaw/core/idempotency.py +289 -0
  82. foxclaw-0.1.0/foxclaw/core/injection_guard.py +207 -0
  83. foxclaw-0.1.0/foxclaw/core/memory_adapter.py +462 -0
  84. foxclaw-0.1.0/foxclaw/core/metrics.py +89 -0
  85. foxclaw-0.1.0/foxclaw/core/model_router.py +1103 -0
  86. foxclaw-0.1.0/foxclaw/core/recovery.py +362 -0
  87. foxclaw-0.1.0/foxclaw/core/scheduler.py +144 -0
  88. foxclaw-0.1.0/foxclaw/core/sessions.py +157 -0
  89. foxclaw-0.1.0/foxclaw/core/settings.py +426 -0
  90. foxclaw-0.1.0/foxclaw/core/shared_write.py +198 -0
  91. foxclaw-0.1.0/foxclaw/core/steering_queue.py +153 -0
  92. foxclaw-0.1.0/foxclaw/core/system_bus.py +84 -0
  93. foxclaw-0.1.0/foxclaw/core/thought_chain.py +318 -0
  94. foxclaw-0.1.0/foxclaw/core/token_meter.py +235 -0
  95. foxclaw-0.1.0/foxclaw/core/tools.py +172 -0
  96. foxclaw-0.1.0/foxclaw/core/tracing.py +390 -0
  97. foxclaw-0.1.0/foxclaw/core/truth_pipeline.py +114 -0
  98. foxclaw-0.1.0/foxclaw/core/verify.py +181 -0
  99. foxclaw-0.1.0/foxclaw/core/web_search.py +242 -0
  100. foxclaw-0.1.0/foxclaw/finance/__init__.py +15 -0
  101. foxclaw-0.1.0/foxclaw/finance/evidence.py +153 -0
  102. foxclaw-0.1.0/foxclaw/finance/fx.py +100 -0
  103. foxclaw-0.1.0/foxclaw/finance/graph.py +188 -0
  104. foxclaw-0.1.0/foxclaw/finance/models.py +150 -0
  105. foxclaw-0.1.0/foxclaw/finance/nlparse.py +575 -0
  106. foxclaw-0.1.0/foxclaw/finance/policy.py +329 -0
  107. foxclaw-0.1.0/foxclaw/finance/reasoner.py +129 -0
  108. foxclaw-0.1.0/foxclaw/finance/reasoning.py +340 -0
  109. foxclaw-0.1.0/foxclaw/finance/reconcile.py +180 -0
  110. foxclaw-0.1.0/foxclaw/finance/runtime.py +527 -0
  111. foxclaw-0.1.0/foxclaw/governance/__init__.py +24 -0
  112. foxclaw-0.1.0/foxclaw/governance/middleware.py +184 -0
  113. foxclaw-0.1.0/foxclaw/harness/__init__.py +17 -0
  114. foxclaw-0.1.0/foxclaw/harness/_base.py +72 -0
  115. foxclaw-0.1.0/foxclaw/harness/_policy.py +359 -0
  116. foxclaw-0.1.0/foxclaw/harness/drift.py +89 -0
  117. foxclaw-0.1.0/foxclaw/harness/event_bus.py +31 -0
  118. foxclaw-0.1.0/foxclaw/harness/harness.py +446 -0
  119. foxclaw-0.1.0/foxclaw/harness/loop_detection.py +152 -0
  120. foxclaw-0.1.0/foxclaw/itinerary/__init__.py +10 -0
  121. foxclaw-0.1.0/foxclaw/itinerary/amap_client.py +117 -0
  122. foxclaw-0.1.0/foxclaw/itinerary/models.py +80 -0
  123. foxclaw-0.1.0/foxclaw/itinerary/reasoner.py +101 -0
  124. foxclaw-0.1.0/foxclaw/itinerary/reasoning.py +174 -0
  125. foxclaw-0.1.0/foxclaw/itinerary/runtime.py +148 -0
  126. foxclaw-0.1.0/foxclaw/kernel/__init__.py +13 -0
  127. foxclaw-0.1.0/foxclaw/kernel/capabilities.py +73 -0
  128. foxclaw-0.1.0/foxclaw/kernel/policy_gate.py +107 -0
  129. foxclaw-0.1.0/foxclaw/kernel/process_manager.py +205 -0
  130. foxclaw-0.1.0/foxclaw/kernel/scheduler.py +131 -0
  131. foxclaw-0.1.0/foxclaw/kernel/sentinel.py +453 -0
  132. foxclaw-0.1.0/foxclaw/kernel/sentinel_client.py +246 -0
  133. foxclaw-0.1.0/foxclaw/kernel/spine.py +97 -0
  134. foxclaw-0.1.0/foxclaw/knowledge/__init__.py +371 -0
  135. foxclaw-0.1.0/foxclaw/knowledge/truth_crystallizer.py +92 -0
  136. foxclaw-0.1.0/foxclaw/learning/__init__.py +12 -0
  137. foxclaw-0.1.0/foxclaw/learning/knowledge_graph.py +149 -0
  138. foxclaw-0.1.0/foxclaw/learning/models.py +93 -0
  139. foxclaw-0.1.0/foxclaw/learning/reasoner.py +70 -0
  140. foxclaw-0.1.0/foxclaw/learning/runtime.py +363 -0
  141. foxclaw-0.1.0/foxclaw/learning/spaced_repetition.py +96 -0
  142. foxclaw-0.1.0/foxclaw/mcp_server.py +147 -0
  143. foxclaw-0.1.0/foxclaw/orchestration/__init__.py +184 -0
  144. foxclaw-0.1.0/foxclaw/pipeline/__init__.py +23 -0
  145. foxclaw-0.1.0/foxclaw/pipeline/cognitive_pipeline.py +481 -0
  146. foxclaw-0.1.0/foxclaw/pipeline/supervisor_stages.py +230 -0
  147. foxclaw-0.1.0/foxclaw/planning/__init__.py +17 -0
  148. foxclaw-0.1.0/foxclaw/planning/llm_planner.py +232 -0
  149. foxclaw-0.1.0/foxclaw/planning/planner.py +99 -0
  150. foxclaw-0.1.0/foxclaw/search/__init__.py +24 -0
  151. foxclaw-0.1.0/foxclaw/search/agent_port.py +194 -0
  152. foxclaw-0.1.0/foxclaw/search/evidence.py +113 -0
  153. foxclaw-0.1.0/foxclaw/search/external_search.py +50 -0
  154. foxclaw-0.1.0/foxclaw/search/hkc_read_port.py +60 -0
  155. foxclaw-0.1.0/foxclaw/search/internal_search.py +73 -0
  156. foxclaw-0.1.0/foxclaw/search/models.py +129 -0
  157. foxclaw-0.1.0/foxclaw/search/planner.py +44 -0
  158. foxclaw-0.1.0/foxclaw/search/retriever.py +39 -0
  159. foxclaw-0.1.0/foxclaw/search/runtime.py +134 -0
  160. foxclaw-0.1.0/foxclaw/search/strategy.py +44 -0
  161. foxclaw-0.1.0/foxclaw/skills/__init__.py +601 -0
  162. foxclaw-0.1.0/foxclaw/skills/hooks_spec.py +73 -0
  163. foxclaw-0.1.0/foxclaw/skills/lifecycle.py +278 -0
  164. foxclaw-0.1.0/foxclaw/skills/markdown_skill.py +174 -0
  165. foxclaw-0.1.0/foxclaw/skills/markdown_store.py +39 -0
  166. foxclaw-0.1.0/foxclaw/skills/mcp_client.py +190 -0
  167. foxclaw-0.1.0/foxclaw/skills/mcp_store.py +43 -0
  168. foxclaw-0.1.0/foxclaw/skills/permission.py +178 -0
  169. foxclaw-0.1.0/foxclaw/skills/pipeline.py +386 -0
  170. foxclaw-0.1.0/foxclaw/skills/policy.py +80 -0
  171. foxclaw-0.1.0/foxclaw/skills/review.py +72 -0
  172. foxclaw-0.1.0/foxclaw/skills/store.py +57 -0
  173. foxclaw-0.1.0/foxclaw.egg-info/PKG-INFO +46 -0
  174. foxclaw-0.1.0/foxclaw.egg-info/SOURCES.txt +278 -0
  175. foxclaw-0.1.0/foxclaw.egg-info/dependency_links.txt +1 -0
  176. foxclaw-0.1.0/foxclaw.egg-info/entry_points.txt +2 -0
  177. foxclaw-0.1.0/foxclaw.egg-info/requires.txt +46 -0
  178. foxclaw-0.1.0/foxclaw.egg-info/top_level.txt +2 -0
  179. foxclaw-0.1.0/pyproject.toml +231 -0
  180. foxclaw-0.1.0/setup.cfg +4 -0
  181. foxclaw-0.1.0/tests/test_agent_lifecycle.py +360 -0
  182. foxclaw-0.1.0/tests/test_ahs_p2.py +414 -0
  183. foxclaw-0.1.0/tests/test_anthropic_tools.py +206 -0
  184. foxclaw-0.1.0/tests/test_api.py +87 -0
  185. foxclaw-0.1.0/tests/test_api_auth.py +83 -0
  186. foxclaw-0.1.0/tests/test_api_host_guard.py +69 -0
  187. foxclaw-0.1.0/tests/test_attachments.py +167 -0
  188. foxclaw-0.1.0/tests/test_audit_sink.py +136 -0
  189. foxclaw-0.1.0/tests/test_browser.py +153 -0
  190. foxclaw-0.1.0/tests/test_capabilities.py +158 -0
  191. foxclaw-0.1.0/tests/test_channel_signing.py +192 -0
  192. foxclaw-0.1.0/tests/test_channel_trust.py +91 -0
  193. foxclaw-0.1.0/tests/test_channels.py +184 -0
  194. foxclaw-0.1.0/tests/test_cli.py +46 -0
  195. foxclaw-0.1.0/tests/test_compaction_toolpair.py +119 -0
  196. foxclaw-0.1.0/tests/test_config_layering.py +65 -0
  197. foxclaw-0.1.0/tests/test_confirm_nonce.py +197 -0
  198. foxclaw-0.1.0/tests/test_context_compaction_wiring.py +130 -0
  199. foxclaw-0.1.0/tests/test_dispatch.py +95 -0
  200. foxclaw-0.1.0/tests/test_domain_evals.py +403 -0
  201. foxclaw-0.1.0/tests/test_domain_import.py +78 -0
  202. foxclaw-0.1.0/tests/test_domain_reasoners.py +148 -0
  203. foxclaw-0.1.0/tests/test_e2e.py +178 -0
  204. foxclaw-0.1.0/tests/test_emb_cache.py +107 -0
  205. foxclaw-0.1.0/tests/test_embedding_singleton.py +89 -0
  206. foxclaw-0.1.0/tests/test_evals_smoke.py +114 -0
  207. foxclaw-0.1.0/tests/test_event_spine.py +182 -0
  208. foxclaw-0.1.0/tests/test_evidence_semantic.py +101 -0
  209. foxclaw-0.1.0/tests/test_evidence_sse.py +97 -0
  210. foxclaw-0.1.0/tests/test_file_ingest.py +146 -0
  211. foxclaw-0.1.0/tests/test_finance.py +153 -0
  212. foxclaw-0.1.0/tests/test_finance_ledger.py +252 -0
  213. foxclaw-0.1.0/tests/test_finance_persist.py +178 -0
  214. foxclaw-0.1.0/tests/test_gateway.py +103 -0
  215. foxclaw-0.1.0/tests/test_governance.py +468 -0
  216. foxclaw-0.1.0/tests/test_governance_audit.py +359 -0
  217. foxclaw-0.1.0/tests/test_governance_middleware.py +143 -0
  218. foxclaw-0.1.0/tests/test_hkc.py +286 -0
  219. foxclaw-0.1.0/tests/test_hkc_index_build_manager.py +341 -0
  220. foxclaw-0.1.0/tests/test_hkc_manifest_reuse.py +319 -0
  221. foxclaw-0.1.0/tests/test_hkc_search_event_sync.py +535 -0
  222. foxclaw-0.1.0/tests/test_injection_guard.py +211 -0
  223. foxclaw-0.1.0/tests/test_integration.py +141 -0
  224. foxclaw-0.1.0/tests/test_itinerary.py +103 -0
  225. foxclaw-0.1.0/tests/test_kee_semantic.py +89 -0
  226. foxclaw-0.1.0/tests/test_kernel.py +222 -0
  227. foxclaw-0.1.0/tests/test_learning.py +110 -0
  228. foxclaw-0.1.0/tests/test_llm_admin.py +160 -0
  229. foxclaw-0.1.0/tests/test_llm_planner.py +366 -0
  230. foxclaw-0.1.0/tests/test_markdown_skills.py +73 -0
  231. foxclaw-0.1.0/tests/test_markdown_skills_openclaw.py +71 -0
  232. foxclaw-0.1.0/tests/test_mcp_connectors.py +109 -0
  233. foxclaw-0.1.0/tests/test_mcp_guardian_discovery.py +91 -0
  234. foxclaw-0.1.0/tests/test_mcp_no_memory.py +43 -0
  235. foxclaw-0.1.0/tests/test_mcp_server.py +95 -0
  236. foxclaw-0.1.0/tests/test_memory_recall.py +95 -0
  237. foxclaw-0.1.0/tests/test_metrics.py +66 -0
  238. foxclaw-0.1.0/tests/test_multi_chain.py +102 -0
  239. foxclaw-0.1.0/tests/test_multimodal.py +135 -0
  240. foxclaw-0.1.0/tests/test_negotiation.py +146 -0
  241. foxclaw-0.1.0/tests/test_orchestration.py +119 -0
  242. foxclaw-0.1.0/tests/test_orchestration_decoupled.py +109 -0
  243. foxclaw-0.1.0/tests/test_p3_p5_hardening.py +338 -0
  244. foxclaw-0.1.0/tests/test_parallel_dispatch.py +216 -0
  245. foxclaw-0.1.0/tests/test_pipeline.py +533 -0
  246. foxclaw-0.1.0/tests/test_plan_visible.py +86 -0
  247. foxclaw-0.1.0/tests/test_planner.py +95 -0
  248. foxclaw-0.1.0/tests/test_policy_gate.py +109 -0
  249. foxclaw-0.1.0/tests/test_reasoner.py +185 -0
  250. foxclaw-0.1.0/tests/test_release_check.py +220 -0
  251. foxclaw-0.1.0/tests/test_resume_checkpoint.py +156 -0
  252. foxclaw-0.1.0/tests/test_routing.py +95 -0
  253. foxclaw-0.1.0/tests/test_scheduler.py +141 -0
  254. foxclaw-0.1.0/tests/test_search.py +204 -0
  255. foxclaw-0.1.0/tests/test_semantic.py +78 -0
  256. foxclaw-0.1.0/tests/test_sessions.py +91 -0
  257. foxclaw-0.1.0/tests/test_settings.py +281 -0
  258. foxclaw-0.1.0/tests/test_shadow_learning.py +330 -0
  259. foxclaw-0.1.0/tests/test_shared_write.py +207 -0
  260. foxclaw-0.1.0/tests/test_skills.py +133 -0
  261. foxclaw-0.1.0/tests/test_stats_and_events.py +165 -0
  262. foxclaw-0.1.0/tests/test_streaming.py +60 -0
  263. foxclaw-0.1.0/tests/test_supervisor_pipeline.py +177 -0
  264. foxclaw-0.1.0/tests/test_supervisor_triage.py +108 -0
  265. foxclaw-0.1.0/tests/test_taint.py +117 -0
  266. foxclaw-0.1.0/tests/test_task_stream.py +85 -0
  267. foxclaw-0.1.0/tests/test_thinking_sse.py +67 -0
  268. foxclaw-0.1.0/tests/test_thinking_stream.py +76 -0
  269. foxclaw-0.1.0/tests/test_tool_center.py +129 -0
  270. foxclaw-0.1.0/tests/test_tool_parallel.py +113 -0
  271. foxclaw-0.1.0/tests/test_tool_params.py +103 -0
  272. foxclaw-0.1.0/tests/test_tool_use.py +242 -0
  273. foxclaw-0.1.0/tests/test_toplevel_concurrency.py +117 -0
  274. foxclaw-0.1.0/tests/test_tracing.py +290 -0
  275. foxclaw-0.1.0/tests/test_truth_crystallizer.py +127 -0
  276. foxclaw-0.1.0/tests/test_truth_flow.py +93 -0
  277. foxclaw-0.1.0/tests/test_url_policy.py +53 -0
  278. foxclaw-0.1.0/tests/test_verify_evidence.py +225 -0
  279. foxclaw-0.1.0/tests/test_version_sync.py +71 -0
  280. foxclaw-0.1.0/tests/test_web_trigger.py +99 -0
foxclaw-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: foxclaw
3
+ Version: 0.1.0
4
+ Summary: Foxclaw - Cognitive Agent Operating System built on HMR
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: anthropic>=0.25.0
7
+ Requires-Dist: openai>=1.0.0
8
+ Requires-Dist: sentence-transformers>=2.7.0
9
+ Requires-Dist: numpy>=1.26.0
10
+ Requires-Dist: scikit-learn>=1.4.0
11
+ Requires-Dist: faiss-cpu>=1.8.0
12
+ Requires-Dist: fastapi>=0.111.0
13
+ Requires-Dist: uvicorn>=0.29.0
14
+ Requires-Dist: websockets>=12.0
15
+ Requires-Dist: pydantic>=2.0.0
16
+ Requires-Dist: mcp<2.0,>=1.27.0
17
+ Requires-Dist: httpx<0.28,>=0.24
18
+ Requires-Dist: cryptography>=41.0.0
19
+ Requires-Dist: pyyaml>=6.0.0
20
+ Requires-Dist: python-dotenv>=1.0.0
21
+ Requires-Dist: rich>=13.7.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=8.0; extra == "dev"
24
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
25
+ Requires-Dist: ruff>=0.16; extra == "dev"
26
+ Requires-Dist: mypy>=1.10; extra == "dev"
27
+ Requires-Dist: coverage>=7.5; extra == "dev"
28
+ Requires-Dist: python-docx>=1.1; extra == "dev"
29
+ Requires-Dist: openpyxl>=3.1; extra == "dev"
30
+ Provides-Extra: browser
31
+ Requires-Dist: playwright>=1.44.0; extra == "browser"
32
+ Provides-Extra: gemini
33
+ Requires-Dist: google-generativeai>=0.8; extra == "gemini"
34
+ Provides-Extra: knowledge
35
+ Requires-Dist: networkx>=3.0; extra == "knowledge"
36
+ Requires-Dist: rank-bm25>=0.2; extra == "knowledge"
37
+ Requires-Dist: aiofiles>=23.0; extra == "knowledge"
38
+ Requires-Dist: requests>=2.31; extra == "knowledge"
39
+ Provides-Extra: knowledge-files
40
+ Requires-Dist: pymupdf>=1.24; extra == "knowledge-files"
41
+ Requires-Dist: ebooklib>=0.18; extra == "knowledge-files"
42
+ Requires-Dist: beautifulsoup4>=4.12; extra == "knowledge-files"
43
+ Requires-Dist: mobi>=0.3.3; extra == "knowledge-files"
44
+ Requires-Dist: python-multipart>=0.0.9; extra == "knowledge-files"
45
+ Requires-Dist: python-docx>=1.1; extra == "knowledge-files"
46
+ Requires-Dist: openpyxl>=3.1; extra == "knowledge-files"
@@ -0,0 +1,130 @@
1
+ # Foxclaw · Cognitive Agent Operating System
2
+
3
+ A **cognitive agent OS** built on the HMR memory runtime: three collaborating agents, cross-layer Harness governance, with the memory/cognition layer fully decoupled from any LLM.
4
+
5
+ ```
6
+ Traditional frameworks: memory = storage, agents = stateless execution
7
+ Foxclaw: memory = living cognitive runtime, agents = reason · learn · evolve
8
+ ```
9
+
10
+ ## What it is
11
+
12
+ Foxclaw is not "yet another agent framework" but an operating system for agents. Its moats are independent of any LLM:
13
+
14
+ - **ThoughtChain** — each agent's reasoning is an auditable, comparable directed graph, not a log
15
+ - **Harness** — three-dimensional drift detection (semantic / tool / scope) + shadow-mode self-calibration + policy self-learning
16
+ - **Evolution** — every harness truncation teaches the policy; the system gets sharper with use
17
+ - **Runtime governance** — idempotency, crash recovery, loop detection, etc., keeping the system reliable under real-world operation
18
+
19
+ Three agents: Supervisor (coordination), Finance, Office (learning + itinerary). Each has isolated memory and policy evolution, mounts external ecosystems via the Skill layer, and connects to mainstream messaging platforms via the channel layer. The former Assistant and Admin responsibilities are now **instruction skills** (`skills/general-assistant`, `skills/schedule-itinerary`) mounted on demand, not separate agents.
20
+
21
+ ## Domain kernels
22
+
23
+ Finance / Office each mount an isomorphic kernel (pure-algorithm layer + external tool interface + gatekeeper):
24
+
25
+ - **Finance** — budget reasoning, MAD anomaly detection, cash-flow forecast; gatekeeper with four permissions, emits approval requests rather than moving money. **Advanced trio**: structured evidence chains (explainable risk), financial data graph (trace who caused an overspend), reconciliation (3-tier matching + suspicious-charge detection).
26
+ - **Office** — SM-2 spaced repetition (mastery + forgetting risk) + knowledge graph (cluster discovery).
27
+ - **Office · itinerary** — TSP routing, reachability ("won't make it") detection, time conflicts, geo-clustering; integrates Amap.
28
+
29
+ ## Messaging platforms
30
+
31
+ Four mainstream platforms via a unified channel abstraction, **each adapter implemented to its own official spec** (not one mold):
32
+
33
+ | Channel | Model | Credential |
34
+ |---------|-------|-----------|
35
+ | WeChat | iLink Bot API, long-poll + context_token | scan-login token |
36
+ | Feishu | event-subscription webhook + signature + token refresh | App ID/Secret |
37
+ | Telegram | Bot API getUpdates polling | bot token |
38
+ | Discord | Gateway WebSocket + REST | bot token |
39
+
40
+ Closed loop (`ChannelDispatcher`): receive → Supervisor → reply to origin, with per-channel session isolation and idempotent dedup. See [docs/CHANNELS.md](docs/CHANNELS.md).
41
+
42
+ ## Runtime governance
43
+
44
+ Keeps the system reliable under message redelivery, crashes, long tasks, and loops. See [docs/GOVERNANCE.md](docs/GOVERNANCE.md): idempotency guard, crash/restart recovery (boot_id avoids pid reuse), tool-loop detection, context compaction, hook standardization, steering queue.
45
+
46
+ ## Quick start
47
+
48
+ ```bash
49
+ pip install fastapi uvicorn "httpx<0.28" openai cryptography websockets pyyaml numpy scikit-learn rich pydantic
50
+ python tests/run_all.py # full regression (all green)
51
+ export DEEPSEEK_API_KEY=sk-... # or ANTHROPIC_API_KEY; unset → stub
52
+ python -m uvicorn foxclaw.api:app --port 8000
53
+ ```
54
+
55
+ See [docs/RUN.md](docs/RUN.md). Chinese docs: [README_CN.md](README_CN.md).
56
+
57
+ > **Windows**: don't place the project under OneDrive-managed folders (Documents/Desktop/Pictures); Python can't create dirs inside redirect placeholders. Use a path like `C:\foxclaw`.
58
+
59
+ ## Knowledge base (HKC) model config
60
+
61
+ HKC's knowledge base uses **two different types of models**, each for one job, both configured in `.env` — no code changes:
62
+
63
+ | Stage | Model type | What it does | Config keys |
64
+ |-------|-----------|-------------|-------------|
65
+ | Write (ingesting books/files) | **Generative LLM** (reads & emits JSON) | Extracts entities / concepts / facts / claims from each chunk | `HKC_LLM_*` |
66
+ | Retrieve (querying) | **embedding** (text → vector) | Vectorizes knowledge & queries, ranks by semantic similarity | `HKC_EMBEDDING_*` |
67
+
68
+ They are not interchangeable: an embedding model cannot generate text (can't produce JSON), and an LLM is not suited to vector search.
69
+
70
+ ### First, pick your case
71
+
72
+ | Your environment | Extraction model setup | `HKC_LLM_API_KEY` value |
73
+ |---|---|---|
74
+ | Have local Ollama | `openai-compatible` + `base_url` pointing at Ollama | **any non-empty value** (Ollama ignores it; `ollama` is just a placeholder) |
75
+ | No local model | Use a **public cloud model** (DeepSeek / OpenAI / Qwen …), see table | the platform's **real API key** |
76
+
77
+ ### Case A · local Ollama
78
+
79
+ ```bash
80
+ HKC_LLM_PROVIDER=openai-compatible
81
+ HKC_LLM_API_KEY=ollama # placeholder only for local Ollama; never use this for cloud
82
+ HKC_LLM_MODEL=my-qwen-32k:latest # a model name from your `ollama list`
83
+ HKC_LLM_BASE_URL=http://localhost:11434/v1 # Ollama's OpenAI-compatible endpoint
84
+ HKC_LLM_TIMEOUT=180 # local models are slow; relax the default 60s
85
+ HKC_EXTRACT_CONCURRENCY=2 # 1–2 for local, up to 5 for cloud APIs
86
+ HKC_EXTRACT_BATCH=8 # optional: extract N chunks per call, saves tokens & time; default 1 = per-chunk
87
+ HKC_MAX_CHUNKS_PER_DOC=0 # optional: per-doc chunk cap; 0 = no cap (ingest whole book), default 500
88
+ ```
89
+
90
+ ### Case B · public cloud model (no local model)
91
+
92
+ `HKC_LLM_MODEL` is the platform's **public model id** (passed through verbatim); `HKC_LLM_API_KEY` is the platform's **real key**:
93
+
94
+ | Platform | `HKC_LLM_PROVIDER` | `HKC_LLM_API_KEY` | `HKC_LLM_MODEL` example | `HKC_LLM_BASE_URL` |
95
+ |---|---|---|---|---|
96
+ | DeepSeek | `deepseek` | `sk-...` (DeepSeek key) | `deepseek-chat` / `deepseek-reasoner` | leave blank (official default) |
97
+ | OpenAI | `openai` | `sk-...` (OpenAI key) | `gpt-4o-mini` / `gpt-4o` | leave blank |
98
+ | Qwen (Alibaba) | `openai-compatible` | DashScope key | `qwen-max` / `qwen-plus` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
99
+ | Zhipu / Moonshot / MiniMax … | `openai-compatible` | that platform's key | that platform's model id | that platform's OpenAI-compatible URL |
100
+
101
+ DeepSeek example:
102
+
103
+ ```bash
104
+ HKC_LLM_PROVIDER=deepseek
105
+ HKC_LLM_API_KEY=sk-your-deepseek-key
106
+ HKC_LLM_MODEL=deepseek-chat
107
+ ```
108
+
109
+ ### Retrieval model (embedding)
110
+
111
+ The retrieval model does **not** use Ollama; it uses sentence-transformers, and auto-downloads weights from HuggingFace when missing locally:
112
+
113
+ ```bash
114
+ HKC_EMBEDDING=local
115
+ HKC_EMBEDDING_MODEL=BAAI/bge-m3 # auto-downloads on first use (~2.2 GB); or a local path like C:\...\bge-m3
116
+ ```
117
+
118
+ Leave it unset if you don't need semantic precision (defaults to `stub` pseudo-semantics, works out of the box).
119
+
120
+ ### Where to put the key, and precedence
121
+
122
+ - **`.env` is the source of truth** — read at startup; restart after editing.
123
+ - The "extraction model" section in the planet page's connection settings is an **optional runtime override** (stored in browser localStorage, may override `.env` on refresh); leave it blank to always follow `.env`.
124
+ - The page's first "API Key" field is the backend auth token (`.env`'s `FOXCLAW_API_KEY`), unrelated to the model keys.
125
+
126
+ > Note: switching the embedding model changes the vector dimension (e.g. 384 → 1024), so you must rebuild the knowledge index (clear and re-ingest).
127
+
128
+ ## Philosophy
129
+
130
+ Memory and cognition are fully decoupled from the LLM. The model is a replaceable text generator; the real moat (ThoughtChain audit + Harness drift + policy self-learning + domain kernels) exists independently of any model.