xenfra-sdk 0.2.5__py3-none-any.whl → 0.2.7__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 (42) hide show
  1. xenfra_sdk/__init__.py +46 -2
  2. xenfra_sdk/blueprints/base.py +150 -0
  3. xenfra_sdk/blueprints/factory.py +99 -0
  4. xenfra_sdk/blueprints/node.py +219 -0
  5. xenfra_sdk/blueprints/python.py +57 -0
  6. xenfra_sdk/blueprints/railpack.py +99 -0
  7. xenfra_sdk/blueprints/schema.py +70 -0
  8. xenfra_sdk/cli/main.py +175 -49
  9. xenfra_sdk/client.py +6 -2
  10. xenfra_sdk/constants.py +26 -0
  11. xenfra_sdk/db/session.py +8 -3
  12. xenfra_sdk/detection.py +262 -191
  13. xenfra_sdk/dockerizer.py +76 -120
  14. xenfra_sdk/engine.py +767 -172
  15. xenfra_sdk/events.py +254 -0
  16. xenfra_sdk/exceptions.py +9 -0
  17. xenfra_sdk/governance.py +150 -0
  18. xenfra_sdk/manifest.py +93 -138
  19. xenfra_sdk/mcp_client.py +7 -5
  20. xenfra_sdk/{models.py → models/__init__.py} +17 -1
  21. xenfra_sdk/models/context.py +61 -0
  22. xenfra_sdk/orchestrator.py +223 -99
  23. xenfra_sdk/privacy.py +11 -0
  24. xenfra_sdk/protocol.py +38 -0
  25. xenfra_sdk/railpack_adapter.py +357 -0
  26. xenfra_sdk/railpack_detector.py +587 -0
  27. xenfra_sdk/railpack_manager.py +312 -0
  28. xenfra_sdk/recipes.py +152 -19
  29. xenfra_sdk/resources/activity.py +45 -0
  30. xenfra_sdk/resources/build.py +157 -0
  31. xenfra_sdk/resources/deployments.py +22 -2
  32. xenfra_sdk/resources/intelligence.py +25 -0
  33. xenfra_sdk-0.2.7.dist-info/METADATA +118 -0
  34. xenfra_sdk-0.2.7.dist-info/RECORD +49 -0
  35. {xenfra_sdk-0.2.5.dist-info → xenfra_sdk-0.2.7.dist-info}/WHEEL +1 -1
  36. xenfra_sdk/templates/Caddyfile.j2 +0 -14
  37. xenfra_sdk/templates/Dockerfile.j2 +0 -41
  38. xenfra_sdk/templates/cloud-init.sh.j2 +0 -90
  39. xenfra_sdk/templates/docker-compose-multi.yml.j2 +0 -29
  40. xenfra_sdk/templates/docker-compose.yml.j2 +0 -30
  41. xenfra_sdk-0.2.5.dist-info/METADATA +0 -116
  42. xenfra_sdk-0.2.5.dist-info/RECORD +0 -38
