smartify-ai 0.1.0__py3-none-any.whl

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 (46) hide show
  1. smartify/__init__.py +3 -0
  2. smartify/agents/__init__.py +0 -0
  3. smartify/agents/adapters/__init__.py +13 -0
  4. smartify/agents/adapters/anthropic.py +253 -0
  5. smartify/agents/adapters/openai.py +289 -0
  6. smartify/api/__init__.py +26 -0
  7. smartify/api/auth.py +352 -0
  8. smartify/api/errors.py +380 -0
  9. smartify/api/events.py +345 -0
  10. smartify/api/server.py +992 -0
  11. smartify/cli/__init__.py +1 -0
  12. smartify/cli/main.py +430 -0
  13. smartify/engine/__init__.py +64 -0
  14. smartify/engine/approval.py +479 -0
  15. smartify/engine/orchestrator.py +1365 -0
  16. smartify/engine/scheduler.py +380 -0
  17. smartify/engine/spark.py +294 -0
  18. smartify/guardrails/__init__.py +22 -0
  19. smartify/guardrails/breakers.py +409 -0
  20. smartify/models/__init__.py +61 -0
  21. smartify/models/grid.py +625 -0
  22. smartify/notifications/__init__.py +22 -0
  23. smartify/notifications/webhook.py +556 -0
  24. smartify/state/__init__.py +46 -0
  25. smartify/state/checkpoint.py +558 -0
  26. smartify/state/resume.py +301 -0
  27. smartify/state/store.py +370 -0
  28. smartify/tools/__init__.py +17 -0
  29. smartify/tools/base.py +196 -0
  30. smartify/tools/builtin/__init__.py +79 -0
  31. smartify/tools/builtin/file.py +464 -0
  32. smartify/tools/builtin/http.py +195 -0
  33. smartify/tools/builtin/shell.py +137 -0
  34. smartify/tools/mcp/__init__.py +33 -0
  35. smartify/tools/mcp/adapter.py +157 -0
  36. smartify/tools/mcp/client.py +334 -0
  37. smartify/tools/mcp/registry.py +130 -0
  38. smartify/validator/__init__.py +0 -0
  39. smartify/validator/validate.py +271 -0
  40. smartify/workspace/__init__.py +5 -0
  41. smartify/workspace/manager.py +248 -0
  42. smartify_ai-0.1.0.dist-info/METADATA +201 -0
  43. smartify_ai-0.1.0.dist-info/RECORD +46 -0
  44. smartify_ai-0.1.0.dist-info/WHEEL +4 -0
  45. smartify_ai-0.1.0.dist-info/entry_points.txt +2 -0
  46. smartify_ai-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: smartify-ai
