10xscale-agentflow-cli 0.2.8__tar.gz → 0.3.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 (115) hide show
  1. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/PKG-INFO +27 -2
  2. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/SOURCES.txt +11 -0
  3. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/requires.txt +2 -1
  4. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/PKG-INFO +27 -2
  5. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/README.md +24 -0
  6. 10xscale_agentflow_cli-0.3.0/agentflow_cli/cli/commands/api.py +211 -0
  7. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/constants.py +1 -0
  8. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/main.py +63 -1
  9. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/auth/jwt_auth.py +7 -8
  10. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/core/config/media_settings.py +50 -0
  11. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/settings.py +8 -3
  12. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/exceptions/handle_errors.py +1 -1
  13. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/middleware/request_limits.py +1 -2
  14. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/loader.py +51 -4
  15. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/main.py +29 -1
  16. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/checkpointer/router.py +37 -4
  17. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/checkpointer/schemas/checkpointer_schemas.py +1 -1
  18. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/checkpointer/services/checkpointer_service.py +13 -3
  19. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/graph/router.py +1 -1
  20. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/graph/schemas/graph_schemas.py +30 -4
  21. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/graph/services/graph_service.py +66 -12
  22. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/routers/graph/services/multimodal_preprocessor.py +89 -0
  23. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/routers/media/__init__.py +395 -0
  24. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/routers/media/router.py +154 -0
  25. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/routers/media/schemas.py +40 -0
  26. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/setup_router.py +2 -0
  27. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/store/router.py +12 -1
  28. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/store/schemas/store_schemas.py +2 -2
  29. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/store/services/store_service.py +13 -3
  30. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/utils/media/__init__.py +15 -0
  31. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/utils/media/extractor.py +73 -0
  32. 10xscale_agentflow_cli-0.3.0/agentflow_cli/src/app/utils/media/pipeline.py +83 -0
  33. 10xscale_agentflow_cli-0.3.0/graph/react.py +95 -0
  34. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/pyproject.toml +9 -9
  35. 10xscale_agentflow_cli-0.3.0/requirements.txt +31 -0
  36. 10xscale_agentflow_cli-0.3.0/tests/test_multimodal_sprint2_extraction.py +213 -0
  37. 10xscale_agentflow_cli-0.3.0/tests/test_sprint4_media_api.py +340 -0
  38. 10xscale_agentflow_cli-0.2.8/agentflow_cli/cli/commands/api.py +0 -101
  39. 10xscale_agentflow_cli-0.2.8/graph/react.py +0 -214
  40. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/dependency_links.txt +0 -0
  41. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/entry_points.txt +0 -0
  42. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/not-zip-safe +0 -0
  43. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/10xscale_agentflow_cli.egg-info/top_level.txt +0 -0
  44. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/ActionPlan.md +0 -0
  45. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/MANIFEST.in +0 -0
  46. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow.json +0 -0
  47. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/__init__.py +0 -0
  48. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/__init__.py +0 -0
  49. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/commands/__init__.py +0 -0
  50. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/commands/build.py +0 -0
  51. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/commands/init.py +0 -0
  52. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/commands/version.py +0 -0
  53. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/core/__init__.py +0 -0
  54. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/core/config.py +0 -0
  55. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/core/output.py +0 -0
  56. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/core/validation.py +0 -0
  57. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/exceptions.py +0 -0
  58. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/logger.py +0 -0
  59. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/templates/__init__.py +0 -0
  60. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/cli/templates/defaults.py +0 -0
  61. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/__init__.py +0 -0
  62. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/__init__.py +0 -0
  63. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/__init__.py +0 -0
  64. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/auth/__init__.py +0 -0
  65. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/auth/auth_backend.py +0 -0
  66. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/auth/authorization.py +0 -0
  67. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/auth/base_auth.py +0 -0
  68. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/auth/permissions.py +0 -0
  69. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/__init__.py +0 -0
  70. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/graph_config.py +0 -0
  71. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/sentry_config.py +0 -0
  72. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/setup_logs.py +0 -0
  73. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/setup_middleware.py +0 -0
  74. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/config/worker_middleware.py +0 -0
  75. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/exceptions/__init__.py +0 -0
  76. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/exceptions/general_exception.py +0 -0
  77. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/exceptions/resources_exceptions.py +0 -0
  78. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/exceptions/user_exception.py +0 -0
  79. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/middleware/__init__.py +0 -0
  80. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/middleware/security_headers.py +0 -0
  81. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/utils/__init__.py +0 -0
  82. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/core/utils/log_sanitizer.py +0 -0
  83. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/__init__.py +0 -0
  84. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/a2a.py +0 -0
  85. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/a2ui.py +0 -0
  86. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/checkpointer/__init__.py +0 -0
  87. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/checkpointer/schemas/__init__.py +0 -0
  88. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/checkpointer/services/__init__.py +0 -0
  89. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/graph/__init__.py +0 -0
  90. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/graph/schemas/__init__.py +0 -0
  91. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/graph/services/__init__.py +0 -0
  92. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/ping/__init__.py +0 -0
  93. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/ping/router.py +0 -0
  94. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/store/__init__.py +0 -0
  95. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/store/schemas/__init__.py +0 -0
  96. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/routers/store/services/__init__.py +0 -0
  97. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/tasks/__init__.py +0 -0
  98. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/tasks/user_tasks.py +0 -0
  99. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/__init__.py +0 -0
  100. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/callable_helper.py +0 -0
  101. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/parse_output.py +0 -0
  102. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/response_helper.py +0 -0
  103. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/schemas/__init__.py +0 -0
  104. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/schemas/output_schemas.py +0 -0
  105. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/schemas/user_schemas.py +0 -0
  106. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/snowflake_id_generator.py +0 -0
  107. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/swagger_helper.py +0 -0
  108. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/utils/thread_name_generator.py +0 -0
  109. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/agentflow_cli/src/app/worker.py +0 -0
  110. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/graph/__init__.py +0 -0
  111. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/graph/thread_name_generator.py +0 -0
  112. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/plan.md +0 -0
  113. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/scripts/generate_docs.py +0 -0
  114. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/setup.cfg +0 -0
  115. {10xscale_agentflow_cli-0.2.8 → 10xscale_agentflow_cli-0.3.0}/tests/test_utils_parse_and_callable.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 10xscale-agentflow-cli
