chaoscypher-core 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 (597) hide show
  1. chaoscypher_core-0.1.0/PKG-INFO +495 -0
  2. chaoscypher_core-0.1.0/README.md +407 -0
  3. chaoscypher_core-0.1.0/pyproject.toml +268 -0
  4. chaoscypher_core-0.1.0/setup.cfg +4 -0
  5. chaoscypher_core-0.1.0/src/chaoscypher_core/__init__.py +758 -0
  6. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/__init__.py +54 -0
  7. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/__init__.py +61 -0
  8. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/_retry.py +180 -0
  9. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/factory.py +187 -0
  10. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/gemini_provider.py +288 -0
  11. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/local_provider.py +358 -0
  12. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/models.py +96 -0
  13. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/ollama_provider.py +275 -0
  14. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/openai_provider.py +272 -0
  15. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/embedding/registry.py +189 -0
  16. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/__init__.py +85 -0
  17. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/cost.py +235 -0
  18. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/error_types.py +124 -0
  19. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/factory.py +292 -0
  20. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/limit.py +490 -0
  21. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/load_balancer.py +481 -0
  22. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/model_registry.py +121 -0
  23. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/provider.py +482 -0
  24. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/__init__.py +207 -0
  25. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/anthropic_provider.py +391 -0
  26. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/base.py +420 -0
  27. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/error_classifier.py +186 -0
  28. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/gemini_provider.py +410 -0
  29. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/ollama_provider.py +896 -0
  30. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/providers/openai_provider.py +387 -0
  31. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/__init__.py +33 -0
  32. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/anthropic.py +45 -0
  33. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/base.py +65 -0
  34. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/extractor.py +1731 -0
  35. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/gemini.py +45 -0
  36. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/ollama.py +62 -0
  37. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/schema/openai.py +52 -0
  38. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/llm/utils.py +89 -0
  39. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/__init__.py +60 -0
  40. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/adapter.py +341 -0
  41. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/engine.py +464 -0
  42. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixin_base.py +76 -0
  43. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/__init__.py +80 -0
  44. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/_chunk_tasks_analytics.py +436 -0
  45. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/_chunk_tasks_crud.py +393 -0
  46. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/_chunk_tasks_lifecycle.py +842 -0
  47. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/_chunk_tasks_recovery.py +154 -0
  48. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/_extraction_job_query_base.py +56 -0
  49. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/chats.py +202 -0
  50. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/extraction_submissions.py +167 -0
  51. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/llm_metrics.py +358 -0
  52. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/search_retry_queue.py +49 -0
  53. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/source_deletion.py +84 -0
  54. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/source_files.py +1040 -0
  55. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/source_files_chunk_tasks.py +45 -0
  56. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/source_files_extraction_jobs.py +554 -0
  57. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/source_files_indexing.py +1418 -0
  58. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/source_recovery_events.py +145 -0
  59. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/sources.py +860 -0
  60. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/sources_chunks.py +932 -0
  61. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/sources_citations.py +782 -0
  62. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/sources_tags.py +254 -0
  63. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/stage_progress.py +198 -0
  64. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/system_state.py +290 -0
  65. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/tools.py +272 -0
  66. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/triggers.py +156 -0
  67. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/vision_pages.py +338 -0
  68. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/workflow_executions.py +546 -0
  69. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/mixins/workflows.py +358 -0
  70. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/models.py +1967 -0
  71. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/__init__.py +31 -0
  72. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/extraction.py +140 -0
  73. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/__init__.py +20 -0
  74. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/cleanup.py +115 -0
  75. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/graph_mixin_base.py +39 -0
  76. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/sqlite_edge_ops.py +518 -0
  77. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/sqlite_node_ops.py +610 -0
  78. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/sqlite_repository.py +669 -0
  79. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph/sqlite_template_ops.py +595 -0
  80. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph_breakdown.py +330 -0
  81. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/graph_snapshot.py +141 -0
  82. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/search.py +1745 -0
  83. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/repos/text_indexer.py +38 -0
  84. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/safe_session.py +179 -0
  85. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/session.py +82 -0
  86. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/sqlite/utils.py +55 -0
  87. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/web/__init__.py +16 -0
  88. chaoscypher_core-0.1.0/src/chaoscypher_core/adapters/web/search.py +604 -0
  89. chaoscypher_core-0.1.0/src/chaoscypher_core/analytics/__init__.py +14 -0
  90. chaoscypher_core-0.1.0/src/chaoscypher_core/analytics/llm_metrics.py +342 -0
  91. chaoscypher_core-0.1.0/src/chaoscypher_core/app_config/__init__.py +1818 -0
  92. chaoscypher_core-0.1.0/src/chaoscypher_core/app_config/engine_factory.py +88 -0
  93. chaoscypher_core-0.1.0/src/chaoscypher_core/app_config/manager.py +240 -0
  94. chaoscypher_core-0.1.0/src/chaoscypher_core/bootstrap.py +1919 -0
  95. chaoscypher_core-0.1.0/src/chaoscypher_core/constants.py +91 -0
  96. chaoscypher_core-0.1.0/src/chaoscypher_core/data/cloud_models.json +354 -0
  97. chaoscypher_core-0.1.0/src/chaoscypher_core/database/__init__.py +39 -0
  98. chaoscypher_core-0.1.0/src/chaoscypher_core/database/adapter_factory.py +102 -0
  99. chaoscypher_core-0.1.0/src/chaoscypher_core/database/backup.py +176 -0
  100. chaoscypher_core-0.1.0/src/chaoscypher_core/database/engine.py +210 -0
  101. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/__init__.py +12 -0
  102. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/alembic.ini +44 -0
  103. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/drift.py +205 -0
  104. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/env.py +97 -0
  105. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/runner.py +234 -0
  106. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/script.py.mako +33 -0
  107. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/startup.py +298 -0
  108. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/state.py +248 -0
  109. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/tiers.py +113 -0
  110. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/upgrade.py +219 -0
  111. chaoscypher_core-0.1.0/src/chaoscypher_core/database/migrations/versions/0001_baseline.py +928 -0
  112. chaoscypher_core-0.1.0/src/chaoscypher_core/database/repository.py +141 -0
  113. chaoscypher_core-0.1.0/src/chaoscypher_core/database/seed.py +434 -0
  114. chaoscypher_core-0.1.0/src/chaoscypher_core/exceptions.py +1272 -0
  115. chaoscypher_core-0.1.0/src/chaoscypher_core/facade.py +563 -0
  116. chaoscypher_core-0.1.0/src/chaoscypher_core/factories/__init__.py +33 -0
  117. chaoscypher_core-0.1.0/src/chaoscypher_core/factories/tool_factory.py +42 -0
  118. chaoscypher_core-0.1.0/src/chaoscypher_core/factories/trigger_factory.py +34 -0
  119. chaoscypher_core-0.1.0/src/chaoscypher_core/factories/workflow_factory.py +42 -0
  120. chaoscypher_core-0.1.0/src/chaoscypher_core/license_pubkey.pem +5 -0
  121. chaoscypher_core-0.1.0/src/chaoscypher_core/llm_queue/__init__.py +58 -0
  122. chaoscypher_core-0.1.0/src/chaoscypher_core/llm_queue/factory.py +81 -0
  123. chaoscypher_core-0.1.0/src/chaoscypher_core/llm_queue/provider_utils.py +82 -0
  124. chaoscypher_core-0.1.0/src/chaoscypher_core/llm_queue/queue_factory.py +103 -0
  125. chaoscypher_core-0.1.0/src/chaoscypher_core/llm_queue/queue_service.py +557 -0
  126. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/__init__.py +44 -0
  127. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/bridge.py +66 -0
  128. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/extraction.py +1561 -0
  129. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/maintenance.py +213 -0
  130. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/processor.py +390 -0
  131. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/server.py +1014 -0
  132. chaoscypher_core-0.1.0/src/chaoscypher_core/mcp/tools.py +1115 -0
  133. chaoscypher_core-0.1.0/src/chaoscypher_core/models.py +904 -0
  134. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/__init__.py +41 -0
  135. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/bulk/__init__.py +28 -0
  136. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/bulk/bulk_edge_ops.py +57 -0
  137. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/bulk/bulk_node_ops.py +57 -0
  138. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/bulk/bulk_service.py +550 -0
  139. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/bulk/bulk_template_ops.py +57 -0
  140. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/export_operations_service.py +348 -0
  141. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/extraction/__init__.py +47 -0
  142. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/extraction/chunk_extraction_service.py +1550 -0
  143. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/extraction/extraction_finalizer.py +1662 -0
  144. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/extraction/extraction_metrics_service.py +76 -0
  145. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/extraction/schemas.py +198 -0
  146. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/graph_snapshot_handler.py +108 -0
  147. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/__init__.py +34 -0
  148. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/confirmation_gate.py +375 -0
  149. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/embedding_handler.py +571 -0
  150. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/fanout_limits.py +67 -0
  151. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/format_handler.py +227 -0
  152. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/import_service.py +2014 -0
  153. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/indexing_handler.py +1848 -0
  154. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/vision_finalizer.py +493 -0
  155. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/vision_operations_service.py +425 -0
  156. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/importing/vision_page_handler.py +150 -0
  157. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/pause_guard.py +85 -0
  158. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/queue_utils.py +520 -0
  159. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/rebuild_handler.py +111 -0
  160. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/repository.py +125 -0
  161. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/reset_handler.py +214 -0
  162. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/sources/__init__.py +9 -0
  163. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/sources/processing/__init__.py +46 -0
  164. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/sources/processing/validators.py +72 -0
  165. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/sources/url_fetch_handler.py +399 -0
  166. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/workflow_operations_service.py +270 -0
  167. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/workflows/__init__.py +28 -0
  168. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/workflows/orchestrator.py +551 -0
  169. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/workflows/repository.py +154 -0
  170. chaoscypher_core-0.1.0/src/chaoscypher_core/operations/workflows/status.py +24 -0
  171. chaoscypher_core-0.1.0/src/chaoscypher_core/plugins/__init__.py +130 -0
  172. chaoscypher_core-0.1.0/src/chaoscypher_core/plugins/base.py +204 -0
  173. chaoscypher_core-0.1.0/src/chaoscypher_core/plugins/discovery.py +394 -0
  174. chaoscypher_core-0.1.0/src/chaoscypher_core/plugins/factory.py +205 -0
  175. chaoscypher_core-0.1.0/src/chaoscypher_core/plugins/registry.py +494 -0
  176. chaoscypher_core-0.1.0/src/chaoscypher_core/plugins/user_plugin_loader.py +132 -0
  177. chaoscypher_core-0.1.0/src/chaoscypher_core/policy.py +53 -0
  178. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/__init__.py +111 -0
  179. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/chunk.py +122 -0
  180. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/db.py +43 -0
  181. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/embedding.py +134 -0
  182. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/graph.py +691 -0
  183. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/index.py +168 -0
  184. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/llm.py +81 -0
  185. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/retry.py +65 -0
  186. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/search.py +398 -0
  187. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/search_retry.py +39 -0
  188. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/source_file.py +13 -0
  189. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/source_recovery.py +171 -0
  190. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/stage_progress.py +87 -0
  191. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_chats.py +103 -0
  192. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_chunks.py +129 -0
  193. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_citations.py +245 -0
  194. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_embeddings.py +77 -0
  195. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_extraction_queue.py +118 -0
  196. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_extraction_submissions.py +49 -0
  197. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_graph_snapshot.py +136 -0
  198. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_llm_metrics.py +73 -0
  199. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_source_tags.py +117 -0
  200. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_sources.py +424 -0
  201. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_tools.py +117 -0
  202. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_triggers.py +74 -0
  203. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_vision.py +178 -0
  204. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_workflow_executions.py +237 -0
  205. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/storage_workflows.py +159 -0
  206. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/structured_extraction.py +56 -0
  207. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/transactional.py +51 -0
  208. chaoscypher_core-0.1.0/src/chaoscypher_core/ports/types.py +310 -0
  209. chaoscypher_core-0.1.0/src/chaoscypher_core/py.typed +0 -0
  210. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/__init__.py +86 -0
  211. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/client.py +1627 -0
  212. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/handler_spec.py +234 -0
  213. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/monitor.py +261 -0
  214. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/pubsub.py +187 -0
  215. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/reconciler.py +321 -0
  216. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/rehydrate.py +320 -0
  217. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/scripts/__init__.py +4 -0
  218. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/scripts/atomic_complete.lua +17 -0
  219. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/service.py +379 -0
  220. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/upgrade_recovery.py +293 -0
  221. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/utils.py +22 -0
  222. chaoscypher_core-0.1.0/src/chaoscypher_core/queue/worker.py +950 -0
  223. chaoscypher_core-0.1.0/src/chaoscypher_core/repo_factories/__init__.py +25 -0
  224. chaoscypher_core-0.1.0/src/chaoscypher_core/repo_factories/embedding_factory.py +83 -0
  225. chaoscypher_core-0.1.0/src/chaoscypher_core/repo_factories/graph_factory.py +81 -0
  226. chaoscypher_core-0.1.0/src/chaoscypher_core/repo_factories/search_factory.py +92 -0
  227. chaoscypher_core-0.1.0/src/chaoscypher_core/services/__init__.py +181 -0
  228. chaoscypher_core-0.1.0/src/chaoscypher_core/services/backup.py +275 -0
  229. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/__init__.py +56 -0
  230. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/engine/__init__.py +49 -0
  231. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/engine/constants.py +248 -0
  232. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/engine/executor.py +237 -0
  233. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/engine/research.py +457 -0
  234. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/management/__init__.py +24 -0
  235. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/management/service.py +409 -0
  236. chaoscypher_core-0.1.0/src/chaoscypher_core/services/chat/recovery.py +104 -0
  237. chaoscypher_core-0.1.0/src/chaoscypher_core/services/compose/__init__.py +88 -0
  238. chaoscypher_core-0.1.0/src/chaoscypher_core/services/compose/merger.py +496 -0
  239. chaoscypher_core-0.1.0/src/chaoscypher_core/services/compose/models.py +346 -0
  240. chaoscypher_core-0.1.0/src/chaoscypher_core/services/compose/resolver.py +480 -0
  241. chaoscypher_core-0.1.0/src/chaoscypher_core/services/compose/service.py +400 -0
  242. chaoscypher_core-0.1.0/src/chaoscypher_core/services/diagnostics/__init__.py +28 -0
  243. chaoscypher_core-0.1.0/src/chaoscypher_core/services/diagnostics/collector.py +300 -0
  244. chaoscypher_core-0.1.0/src/chaoscypher_core/services/diagnostics/models.py +49 -0
  245. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/__init__.py +23 -0
  246. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/bus.py +95 -0
  247. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/__init__.py +33 -0
  248. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/models.py +104 -0
  249. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/pause_evaluator.py +178 -0
  250. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/__init__.py +48 -0
  251. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/cloud_provider.py +81 -0
  252. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/database.py +114 -0
  253. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/disk_space.py +146 -0
  254. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/embedding.py +121 -0
  255. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/error_rate.py +131 -0
  256. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/graph.py +107 -0
  257. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/ollama.py +237 -0
  258. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/queue.py +89 -0
  259. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/search_index.py +125 -0
  260. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/probes/worker.py +161 -0
  261. chaoscypher_core-0.1.0/src/chaoscypher_core/services/events/health/registry.py +147 -0
  262. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/__init__.py +41 -0
  263. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/engine/readme.py +202 -0
  264. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/engine/stats.py +613 -0
  265. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/management/__init__.py +19 -0
  266. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/management/data_extractor.py +516 -0
  267. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/management/metadata_manager.py +354 -0
  268. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/management/package_builder.py +242 -0
  269. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/management/service.py +467 -0
  270. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/models/__init__.py +57 -0
  271. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/models/schemas.py +360 -0
  272. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/utils/__init__.py +36 -0
  273. chaoscypher_core-0.1.0/src/chaoscypher_core/services/export/utils/file_integrity.py +181 -0
  274. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/__init__.py +26 -0
  275. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/__init__.py +39 -0
  276. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/algorithms.py +254 -0
  277. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/analytics.py +110 -0
  278. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/graph_metrics.py +66 -0
  279. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/stats.py +110 -0
  280. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/traversal.py +236 -0
  281. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/engine/validator.py +378 -0
  282. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/management/__init__.py +37 -0
  283. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/management/edge.py +253 -0
  284. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/management/embedding.py +69 -0
  285. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/management/node.py +418 -0
  286. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/management/source.py +608 -0
  287. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/management/template.py +221 -0
  288. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/__init__.py +14 -0
  289. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/build_service.py +174 -0
  290. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/geometry.py +136 -0
  291. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/layout.py +64 -0
  292. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/models.py +99 -0
  293. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/renderer.py +541 -0
  294. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/resources/__init__.py +13 -0
  295. chaoscypher_core-0.1.0/src/chaoscypher_core/services/graph/snapshot/resources/logo.png +0 -0
  296. chaoscypher_core-0.1.0/src/chaoscypher_core/services/lexicon/__init__.py +102 -0
  297. chaoscypher_core-0.1.0/src/chaoscypher_core/services/lexicon/client.py +957 -0
  298. chaoscypher_core-0.1.0/src/chaoscypher_core/services/lexicon/models.py +338 -0
  299. chaoscypher_core-0.1.0/src/chaoscypher_core/services/lexicon/service.py +545 -0
  300. chaoscypher_core-0.1.0/src/chaoscypher_core/services/lexicon/storage.py +304 -0
  301. chaoscypher_core-0.1.0/src/chaoscypher_core/services/llm/__init__.py +34 -0
  302. chaoscypher_core-0.1.0/src/chaoscypher_core/services/llm/connectivity.py +138 -0
  303. chaoscypher_core-0.1.0/src/chaoscypher_core/services/llm/health.py +280 -0
  304. chaoscypher_core-0.1.0/src/chaoscypher_core/services/llm/spend.py +224 -0
  305. chaoscypher_core-0.1.0/src/chaoscypher_core/services/local_auth/__init__.py +52 -0
  306. chaoscypher_core-0.1.0/src/chaoscypher_core/services/local_auth/api_keys.py +41 -0
  307. chaoscypher_core-0.1.0/src/chaoscypher_core/services/local_auth/credentials.py +336 -0
  308. chaoscypher_core-0.1.0/src/chaoscypher_core/services/local_auth/errors.py +52 -0
  309. chaoscypher_core-0.1.0/src/chaoscypher_core/services/local_auth/session.py +84 -0
  310. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/__init__.py +19 -0
  311. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/__main__.py +74 -0
  312. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/renderer.py +123 -0
  313. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/templates/multi-interface-nginx.conf.j2 +154 -0
  314. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/templates/nginx-http.conf.j2 +244 -0
  315. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/templates/nginx-https.conf.j2 +248 -0
  316. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/templates/proxy-common.conf.j2 +14 -0
  317. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/templates/supervisord.conf.j2 +91 -0
  318. chaoscypher_core-0.1.0/src/chaoscypher_core/services/orchestration/templates/valkey-args.txt.j2 +14 -0
  319. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/__init__.py +98 -0
  320. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/archive/__init__.py +56 -0
  321. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/archive/create.py +183 -0
  322. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/archive/extract.py +228 -0
  323. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/archive/info.py +123 -0
  324. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/__init__.py +61 -0
  325. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/loaders/__init__.py +36 -0
  326. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/loaders/base.py +63 -0
  327. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/loaders/knowledge.py +265 -0
  328. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/loaders/sources.py +345 -0
  329. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/loaders/templates.py +188 -0
  330. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/loaders/workflows.py +243 -0
  331. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/models.py +234 -0
  332. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/importer/service.py +437 -0
  333. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/models/__init__.py +41 -0
  334. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/models/manifest.py +285 -0
  335. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/validation/__init__.py +29 -0
  336. chaoscypher_core-0.1.0/src/chaoscypher_core/services/package/validation/validator.py +156 -0
  337. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/__init__.py +42 -0
  338. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/base.py +130 -0
  339. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/configurable.py +208 -0
  340. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/factory.py +57 -0
  341. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_128gb.json +30 -0
  342. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_16gb.json +31 -0
  343. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_20gb.json +29 -0
  344. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_24gb.json +31 -0
  345. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_32gb.json +28 -0
  346. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_48gb.json +31 -0
  347. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/plugins/vram_96gb.json +29 -0
  348. chaoscypher_core-0.1.0/src/chaoscypher_core/services/presets/registry.py +267 -0
  349. chaoscypher_core-0.1.0/src/chaoscypher_core/services/quality/__init__.py +39 -0
  350. chaoscypher_core-0.1.0/src/chaoscypher_core/services/quality/counters.py +446 -0
  351. chaoscypher_core-0.1.0/src/chaoscypher_core/services/quality/scoring.py +1092 -0
  352. chaoscypher_core-0.1.0/src/chaoscypher_core/services/reset/__init__.py +33 -0
  353. chaoscypher_core-0.1.0/src/chaoscypher_core/services/reset/data_reset.py +155 -0
  354. chaoscypher_core-0.1.0/src/chaoscypher_core/services/reset/database_reset.py +161 -0
  355. chaoscypher_core-0.1.0/src/chaoscypher_core/services/reset/graph_cleanup.py +138 -0
  356. chaoscypher_core-0.1.0/src/chaoscypher_core/services/reset/operations.py +402 -0
  357. chaoscypher_core-0.1.0/src/chaoscypher_core/services/reset/workflow_system_reset.py +117 -0
  358. chaoscypher_core-0.1.0/src/chaoscypher_core/services/search/__init__.py +43 -0
  359. chaoscypher_core-0.1.0/src/chaoscypher_core/services/search/engine/__init__.py +38 -0
  360. chaoscypher_core-0.1.0/src/chaoscypher_core/services/search/engine/index.py +606 -0
  361. chaoscypher_core-0.1.0/src/chaoscypher_core/services/search/engine/research.py +208 -0
  362. chaoscypher_core-0.1.0/src/chaoscypher_core/services/search/engine/search.py +689 -0
  363. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/__init__.py +71 -0
  364. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/__init__.py +37 -0
  365. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/commit/__init__.py +55 -0
  366. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/commit/entity.py +432 -0
  367. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/commit/matcher.py +249 -0
  368. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/commit/relation.py +552 -0
  369. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/commit/service.py +1753 -0
  370. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/commit/template.py +201 -0
  371. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/deduplication/__init__.py +37 -0
  372. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/deduplication/embedding_generator.py +138 -0
  373. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/deduplication/service.py +1324 -0
  374. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/deduplication/similarity_matcher.py +307 -0
  375. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/__init__.py +87 -0
  376. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/content_categories.py +503 -0
  377. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domain_resolver.py +204 -0
  378. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/__init__.py +147 -0
  379. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/base.py +329 -0
  380. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/config_schema.py +268 -0
  381. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/configurable.py +755 -0
  382. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/factory.py +95 -0
  383. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/fingerprint.py +86 -0
  384. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/biographical.jsonld +1037 -0
  385. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/cybersecurity.jsonld +1940 -0
  386. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/design.jsonld +1589 -0
  387. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/educational.jsonld +1526 -0
  388. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/financial.jsonld +1297 -0
  389. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/generic.jsonld +1120 -0
  390. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/historical.jsonld +1321 -0
  391. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/intelligence.jsonld +1751 -0
  392. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/investigation.jsonld +1560 -0
  393. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/legal.jsonld +1151 -0
  394. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/literary.jsonld +1620 -0
  395. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/medical.jsonld +1157 -0
  396. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/news.jsonld +1110 -0
  397. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/philosophical.jsonld +1687 -0
  398. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/political.jsonld +1155 -0
  399. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/reference.jsonld +1676 -0
  400. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/scientific.jsonld +1341 -0
  401. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/technical.jsonld +1162 -0
  402. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/plugins/theological.jsonld +1364 -0
  403. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/domains/registry.py +609 -0
  404. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/extractor.py +698 -0
  405. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/orchestration.py +736 -0
  406. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/preprocessor.py +62 -0
  407. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/safe_user_regex.py +166 -0
  408. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/service.py +802 -0
  409. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/template_matcher.py +64 -0
  410. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/__init__.py +127 -0
  411. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/ai_entities.py +1993 -0
  412. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/constants.py +26 -0
  413. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/entity_cleaner.py +1910 -0
  414. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/evidence_validator.py +566 -0
  415. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/filtering_config.py +315 -0
  416. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/filtering_log.py +145 -0
  417. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/line_parser.py +866 -0
  418. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/post_extraction.py +222 -0
  419. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/prompts.py +139 -0
  420. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/quality_analyzer.py +61 -0
  421. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/sentence_splitter.py +254 -0
  422. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/template_extractor.py +243 -0
  423. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/template_formatter.py +431 -0
  424. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/text_preparation.py +144 -0
  425. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/type_inferencer.py +73 -0
  426. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/type_normalizer.py +401 -0
  427. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/engine/extraction/utils/type_rescue.py +440 -0
  428. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/heartbeat.py +219 -0
  429. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/__init__.py +69 -0
  430. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/__init__.py +73 -0
  431. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/exceptions.py +95 -0
  432. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/extractor.py +351 -0
  433. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/__init__.py +55 -0
  434. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/base.py +160 -0
  435. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/generic_handler.py +310 -0
  436. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/markdown_handler.py +563 -0
  437. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/openapi_handler.py +1336 -0
  438. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/registry.py +286 -0
  439. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive/handlers/sphinx_handler.py +534 -0
  440. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/archive_loader.py +227 -0
  441. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/audio_loader.py +233 -0
  442. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/base.py +181 -0
  443. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/csv_loader.py +165 -0
  444. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/docx_loader.py +185 -0
  445. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/epub_loader.py +305 -0
  446. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/facade.py +67 -0
  447. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/factory.py +73 -0
  448. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/html_loader.py +143 -0
  449. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/image_loader.py +149 -0
  450. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/json_loader.py +211 -0
  451. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/pdf_loader.py +341 -0
  452. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/pptx_loader.py +152 -0
  453. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/registry.py +528 -0
  454. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/rst_loader.py +131 -0
  455. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/text_loader.py +106 -0
  456. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/video_loader.py +234 -0
  457. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/loaders/xlsx_loader.py +136 -0
  458. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/management/__init__.py +27 -0
  459. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/management/paths.py +41 -0
  460. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/management/re_extraction.py +91 -0
  461. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/management/service.py +463 -0
  462. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/models/__init__.py +27 -0
  463. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/models/entities.py +78 -0
  464. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/__init__.py +90 -0
  465. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/cleaners/__init__.py +66 -0
  466. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/cleaners/base.py +193 -0
  467. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/cleaners/ocr_cleaner.py +794 -0
  468. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/cleaners/registry.py +278 -0
  469. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/cleaners/text_cleaner.py +292 -0
  470. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/cleaners/web_cleaner.py +307 -0
  471. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/models.py +228 -0
  472. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/service.py +739 -0
  473. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/transformers/__init__.py +45 -0
  474. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/transformers/base.py +97 -0
  475. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/normalizer/transformers/markdown_transformer.py +377 -0
  476. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/orphan_files.py +119 -0
  477. chaoscypher_core-0.1.0/src/chaoscypher_core/services/sources/recovery.py +1277 -0
  478. chaoscypher_core-0.1.0/src/chaoscypher_core/services/stage_progress/__init__.py +13 -0
  479. chaoscypher_core-0.1.0/src/chaoscypher_core/services/stage_progress/service.py +149 -0
  480. chaoscypher_core-0.1.0/src/chaoscypher_core/services/tls/__init__.py +9 -0
  481. chaoscypher_core-0.1.0/src/chaoscypher_core/services/tls/service.py +81 -0
  482. chaoscypher_core-0.1.0/src/chaoscypher_core/services/vision/__init__.py +12 -0
  483. chaoscypher_core-0.1.0/src/chaoscypher_core/services/vision/prompts.py +75 -0
  484. chaoscypher_core-0.1.0/src/chaoscypher_core/services/vision/service.py +181 -0
  485. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/__init__.py +94 -0
  486. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/__init__.py +73 -0
  487. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/builder.py +269 -0
  488. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/executor.py +369 -0
  489. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/interpolator.py +147 -0
  490. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/output_parser.py +293 -0
  491. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/state.py +111 -0
  492. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/step_executor.py +277 -0
  493. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/tool_executor_adapter.py +124 -0
  494. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/engine/validator.py +200 -0
  495. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/management/__init__.py +35 -0
  496. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/management/history.py +522 -0
  497. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/management/io.py +473 -0
  498. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/management/service.py +608 -0
  499. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/management/step.py +316 -0
  500. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/__init__.py +116 -0
  501. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/__init__.py +105 -0
  502. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/base.py +275 -0
  503. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/chunk_hydration.py +110 -0
  504. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/context.py +122 -0
  505. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/executor.py +349 -0
  506. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/__init__.py +48 -0
  507. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/analytics_handlers.py +547 -0
  508. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/decorators.py +50 -0
  509. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/edge_handlers.py +237 -0
  510. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/external_handlers.py +77 -0
  511. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/graphrag_handlers.py +761 -0
  512. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/node_handlers.py +824 -0
  513. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/summarize_handlers.py +564 -0
  514. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/handlers/template_handlers.py +304 -0
  515. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/registry.py +309 -0
  516. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/schema_registry.py +688 -0
  517. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/engine/validators.py +260 -0
  518. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/management/__init__.py +45 -0
  519. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/management/service.py +259 -0
  520. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/__init__.py +82 -0
  521. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/ai_extract_json_plugin.py +259 -0
  522. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/ai_generate_embedding_plugin.py +273 -0
  523. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/ai_prompt_plugin.py +651 -0
  524. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/ai_vector_search_plugin.py +177 -0
  525. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/data_extract_plugin.py +127 -0
  526. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/data_merge_plugin.py +132 -0
  527. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/http_request_plugin.py +256 -0
  528. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/logic_conditional_plugin.py +146 -0
  529. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/logic_loop_plugin.py +120 -0
  530. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/plugins/templates_list_plugin.py +105 -0
  531. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/tools/system_tools.py +118 -0
  532. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/__init__.py +62 -0
  533. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/engine/__init__.py +39 -0
  534. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/engine/executor.py +636 -0
  535. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/management/__init__.py +36 -0
  536. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/management/service.py +349 -0
  537. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/management/stats_tracker.py +135 -0
  538. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/models/__init__.py +38 -0
  539. chaoscypher_core-0.1.0/src/chaoscypher_core/services/workflows/triggers/models/entities.py +57 -0
  540. chaoscypher_core-0.1.0/src/chaoscypher_core/settings.py +3223 -0
  541. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/__init__.py +9 -0
  542. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/__init__.py +139 -0
  543. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/approval.py +172 -0
  544. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/citations.py +1198 -0
  545. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/events.py +148 -0
  546. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/handler.py +1410 -0
  547. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/messages.py +422 -0
  548. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/tools.py +1206 -0
  549. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/utils.py +360 -0
  550. chaoscypher_core-0.1.0/src/chaoscypher_core/streaming/chat/validation.py +376 -0
  551. chaoscypher_core-0.1.0/src/chaoscypher_core/templates/__init__.py +20 -0
  552. chaoscypher_core-0.1.0/src/chaoscypher_core/templates/default_templates.py +764 -0
  553. chaoscypher_core-0.1.0/src/chaoscypher_core/templates/visuals.py +666 -0
  554. chaoscypher_core-0.1.0/src/chaoscypher_core/testing/__init__.py +60 -0
  555. chaoscypher_core-0.1.0/src/chaoscypher_core/testing/structlog_fixtures.py +168 -0
  556. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/__init__.py +52 -0
  557. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/chunk.py +1301 -0
  558. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/disk.py +45 -0
  559. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/encoding.py +247 -0
  560. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/filelock.py +97 -0
  561. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/id.py +36 -0
  562. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/llm_response.py +135 -0
  563. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/logging/__init__.py +35 -0
  564. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/logging/app_config.py +21 -0
  565. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/logging/config.py +185 -0
  566. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/normalization_default.py +38 -0
  567. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/retry.py +398 -0
  568. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/rrf.py +40 -0
  569. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/safe_paths.py +105 -0
  570. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/settings_validators.py +93 -0
  571. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/task_callbacks.py +48 -0
  572. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/text_patterns.py +45 -0
  573. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/tokens.py +68 -0
  574. chaoscypher_core-0.1.0/src/chaoscypher_core/utils/url_safety.py +278 -0
  575. chaoscypher_core-0.1.0/src/chaoscypher_core/vision/__init__.py +15 -0
  576. chaoscypher_core-0.1.0/src/chaoscypher_core/vision/states.py +39 -0
  577. chaoscypher_core-0.1.0/src/chaoscypher_core.egg-info/PKG-INFO +495 -0
  578. chaoscypher_core-0.1.0/src/chaoscypher_core.egg-info/SOURCES.txt +595 -0
  579. chaoscypher_core-0.1.0/src/chaoscypher_core.egg-info/dependency_links.txt +1 -0
  580. chaoscypher_core-0.1.0/src/chaoscypher_core.egg-info/entry_points.txt +5 -0
  581. chaoscypher_core-0.1.0/src/chaoscypher_core.egg-info/requires.txt +68 -0
  582. chaoscypher_core-0.1.0/src/chaoscypher_core.egg-info/top_level.txt +1 -0
  583. chaoscypher_core-0.1.0/tests/test_app_config_strict_yaml.py +47 -0
  584. chaoscypher_core-0.1.0/tests/test_exception_hierarchy.py +42 -0
  585. chaoscypher_core-0.1.0/tests/test_filtering_config_no_aliases.py +33 -0
  586. chaoscypher_core-0.1.0/tests/test_phase2_ai_entities_port.py +62 -0
  587. chaoscypher_core-0.1.0/tests/test_phase2_commit_service_ports.py +120 -0
  588. chaoscypher_core-0.1.0/tests/test_phase2_engine_port_wiring.py +59 -0
  589. chaoscypher_core-0.1.0/tests/test_phase2_extraction_repo_dict_contract.py +151 -0
  590. chaoscypher_core-0.1.0/tests/test_phase2_shims_deleted.py +98 -0
  591. chaoscypher_core-0.1.0/tests/test_phase2_source_service_retry_port.py +74 -0
  592. chaoscypher_core-0.1.0/tests/test_phase2_structured_extractor_port.py +129 -0
  593. chaoscypher_core-0.1.0/tests/test_phase2_utility_relocation.py +116 -0
  594. chaoscypher_core-0.1.0/tests/test_phase2_vision_service_port.py +55 -0
  595. chaoscypher_core-0.1.0/tests/test_policy.py +63 -0
  596. chaoscypher_core-0.1.0/tests/test_ports_no_lens_protocol.py +20 -0
  597. chaoscypher_core-0.1.0/tests/test_settings.py +308 -0