3
+ Version: 0.1.0
4
+ Summary: Local runtime for Agent Swarms using the Smartify Grid specification
5
+ Project-URL: Documentation, https://docs.smartify.ai
6
+ Project-URL: Repository, https://github.com/smartify/smartify
7
+ Author-email: smartifyai <hello@smartify.ai>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: agents,ai,automation,orchestration
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.11
17
+ Requires-Dist: anthropic>=0.18
18
+ Requires-Dist: fastapi>=0.109
19
+ Requires-Dist: httpx<0.28,>=0.25
20
+ Requires-Dist: openai>=1.0
21
+ Requires-Dist: pydantic>=2.0
22
+ Requires-Dist: pyyaml>=6.0
23
+ Requires-Dist: rich>=13.0
24
+ Requires-Dist: tiktoken>=0.5
25
+ Requires-Dist: typer>=0.9
26
+ Requires-Dist: uvicorn>=0.25
27
+ Provides-Extra: all
28
+ Requires-Dist: smartify[dev,mcp]; extra == 'all'
29
+ Provides-Extra: dev
30
+ Requires-Dist: mypy>=1.0; extra == 'dev'
31
+ Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
32
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
33
+ Requires-Dist: pytest>=7.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.1; extra == 'dev'
35
+ Provides-Extra: mcp
36
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Smartify Runtime
40
+
41
+ Open-source runtime for AI agent swarms. Orchestrate multiple agents with guardrails, plug-and-play tool integrations (including MCP), and coordinate complex workflows for SaaS applications.
42
+
43
+ ## Features
44
+
45
+ - **Agent Swarms** - Coordinate multiple AI agents in a hierarchy (controller → relay → substation)
46
+ - **Multi-Provider** - Anthropic and OpenAI adapters, easily extensible to other providers
47
+ - **MCP Integration** - Plug-and-play with any [Model Context Protocol](https://modelcontextprotocol.io) server
48
+ - **Guardrails** - Token, time, and cost limits with configurable breaker actions
49
+ - **Parallel Execution** - Run tasks concurrently within constraints
50
+ - **Grid YAML** - Declarative workflow specification
51
+ - **CLI & API** - Command-line and REST API interfaces
52
+ - **Checkpoint/Resume** - Persist and resume long-running workflows
53
+
54
+ ## Quick Start
55
+
56
+ ### Installation
57
+
58
+ ```bash
59
+ # Basic installation
60
+ pip install smartify
61
+
62
+ # With MCP support (for external tool servers)
63
+ pip install smartify[mcp]
64
+
65
+ # Development (includes tests, linting)
66
+ pip install -e ".[dev]"
67
+
68
+ # Everything
69
+ pip install -e ".[all]"
70
+ ```
71
+
72
+ ### Validate a Grid
73
+
74
+ ```bash
75
+ smartify validate examples/minimal.yaml
76
+ ```
77
+
78
+ ### Run a Grid
79
+
80
+ ```bash
81
+ smartify run examples/calculator.yaml --input project_name=myapp
82
+ ```
83
+
84
+ ### Check Status
85
+
86
+ ```bash
87
+ smartify status <run_id>
88
+ ```
89
+
90
+ ## Grid Structure
91
+
92
+ ```yaml
93
+ apiVersion: smartify.ai/v1
94
+ kind: GridSpec
95
+
96
+ metadata:
97
+ id: my-grid
98
+ name: My Grid
99
+
100
+ topology:
101
+ nodes:
102
+ - id: controller
103
+ kind: controller
104
+ name: Main Controller
105
+ description: Orchestrate the workflow
106
+
107
+ - id: relay_build
108
+ kind: relay
109
+ parent: controller
110
+ name: Build Relay
111
+
112
+ - id: sub_impl
113
+ kind: substation
114
+ parent: relay_build
115
+ name: Implementation
116
+ ```
117
+
118
+ ## Node Types
119
+
120
+ | Kind | Description |
121
+ |------|-------------|
122
+ | `controller` | Primary orchestrator (exactly 1 per grid) |
123
+ | `relay` | Coordination/delegation node |
124
+ | `substation` | Task execution node |
125
+ | `foreach` | Fan-out iteration |
126
+ | `aggregate` | Fan-in merge |
127
+ | `approval` | Human-in-the-loop checkpoint |
128
+
129
+ ## MCP Integration
130
+
131
+ Connect to external [Model Context Protocol](https://modelcontextprotocol.io) servers for plug-and-play tool access.
132
+
133
+ ```yaml
134
+ # In your grid YAML
135
+ tools:
136
+ mcpServers:
137
+ - id: filesystem
138
+ transport: stdio
139
+ command: npx
140
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
141
+ prefix: fs # Tools become: fs_read_file, fs_write_file, etc.
142
+ ```
143
+
144
+ Nodes can then use MCP tools like any builtin:
145
+
146
+ ```yaml
147
+ nodes:
148
+ - id: file-worker
149
+ kind: substation
150
+ tools:
151
+ - fs_read_file
152
+ - fs_write_file
153
+ ```
154
+
155
+ See [examples/mcp-filesystem.yaml](examples/mcp-filesystem.yaml) for a complete example.
156
+
157
+ ## Agent Providers
158
+
159
+ Smartify supports multiple LLM providers. Set your API key and the runtime auto-registers the adapter:
160
+
161
+ ```bash
162
+ # Anthropic (default)
163
+ export ANTHROPIC_API_KEY=your_key
164
+
165
+ # OpenAI
166
+ export OPENAI_API_KEY=your_key
167
+ ```
168
+
169
+ Configure per-agent in grid YAML:
170
+
171
+ ```yaml
172
+ agents:
173
+ researcher:
174
+ modelPolicy:
175
+ preferred: claude-sonnet-4-20250514
176
+ fallback: [gpt-4o]
177
+ ```
178
+
179
+ ## Development
180
+
181
+ ```bash
182
+ # Install dev dependencies
183
+ pip install -e ".[dev]"
184
+
185
+ # Run tests
186
+ pytest
187
+
188
+ # Run tests with MCP
189
+ pip install -e ".[all]"
190
+ pytest
191
+
192
+ # Type checking
193
+ mypy src/
194
+
195
+ # Linting
196
+ ruff check src/
197
+ ```
198
+
199
+ ## License
200
+
201
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,46 @@
1
+ smartify/__init__.py,sha256=Za0PhLSZjQZh5Lxqj16DuyrN5b70MVQo9VMFGQ5fLTI,79
2
+ smartify/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ smartify/agents/adapters/__init__.py,sha256=bV4qm2e_UarfYo9HlDqOkTlrvEJJP0xM7t5nhU6p53Q,328
4
+ smartify/agents/adapters/anthropic.py,sha256=WlWVkbDg31b_TpadnNKTXgs5z6QEUjznZVHwEnvkL5I,8544
5
+ smartify/agents/adapters/openai.py,sha256=HKO49PDYbFg8Yu7J1cgNvmzSK1UW0hFV7PShLdQX7xo,10076
6
+ smartify/api/__init__.py,sha256=LbTRg5qjNBqrzNIZVOCHNKmXiqH2v3HtUBb2ko0NMxs,469
7
+ smartify/api/auth.py,sha256=qsdEOzhE5VLNJt6fb3-4QyabuEwO9MgYRyqDvmke4FQ,11334
8
+ smartify/api/errors.py,sha256=1VLa7k1hOfAgak-Ceon9v9gPv0WrYlf4GCT8rJkfYkY,13080
9
+ smartify/api/events.py,sha256=I2ef1e11Ovwcd3am3hagOfWzA9ANiMlW64PyH1GO3eQ,11091
10
+ smartify/api/server.py,sha256=JK4VoPv8zOQXEBpUXSVSYQIQetFp0bGR4JcCjbnfooE,30335
11
+ smartify/cli/__init__.py,sha256=aca0-tGaOaN0IAhiC7bvxjXl6_2lcLkJKAVtVSkpNXA,31
12
+ smartify/cli/main.py,sha256=7VaABcIVxEw6do5r92BHIJzH-yvHveCaqWwB51gyCNk,14965
13
+ smartify/engine/__init__.py,sha256=ufvvJM8xEra8edkVWUTSeiwNysYmDmM1s8TntDjv8tA,1522
14
+ smartify/engine/approval.py,sha256=RaPq1dKAO8gphvpKLCu-m_D2-DsbBdLBiA1XycdVYIk,16227
15
+ smartify/engine/orchestrator.py,sha256=EUwT-RUZ1M7hSO2l12odPre0oFXcTUwMq61bSj1p-tU,51729
16
+ smartify/engine/scheduler.py,sha256=H4VyqbEkqwF9eI3QIQbU6oSUk_EJbSPM2ZtQGTTMOYM,14382
17
+ smartify/engine/spark.py,sha256=pY0DO444TLIBVCkxCm-duEyYznXcK5NU5NMI_f2RK2Y,9587
18
+ smartify/guardrails/__init__.py,sha256=8fU8uTZqGrIVgbdb5xVZhQaIZ1rTfHVFUMdFctb2EZw,399
19
+ smartify/guardrails/breakers.py,sha256=QdSI3vu3CZ6mD_WY6Y3xq20lz0rd_d471YIz76Df0pE,13479
20
+ smartify/models/__init__.py,sha256=YNhKfnn0wAQzkEyFImWm27mpzZFzzo4bKigtprbWhOs,1070
21
+ smartify/models/grid.py,sha256=7wLcYA7n6Xsxnd90gTVFJaAmFU2SYNDyKqLs9czXljA,19675
22
+ smartify/notifications/__init__.py,sha256=p7Ae8McecKfWMAV4T90p4f4z-ebi18IWFQ1kbbk9meA,368
23
+ smartify/notifications/webhook.py,sha256=ArMhVqSJYVTI1nO3TMrCc3S_k89GBAkYRq0CxTZNmQk,18412
24
+ smartify/state/__init__.py,sha256=ucXds2RLGxdb2M7zTP6yugxdUYtZTXac2Ns6fYuJiQU,913
25
+ smartify/state/checkpoint.py,sha256=_uZ-QGb739Qf_gU8octClTLI1LzsnAkICtivrBCXYzs,20555
26
+ smartify/state/resume.py,sha256=3a0tX-gO4COY85OFZd5ffZmafM7Q2ZXOGa9kk3VccNg,10065
27
+ smartify/state/store.py,sha256=HWg7oHp9d9FNwCa2KD31FwNGHXTPyTCrJPlr1JoQV_E,12702
28
+ smartify/tools/__init__.py,sha256=75DcbRRIQ5bqYNriURN-ky_MeInoQIYezpJxlQT9pJk,315
29
+ smartify/tools/base.py,sha256=Z67XOeIoVWlJI_7LPNUjroMQkMRuDM-khTH07zrJejE,5808
30
+ smartify/tools/builtin/__init__.py,sha256=DeWaF9JEZdcLrhs6VPV1-2qi8jF19F5-1EXoHeme6qg,1930
31
+ smartify/tools/builtin/file.py,sha256=wLzn8TT8dPAkYMJaaGn4xKdKXzp2_UwvIT7hnvZ0O9E,14204
32
+ smartify/tools/builtin/http.py,sha256=jmdAAvv9Cmn8_Eoadk2x5YX6uEY3THX3kvPwwvsEiqs,6464
33
+ smartify/tools/builtin/shell.py,sha256=Kg05Pc_gF79ajJq4hGSZ3pHHdsTmBIT9gAlVjNq-zoQ,4554
34
+ smartify/tools/mcp/__init__.py,sha256=lA1Vy83aKMuWoLP2gVj21HpEy3t50wbCiA7d_3UP7ps,821
35
+ smartify/tools/mcp/adapter.py,sha256=gPWOwIXMsjYF1AqLosBdLl0b6do9A7g3McB_YYHm0Pk,4690
36
+ smartify/tools/mcp/client.py,sha256=KlYv6YxN-IyVlaLMf0kXxxhhQX1KNxNXf0yrOJqSaqs,10649
37
+ smartify/tools/mcp/registry.py,sha256=IjreV6_uNZ89Rrv7pKK0zqvOgXq1Nc8BV9OpYGsFPI4,3821
38
+ smartify/validator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
+ smartify/validator/validate.py,sha256=2DO4C_bfBLUGl5vp4PPeO5-1Auuc08cAf9l_ZjYdmVs,9222
40
+ smartify/workspace/__init__.py,sha256=snJ9pvvrWpPrjmXvfTBu9oNyUrbqA5aM2rhGmVs95vw,169
41
+ smartify/workspace/manager.py,sha256=oeTqYWEG_tW9NAwzbYsZhoMffCzhIMjYW-stCcn1IlM,7920
42
+ smartify_ai-0.1.0.dist-info/METADATA,sha256=h70Vjgl0rVyd7y_ehdUPuVwNxhfvbD2_E516D3cyxio,4734
43
+ smartify_ai-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
44
+ smartify_ai-0.1.0.dist-info/entry_points.txt,sha256=RrGT07LIgRdXPXZmYwZUEPrvx5Inic8CB6eP4nLO4F0,51
45
+ smartify_ai-0.1.0.dist-info/licenses/LICENSE,sha256=sGVAlk8QB6ir30zz8k6LBdtZZ3BNs1lLKQrGbl9QKpo,1065
46
+ smartify_ai-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ smartify = smartify.cli.main:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Smartify
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.