3
- Version: 0.2.8
3
+ Version: 0.3.0
4
4
  Summary: CLI and API for 10xscale AgentFlow
5
5
  Author-email: 10xscale <contact@10xscale.ai>
6
6
  Maintainer-email: Shudipto Trafder <shudiptotrafder@gmail.com>
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
21
  Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
22
22
  Requires-Python: >=3.12
23
23
  Description-Content-Type: text/markdown
24
- Requires-Dist: 10xscale-agentflow>=0.5.0
24
+ Requires-Dist: 10xscale-agentflow>=0.7.0
25
25
  Requires-Dist: fastapi
26
26
  Requires-Dist: gunicorn
27
27
  Requires-Dist: orjson
@@ -32,6 +32,7 @@ Requires-Dist: uvicorn
32
32
  Requires-Dist: typer
33
33
  Requires-Dist: python-dotenv
34
34
  Requires-Dist: PyJWT
35
+ Requires-Dist: textxtract[docx,html,md,pdf,xml]>=0.2.0
35
36
  Provides-Extra: sentry
36
37
  Requires-Dist: sentry-sdk>=2.10.0; extra == "sentry"
37
38
  Provides-Extra: firebase
@@ -81,6 +82,12 @@ agentflow init --prod
81
82
  agentflow api
82
83
  ```
83
84
 
85
+ ### Start API With Play
86
+
87
+ ```bash
88
+ agentflow play
89
+ ```
90
+
84
91
  ### Generate Docker Files
85
92
 
86
93
  ```bash
@@ -142,6 +149,24 @@ agentflow api --no-reload
142
149
  agentflow api --verbose