@@ -0,0 +1,495 @@
1
+ Metadata-Version: 2.4
2
+ Name: chaoscypher-core
3
+ Version: 0.1.0
4
+ Summary: Chaos Cypher Core - Knowledge graph library with hexagonal architecture
5
+ Author-email: Denis MacPherson <denis@chaoscypher.com>
6
+ Maintainer-email: Denis MacPherson <denis@chaoscypher.com>
7
+ License-Expression: AGPL-3.0-only
8
+ Project-URL: Homepage, https://github.com/chaoscypherinc/chaoscypher
9
+ Project-URL: Documentation, https://github.com/chaoscypherinc/chaoscypher#readme
10
+ Project-URL: Repository, https://github.com/chaoscypherinc/chaoscypher
11
+ Project-URL: Issues, https://github.com/chaoscypherinc/chaoscypher/issues
12
+ Keywords: knowledge-graph,graph-database,rdf,semantic-web,nlp,vector-search,hexagonal-architecture
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.14
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: sqlmodel<0.1,>=0.0.38
22
+ Requires-Dist: alembic<2,>=1.13.0
23
+ Requires-Dist: structlog<26,>=25.5.0
24
+ Requires-Dist: pydantic<3,>=2.12.0
25
+ Requires-Dist: platformdirs<5,>=4.9.0
26
+ Requires-Dist: mcp<2,>=1.27.0
27
+ Requires-Dist: sqlite-vec<0.2,>=0.1.9
28
+ Requires-Dist: sentence-transformers<6,>=5.4.0
29
+ Requires-Dist: torch<3,>=2.10.0
30
+ Requires-Dist: anthropic<2,>=0.92.0
31
+ Requires-Dist: openai<4,>=2.31.0
32
+ Requires-Dist: pypdf<7,>=6.9.0
33
+ Requires-Dist: pypdfium2<6,>=5.7.0
34
+ Requires-Dist: beautifulsoup4<5,>=4.12
35
+ Requires-Dist: docutils<1,>=0.20
36
+ Requires-Dist: python-docx<2,>=1.1
37
+ Requires-Dist: openpyxl<4,>=3.1
38
+ Requires-Dist: python-pptx<1,>=0.6
39
+ Requires-Dist: Pillow<13,>=12.2.0
40
+ Requires-Dist: faster-whisper<2,>=1.2.0
41
+ Requires-Dist: pyspellchecker<0.10,>=0.9.0
42
+ Requires-Dist: ftfy<7,>=6.3.0
43
+ Requires-Dist: trafilatura<3.0.0,>=2.0.0
44
+ Requires-Dist: charset-normalizer<4,>=3.3
45
+ Requires-Dist: chardet>=5.2.0
46
+ Requires-Dist: jsonref>=1.1.0
47
+ Requires-Dist: argon2-cffi<26,>=25.1.0
48
+ Requires-Dist: passlib<2,>=1.7.4
49
+ Requires-Dist: bcrypt<4.1,>=4.0.1
50
+ Requires-Dist: PyJWT[crypto]<3,>=2.13.0
51
+ Requires-Dist: cryptography<47,>=46.0.6
52
+ Requires-Dist: rustworkx<0.18,>=0.17.0
53
+ Requires-Dist: rapidfuzz<4,>=3.12.0
54
+ Requires-Dist: httpx<1,>=0.28.0
55
+ Requires-Dist: jinja2<4,>=3.1
56
+ Requires-Dist: jsonschema<5,>=4.26.0
57
+ Requires-Dist: regex<2027,>=2025.0.0
58
+ Requires-Dist: pydantic-settings<3,>=2.13.0
59
+ Requires-Dist: valkey<7,>=6.1.0
60
+ Requires-Dist: dynaconf<4,>=3.2.13
61
+ Requires-Dist: python-dotenv<2,>=1.2.0
62
+ Requires-Dist: pyyaml<7,>=6.0.3
63
+ Requires-Dist: langchain<2,>=1.2.15
64
+ Requires-Dist: langchain_core<2,>=1.2.28
65
+ Requires-Dist: langchain_text_splitters<2,>=1.1.0
66
+ Requires-Dist: langgraph<2,>=1.1.6
67
+ Requires-Dist: langchain_ollama<2,>=1.1.0
68
+ Requires-Dist: langchain_openai<2,>=1.1.10
69
+ Requires-Dist: langchain_anthropic<2,>=1.4.0
70
+ Requires-Dist: langchain_google_genai<5,>=4.2.0
71
+ Provides-Extra: dev
72
+ Requires-Dist: pytest<10,>=9.0.0; extra == "dev"
73
+ Requires-Dist: pytest-cov<8,>=7.1.0; extra == "dev"
74
+ Requires-Dist: pytest-asyncio<2,>=1.3.0; extra == "dev"
75
+ Requires-Dist: pytest-xdist<4,>=3.6.0; extra == "dev"
76
+ Requires-Dist: hypothesis<7,>=6.115.0; extra == "dev"
77
+ Requires-Dist: diff-cover<10,>=9.6.0; extra == "dev"
78
+ Requires-Dist: import-linter<3,>=2.0; extra == "dev"
79
+ Requires-Dist: ruff<1,>=0.15.0; extra == "dev"
80
+ Requires-Dist: mypy<2,>=1.20.0; extra == "dev"
81
+ Requires-Dist: vulture<3,>=2.16; extra == "dev"
82
+ Requires-Dist: pre-commit<5,>=4.5.0; extra == "dev"
83
+ Requires-Dist: pip-audit<3,>=2.10.0; extra == "dev"
84
+ Requires-Dist: pip-licenses<6,>=5.0.0; extra == "dev"
85
+ Requires-Dist: interrogate<2,>=1.7.0; extra == "dev"
86
+ Requires-Dist: types-requests<3,>=2.33.0; extra == "dev"
87
+ Requires-Dist: mutmut<4,>=3.5.0; extra == "dev"
88
+
89
+ # ChaosCypher Core
90
+
91
+ **Standalone AI knowledge graph library using Hexagonal Architecture (Ports & Adapters)**
92
+
93
+ Version: 0.1.0
94
+
95
+ [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.html)
96
+ [![Python 3.14+](https://img.shields.io/badge/python-3.14+-blue.svg)](https://www.python.org/downloads/)
97
+
98
+ ## Quick Start
99
+
100
+ ### Zero-boilerplate facade (no database, no setup)
101
+
102
+ ```python
103
+ from chaoscypher_core import ChaosCypher
104
+
105
+ # Configure once (optional — defaults to Ollama, env vars auto-detected)
106
+ ChaosCypher.configure(provider="openai", api_key="sk-...")
107
+
108
+ # Extract entities from any document
109
+ result = ChaosCypher.extract_sync("paper.pdf")
110
+ print(f"{len(result.entities)} entities, {len(result.relationships)} relationships")
111
+
112
+ # Chat with an LLM
113
+ response = ChaosCypher.chat_sync("Explain knowledge graphs")
114
+ print(response.content)
115
+
116
+ # Embed text (single or batch)
117
+ single = ChaosCypher.embed_sync("quantum entanglement")
118
+ batch = ChaosCypher.embed_batch_sync(["text one", "text two"])
119
+
120
+ # Process documents into a knowledge graph
121
+ result = ChaosCypher.add_document_sync("paper.pdf", database="demo")
122
+ results = ChaosCypher.add_documents_sync(["doc1.pdf", "doc2.pdf"])
123
+
124
+ # Extract from raw text (no file needed)
125
+ result = await ChaosCypher.extract(text="Alice knows Bob. Bob works at Acme.")
126
+ chunks = await ChaosCypher.chunk(text="Long document content...")
127
+ ```
128
+
129
+ A short alias `CC` is also available: `from chaoscypher_core import CC`.
130
+
131
+ Every method has an async variant (`extract`, `chat`, `embed`, `embed_batch`,
132
+ `search`, `add_document`, `add_documents`, `chunk`) and a sync variant with
133
+ a `_sync` suffix.
134
+
135
+ ### Build a knowledge graph (with persistent storage)
136
+
137
+ ```python
138
+ from chaoscypher_core import Engine
139
+
140
+ # Inline configuration — same kwargs as ChaosCypher.configure()
141
+ with Engine(database="demo", provider="openai", api_key="sk-...") as engine:
142
+ # Quick graph building with auto-created templates
143
+ alice = engine.add_node("Person", "Alice", properties={"role": "Engineer"})
144
+ bob = engine.add_node("Person", "Bob")
145
+ engine.add_edge("knows", alice, bob)
146
+
147
+ # Process a document into the graph
148
+ result = engine.add_document_sync("paper.pdf")
149
+ print(f"Extracted {len(result.nodes)} nodes")
150
+
151
+ # Search the graph (sync and async)
152
+ results = engine.search_sync("quantum entanglement")
153
+ results = await engine.search("quantum entanglement", mode="semantic")
154
+
155
+ # Chat and embed (sync wrappers for scripts/notebooks)
156
+ response = engine.chat_sync("Summarize this graph")
157
+ embedding = engine.embed_sync("quantum physics")
158
+ embeddings = engine.batch_embed_sync(["text one", "text two"])
159
+
160
+ stats = engine.get_stats()
161
+ print(f"Graph: {stats.nodes} nodes, {stats.edges} edges")
162
+ ```
163
+
164
+ `Engine` also accepts `data_dir=` for an explicit path instead of a database name.
165
+
166
+ ## Overview
167
+
168
+ A reusable, framework-agnostic library providing core AI-powered knowledge graph capabilities:
169
+
170
+ - **Entity Extraction:** AI-powered extraction from documents with template matching and deduplication
171
+ - **Document Loading:** Auto-detect file type (PDF, text, HTML, RST, DOCX, XLSX, PPTX, EPUB, CSV, JSON, JSONL, audio, video, image, archives)
172
+ - **RAG Pipeline:** Chunking, vector embeddings, and hybrid search (keyword + semantic)
173
+ - **Graph Management:** Node, edge, and template CRUD with search index synchronization
174
+ - **Graph Analytics:** Centrality, clustering, path analysis, community detection
175
+ - **Workflow Execution:** LangGraph-based workflow engine with tool calling
176
+ - **LLM Integration:** Ollama, OpenAI, Anthropic, and Gemini providers
177
+
178
+ ## Architecture: Hexagonal (Ports & Adapters)
179
+
180
+ ```
181
+ ┌─────────────────────────────────────────────────────────────┐
182
+ │ PORTS (Interfaces) │
183
+ │ ports/ - Python Protocols defining contracts │
184
+ │ - GraphRepositoryProtocol, SearchRepositoryProtocol, etc. │
185
+ └─────────────────────────────────────────────────────────────┘
186
+
187
+
188
+ ┌─────────────────────────────┼───────────────────────────────┐
189
+ │ CORE (Business Logic) │
190
+ │ services/ - Domain-organized business rules │
191
+ │ - graph/, search/, sources/, workflows/, chat/, export/ │
192
+ │ │
193
+ │ models.py - Pure Pydantic DTOs (no ORM dependencies) │
194
+ │ exceptions.py - Domain-specific exceptions │
195
+ └──────────────────────────────────────────────────────────────┘
196
+
197
+
198
+ ┌─────────────────────────────┼───────────────────────────────┐
199
+ │ ADAPTERS (Implementations) │
200
+ │ adapters/sqlite/ - SQLite storage (default) │
201
+ │ adapters/llm/ - LLM providers (Ollama, OpenAI, etc.) │
202
+ │ repos/graph/ - Graph repository (SQLite-backed) │
203
+ │ repos/search/ - Search repository (sqlite-vec + FTS5) │
204
+ └──────────────────────────────────────────────────────────────┘
205
+ ```
206
+
207
+ **Why Hexagonal?**
208
+
209
+ 1. **Framework Independence:** No FastAPI, SQLModel, or Docker dependencies in core
210
+ 2. **Testability:** Easy to mock protocol interfaces for unit testing
211
+ 3. **Portability:** Embeddable in web apps, CLIs, Jupyter notebooks, or scripts
212
+ 4. **Dual Deployment:** Supports async (Docker + Valkey) and sync (standalone) modes
213
+
214
+ ## Import Strategy
215
+
216
+ **Namespace class (recommended for most users):**
217
+
218
+ ```python
219
+ from chaoscypher_core import ChaosCypher # or CC
220
+
221
+ # One import gives you IDE autocomplete for every method
222
+ result = ChaosCypher.extract_sync("paper.pdf")
223
+ response = ChaosCypher.chat_sync("Explain knowledge graphs")
224
+ embedding = ChaosCypher.embed_sync("quantum entanglement")
225
+ batch = ChaosCypher.embed_batch_sync(["text one", "text two"])
226
+ results = ChaosCypher.search_sync("quantum", database="demo")
227
+ ```
228
+
229
+ **Granular imports (organized by tier):**
230
+
231
+ ```python
232
+ from chaoscypher_core import (
233
+ # --- Primary API (start here) ---
234
+ ChaosCypher, CC, Engine,
235
+ # Async convenience functions
236
+ extract, chat, embed, embed_batch, search, chunk,
237
+ add_document, add_documents,
238
+ # Sync convenience functions
239
+ extract_sync, chat_sync, embed_sync, embed_batch_sync, search_sync, chunk_sync,
240
+ add_document_sync, add_documents_sync,
241
+
242
+ # --- Configuration ---
243
+ EngineSettings, LLMSettings,
244
+
245
+ # --- Models (input DTOs) ---
246
+ NodeCreate, NodeUpdate, NodePosition,
247
+ EdgeCreate, EdgeUpdate,
248
+ TemplateCreate, TemplateUpdate,
249
+ PropertyDefinition, PropertyType,
250
+ AnalysisDepth, SearchMode, ProgressCallback, ProgressStage,
251
+
252
+ # --- Models (output DTOs) ---
253
+ Node, Edge, Template,
254
+ ExtractionResult, ProcessingResult, LLMChatResponse,
255
+ EmbedResult, BatchEmbedResult, EngineSearchResult,
256
+ ChunksResult, ChunkingResult, IndexingResult, RebuildResult,
257
+ PaginatedResult, DatabaseStats, DatabaseInfo,
258
+ HealthReport, HealthResult, TokenUsage, ToolResult, SourceStatus,
259
+
260
+ # --- Services (for Engine direct usage) ---
261
+ NodeService, EdgeService, TemplateService,
262
+ IndexingService, SearchService,
263
+ ExtractionService, SourceCommitService,
264
+ ChunkingService, Loaders,
265
+
266
+ # --- Advanced (adapters, protocols, factories) ---
267
+ LLMProvider, BaseLLMProvider, ProviderFactory, SqliteAdapter,
268
+ create_embedding_provider, ToolExecutionContext, generate_id,
269
+ # Protocols (for custom adapter authors)
270
+ GraphRepositoryProtocol, SearchRepositoryProtocol,
271
+ ChunkingProtocol, IndexingProtocol, EmbeddingProviderProtocol,
272
+ SourcesProtocol, SourceStorageProtocol,
273
+ )
274
+ ```
275
+
276
+ All public APIs are available as top-level imports. Deep imports are only needed for internal/private APIs.
277
+
278
+ ## Directory Structure
279
+
280
+ ```
281
+ chaoscypher_core/
282
+ ├── __init__.py # Public API exports
283
+ ├── models.py # Pure Pydantic DTOs
284
+ ├── settings.py # EngineSettings configuration
285
+ ├── exceptions.py # Exception hierarchy
286
+ ├── bootstrap.py # Engine class (single entry point)
287
+
288
+ ├── ports/ # PORTS: Protocol definitions (contracts)
289
+ │ ├── graph.py # GraphRepositoryProtocol
290
+ │ ├── search.py # SearchRepositoryProtocol
291
+ │ ├── chunk.py # ChunkingProtocol
292
+ │ ├── index.py # IndexingProtocol
293
+ │ ├── embedding.py # EmbeddingProviderProtocol
294
+ │ ├── llm.py # LLM provider protocols
295
+ │ ├── db.py # DatabaseProtocol
296
+ │ └── storage_*.py # Granular storage protocols, one file per concern
297
+ │ # (storage_sources, storage_chats, storage_tools,
298
+ │ # storage_triggers, storage_workflows, …)
299
+
300
+ ├── services/ # CORE: Business logic (domain-organized)
301
+ │ ├── graph/ # Graph CRUD (NodeService, EdgeService, TemplateService)
302
+ │ │ ├── engine/ # Analytics (centrality, clustering, paths)
303
+ │ │ └── management/ # Node, edge, template, source management
304
+ │ ├── search/ # RAG pipeline
305
+ │ │ └── engine/ # IndexingService, SearchService
306
+ │ ├── sources/ # Document processing
307
+ │ │ ├── engine/ # Extraction, commit, deduplication
308
+ │ │ │ └── extraction/utils/post_extraction.py # Shared structural-filter + type-normalize (Cortex/CLI/MCP parity)
309
+ │ │ ├── loaders/ # File type loaders (PDF, text, HTML, RST, DOCX, XLSX, PPTX, EPUB, CSV, JSON, JSONL, audio, video, image)
310
+ │ │ ├── normalizer/ # Content cleaning (cleaners return CleanerResult; OCRCleaner overrides applies_to)
311
+ │ │ └── management/ # Source CRUD
312
+ │ ├── workflows/ # Workflow orchestration
313
+ │ │ ├── engine/ # LangGraph executor
314
+ │ │ ├── management/ # Workflow CRUD
315
+ │ │ ├── tools/ # Tool plugins
316
+ │ │ └── triggers/ # Event triggers
317
+ │ ├── chat/ # Conversational AI
318
+ │ ├── export/ # Graph data export
319
+ │ ├── quality/ # Entity quality scoring + per-source quality counters (counters.py)
320
+ │ ├── compose/ # Graph merge/resolve
321
+ │ ├── lexicon/ # Vocabulary management
322
+ │ ├── presets/ # Preset configurations
323
+ │ └── package/ # Import/export packages
324
+
325
+ ├── adapters/ # ADAPTERS: External integrations
326
+ │ ├── sqlite/ # SQLite storage adapter (default)
327
+ │ │ ├── adapter.py # SqliteAdapter (implements all storage protocols)
328
+ │ │ ├── models.py # SQLModel entity definitions
329
+ │ │ └── mixins/ # Protocol implementations (14 focused mixins)
330
+ │ ├── llm/ # LLM provider system
331
+ │ │ ├── factory.py # ProviderFactory (cached provider creation)
332
+ │ │ ├── provider.py # LLMProvider (queue-free direct access)
333
+ │ │ └── providers/ # Ollama, OpenAI, Anthropic, Gemini
334
+ │ └── web/ # Web/HTTP integrations
335
+
336
+ ├── repos/ # DATA ACCESS: Repository implementations
337
+ │ ├── graph/ # GraphRepository (SQLite-backed)
338
+ │ ├── search/ # SearchRepository (sqlite-vec + FTS5)
339
+ │ └── extraction/ # ExtractionRepository
340
+
341
+ ├── plugins/ # Plugin system (base classes, discovery, registry)
342
+ ├── utils/ # Utilities (ID generation, chunking, logging)
343
+ │ ├── encoding.py # detect_encoding(path) — text-shaped loader pre-read
344
+ │ └── normalization_default.py # resolve_normalization_default(filename) — CSV/JSON default off
345
+ └── data/ # Static data files
346
+ ```
347
+
348
+ ## API Reference
349
+
350
+ ### ChaosCypher Facade
351
+
352
+ Static namespace class for one-import convenience. No instantiation needed.
353
+
354
+ | Method | Sync variant | Returns |
355
+ |--------|-------------|---------|
356
+ | `extract(source, *, text=)` | `extract_sync` | `ExtractionResult` |
357
+ | `chat(messages)` | `chat_sync` | `LLMChatResponse` |
358
+ | `embed(text)` | `embed_sync` | `EmbedResult \| BatchEmbedResult` |
359
+ | `embed_batch(texts)` | `embed_batch_sync` | `BatchEmbedResult` |
360
+ | `search(query, database=)` | `search_sync` | `list[EngineSearchResult]` |
361
+ | `chunk(source, *, text=)` | `chunk_sync` | `ChunksResult` |
362
+ | `add_document(filepath)` | `add_document_sync` | `ProcessingResult` |
363
+ | `add_documents(paths)` | `add_documents_sync` | `list[ProcessingResult]` |
364
+ | `load(filepath)` | (sync only) | `str` |
365
+ | `configure(provider=, api_key=)` | (sync only) | `None` |
366
+
367
+ `extract()` and `chunk()` accept `text=` for explicit text input, skipping file detection.
368
+
369
+ `embed_batch()` / `embed_batch_sync()` always return `BatchEmbedResult` (no union type).
370
+
371
+ ### Engine
372
+
373
+ Persistent graph engine with full service access. Accepts the same `provider=`, `api_key=`, and configuration kwargs as `ChaosCypher.configure()`.
374
+
375
+ ```python
376
+ Engine(database="mydb", provider="openai", api_key="sk-...")
377
+ Engine(data_dir="./data/databases/mydb") # explicit path
378
+ Engine(database="mydb", settings=my_engine_settings) # pre-built settings
379
+ ```
380
+
381
+ **Convenience methods (return Pydantic models):**
382
+
383
+ | Method | Returns | Notes |
384
+ |--------|---------|-------|
385
+ | `add_node(template, label)` | `Node` | Auto-creates template |
386
+ | `add_edge(template, source, target)` | `Edge` | Auto-creates template |
387
+ | `add_document(filepath)` | `ProcessingResult` | Full pipeline (async) |
388
+ | `add_documents(paths)` | `list[ProcessingResult]` | Batch pipeline (async) |
389
+ | `search(query)` | `list[EngineSearchResult]` | Async |
390
+ | `chat(messages)` | `LLMChatResponse` | Async |
391
+ | `embed(text)` | `EmbedResult` | Async |
392
+ | `batch_embed(texts)` | `BatchEmbedResult` | Async |
393
+
394
+ **Sync wrappers (for scripts and notebooks):**
395
+
396
+ `search_sync`, `chat_sync`, `embed_sync`, `batch_embed_sync`,
397
+ `add_document_sync`, `add_documents_sync`, `process_document_sync`
398
+
399
+ ### Advanced: Direct Service Access
400
+
401
+ For fine-grained control, Engine exposes the underlying services and models.
402
+ Use `TemplateCreate`, `NodeCreate`, and `EdgeCreate` DTOs when you need full
403
+ control over IDs, properties, and template configuration:
404
+
405
+ ```python
406
+ from chaoscypher_core import Engine, TemplateCreate, NodeCreate, EdgeCreate
407
+
408
+ with Engine(database="demo") as engine:
409
+ # Create a template with property definitions
410
+ t = engine.create_template(TemplateCreate(
411
+ name="Person",
412
+ template_type="node",
413
+ properties={"role": {"type": "string"}},
414
+ ))
415
+
416
+ # Create nodes with explicit template ID
417
+ alice = engine.create_node(NodeCreate(
418
+ template_id=t.id, label="Alice", properties={"role": "Engineer"},
419
+ ))
420
+ bob = engine.create_node(NodeCreate(
421
+ template_id=t.id, label="Bob", properties={"role": "Designer"},
422
+ ))
423
+
424
+ # Direct service access (returns dicts, not models)
425
+ nodes = engine.node_service.list_nodes()
426
+ templates = engine.template_service.list_templates()
427
+ ```
428
+
429
+ ## Storage Protocols
430
+
431
+ All storage protocols are defined in `chaoscypher_core.ports` and return `dict[str, Any]`:
432
+
433
+ | Protocol | Purpose |
434
+ |----------|---------|
435
+ | `GraphRepositoryProtocol` | Node, edge, and template CRUD |
436
+ | `SearchRepositoryProtocol` | Keyword, vector, and hybrid search |
437
+ | `ChunkingProtocol` | Hierarchical document chunking |
438
+ | `IndexingProtocol` | Chunk embedding storage and retrieval |
439
+ | `WorkflowStorageProtocol` | Workflow definitions, steps, statistics |
440
+ | `SourceStorageProtocol` | Source document lifecycle |
441
+ | `ChatStorageProtocol` | Chat conversations and messages |
442
+ | `ToolStorageProtocol` | Tool registry |
443
+ | `TriggerStorageProtocol` | Event triggers |
444
+ | `LLMMetricsStorageProtocol` | LLM call metrics and cost tracking |
445
+ | `SourcesProtocol` | Source and citation management |
446
+
447
+ The default implementation for all protocols is `SqliteAdapter` (via 14 focused mixins following Interface Segregation Principle).
448
+
449
+ ## Plugin Protocols
450
+
451
+ In addition to storage protocols, the core library exposes plugin protocols for extension points with a shared metadata contract:
452
+
453
+ - `PluginMetadata` (`plugins/base.py`) — unified Pydantic descriptor for all plugin
454
+ types (loaders, tools, cleaners, archive handlers, LLM providers). Carries
455
+ `plugin_id / name / description / version / priority / applies_to / origin / tags`.
456
+ - `CleanerProtocol` (`services/sources/normalizer/cleaners/base.py`) — `clean(content, metadata) -> CleanerResult`
457
+ carrying `(content, ops, lines_removed, paragraphs_deduplicated, chars_removed)`. Tuple
458
+ unpacking still works via `CleanerResult.__iter__` for back-compat. Cleaners may
459
+ optionally implement `applies_to(metadata) -> bool` to gate themselves by document
460
+ metadata (`OCRCleaner` uses this to fire only on OCR-derived content).
461
+ - `ArchiveHandler` (`services/sources/loaders/archive/handlers/base.py`) — extended in PR 1
462
+ to carry `metadata`, `can_handle() -> int` specificity score, and `find_root()` for
463
+ nested-docs discovery.
464
+
465
+ ## Testing
466
+
467
+ Protocol-based design enables clean mocking. All protocols are top-level exports:
468
+
469
+ ```python
470
+ from unittest.mock import Mock
471
+ from chaoscypher_core import ExtractionService, GraphRepositoryProtocol
472
+
473
+ def test_extraction():
474
+ service = ExtractionService(
475
+ graph_repository=Mock(spec=GraphRepositoryProtocol),
476
+ llm_provider=Mock(),
477
+ settings=Mock(),
478
+ )
479
+ # Test business logic with mocked dependencies
480
+ ```
481
+
482
+ ## Design Principles
483
+
484
+ - **KISS:** Simple, focused services with clear responsibilities
485
+ - **DRY:** Shared logic in utils/, protocol-based reuse
486
+ - **SOLID:** Interface segregation, dependency inversion, single responsibility
487
+ - **No Technical Debt:** Clean breaks over gradual migrations, delete dead code immediately
488
+
489
+ ## Documentation
490
+
491
+ For complete documentation including tutorials, API reference, and architecture guides, see the docs site or `docs/developer-guide/` in the repository.
492
+
493
+ ## License
494
+
495
+ See main project LICENSE