10xgraph-api 0.7.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 (220) hide show
  1. 10xgraph_api-0.7.0/10xgraph.json +16 -0
  2. 10xgraph_api-0.7.0/10xgraph_api.egg-info/PKG-INFO +618 -0
  3. 10xgraph_api-0.7.0/10xgraph_api.egg-info/SOURCES.txt +218 -0
  4. 10xgraph_api-0.7.0/10xgraph_api.egg-info/dependency_links.txt +1 -0
  5. 10xgraph_api-0.7.0/10xgraph_api.egg-info/entry_points.txt +3 -0
  6. 10xgraph_api-0.7.0/10xgraph_api.egg-info/not-zip-safe +1 -0
  7. 10xgraph_api-0.7.0/10xgraph_api.egg-info/requires.txt +44 -0
  8. 10xgraph_api-0.7.0/10xgraph_api.egg-info/top_level.txt +2 -0
  9. 10xgraph_api-0.7.0/CHANGELOG.md +357 -0
  10. 10xgraph_api-0.7.0/CODE_OF_CONDUCT.md +122 -0
  11. 10xgraph_api-0.7.0/CONTRIBUTING.md +109 -0
  12. 10xgraph_api-0.7.0/LICENSE +21 -0
  13. 10xgraph_api-0.7.0/MANIFEST.in +23 -0
  14. 10xgraph_api-0.7.0/PKG-INFO +618 -0
  15. 10xgraph_api-0.7.0/README.md +556 -0
  16. 10xgraph_api-0.7.0/RELEASE_NOTES.md +51 -0
  17. 10xgraph_api-0.7.0/SECURITY.md +75 -0
  18. 10xgraph_api-0.7.0/agentflow_cli/__init__.py +69 -0
  19. 10xgraph_api-0.7.0/pyproject.toml +390 -0
  20. 10xgraph_api-0.7.0/setup.cfg +4 -0
  21. 10xgraph_api-0.7.0/tenxgraph_api/__init__.py +23 -0
  22. 10xgraph_api-0.7.0/tenxgraph_api/cli/__init__.py +6 -0
  23. 10xgraph_api-0.7.0/tenxgraph_api/cli/capabilities.py +127 -0
  24. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/__init__.py +49 -0
  25. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/api.py +262 -0
  26. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/audit.py +213 -0
  27. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/build.py +305 -0
  28. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/config.py +71 -0
  29. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/demo.py +93 -0
  30. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/eval.py +909 -0
  31. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/init.py +531 -0
  32. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/skills.py +532 -0
  33. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/test.py +113 -0
  34. 10xgraph_api-0.7.0/tenxgraph_api/cli/commands/version.py +47 -0
  35. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/__init__.py +15 -0
  36. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/schema.py +566 -0
  37. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/server.py +240 -0
  38. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/static/app.css +2 -0
  39. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/static/app.js +3 -0
  40. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/static/favicon.svg +11 -0
  41. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/static/index.html +20 -0
  42. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/store.py +120 -0
  43. 10xgraph_api-0.7.0/tenxgraph_api/cli/config_editor/validation.py +377 -0
  44. 10xgraph_api-0.7.0/tenxgraph_api/cli/constants.py +112 -0
  45. 10xgraph_api-0.7.0/tenxgraph_api/cli/context.py +46 -0
  46. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/__init__.py +0 -0
  47. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/animations.py +550 -0
  48. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/config.py +279 -0
  49. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/output.py +625 -0
  50. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/prompts.py +220 -0
  51. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/screen.py +287 -0
  52. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/steps.py +621 -0
  53. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/theme.py +242 -0
  54. 10xgraph_api-0.7.0/tenxgraph_api/cli/core/validation.py +251 -0
  55. 10xgraph_api-0.7.0/tenxgraph_api/cli/exceptions.py +129 -0
  56. 10xgraph_api-0.7.0/tenxgraph_api/cli/logger.py +84 -0
  57. 10xgraph_api-0.7.0/tenxgraph_api/cli/main.py +936 -0
  58. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/__init__.py +0 -0
  59. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/defaults.py +844 -0
  60. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/dev/.env.example +1 -0
  61. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/dev/10xgraph.json +16 -0
  62. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/dev/graph/__init__.py +0 -0
  63. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/dev/graph/agent.py +63 -0
  64. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/.env.example +75 -0
  65. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/.pre-commit-config.yaml +50 -0
  66. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/.python-version +1 -0
  67. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/10xgraph.json +42 -0
  68. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/auth/__init__.py +0 -0
  69. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/auth/agent_auth.py +46 -0
  70. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/evals/__init__.py +0 -0
  71. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/evals/user_simulator_eval.py +76 -0
  72. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/evals/weather_agents_eval.py +53 -0
  73. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/__init__.py +0 -0
  74. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/agent.py +50 -0
  75. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/state.py +5 -0
  76. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/thread_name_generator.py +7 -0
  77. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/tools/__init__.py +0 -0
  78. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/tools/weather_tool.py +43 -0
  79. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/validators/__init__.py +0 -0
  80. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/validators/lifecyle.py +107 -0
  81. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/validators/manager.py +9 -0
  82. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/graph/validators/validators.py +21 -0
  83. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/pyproject.toml +79 -0
  84. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/tests/__init__.py +0 -0
  85. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/tests/conftest.py +6 -0
  86. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/tests/test_agent_eval.py +78 -0
  87. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/tests/test_catalog_tools.py +47 -0
  88. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/prod/tests/test_graph_nodes.py +57 -0
  89. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/SKILL.md +92 -0
  90. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/agents-and-tools.md +389 -0
  91. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/api-client.md +61 -0
  92. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/api-configuration.md +75 -0
  93. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/api-settings-and-middleware.md +89 -0
  94. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/architecture.md +91 -0
  95. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/auth-and-authorization.md +149 -0
  96. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/callbacks-and-command.md +283 -0
  97. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/checkpointing-and-threads.md +63 -0
  98. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/cli-commands.md +73 -0
  99. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/client-auth-and-errors.md +94 -0
  100. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/client-messages-invoke-stream.md +115 -0
  101. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/client-threads-memory-files.md +80 -0
  102. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/context-id-background.md +80 -0
  103. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/dependency-injection.md +58 -0
  104. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/evaluation.md +500 -0
  105. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/id-and-thread-name-generators.md +69 -0
  106. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/media-and-files.md +66 -0
  107. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/memory-and-store.md +70 -0
  108. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/prebuilt-agents-and-tools.md +394 -0
  109. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/production-runtime.md +56 -0
  110. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/providers-and-adapters.md +89 -0
  111. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/publishers-and-runtime-protocols.md +84 -0
  112. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/rate-limiting.md +194 -0
  113. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/realtime.md +172 -0
  114. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/remote-tools.md +55 -0
  115. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/rest-api-and-errors.md +97 -0
  116. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/security-and-validators.md +86 -0
  117. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/state-and-messages.md +68 -0
  118. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/state-graph.md +232 -0
  119. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/stream-emitter.md +144 -0
  120. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/streaming.md +53 -0
  121. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/testing-and-evaluation.md +64 -0
  122. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/10xgraph/references/unit-testing.md +202 -0
  123. 10xgraph_api-0.7.0/tenxgraph_api/cli/templates/skills/copilot/10xgraph.instructions.md +108 -0
  124. 10xgraph_api-0.7.0/tenxgraph_api/py.typed +0 -0
  125. 10xgraph_api-0.7.0/tenxgraph_api/src/__init__.py +0 -0
  126. 10xgraph_api-0.7.0/tenxgraph_api/src/app/__init__.py +13 -0
  127. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/__init__.py +15 -0
  128. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/__init__.py +0 -0
  129. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/auth_backend.py +38 -0
  130. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/authorization.py +379 -0
  131. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/base_auth.py +27 -0
  132. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/jwt_auth.py +122 -0
  133. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/ownership_resolver.py +170 -0
  134. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/permissions.py +354 -0
  135. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/request_config.py +130 -0
  136. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/auth/route_guard.py +105 -0
  137. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/__init__.py +0 -0
  138. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/graph_config.py +532 -0
  139. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/media_settings.py +72 -0
  140. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/sentry_config.py +60 -0
  141. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/settings.py +202 -0
  142. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/setup_logs.py +65 -0
  143. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/setup_middleware.py +483 -0
  144. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/config/worker_middleware.py +99 -0
  145. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/exceptions/__init__.py +17 -0
  146. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/exceptions/general_exception.py +58 -0
  147. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/exceptions/handle_errors.py +363 -0
  148. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/exceptions/resources_exceptions.py +72 -0
  149. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/exceptions/user_exception.py +58 -0
  150. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/__init__.py +25 -0
  151. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/__init__.py +15 -0
  152. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/base.py +27 -0
  153. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/factory.py +98 -0
  154. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/keying.py +133 -0
  155. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/memory.py +98 -0
  156. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/middleware.py +90 -0
  157. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/rate_limit/redis.py +115 -0
  158. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/request_limits.py +154 -0
  159. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/middleware/security_headers.py +239 -0
  160. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/utils/__init__.py +14 -0
  161. 10xgraph_api-0.7.0/tenxgraph_api/src/app/core/utils/log_sanitizer.py +216 -0
  162. 10xgraph_api-0.7.0/tenxgraph_api/src/app/loader.py +516 -0
  163. 10xgraph_api-0.7.0/tenxgraph_api/src/app/main.py +180 -0
  164. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/__init__.py +4 -0
  165. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ag_ui/__init__.py +10 -0
  166. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ag_ui/converter.py +195 -0
  167. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ag_ui/event_mapper.py +353 -0
  168. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ag_ui/router.py +90 -0
  169. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ag_ui/service.py +193 -0
  170. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/checkpointer/__init__.py +1 -0
  171. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/checkpointer/router.py +482 -0
  172. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/checkpointer/schemas/__init__.py +1 -0
  173. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/checkpointer/schemas/checkpointer_schemas.py +121 -0
  174. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/checkpointer/services/__init__.py +1 -0
  175. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/checkpointer/services/checkpointer_service.py +300 -0
  176. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/evals/__init__.py +6 -0
  177. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/evals/router.py +38 -0
  178. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/evals/services/__init__.py +1 -0
  179. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/evals/services/eval_report_service.py +354 -0
  180. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/__init__.py +6 -0
  181. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/realtime_guard.py +161 -0
  182. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/router.py +821 -0
  183. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/schemas/__init__.py +1 -0
  184. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/schemas/graph_schemas.py +386 -0
  185. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/services/__init__.py +1 -0
  186. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/services/graph_service.py +1219 -0
  187. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/graph/services/multimodal_preprocessor.py +164 -0
  188. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/media/__init__.py +506 -0
  189. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/media/router.py +242 -0
  190. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/media/schemas.py +39 -0
  191. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ping/__init__.py +4 -0
  192. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/ping/router.py +28 -0
  193. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/setup_router.py +60 -0
  194. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/store/__init__.py +4 -0
  195. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/store/router.py +200 -0
  196. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/store/schemas/__init__.py +28 -0
  197. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/store/schemas/store_schemas.py +200 -0
  198. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/store/services/__init__.py +4 -0
  199. 10xgraph_api-0.7.0/tenxgraph_api/src/app/routers/store/services/store_service.py +203 -0
  200. 10xgraph_api-0.7.0/tenxgraph_api/src/app/tasks/__init__.py +0 -0
  201. 10xgraph_api-0.7.0/tenxgraph_api/src/app/tasks/user_tasks.py +38 -0
  202. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/__init__.py +12 -0
  203. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/callable_helper.py +26 -0
  204. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/media/__init__.py +15 -0
  205. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/media/extractor.py +172 -0
  206. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/media/pipeline.py +83 -0
  207. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/parse_output.py +17 -0
  208. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/response_helper.py +129 -0
  209. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/schemas/__init__.py +11 -0
  210. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/schemas/output_schemas.py +28 -0
  211. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/schemas/user_schemas.py +13 -0
  212. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/snowflake_id_generator.py +90 -0
  213. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/swagger_helper.py +160 -0
  214. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/telemetry_store.py +123 -0
  215. 10xgraph_api-0.7.0/tenxgraph_api/src/app/utils/thread_name_generator.py +304 -0
  216. 10xgraph_api-0.7.0/tenxgraph_api/src/app/worker.py +91 -0
  217. 10xgraph_api-0.7.0/tests/test_agentflow_cli_alias.py +66 -0
  218. 10xgraph_api-0.7.0/tests/test_multimodal_sprint2_extraction.py +213 -0
  219. 10xgraph_api-0.7.0/tests/test_sprint4_media_api.py +341 -0
  220. 10xgraph_api-0.7.0/tests/test_utils_parse_and_callable.py +72 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "agent": "graph.react:app",