143
150
  ```
144
151
 
152
+ ### `agentflow play`
153
+
154
+ Start the development API server and open the hosted playground with your local backend URL preconfigured.
155
+
156
+ ```bash
157
+ # Start with defaults and open the playground
158
+ agentflow play
159
+
160
+ # Custom host and port
161
+ agentflow play --host 127.0.0.1 --port 9000
162
+
163
+ # Custom config file
164
+ agentflow play --config production.json
165
+
166
+ # Disable auto-reload
167
+ agentflow play --no-reload
168
+ ```
169
+
145
170
  ### `agentflow build`
146
171
 
147
172
  Generate production Docker files.
@@ -4,6 +4,7 @@ README.md
4
4
  agentflow.json
5
5
  plan.md
6
6
  pyproject.toml
7
+ requirements.txt
7
8
  10xscale_agentflow_cli.egg-info/PKG-INFO
8
9
  10xscale_agentflow_cli.egg-info/SOURCES.txt
9
10
  10xscale_agentflow_cli.egg-info/dependency_links.txt
@@ -42,6 +43,7 @@ agentflow_cli/src/app/core/auth/jwt_auth.py
42
43
  agentflow_cli/src/app/core/auth/permissions.py
43
44
  agentflow_cli/src/app/core/config/__init__.py
44
45
  agentflow_cli/src/app/core/config/graph_config.py
46
+ agentflow_cli/src/app/core/config/media_settings.py
45
47
  agentflow_cli/src/app/core/config/sentry_config.py
46
48
  agentflow_cli/src/app/core/config/settings.py
47
49
  agentflow_cli/src/app/core/config/setup_logs.py
@@ -73,6 +75,10 @@ agentflow_cli/src/app/routers/graph/schemas/__init__.py
73
75
  agentflow_cli/src/app/routers/graph/schemas/graph_schemas.py
74
76
  agentflow_cli/src/app/routers/graph/services/__init__.py
75
77
  agentflow_cli/src/app/routers/graph/services/graph_service.py
78
+ agentflow_cli/src/app/routers/graph/services/multimodal_preprocessor.py
79
+ agentflow_cli/src/app/routers/media/__init__.py
80
+ agentflow_cli/src/app/routers/media/router.py
81
+ agentflow_cli/src/app/routers/media/schemas.py
76
82
  agentflow_cli/src/app/routers/ping/__init__.py
77
83
  agentflow_cli/src/app/routers/ping/router.py
78
84
  agentflow_cli/src/app/routers/store/__init__.py
@@ -90,6 +96,9 @@ agentflow_cli/src/app/utils/response_helper.py
90
96
  agentflow_cli/src/app/utils/snowflake_id_generator.py
91
97
  agentflow_cli/src/app/utils/swagger_helper.py
92
98
  agentflow_cli/src/app/utils/thread_name_generator.py
99
+ agentflow_cli/src/app/utils/media/__init__.py
100
+ agentflow_cli/src/app/utils/media/extractor.py
101
+ agentflow_cli/src/app/utils/media/pipeline.py
93
102
  agentflow_cli/src/app/utils/schemas/__init__.py
94
103
  agentflow_cli/src/app/utils/schemas/output_schemas.py
95
104
  agentflow_cli/src/app/utils/schemas/user_schemas.py
@@ -97,4 +106,6 @@ graph/__init__.py
97
106
  graph/react.py
98
107
  graph/thread_name_generator.py
99
108
  scripts/generate_docs.py
109
+ tests/test_multimodal_sprint2_extraction.py
110
+ tests/test_sprint4_media_api.py
100
111
  tests/test_utils_parse_and_callable.py
@@ -1,4 +1,4 @@
1
- 10xscale-agentflow>=0.5.0
1
+ 10xscale-agentflow>=0.7.0
2
2
  fastapi
3
3
  gunicorn
4
4
  orjson
@@ -9,6 +9,7 @@ uvicorn
9
9
  typer
10
10
  python-dotenv
11
11
  PyJWT
12
+ textxtract[docx,html,md,pdf,xml]>=0.2.0
12
13
 
13
14
  [firebase]
14
15
  firebase-admin>=6.5.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 10xscale-agentflow-cli
3
- Version: 0.2.8
3
+ Version: 0.3.0
4
4
  Summary: CLI and API for 10xscale AgentFlow
5
5
  Author-email: 10xscale <contact@10xscale.ai>
6
6
  Maintainer-email: Shudipto Trafder <shudiptotrafder@gmail.com>
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
21
  Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
22
22
  Requires-Python: >=3.12
23
23
  Description-Content-Type: text/markdown
24
- Requires-Dist: 10xscale-agentflow>=0.5.0
24
+ Requires-Dist: 10xscale-agentflow>=0.7.0
25
25
  Requires-Dist: fastapi
26
26
  Requires-Dist: gunicorn
27
27
  Requires-Dist: orjson
@@ -32,6 +32,7 @@ Requires-Dist: uvicorn
32
32
  Requires-Dist: typer
33
33
  Requires-Dist: python-dotenv
34
34
  Requires-Dist: PyJWT
35
+ Requires-Dist: textxtract[docx,html,md,pdf,xml]>=0.2.0
35
36
  Provides-Extra: sentry
36
37
  Requires-Dist: sentry-sdk>=2.10.0; extra == "sentry"
37
38
  Provides-Extra: firebase
@@ -81,6 +82,12 @@ agentflow init --prod
81
82
  agentflow api
82
83
  ```