@@ -1,116 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: xenfra-sdk
3
- Version: 0.2.5
4
- Summary: Xenfra SDK: Core engine and utilities for the Xenfra platform.
5
- Author: xenfra-cloud
6
- Author-email: xenfra-cloud <xenfracloud@gmail.com>
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Topic :: Software Development :: Build Tools
13
- Classifier: Topic :: System :: Systems Administration
14
- Requires-Dist: fabric>=3.2.2
15
- Requires-Dist: python-digitalocean>=1.17.0
16
- Requires-Dist: python-dotenv>=1.2.1
17
- Requires-Dist: rich>=14.2.0
18
- Requires-Dist: sqlmodel>=0.0.16
19
- Requires-Dist: pyyaml>=6.0.1
20
- Requires-Dist: httpx>=0.27.0
21
- Requires-Dist: jinja2>=3.1.3
22
- Requires-Dist: python-jose[cryptography]>=3.3.0
23
- Requires-Dist: passlib>=1.7.4
24
- Requires-Dist: cryptography>=41.0.0
25
- Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
26
- Requires-Dist: pytest-mock>=3.12.0 ; extra == 'dev'
27
- Requires-Dist: pytest-cov>=4.0.0 ; extra == 'dev'
28
- Requires-Dist: pytest-asyncio>=0.21.0 ; extra == 'dev'
29
- Requires-Python: >=3.11
30
- Project-URL: Homepage, https://github.com/xenfra-cloud/xenfra-sdk
31
- Project-URL: Issues, https://github.com/xenfra-cloud/xenfra-sdk/issues
32
- Provides-Extra: dev
33
- Description-Content-Type: text/markdown
34
-
35
- # Xenfra SDK (The Engine) 📦
36
-
37
- [![PyPI](https://img.shields.io/pypi/v/xenfra-sdk)](https://pypi.org/project/xenfra-sdk/)
38
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
- [![Python](https://img.shields.io/pypi/pyversions/xenfra-sdk.svg)](https://pypi.org/project/xenfra-sdk/)
40
-
41
- The core infrastructure automation engine behind **Xenfra** (The Sovereign Cloud OS). This SDK provides the primitives for deploying, managing, and diagnosing applications on DigitalOcean with "Zen Mode" auto-healing.
42
-
43
- ## 🚀 Features
44
-
45
- - **InfraEngine**: A robust 9-phase deployment pipeline (Setup -> Asset Gen -> Droplet -> Code -> Build -> Health).
46
- - **Dockerizer**: Deterministic Dockerfile and Compose generation using Jinja2 templates.
47
- - **Zen Mode**: Utilities to automatically heal common failures (e.g., locked dpkg, exhausted ports).
48
- - **Privacy-First**: Built-in PII scrubbing for logs before they touch any AI services.
49
- - **Security**: Fernet encryption for tokens and RS256 JWT validation helpers.
50
-
51
- ## 📦 Installation
52
-
53
- ```bash
54
- pip install xenfra-sdk
55
- # or with uv
56
- uv add xenfra-sdk
57
- ```
58
-
59
- ## 🛠️ Usage
60
-
61
- ### 1. Initialize the Engine
62
-
63
- ```python
64
- from xenfra_sdk import XenfraClient, InfraEngine
65
-
66
- # Authenticate (Token usually comes from the CLI)
67
- client = XenfraClient(token="xenfra_...")
68
- engine = InfraEngine(client)
69
- ```
70
-
71
- ### 2. Deploy a Project
72
-
73
- ```python
74
- project_path = "/path/to/my-fastapi-app"
75
-
76
- # The engine handles detection (Python/Node), dockerization, and provisioning
77
- deployment = await engine.deploy(
78
- path=project_path,
79
- project_id="proj_123",
80
- env_vars={"DATABASE_URL": "..."}
81
- )
82
-
83
- print(f"🚀 Deployed successfully to: http://{deployment.ip_address}")
84
- ```
85
-
86
- ### 3. Diagnose a Failure
87
-
88
- ```python
89
- from xenfra_sdk.intelligence import diagnose_failure
90
-
91
- logs = client.deployments.get_logs(deployment.id)
92
- analysis = await diagnose_failure(logs)
93
-
94
- print(f"Diagnosis: {analysis.root_cause}")
95
- print(f"Suggested Fix: {analysis.suggestion}")
96
- ```
97
-
98
- ## 🔗 The Xenfra Ecosystem
99
-
100
- This SDK is the "Body" of the Xenfra Open Core architecture:
101
-
102
- - **[xenfra-cli](https://github.com/xenfracloud/xenfra-cli)**: The Terminal Interface (Uses this SDK).
103
- - **[xenfra-mcp](https://github.com/xenfracloud/xenfra-mcp)**: The AI Agent Interface (Uses this SDK).
104
- - **xenfra-platform**: The Private SaaS Backend (Uses this SDK).
105
-
106
- ## 🤝 Contributing
107
-
108
- We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
109
-
110
- 1. Clone: `git clone https://github.com/xenfracloud/xenfra-sdk`
111
- 2. Install: `uv sync`
112
- 3. Test: `pytest`
113
-
114
- ## 📄 License
115
-
116
- MIT © [Xenfra Cloud](https://xenfra.tech)
@@ -1,38 +0,0 @@
1
- xenfra_sdk/__init__.py,sha256=ZPdW5mFBa9UbmJXRjyBeodbIHWCQsOvmJ2MmUn0aApY,1420
2
- xenfra_sdk/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- xenfra_sdk/cli/main.py,sha256=541nlIUYFFeu4h1sCXivaHMC7SqpskazI0YocM8ylh4,7958
4
- xenfra_sdk/client.py,sha256=88M-ram8wDVfVEPpa3q1z4hXToBg4kSOgsIBOLXxsBo,3597
5
- xenfra_sdk/client_with_hooks.py,sha256=iN-xTGdeSPizktM6UG-aZEsuwQc5OgosNYUf1_Tq4Dc,10046
6
- xenfra_sdk/config.py,sha256=gaT4k5iJgW9guNVmlnYkCFGDSU1_er4LRZA2CgfKmJ0,588
7
- xenfra_sdk/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- xenfra_sdk/db/models.py,sha256=nbnlNiFShUo9uxrcVLHUezlNtF_NATS85pPYTKBriIE,714
9
- xenfra_sdk/db/session.py,sha256=0MA0404QU9eUabDgTqi-wNIUP0DpIKKG-OvB4Jzf7rc,885
10
- xenfra_sdk/dependencies.py,sha256=WHGfIrEYkss5yuBd_uOFrB6lPBWM2X0mEuG26ILAjXI,1211
11
- xenfra_sdk/detection.py,sha256=t8FA_AaNphvv-G0dGL6hLYqOdC9an6-QnVrtFoiTd7M,13993
12
- xenfra_sdk/dockerizer.py,sha256=KuVGcS5RacR91fGo_6pPlQ4wvJYqnenz0C6x9JoLPWU,7291
13
- xenfra_sdk/engine.py,sha256=haeU7YhAOgRFb8HG6BKhYmCBFnIHfS5YZpljBW4okvU,36581
14
- xenfra_sdk/exceptions.py,sha256=aMVtDVlzG7-FT2G_b-pJSuuey22B4YvC-b-L37GaImM,477
15
- xenfra_sdk/manifest.py,sha256=49wfCr0VK9AJBCF8HGOJ_K0ru8iUbjRDczH3MPzPJBc,6613
16
- xenfra_sdk/mcp_client.py,sha256=NZtQz_qK_8i504rVPXlE1vPdzt75hg8Lkp4d8BA8dk0,5777
17
- xenfra_sdk/models.py,sha256=qSUvtsBMaiTKCHxOcdgY9ghJc-rwwZEOHMp1qiTuvMI,7198
18
- xenfra_sdk/orchestrator.py,sha256=vRRBC9dl8A8HwQ7gHGwzC31MeZ7aXvyqhfjK4t4Yvno,27211
19
- xenfra_sdk/patterns.json,sha256=xHxbc0ogHDwysMczi30_hW1Ylfdsf-nsQdAom7RZ4KI,446
20
- xenfra_sdk/privacy.py,sha256=Bscv7bopCQTeJhvU8Z2jxdBfc5tCZDY5kuODonTcgSk,5509
21
- xenfra_sdk/recipes.py,sha256=-LLMz1ye6sqHb9zg3YGhOXzYO6-S9I13xTEKhca7C5U,947
22
- xenfra_sdk/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- xenfra_sdk/resources/base.py,sha256=5n-HTKAnIX2lTgXwio0xtwoaBn-nksjdm8qRTpe3iDk,81
24
- xenfra_sdk/resources/deployments.py,sha256=kqSxxAwJx_3TveNH-075RQH9IbQ9w-qJ9uM29CETuJU,11941
25
- xenfra_sdk/resources/files.py,sha256=opdxZt6GWMU-qu5ltfWfv2hm8TscdaK-r9o4k743Irs,3087
26
- xenfra_sdk/resources/intelligence.py,sha256=_jCIqny-gTV5cBjC6RF5CAs86xzXUKuoqNSAtkNnIYY,3560
27
- xenfra_sdk/resources/projects.py,sha256=EsCVXmqkhWl_Guz_8WDQDi3kAm1Wyg1rjXcyAigPD6E,3712
28
- xenfra_sdk/security.py,sha256=6vMZpbglhkRGBVVj4RCTu45-MCnQ15wt94-996zmaT8,1199
29
- xenfra_sdk/security_scanner.py,sha256=US9QdMjHdTUkqObrGPHvDPxMP0QXCxmwK5e28d8KT2E,12957
30
- xenfra_sdk/templates/Caddyfile.j2,sha256=PVXffF6dQN06xZ5KyiaSBTK31742v3GN4ISSwiJAXC4,320
31
- xenfra_sdk/templates/Dockerfile.j2,sha256=qEMnFo2kfYNWaeTpyjh6qeKciHv0dBBNxSVRmnmAIQQ,1176
32
- xenfra_sdk/templates/cloud-init.sh.j2,sha256=xOwf-VERYXnL8vNMU13SnrmRX0H-hEh3l1A4zSmLG0c,2999
33
- xenfra_sdk/templates/docker-compose-multi.yml.j2,sha256=PWSPdWsGb-sWJ-XCutMdHiz-uhChIwEN6QMaZ0_Spxs,911
34
- xenfra_sdk/templates/docker-compose.yml.j2,sha256=TQ__p3-TYAUbU0RNeZCxTjJ9gt81-Rry1B1QnuPzBzc,935
35
- xenfra_sdk/utils.py,sha256=d8eCjjV32QwqoJa759CEcETnnsjG5qVKDLQ84yYtlus,3898
36
- xenfra_sdk-0.2.5.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
37
- xenfra_sdk-0.2.5.dist-info/METADATA,sha256=Kvjh7DUxezPgF6MUP1qv9xQL1slb-b5ycvBNHft1GXI,3982
38
- xenfra_sdk-0.2.5.dist-info/RECORD,,