3
+ "thread_name_generator": "graph.thread_name_generator:MyNameGenerator",
4
+ "store": "graph.dummy_store:store",
5
+ "env": ".env",
6
+ "auth": null,
7
+ "rate_limit": {
8
+ "enabled": true,
9
+ "backend": "memory",
10
+ "requests": 100,
11
+ "window": 60,
12
+ "by": "ip",
13
+ "trusted_proxy_headers": false,
14
+ "exclude_paths": ["/health", "/docs", "/redoc", "/openapi.json"]
15
+ }
16
+ }
@@ -0,0 +1,618 @@
1
+ Metadata-Version: 2.4
2
+ Name: 10xgraph-api
3
+ Version: 0.7.0
4
+ Summary: Production server for 10xGraph agents (formerly 10xscale-agentflow-cli). Serves a compiled graph over REST, SSE, WebSocket, realtime audio and AG-UI with JWT or custom auth, scoped authorization on every endpoint, owner-only threads and rate limiting, and generates Docker Compose and Kubernetes files. Includes the 10xgraph CLI. MIT licensed, self-hosted.
5
+ Author-email: Shudipto Trafder <shudiptotrafder@gmail.com>
6
+ Maintainer-email: Shudipto Trafder <shudiptotrafder@gmail.com>, 10xScale <contact@10xscale.ai>
7
+ License: MIT
8
+ Project-URL: Homepage, https://10xgraph.com
9
+ Project-URL: Repository, https://github.com/10xGraph/10xgraph-api
10
+ Project-URL: Issues, https://github.com/10xGraph/10xgraph-api/issues
11
+ Project-URL: Documentation, https://10xgraph.com
12
+ Project-URL: Changelog, https://github.com/10xGraph/10xgraph-api/blob/main/CHANGELOG.md
13
+ Keywords: 10xgraph,10xscale,agentflow,agents,ai-agents,multi-agent,agent-server,agent-deployment,llm,fastapi,api-server,rest-api,sse,websocket,realtime-audio,ag-ui,jwt,authentication,authorization,rbac,multi-tenant,rate-limiting,self-hosted,production,docker,kubernetes,cli
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
23
+ Requires-Python: >=3.12
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: 10xgraph<2.0,>=0.10.0
27
+ Requires-Dist: fastapi<1.0,>=0.116
28
+ Requires-Dist: gunicorn<24,>=23.0
29
+ Requires-Dist: orjson<4,>=3.11
30
+ Requires-Dist: platformdirs<5,>=4.0
31
+ Requires-Dist: python-multipart<0.1,>=0.0.19
32
+ Requires-Dist: pydantic<3,>=2.13
33
+ Requires-Dist: pydantic-settings<3,>=2.3
34
+ Requires-Dist: uvicorn<1.0,>=0.30
35
+ Requires-Dist: typer<1.0,>=0.17
36
+ Requires-Dist: python-dotenv<2,>=1.0
37
+ Requires-Dist: questionary<3,>=2.0
38
+ Requires-Dist: rich<15,>=14.0
39
+ Provides-Extra: sentry
40
+ Requires-Dist: sentry-sdk>=2.10.0; extra == "sentry"
41
+ Provides-Extra: firebase
42
+ Requires-Dist: firebase-admin>=6.5.0; extra == "firebase"
43
+ Requires-Dist: oauth2client>=4.1.3; extra == "firebase"
44
+ Provides-Extra: snowflakekit
45
+ Requires-Dist: snowflakekit<1.0,>=0.1.1; extra == "snowflakekit"
46
+ Provides-Extra: redis
47
+ Requires-Dist: redis<7,>=5.0.7; extra == "redis"
48
+ Provides-Extra: jwt
49
+ Requires-Dist: PyJWT<3,>=2.8; extra == "jwt"
50
+ Provides-Extra: media
51
+ Requires-Dist: textxtract[docx,html,md,pdf,xml]>=0.2.0; extra == "media"
52
+ Provides-Extra: gcloud
53
+ Requires-Dist: google-cloud-logging; extra == "gcloud"
54
+ Provides-Extra: otel
55
+ Requires-Dist: opentelemetry-api>=1.20.0; extra == "otel"
56
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "otel"
57
+ Requires-Dist: opentelemetry-instrumentation-fastapi>=0.40b0; extra == "otel"
58
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20.0; extra == "otel"
59
+ Provides-Extra: ag-ui
60
+ Requires-Dist: ag-ui-protocol<2,>=1.0; extra == "ag-ui"
61
+ Dynamic: license-file
62
+
63
+ # 10xGraph API
64
+
65
+ *Formerly `10xscale-agentflow-cli`.* The production server for 10xGraph agents.
66
+
67
+ [![CI](https://github.com/10xGraph/10xgraph-api/actions/workflows/ci.yaml/badge.svg)](https://github.com/10xGraph/10xgraph-api/actions/workflows/ci.yaml)
68
+ [![Release](https://img.shields.io/github/v/release/10xGraph/10xgraph-api)](https://github.com/10xGraph/10xgraph-api/releases/latest)
69
+ [![PyPI](https://img.shields.io/pypi/v/10xgraph-api?color=blue)](https://pypi.org/project/10xgraph-api/)
70
+ [![Python](https://img.shields.io/pypi/pyversions/10xgraph-api)](https://pypi.org/project/10xgraph-api/)
71
+ [![License](https://img.shields.io/github/license/10xGraph/10xgraph-api)](https://github.com/10xGraph/10xgraph-api/blob/main/LICENSE)
72
+
73
+ `10xgraph-api` generates the production server around a [10xGraph](https://github.com/10xGraph/10xGraph) agent. Point `10xgraph.json` at your compiled graph and it serves REST, SSE streaming, WebSocket and realtime-audio endpoints with JWT or custom auth, scoped authorization on every endpoint, owner-only threads and rate limiting, then writes your Docker Compose and Kubernetes files. MIT licensed and self-hosted.
74
+
75
+ Other frameworks give you the graph. 10xGraph gives you the graph and the server around it, in the same open-source project.
76
+
77
+ ---
78
+
79
+ ## What the server gives you
80
+
81
+ - **Endpoints generated from the graph.** Invoke, SSE stream, stop, WebSocket and realtime audio; threads, state and messages; the memory store; file uploads for multimodal input; and an optional [AG-UI](https://10xgraph.com/docs/server/ag-ui) endpoint for CopilotKit and other AG-UI clients.
82
+ - **Authentication.** `"auth": "jwt"`, or your own `BaseAuth` subclass.
83
+ - **Scoped authorization on every endpoint.** Routes require `resource:action` scopes such as `graph:invoke`, `graph:stream` or `checkpointer:read`, checked by a pluggable `AuthorizationBackend`. The server refuses to start if any non-public route has no guard.
84
+ - **Owner-only threads.** In production mode a thread is readable and writable only by the user who created it, on every step that touches it. Ownership checks are cached in-process and optionally in Redis, so they do not hit the database on each request.
85
+ - **Rate limiting.** Sliding-window limits with a memory, Redis or custom backend.
86
+ - **Production hardening.** Request size limits (10 MB default), security headers, error and log sanitization, startup warnings for insecure settings, and Snowflake IDs for multi-node deployments.
87
+ - **Deployment files.** `10xgraph build --docker-compose --k8s` writes a `Dockerfile`, `.dockerignore`, `docker-compose.yml` and `k8s.yaml`.
88
+ - **A secure-by-default scaffold.** `10xgraph init --yes --template production --auth jwt --rate-limit redis` writes a project with JWT auth, owner-only thread access, a Redis rate limit, a prompt-injection validator, evals, tests, `.env.example` and a pre-commit config.
89
+
90
+ Not built in: automatic per-tool permissions (user A may call `refund`, user B may not). Tools receive the caller's verified scopes and can check them with `tenxgraph.core.authz.has_scope`.
91
+
92
+ | Package | What it does | Install |
93
+ |---|---|---|
94
+ | [`10xgraph`](https://github.com/10xGraph/10xGraph) | Core engine: graph, state, replay-safe tools, checkpointing, memory | `pip install 10xgraph` (pulled in by this package) |
95
+ | `10xgraph-api` (this repository) | Production server and the `10xgraph` command | `pip install 10xgraph-api` |
96
+ | [`10xgraph-client`](https://github.com/10xGraph/10xgraph-client) | Typed TypeScript client for every endpoint | `npm install 10xgraph-client` (until it is published, `@10xscale/agentflow-client`) |
97
+
98
+ Docs: [10xgraph.com](https://10xgraph.com).
99
+
100
+ ---
101
+
102
+ ## Migrating from 10xscale-agentflow-cli
103
+
104
+ 10xGraph is the new name of 10xScale Agentflow. The server, CLI, license and maintainers are
105
+ the same, and existing projects keep working.
106
+
107
+ | | Before | Now |
108
+ |---|---|---|
109
+ | PyPI package | `10xscale-agentflow-cli` | `10xgraph-api` |
110
+ | Python import | `agentflow_cli` | `tenxgraph_api` |
111
+ | Command | `agentflow` | `10xgraph` |
112
+ | Config file | `agentflow.json` | `10xgraph.json` |
113
+ | Core framework | `10xscale-agentflow` (import `agentflow`) | `10xgraph` (import `tenxgraph`) |
114
+ | CLI env vars | `AGENTFLOW_NO_FULLSCREEN`, `AGENTFLOW_NO_SPINNER`, `AGENTFLOW_ASCII` | `TENXGRAPH_NO_FULLSCREEN`, `TENXGRAPH_NO_SPINNER`, `TENXGRAPH_ASCII` |
115
+ | Website | agentflow.10xscale.ai | [10xgraph.com](https://10xgraph.com) |
116
+ | GitHub | [github.com/10xHub](https://github.com/10xHub) | [github.com/10xGraph](https://github.com/10xGraph) |
117
+
118
+ ```bash
119
+ pip uninstall 10xscale-agentflow-cli 10xscale-agentflow
120
+ pip install 10xgraph-api
121
+ ```
122
+
123
+ The old core and the new one both ship an `agentflow` module, so do not install
124
+ `10xscale-agentflow` next to `10xgraph`.
125
+
126
+ Kept working until 2.0, so you can migrate at your own pace:
127
+
128
+ - **`agentflow` command.** Runs the same CLI and prints a one-line deprecation notice.
129
+ - **`from agentflow_cli import ...`.** Resolves to the same modules as `tenxgraph_api` and
130
+ emits a `DeprecationWarning`.
131
+ - **`agentflow.json`.** Read when no `10xgraph.json` sits in the same directory. When both
132
+ exist, `10xgraph.json` wins. Rename the file when convenient: the keys are unchanged.
133
+ - **`AGENTFLOW_*` CLI env vars.** Read when the `TENXGRAPH_*` variable is unset.
134
+ - **`agentflow-bearer` WebSocket subprotocol and `agentflow://media/` URLs.** Still accepted.
135
+ New media references are written as `graph://media/`, and the server now also accepts
136
+ `10xgraph-bearer`.
137
+
138
+ ---
139
+
140
+ ## Installation
141
+
142
+ **Basic installation:**
143
+
144
+ ```bash
145
+ pip install 10xgraph-api
146
+ ```
147
+
148
+ Optional extras; install only what you configure:
149
+
150
+ ```bash
151
+ pip install "10xgraph-api[redis]" # Redis rate-limit / cache backend
152
+ pip install "10xgraph-api[jwt]" # JWT authentication
153
+ pip install "10xgraph-api[media]" # Document text extraction (multimodal)
154
+ pip install "10xgraph-api[otel]" # OpenTelemetry tracing
155
+ pip install "10xgraph-api[snowflakekit]" # Snowflake ID generation
156
+ ```
157
+
158
+ Requires Python 3.12 or newer. Installs the core `10xgraph` framework as a dependency.
159
+
160
+ ---
161
+
162
+ ## Quick start
163
+
164
+ ```bash
165
+ # 1. Scaffold a project (interactive: dev vs production, auth, rate limiting)
166
+ 10xgraph init
167
+
168
+ # 2. Start the local development server and open the playground (127.0.0.1:8000)
169
+ 10xgraph dev
170
+
171
+ # 3. Check the environment if anything looks wrong
172
+ 10xgraph audit
173
+
174
+ # 4. Generate production Docker files
175
+ 10xgraph build --docker-compose
176
+ ```
177
+
178
+ `10xgraph api` (server only) and `10xgraph play` (server + playground) remain
179
+ available; `dev` is the goal-oriented wrapper around them.
180
+
181
+ ---
182
+
183
+ ## CLI commands
184
+
185
+ Run `10xgraph --help` or `10xgraph COMMAND --help` for the generated command reference.
186
+
187
+ ### `10xgraph init`
188
+
189
+ Initialize a new project with configuration and a sample graph.
190
+
191
+ ```bash
192
+ 10xgraph init # interactive (chooses dev vs production setup)
193
+ 10xgraph init --path ./my-app # custom directory
194
+ 10xgraph init --force # overwrite existing files
195
+ 10xgraph init --path ./my-app --name MyAgent --template quick-start \
196
+ --non-interactive # reproducible CI/agent workflow
197
+ 10xgraph init --path ./my-app --template production --auth jwt \
198
+ --rate-limit redis --yes --dry-run
199
+ ```
200
+
201
+ ### `10xgraph dev`
202
+
203
+ Start the development API server and open the hosted playground when it is ready.
204
+
205
+ ```bash
206
+ 10xgraph dev # defaults (127.0.0.1:8000)
207
+ 10xgraph dev --host 127.0.0.1 --port 9000 # custom host/port
208
+ 10xgraph dev --config production.json # custom config file
209
+ 10xgraph dev --no-open --no-reload # API only, without auto-reload
210
+ ```
211
+
212
+ `10xgraph api` and `10xgraph play` remain available as compatibility commands.
213
+
214
+ ### Adaptive and structured output
215
+
216
+ ```bash
217
+ 10xgraph play # branded intro, then output in your scrollback
218
+ 10xgraph demo # preview every animation theme safely
219
+ 10xgraph demo --style build # one theme: typing, network, init, build, or eval
220
+ 10xgraph --fullscreen play # opt-in pinned header/footer surface
221
+ 10xgraph --no-animation play # accessible/static workflow
222
+ 10xgraph --format plain --no-color audit
223
+ 10xgraph --format jsonl eval --parallel
224
+ 10xgraph --quiet build
225
+ 10xgraph --cwd ../my-agent dev
226
+ ```
227
+
228
+ On an interactive terminal each command opens with a short intro (under a second) in
229
+ the logo's colors: the 10XGRAPH wordmark in ink, swept in by the amber entry node and the
230
+ blue accent, the command, the running versions (`10xgraph-api`, core `10xgraph`,
231
+ Python), and the command's own pipeline drawn like the logo's graph: `play`/`dev`
232
+ config→runtime→server→playground, `init` template→graph→config→project, `build`
233
+ source→deps→image→ship, `eval` discover→load→score→report, `audit`
234
+ python→core→config→port. Press any key to skip it; Ctrl+C quits at once. The intro then
235
+ leaves a one-line branded header in your normal scrollback, and the command's output
236
+ follows it, so there is nothing to dismiss when it ends.
237
+
238
+ `--fullscreen` (or `TENXGRAPH_FULLSCREEN=1`) runs the command on a dedicated surface
239
+ instead: a pinned header and footer with the output scrolling between them. That surface
240
+ waits for Enter after a normal finish, so a fast command cannot erase its own result;
241
+ Ctrl+C releases it immediately.
242
+
243
+ Long-running work reports through a live step timeline: stages are declared up
244
+ front, pending ones stay dimmed, and the running one animates with an elapsed
245
+ timer. `10xgraph eval` uses a determinate progress bar with a running pass/fail
246
+ tally.
247
+
248
+ Motion is disabled automatically for redirected output, CI, `TERM=dumb`,
249
+ JSON/JSONL, and `TENXGRAPH_NO_SPINNER=1`. Use `--no-animation` for a stable
250
+ screen-reader friendly experience, or `--animation` to force motion in a
251
+ compatible terminal. Every animated surface has a plain line-per-transition
252
+ renderer and a versioned JSON/JSONL event renderer.
253
+
254
+ ### `10xgraph build`
255
+
256
+ Generate production Docker files.
257
+
258
+ ```bash
259
+ 10xgraph build # Dockerfile
260
+ 10xgraph build --docker-compose # Dockerfile + docker-compose.yml
261
+ 10xgraph build --k8s # Dockerfile + k8s.yaml (Deployment + Service)
262
+ 10xgraph build --python-version 3.12 --port 9000
263
+ 10xgraph build --service-name my-agent # name used in docker-compose.yml / k8s.yaml
264
+ 10xgraph build --force # overwrite an existing Dockerfile
265
+ ```
266
+
267
+ ### `10xgraph eval` / `10xgraph test`
268
+
269
+ Run agent evaluations (discovers `*_eval.py` / `eval_*.py`, writes HTML + JSON to `eval_reports/`) and project tests (pytest).
270
+
271
+ ```bash
272
+ 10xgraph eval --parallel --threshold 0.8
273
+ 10xgraph test --coverage
274
+ ```
275
+
276
+ ### `10xgraph skills`
277
+
278
+ Install bundled coding-agent skills (Codex, Claude, GitHub Copilot) into your project so your AI assistant knows how to build with 10xGraph.
279
+
280
+ ```bash
281
+ 10xgraph skills # pick agents interactively (space toggles, enter confirms)
282
+ 10xgraph skills --all # install for every supported agent
283
+ 10xgraph skills --agent claude # install for one
284
+ 10xgraph skills --list # show supported agents
285
+ 10xgraph skills --force # overwrite an existing install
286
+ 10xgraph skills --validate ./.agents/skills # check skills against the Agent Skills spec
287
+ ```
288
+
289
+ Run without flags to get a checklist of the supported agents. Each row shows
290
+ where it installs, agents that are already set up are labelled and pre-checked,
291
+ and picking one that exists offers to overwrite rather than failing.
292
+
293
+ ### `10xgraph version`
294
+
295
+ Display CLI and package version information.
296
+
297
+ ```bash
298
+ 10xgraph --version # script-friendly CLI version only
299
+ 10xgraph version
300
+ ```
301
+
302
+ ### `10xgraph audit`
303
+
304
+ Read-only check of everything that has to be true before `dev`, `eval`, or `build`
305
+ can work here: the Python interpreter, the installed `10xgraph-api` and
306
+ `10xgraph` packages, whether the installed core still exposes the
307
+ evaluation API this CLI imports, whether `10xgraph.json` is present and declares a
308
+ valid `agent` key, and whether the default port is free.
309
+
310
+ ```bash
311
+ 10xgraph audit # table of six checks
312
+ 10xgraph --format json audit # machine-readable, for CI
313
+ 10xgraph --no-animation audit # static output
314
+ ```
315
+
316
+ Nothing is written or changed. It exits `1` if any check fails and `0` otherwise.
317
+ Warnings (no project config, port already bound) are reported without failing the run,
318
+ so it works as a CI gate.
319
+
320
+ ### `10xgraph config`
321
+
322
+ Open a local browser editor for `10xgraph.json`: switch optional sections (auth,
323
+ authorization, rate limiting, observability, ...) on or off, fill in their fields,
324
+ **Validate** without saving, and **Save** to write the file. Saving is blocked while
325
+ there are errors, and the previous file is kept as `10xgraph.json.bak`.
326
+
327
+ ```bash
328
+ 10xgraph config # edit ./10xgraph.json
329
+ 10xgraph config -c path/to/10xgraph.json --port 8765 --no-open
330
+ ```
331
+
332
+ ### `10xgraph demo`
333
+
334
+ Preview the terminal animations and progress states without touching project state.
335
+
336
+ ```bash
337
+ 10xgraph demo # every theme
338
+ 10xgraph demo --style eval # one of: typing, network, init, build, eval
339
+ ```
340
+
341
+ ---
342
+
343
+ ## Configuration
344
+
345
+ The configuration file (`10xgraph.json`) defines your agent, authentication, and infrastructure settings:
346
+
347
+ ```json
348
+ {
349
+ "agent": "graph.react:app",
350
+ "env": ".env",
351
+ "auth": null,
352
+ "checkpointer": null,
353
+ "injectq": null,
354
+ "authorization": null,
355
+ "store": null,
356
+ "remote_tools": [],
357
+ "redis": null,
358
+ "thread_name_generator": null,
359
+ "rate_limit": {}
360
+ }
361
+ ```
362
+
363
+ ### Configuration Options
364
+
365
+ | Field | Type | Description |
366
+ |-------|------|-------------|
367
+ | `agent` | string | Path to your compiled agent graph, `"module:attribute"` (required) |
368
+ | `env` | string | Path to environment variables file |
369
+ | `auth` | null \| "jwt" \| object | Authentication configuration |
370
+ | `authorization` | string \| null | Path to an `AuthorizationBackend` (RBAC / per-tool access) |
371
+ | `checkpointer` | string \| null | Path to a custom checkpointer |
372
+ | `injectq` | string \| null | Path to an InjectQ container |
373
+ | `store` | string \| null | Path to a data store |
374
+ | `remote_tools` | array | Trusted schemas for tools executed by clients; attached at startup |
375
+ | `redis` | string \| null | Redis connection URL |
376
+ | `rate_limit` | object \| null | Sliding-window rate limiting configuration |
377
+ | `thread_name_generator` | string \| null | Path to a custom thread name generator |
378
+ | `ag_ui` | object | `{"enabled": true}` mounts `POST /v1/ag-ui` (needs the `ag-ui` extra) |
379
+
380
+ Full reference: [Configuration](https://10xgraph.com/docs/reference/api-cli/configuration).
381
+
382
+ ---
383
+
384
+ ## Authentication
385
+
386
+ JWT or your own backend. Guide: [Authentication](https://10xgraph.com/docs/server/auth).
387
+
388
+ ### JWT Authentication
389
+
390
+ **10xgraph.json:**
391
+ ```json
392
+ { "auth": "jwt" }
393
+ ```
394
+
395
+ **.env:**
396
+ ```bash
397
+ JWT_SECRET_KEY=your-super-secret-key
398
+ JWT_ALGORITHM=HS256
399
+ ```
400
+
401
+ ### Custom Authentication
402
+
403
+ **10xgraph.json:**
404
+ ```json
405
+ { "auth": { "method": "custom", "path": "auth.custom:MyAuthBackend" } }
406
+ ```
407
+
408
+ **auth/custom.py:**
409
+ ```python
410
+ from typing import Any
411
+
412
+ from fastapi import HTTPException, Request, Response
413
+ from fastapi.security import HTTPAuthorizationCredentials
414
+ from tenxgraph_api import BaseAuth
415
+
416
+
417
+ class MyAuthBackend(BaseAuth):
418
+ def authenticate(
419
+ self,
420
+ request: Request,
421
+ response: Response,
422
+ credential: HTTPAuthorizationCredentials,
423
+ ) -> dict[str, Any] | None:
424
+ token = credential.credentials
425
+ user = verify_token(token) # your token check
426
+ if not user:
427
+ raise HTTPException(401, "Invalid token")
428
+ return {"user_id": user.id, "username": user.username, "email": user.email}
429
+ ```
430
+
431
+ ---
432
+
433
+ ## ID generation
434
+
435
+ 10xGraph includes Snowflake ID generation for distributed, time-sortable unique IDs.
436
+
437
+ ```bash
438
+ pip install "10xgraph-api[snowflakekit]"
439
+ ```
440
+
441
+ ```python
442
+ from tenxgraph_api import SnowFlakeIdGenerator
443
+
444
+ generator = SnowFlakeIdGenerator(
445
+ snowflake_epoch=1704067200000, # Jan 1, 2024
446
+ snowflake_node_id=1,
447
+ snowflake_worker_id=1,
448
+ )
449
+ new_id = await generator.generate()
450
+ ```
451
+
452
+ **Environment configuration:**
453
+ ```bash
454
+ SNOWFLAKE_EPOCH=1704067200000
455
+ SNOWFLAKE_NODE_ID=1
456
+ SNOWFLAKE_WORKER_ID=1
457
+ SNOWFLAKE_TIME_BITS=39
458
+ SNOWFLAKE_NODE_BITS=5
459
+ SNOWFLAKE_WORKER_BITS=8
460
+ ```
461
+
462
+ More: [Extensibility](https://10xgraph.com/docs/concepts/extensibility).
463
+
464
+ ---
465
+
466
+ ## Thread name generation
467
+
468
+ Generate human-friendly names for conversation threads.
469
+
470
+ ```python
471
+ from tenxgraph_api.src.app.utils.thread_name_generator import AIThreadNameGenerator
472
+
473
+ generator = AIThreadNameGenerator()
474
+ name = generator.generate_name()
475
+ # "thoughtful-dialogue", "exploring-ideas", ...
476
+ ```
477
+
478
+ Custom generators: [Extensibility](https://10xgraph.com/docs/concepts/extensibility).
479
+
480
+ ---
481
+
482
+ ## Security
483
+
484
+ Security features of the server:
485
+
486
+ - **Authentication:** JWT and custom authentication backends
487
+ - **Authorization:** scoped access on every endpoint, owner-only threads, extensible backends
488
+ - **Request limits:** configurable request size limit (10 MB default)
489
+ - **Error sanitization:** production-safe error messages that do not leak internals
490
+ - **Log sanitization:** automatic redaction of tokens, passwords and secrets
491
+ - **Security warnings:** startup validation for insecure configurations
492
+ - **Security headers:** HSTS, frame options and CSP, configurable
493
+
494
+ ### Production Security Checklist
495
+
496
+ ```bash
497
+ MODE=production # production mode
498
+ JWT_SECRET_KEY=<32+ chars> # strong secret (secrets.token_urlsafe(32))
499
+ IS_DEBUG=false # disable debug
500
+ ORIGINS=https://yourdomain.com # specific CORS origins (never *)
501
+ ALLOWED_HOST=yourdomain.com # specific allowed hosts (never *)
502
+ DOCS_PATH= # recommended: disable API docs
503
+ REDOCS_PATH=
504
+ MAX_REQUEST_SIZE=10485760 # request size limit (10MB default)
505
+ ```
506
+
507
+ See the [Production checklist](https://10xgraph.com/docs/server/production-checklist) and
508
+ [Authentication](https://10xgraph.com/docs/server/auth).
509
+
510
+ ---
511
+
512
+ ## Deployment
513
+
514
+ Guide: [Deploy](https://10xgraph.com/docs/server/deploy).
515
+
516
+ ```bash
517
+ # Generate Docker files
518
+ 10xgraph build --docker-compose
519
+
520
+ # Build and run
521
+ docker compose up --build -d
522
+
523
+ # Check logs
524
+ docker compose logs -f
525
+ ```
526
+
527
+ For Kubernetes, `10xgraph build --k8s` writes `k8s.yaml`; see [Kubernetes](https://10xgraph.com/docs/server/kubernetes).
528
+
529
+ ---
530
+
531
+ ## Project structure
532
+
533
+ ```
534
+ 10xgraph-api/
535
+ ├── tenxgraph_api/ # Main package
536
+ │ ├── __init__.py # Package exports (BaseAuth, SnowFlakeIdGenerator, ThreadNameGenerator)
537
+ │ ├── cli/ # Typer CLI: main.py + commands/ + templates/
538
+ │ └── src/app/ # FastAPI application (main.py, loader.py, core/, routers/, utils/)
539
+ ├── tests/ # Test suite
540
+ ├── 10xgraph.json # Configuration
541
+ ├── pyproject.toml # Project metadata
542
+ └── README.md # This file
543
+ ```
544
+
545
+ ---
546
+
547
+ ## Development
548
+
549
+ ```bash
550
+ # Clone and set up
551
+ git clone https://github.com/10xGraph/10xgraph-api.git
552
+ cd 10xgraph-api
553
+ uv sync --dev
554
+ pre-commit install
555
+
556
+ # Quality gate
557
+ pytest # tests (coverage gate: 80%)
558
+ pytest --cov=tenxgraph_api --cov-report=html
559
+ ruff check . && ruff format . # lint + format
560
+ pre-commit run --all-files # full gate (ruff + bandit, pinned versions)
561
+ ```
562
+
563
+ ### Using the Makefile
564
+
565
+ ```bash
566
+ make build # build sdist + wheel
567
+ make test # run tests
568
+ make publish # upload to PyPI (maintainers)
569
+ make clean # remove build artifacts
570
+ ```
571
+
572
+ ### Releasing
573
+
574
+ Releases are cut by pushing a version tag that matches `pyproject.toml`. The
575
+ [`release.yml`](./.github/workflows/release.yml) workflow then verifies the tag, builds the
576
+ sdist + wheel, checks the distribution metadata, and creates a GitHub Release with auto-generated
577
+ notes and the artifacts attached. PyPI publishing is manual (`make publish`).
578
+
579
+ ```bash
580
+ git tag v0.7.0 && git push origin v0.7.0
581
+ ```
582
+
583
+ ---
584
+
585
+ ## License
586
+
587
+ 10xGraph is [MIT licensed](https://github.com/10xGraph/10xgraph-api/blob/main/LICENSE) and made by
588
+ [10xScale](https://10xscale.ai). Contributions are accepted under the same license.
589
+
590
+ ---
591
+
592
+ ## Links
593
+
594
+ - Documentation: [10xgraph.com](https://10xgraph.com)
595
+ - Core framework: [`10xgraph`](https://github.com/10xGraph/10xGraph)
596
+ - PyPI: [`10xgraph-api`](https://pypi.org/project/10xgraph-api/)
597
+ - [Issues](https://github.com/10xGraph/10xgraph-api/issues)
598
+ - [Changelog](https://github.com/10xGraph/10xgraph-api/blob/main/CHANGELOG.md)
599
+
600
+ ---
601
+
602
+ ## Contributing
603
+
604
+ Contributions are welcome. Fork the repo, create a feature branch, run tests and linting, and open a
605
+ Pull Request. See the [repository](https://github.com/10xGraph/10xgraph-api) for issue reporting and
606
+ guidelines.
607
+
608
+ ---
609
+
610
+ ## Support
611
+
612
+ - **Documentation:** [10xgraph.com](https://10xgraph.com/)
613
+ - **Issues:** [GitHub Issues](https://github.com/10xGraph/10xgraph-api/issues)
614
+ - **Repository:** [GitHub](https://github.com/10xGraph/10xgraph-api)
615
+
616
+ ---
617
+
618
+ Developed by [10xScale](https://10xscale.ai), which runs its own AI products on 10xGraph.