83
84
 
85
+ ### Start API With Play
86
+
87
+ ```bash
88
+ agentflow play
89
+ ```
90
+
84
91
  ### Generate Docker Files
85
92
 
86
93
  ```bash
@@ -142,6 +149,24 @@ agentflow api --no-reload
142
149
  agentflow api --verbose
143
150
  ```
144
151
 
152
+ ### `agentflow play`
153
+
154
+ Start the development API server and open the hosted playground with your local backend URL preconfigured.
155
+
156
+ ```bash
157
+ # Start with defaults and open the playground
158
+ agentflow play
159
+
160
+ # Custom host and port
161
+ agentflow play --host 127.0.0.1 --port 9000
162
+
163
+ # Custom config file
164
+ agentflow play --config production.json
165
+
166
+ # Disable auto-reload
167
+ agentflow play --no-reload
168
+ ```
169
+
145
170
  ### `agentflow build`
146
171
 
147
172
  Generate production Docker files.
@@ -35,6 +35,12 @@ agentflow init --prod
35
35
  agentflow api
36
36
  ```
37
37
 
38
+ ### Start API With Play
39
+
40
+ ```bash
41
+ agentflow play
42
+ ```
43
+
38
44
  ### Generate Docker Files
39
45
 
40
46
  ```bash
@@ -96,6 +102,24 @@ agentflow api --no-reload
96
102
  agentflow api --verbose
97
103
  ```
98
104
 
105
+ ### `agentflow play`
106
+
107
+ Start the development API server and open the hosted playground with your local backend URL preconfigured.
108
+
109
+ ```bash
110
+ # Start with defaults and open the playground
111
+ agentflow play
112
+
113
+ # Custom host and port
114
+ agentflow play --host 127.0.0.1 --port 9000
115
+
116
+ # Custom config file
117
+ agentflow play --config production.json
118
+
119
+ # Disable auto-reload
120
+ agentflow play --no-reload
121
+ ```
122
+
99
123
  ### `agentflow build`
100
124
 
101
125
  Generate production Docker files.
@@ -0,0 +1,211 @@
1
+ """API server command implementation."""
2
+
3
+ import ipaddress
4
+ import os
5
+ import socket
6
+ import sys
7
+ import threading
8
+ import time
9
+ import webbrowser
10
+ from pathlib import Path
11
+ from typing import Any
12
+ from urllib.parse import urlencode
13
+
14
+ import uvicorn
15
+ from dotenv import load_dotenv
16
+
17
+ from agentflow_cli.cli.commands import BaseCommand
18
+ from agentflow_cli.cli.constants import (
19
+ DEFAULT_CONFIG_FILE,
20
+ DEFAULT_HOST,
21
+ DEFAULT_PLAYGROUND_URL,
22
+ DEFAULT_PORT,
23
+ )
24
+ from agentflow_cli.cli.core.config import ConfigManager
25
+ from agentflow_cli.cli.core.validation import validate_cli_options
26
+ from agentflow_cli.cli.exceptions import ConfigurationError, ServerError
27
+
28
+
29
+ class APICommand(BaseCommand):
30
+ """Command to start the Pyagenity API server."""
31
+
32
+ _PLAYGROUND_WAIT_TIMEOUT_SECONDS = 30.0
33
+ _PLAYGROUND_WAIT_INTERVAL_SECONDS = 0.25
34
+
35
+ def execute(
36
+ self,
37
+ config: str = DEFAULT_CONFIG_FILE,
38
+ host: str = DEFAULT_HOST,
39
+ port: int = DEFAULT_PORT,
40
+ reload: bool = True,
41
+ open_playground: bool = False,
42
+ playground_url: str = DEFAULT_PLAYGROUND_URL,
43
+ **kwargs: Any,
44
+ ) -> int:
45
+ """Execute the API server command.
46
+
47
+ Args:
48
+ config: Path to config file
49
+ host: Host to bind to
50
+ port: Port to bind to
51
+ reload: Enable auto-reload
52
+ open_playground: Open the hosted playground after the API becomes reachable
53
+ playground_url: Hosted playground base URL
54
+ **kwargs: Additional arguments
55
+
56
+ Returns:
57
+ Exit code
58
+ """
59
+ try:
60
+ # Print banner
61
+ self.output.print_banner(
62
+ "API (development)",
63
+ "Starting development server via Uvicorn. Not for production use.",
64
+ )
65
+
66
+ # Validate inputs
67
+ validated_options = validate_cli_options(host, port, config)
68
+
69
+ # Load configuration
70
+ config_manager = ConfigManager()
71
+ actual_config_path = config_manager.find_config_file(validated_options["config"])
72
+ # Load and validate config
73
+ config_manager.load_config(str(actual_config_path))
74
+
75
+ # Load environment file if specified
76
+ env_file_path = config_manager.resolve_env_file()
77
+ if env_file_path:
78
+ self.logger.info("Loading environment from: %s", env_file_path)
79
+ load_dotenv(env_file_path)
80
+ else:
81
+ # Load default .env if it exists
82
+ load_dotenv()
83
+
84
+ # Set environment variables
85
+ os.environ["GRAPH_PATH"] = str(actual_config_path)
86
+
87
+ # Add project root to sys.path for importing graph modules
88
+ sys.path.insert(0, str(actual_config_path.parent))
89
+
90
+ # Ensure we're using the correct module path
91
+ sys.path.insert(0, str(Path(__file__).parent.parent.parent))
92
+
93
+ self.logger.info(
94
+ "Starting API with config: %s, host: %s, port: %d",
95
+ actual_config_path,
96
+ validated_options["host"],
97
+ validated_options["port"],
98
+ )
99
+
100
+ if open_playground:
101
+ self._schedule_playground_launch(
102
+ host=validated_options["host"],
103
+ port=validated_options["port"],
104
+ playground_base_url=playground_url,
105
+ )
106
+
107
+ # Start the server
108
+ uvicorn.run(
109
+ "agentflow_cli.src.app.main:app",
110
+ host=validated_options["host"],
111
+ port=validated_options["port"],
112
+ reload=reload,
113
+ workers=1,
114
+ )
115
+
116
+ return 0
117
+
118
+ except (ConfigurationError, ServerError) as e:
119
+ return self.handle_error(e)
120
+ except Exception as e:
121
+ server_error = ServerError(
122
+ f"Failed to start API server: {e}",
123
+ host=host,
124
+ port=port,
125
+ )
126
+ return self.handle_error(server_error)
127
+
128
+ def _schedule_playground_launch(
129
+ self,
130
+ host: str,
131
+ port: int,
132
+ playground_base_url: str,
133
+ ) -> None:
134
+ browser_host = self._normalize_browser_host(host)
135
+ launch_url = self._build_playground_url(browser_host, port, playground_base_url)
136
+ self.output.info(
137
+ f"Playground will open at {launch_url} when the API is ready.",
138
+ emoji=False,
139
+ )
140
+ launch_thread = threading.Thread(
141
+ target=self._open_playground_when_ready,
142
+ args=(launch_url, browser_host, port),
143
+ daemon=True,
144
+ name="agentflow-playground-launcher",
145
+ )
146
+ launch_thread.start()
147
+
148
+ def _open_playground_when_ready(
149
+ self,
150
+ launch_url: str,
151
+ host: str,
152
+ port: int,
153
+ ) -> None:
154
+ if not self._wait_for_server(host, port):
155
+ self.logger.warning(
156
+ "API server did not become reachable in time. Open the playground manually: %s",
157
+ launch_url,
158
+ )
159
+ return
160
+
161
+ opened = webbrowser.open_new_tab(launch_url)
162
+ if opened:
163
+ self.logger.info("Opened playground URL: %s", launch_url)
164
+ return
165
+
166
+ self.logger.warning(
167
+ "Browser launch returned false. Open the playground manually: %s",
168
+ launch_url,
169
+ )
170
+
171
+ def _wait_for_server(
172
+ self,
173
+ host: str,
174
+ port: int,
175
+ ) -> bool:
176
+ deadline = time.monotonic() + self._PLAYGROUND_WAIT_TIMEOUT_SECONDS
177
+ while time.monotonic() < deadline:
178
+ try:
179
+ with socket.create_connection((host, port), timeout=1):
180
+ return True
181
+ except OSError:
182
+ time.sleep(self._PLAYGROUND_WAIT_INTERVAL_SECONDS)
183
+
184
+ return False
185
+
186
+ def _build_playground_url(
187
+ self,
188
+ host: str,
189
+ port: int,
190
+ playground_base_url: str,
191
+ ) -> str:
192
+ backend_host = host
193
+ if ":" in backend_host and not backend_host.startswith("["):
194
+ backend_host = f"[{backend_host}]"
195
+
196
+ backend_url = f"http://{backend_host}:{port}"
197
+ return f"{playground_base_url}?{urlencode({'backendUrl': backend_url})}"
198
+
199
+ def _normalize_browser_host(self, host: str) -> str:
200
+ if not host:
201
+ return "127.0.0.1"
202
+
203
+ normalized_host = host[1:-1] if host.startswith("[") and host.endswith("]") else host
204
+
205
+ try:
206
+ if ipaddress.ip_address(normalized_host).is_unspecified:
207
+ return "127.0.0.1"
208
+ except ValueError:
209
+ pass
210
+
211
+ return normalized_host
@@ -11,6 +11,7 @@ CLI_VERSION: Final[str] = "1.0.0"
11
11
  DEFAULT_HOST: Final[str] = "127.0.0.1"
12
12
  DEFAULT_PORT: Final[int] = 8000
13
13
  DEFAULT_CONFIG_FILE: Final[str] = "agentflow.json"
14
+ DEFAULT_PLAYGROUND_URL: Final[str] = "https://playground-463bd.web.app"
14
15
  DEFAULT_PYTHON_VERSION: Final[str] = "3.13"
15
16
  DEFAULT_SERVICE_NAME: Final[str] = "agentflow-api"
16
17
 
@@ -9,7 +9,11 @@ from agentflow_cli.cli.commands.api import APICommand
9
9
  from agentflow_cli.cli.commands.build import BuildCommand
10
10
  from agentflow_cli.cli.commands.init import InitCommand
11
11
  from agentflow_cli.cli.commands.version import VersionCommand
12
- from agentflow_cli.cli.constants import DEFAULT_CONFIG_FILE, DEFAULT_HOST, DEFAULT_PORT
12
+ from agentflow_cli.cli.constants import (
13
+ DEFAULT_CONFIG_FILE,
14
+ DEFAULT_HOST,
15
+ DEFAULT_PORT,
16
+ )
13
17
  from agentflow_cli.cli.core.output import OutputFormatter
14
18
  from agentflow_cli.cli.exceptions import PyagenityCLIError
15
19
  from agentflow_cli.cli.logger import setup_cli_logging
@@ -106,6 +110,64 @@ def api(
106
110
  sys.exit(handle_exception(e))
107
111
 
108
112
 
113
+ @app.command()
114
+ def play(
115
+ config: str = typer.Option(
116
+ DEFAULT_CONFIG_FILE,
117
+ "--config",
118
+ "-c",
119
+ help="Path to config file",
120
+ ),
121
+ host: str = typer.Option(
122
+ DEFAULT_HOST,
123
+ "--host",
124
+ "-H",
125
+ help=(
126
+ "Host to run the API on for the local playground session "
127
+ "(use 127.0.0.1 for localhost only)"
128
+ ),
129
+ ),
130
+ port: int = typer.Option(
131
+ DEFAULT_PORT,
132
+ "--port",
133
+ "-p",
134
+ help="Port to run the API on",
135
+ ),
136
+ reload: bool = typer.Option(
137
+ True,
138
+ "--reload/--no-reload",
139
+ help="Enable auto-reload for development",
140
+ ),
141
+ verbose: bool = typer.Option(
142
+ False,
143
+ "--verbose",
144
+ "-v",
145
+ help="Enable verbose logging",
146
+ ),
147
+ quiet: bool = typer.Option(
148
+ False,
149
+ "--quiet",
150
+ "-q",
151
+ help="Suppress all output except errors",
152
+ ),
153
+ ) -> None:
154
+ """Start the API server and open the hosted playground."""
155
+ setup_cli_logging(verbose=verbose, quiet=quiet)
156
+
157
+ try:
158
+ command = APICommand(output)
159
+ exit_code = command.execute(
160
+ config=config,
161
+ host=host,
162
+ port=port,
163
+ reload=reload,
164
+ open_playground=True,
165
+ )
166
+ sys.exit(exit_code)
167
+ except Exception as e:
168
+ sys.exit(handle_exception(e))
169
+
170
+
109
171
  @app.command()
110
172
  def version(
111
173
  verbose: bool = typer.Option(
@@ -1,4 +1,3 @@
1
- import os
2
1
  from typing import Any
3
2
 
4
3
  import jwt
@@ -7,6 +6,7 @@ from fastapi.security import HTTPAuthorizationCredentials
7
6
 
8
7
  from agentflow_cli.src.app.core import logger
9
8
  from agentflow_cli.src.app.core.auth.base_auth import BaseAuth
9
+ from agentflow_cli.src.app.core.config.settings import get_settings
10
10
  from agentflow_cli.src.app.core.exceptions import UserAccountError
11
11
 
12
12
 
@@ -44,13 +44,12 @@ class JwtAuth(BaseAuth):
44
44
  message="Invalid token, please login again",
45
45
  error_code="REVOKED_TOKEN",
46
46
  )
47
- jwt_secret_key = os.environ.get("JWT_SECRET_KEY", None)
48
- jwt_algorithm = os.environ.get("JWT_ALGORITHM", None)
49
47
 
50
- # check bearer token then remove barer prefix
48
+ settings = get_settings()
49
+ jwt_secret_key = settings.JWT_SECRET_KEY
50
+ jwt_algorithm = settings.JWT_ALGORITHM
51
+
51
52
  token = credential.credentials
52
- if token.lower().startswith("bearer "):
53
- token = token[7:]
54
53
 
55
54
  if jwt_secret_key is None or jwt_algorithm is None:
56
55
  raise UserAccountError(
@@ -61,8 +60,8 @@ class JwtAuth(BaseAuth):
61
60
  try:
62
61
  decoded_token = jwt.decode(
63
62
  token,
64
- jwt_secret_key, # type: ignore
65
- algorithms=[jwt_algorithm], # type: ignore
63
+ jwt_secret_key,
64
+ algorithms=[jwt_algorithm],
66
65
  )
67
66
  except jwt.ExpiredSignatureError:
68
67
  raise UserAccountError(
@@ -0,0 +1,50 @@
1
+ """Media / multimodal configuration loaded from environment variables."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import logging
6
+ from enum import Enum
7
+ from functools import lru_cache
8
+
9
+ from pydantic import ConfigDict
10
+ from pydantic_settings import BaseSettings
11
+
12
+
13
+ logger = logging.getLogger("agentflow-cli.media")
14
+
15
+
16
+ class MediaStorageType(str, Enum):
17
+ MEMORY = "memory"
18
+ LOCAL = "local"
19
+ CLOUD = "cloud"
20
+ PG = "pg"
21
+
22
+
23
+ class MediaSettings(BaseSettings):
24
+ """Settings loaded from env vars (prefix-free, matches plan)."""
25
+
26
+ MEDIA_STORAGE_TYPE: MediaStorageType = MediaStorageType.LOCAL
27
+ MEDIA_STORAGE_PATH: str = "./uploads"
28
+ MEDIA_MAX_SIZE_MB: float = 25.0
29
+ DOCUMENT_HANDLING: str = "extract_text" # extract_text | pass_raw | skip
30
+
31
+ # Cloud storage (S3/GCS) — only used when MEDIA_STORAGE_TYPE=cloud
32
+ MEDIA_CLOUD_PROVIDER: str = "aws" # aws | gcp
33
+ MEDIA_CLOUD_BUCKET: str = ""
34
+ MEDIA_CLOUD_REGION: str = "us-east-1"
35
+ MEDIA_CLOUD_PREFIX: str = "agentflow-media"
36
+ MEDIA_CLOUD_ACCESS_KEY_ID: str | None = None
37
+ MEDIA_CLOUD_SECRET_ACCESS_KEY: str | None = None
38
+ MEDIA_CLOUD_SESSION_TOKEN: str | None = None
39
+ MEDIA_CLOUD_PROJECT_ID: str | None = None
40
+ MEDIA_CLOUD_CREDENTIALS_JSON: str | None = None
41
+
42
+ MEDIA_SIGNED_URL_TTL_SECONDS: int = 3600
43
+ MEDIA_SIGNED_URL_REFRESH_BUFFER_SECONDS: int = 60
44
+
45
+ model_config = ConfigDict(extra="allow")
46
+
47
+
48
+ @lru_cache
49
+ def get_media_settings() -> MediaSettings:
50
+ return MediaSettings() # type: ignore[call-arg]
@@ -2,7 +2,7 @@ import logging
2
2
  import os
3
3
  from functools import lru_cache
4
4
 
5
- from pydantic import field_validator, model_validator
5
+ from pydantic import ConfigDict, field_validator, model_validator
6
6
  from pydantic_settings import BaseSettings
7
7
 
8
8
 
@@ -102,6 +102,12 @@ class Settings(BaseSettings):
102
102
  SNOWFLAKE_NODE_BITS: int = 5
103
103
  SNOWFLAKE_WORKER_BITS: int = 8
104
104
 
105
+ #################################
106
+ ###### JWT Config ###############
107
+ #################################
108
+ JWT_SECRET_KEY: str | None = None
109
+ JWT_ALGORITHM: str = "HS256"
110
+
105
111
  @field_validator("MODE", mode="before")
106
112
  @classmethod
107
113
  def normalize_mode(cls, v: str | None) -> str:
@@ -149,8 +155,7 @@ class Settings(BaseSettings):
149
155
 
150
156
  return self
151
157
 
152
- class Config:
153
- extra = "allow"
158
+ model_config = ConfigDict(extra="allow")
154
159
 
155
160
 
156
161
  @lru_cache
@@ -1,5 +1,5 @@
1
1
  # Handle all exceptions of agentflow here
2
- from agentflow.exceptions import (
2
+ from agentflow.core.exceptions import (
3
3
  GraphError,
4
4
  GraphRecursionError,
5
5
  MetricsError,
@@ -56,8 +56,7 @@ class RequestSizeLimitMiddleware(BaseHTTPMiddleware):
56
56
  "error": {
57
57
  "code": "REQUEST_TOO_LARGE",
58
58
  "message": (
59
- f"Request body too large. "
60
- f"Maximum size is {self.max_size_mb:.1f}MB"
59
+ f"Request body too large. Maximum size is {self.max_size_mb:.1f}MB"
61
60
  ),
62
61
  "max_size_bytes": self.max_size,
63
62
  "max_size_mb": self.max_size_mb,