devops-bot-sdk 1.0.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.
@@ -0,0 +1,178 @@
1
+ Metadata-Version: 2.4
2
+ Name: devops-bot-sdk
3
+ Version: 1.0.0
4
+ Summary: DevOps Bot Desktop SDK — thin client for the AgentOS Electron desktop app
5
+ Author: noumanaziz2128
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://agentos.io
8
+ Project-URL: Repository, https://github.com/consultancy-outfit/devops-bot-ai
9
+ Requires-Python: >=3.11
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: httpx>=0.27
12
+ Requires-Dist: pydantic>=2.0
13
+ Requires-Dist: cryptography>=42
14
+ Provides-Extra: screenshot
15
+ Requires-Dist: Pillow>=10.0; extra == "screenshot"
16
+ Provides-Extra: process
17
+ Requires-Dist: psutil>=5.9; extra == "process"
18
+ Provides-Extra: all
19
+ Requires-Dist: Pillow>=10.0; extra == "all"
20
+ Requires-Dist: psutil>=5.9; extra == "all"
21
+
22
+ # AgentOS SDK
23
+
24
+ Thin Python client for the AgentOS desktop app (Electron). Wraps the backend
25
+ `/api/v1/*` endpoints. No orchestration logic — agents run server-side.
26
+
27
+ ## Requirements
28
+
29
+ - Python 3.11+
30
+ - AgentOS backend running (default: `http://localhost:8000`)
31
+ - An API token from the AgentOS web app (Settings → API Tokens)
32
+
33
+ ## Installation
34
+
35
+ ### Basic (chat + pipeline + webhooks)
36
+ ```bash
37
+ pip install agentos-sdk
38
+ ```
39
+
40
+ ### With screenshot collector
41
+ ```bash
42
+ pip install "agentos-sdk[screenshot]"
43
+ ```
44
+
45
+ ### With process collector
46
+ ```bash
47
+ pip install "agentos-sdk[process]"
48
+ ```
49
+
50
+ ### Everything
51
+ ```bash
52
+ pip install "agentos-sdk[all]"
53
+ ```
54
+
55
+ ### From source (development)
56
+ ```bash
57
+ # From the repo root
58
+ pip install -e sdk/ # installs sdk/ as editable package
59
+ # OR
60
+ pip install -e "sdk/[all]" # with all optional extras
61
+ ```
62
+
63
+ ## Setup
64
+
65
+ ```bash
66
+ agentos configure
67
+ # Backend URL [http://localhost:8000]: https://your-backend.example.com
68
+ # Paste your token (format: aeos_<64-char-hex>): aeos_...
69
+ # ✓ Configuration saved to ~/.agentos/config.toml
70
+ ```
71
+
72
+ Replace a token:
73
+ ```bash
74
+ agentos configure --rotate
75
+ ```
76
+
77
+ ## Quick start
78
+
79
+ ```python
80
+ import asyncio
81
+ from sdk import BackendClient
82
+
83
+ async def main():
84
+ client = BackendClient.from_config() # reads ~/.agentos/config.toml
85
+
86
+ # Bootstrap — load your persona + active model
87
+ profile = await client.bootstrap()
88
+ print(f"Logged in as tier={profile.tier}")
89
+
90
+ # Chat (SSE stream)
91
+ async for envelope in client.chat("my-thread", "What tasks are open?"):
92
+ if envelope.type == "delta":
93
+ print(envelope.data["text"], end="", flush=True)
94
+ elif envelope.type == "done":
95
+ break
96
+
97
+ asyncio.run(main())
98
+ ```
99
+
100
+ ## Run as Electron sidecar
101
+
102
+ ```bash
103
+ python -m sdk.ipc.electron_bridge
104
+ ```
105
+
106
+ Wire protocol (newline-delimited JSON on stdin/stdout):
107
+
108
+ ```
109
+ # Electron → Python (stdin)
110
+ {"channel": "chat:send", "payload": {"thread_id": "t1", "message": "Hello"}}
111
+
112
+ # Python → Electron (stdout)
113
+ {"type": "delta", "thread_id": "t1", "data": {"text": "Hi there"}}
114
+ {"type": "done", "thread_id": "t1", "data": {"text": "Hi there", "usage": {...}}}
115
+ ```
116
+
117
+ ## Available channels
118
+
119
+ | Channel | Payload | What it does |
120
+ |---|---|---|
121
+ | `chat:send` | `{thread_id, message, role_slug?, model_id?}` | Stream chat response |
122
+ | `orchestrator:run` | `{task_input, intent?, task_id?}` | Start pipeline + poll status |
123
+ | `collectors:upload` | `{type, token, paths?, project}` | Upload local data |
124
+ | `auth:oauth_start` | `{service}` | Get OAuth URL (browser opens it) |
125
+ | `auth:oauth_complete` | `{service, code}` | Signal OAuth done |
126
+ | `onboarding:step` | `{step, input}` | Onboarding step |
127
+
128
+ ## Collectors
129
+
130
+ All collector data is sent through `BackendClient.submit_webhook` — no other egress.
131
+
132
+ ```python
133
+ from sdk.collectors import files, screenshot, process
134
+
135
+ # Upload a file
136
+ payload = files.build_webhook_payload(token, ["./notes.md"], project="my-project")
137
+ await client.submit_webhook("local_files", payload)
138
+
139
+ # Screenshot
140
+ payload = screenshot.build_webhook_payload(token, project="my-project")
141
+ await client.submit_webhook("local_screenshot", payload)
142
+
143
+ # Process snapshot
144
+ payload = process.build_webhook_payload(token, project="my-project")
145
+ await client.submit_webhook("local_process", payload)
146
+ ```
147
+
148
+ ## Size limits
149
+
150
+ | Collector | Limit |
151
+ |---|---|
152
+ | Single file | 50 MB |
153
+ | File batch | 200 MB |
154
+ | Screenshot | 10 MB (auto-recompressed) |
155
+
156
+ ## Error handling
157
+
158
+ ```python
159
+ from sdk import BackendUnreachable, BackendAuthFailed, BackendVersionTooOld, TokenNotConfigured
160
+
161
+ try:
162
+ client = BackendClient.from_config()
163
+ await client.ping()
164
+ except TokenNotConfigured:
165
+ print("Run: agentos configure")
166
+ except BackendAuthFailed:
167
+ print("Token expired — run: agentos configure --rotate")
168
+ except BackendVersionTooOld as e:
169
+ print(f"Upgrade required: {e}")
170
+ except BackendUnreachable as e:
171
+ print(f"Backend down: {e}")
172
+ ```
173
+
174
+ ## Versioning
175
+
176
+ The SDK is versioned independently from the backend. Every request carries
177
+ `X-SDK-Version: 1.0.0`. The backend may return HTTP 426 if the SDK is too
178
+ old to safely communicate — upgrade with `pip install --upgrade agentos-sdk`.
@@ -0,0 +1,157 @@
1
+ # AgentOS SDK
2
+
3
+ Thin Python client for the AgentOS desktop app (Electron). Wraps the backend
4
+ `/api/v1/*` endpoints. No orchestration logic — agents run server-side.
5
+
6
+ ## Requirements
7
+
8
+ - Python 3.11+
9
+ - AgentOS backend running (default: `http://localhost:8000`)
10
+ - An API token from the AgentOS web app (Settings → API Tokens)
11
+
12
+ ## Installation
13
+
14
+ ### Basic (chat + pipeline + webhooks)
15
+ ```bash
16
+ pip install agentos-sdk
17
+ ```
18
+
19
+ ### With screenshot collector
20
+ ```bash
21
+ pip install "agentos-sdk[screenshot]"
22
+ ```
23
+
24
+ ### With process collector
25
+ ```bash
26
+ pip install "agentos-sdk[process]"
27
+ ```
28
+
29
+ ### Everything
30
+ ```bash
31
+ pip install "agentos-sdk[all]"
32
+ ```
33
+
34
+ ### From source (development)
35
+ ```bash
36
+ # From the repo root
37
+ pip install -e sdk/ # installs sdk/ as editable package
38
+ # OR
39
+ pip install -e "sdk/[all]" # with all optional extras
40
+ ```
41
+
42
+ ## Setup
43
+
44
+ ```bash
45
+ agentos configure
46
+ # Backend URL [http://localhost:8000]: https://your-backend.example.com
47
+ # Paste your token (format: aeos_<64-char-hex>): aeos_...
48
+ # ✓ Configuration saved to ~/.agentos/config.toml
49
+ ```
50
+
51
+ Replace a token:
52
+ ```bash
53
+ agentos configure --rotate
54
+ ```
55
+
56
+ ## Quick start
57
+
58
+ ```python
59
+ import asyncio
60
+ from sdk import BackendClient
61
+
62
+ async def main():
63
+ client = BackendClient.from_config() # reads ~/.agentos/config.toml
64
+
65
+ # Bootstrap — load your persona + active model
66
+ profile = await client.bootstrap()
67
+ print(f"Logged in as tier={profile.tier}")
68
+
69
+ # Chat (SSE stream)
70
+ async for envelope in client.chat("my-thread", "What tasks are open?"):
71
+ if envelope.type == "delta":
72
+ print(envelope.data["text"], end="", flush=True)
73
+ elif envelope.type == "done":
74
+ break
75
+
76
+ asyncio.run(main())
77
+ ```
78
+
79
+ ## Run as Electron sidecar
80
+
81
+ ```bash
82
+ python -m sdk.ipc.electron_bridge
83
+ ```
84
+
85
+ Wire protocol (newline-delimited JSON on stdin/stdout):
86
+
87
+ ```
88
+ # Electron → Python (stdin)
89
+ {"channel": "chat:send", "payload": {"thread_id": "t1", "message": "Hello"}}
90
+
91
+ # Python → Electron (stdout)
92
+ {"type": "delta", "thread_id": "t1", "data": {"text": "Hi there"}}
93
+ {"type": "done", "thread_id": "t1", "data": {"text": "Hi there", "usage": {...}}}
94
+ ```
95
+
96
+ ## Available channels
97
+
98
+ | Channel | Payload | What it does |
99
+ |---|---|---|
100
+ | `chat:send` | `{thread_id, message, role_slug?, model_id?}` | Stream chat response |
101
+ | `orchestrator:run` | `{task_input, intent?, task_id?}` | Start pipeline + poll status |
102
+ | `collectors:upload` | `{type, token, paths?, project}` | Upload local data |
103
+ | `auth:oauth_start` | `{service}` | Get OAuth URL (browser opens it) |
104
+ | `auth:oauth_complete` | `{service, code}` | Signal OAuth done |
105
+ | `onboarding:step` | `{step, input}` | Onboarding step |
106
+
107
+ ## Collectors
108
+
109
+ All collector data is sent through `BackendClient.submit_webhook` — no other egress.
110
+
111
+ ```python
112
+ from sdk.collectors import files, screenshot, process
113
+
114
+ # Upload a file
115
+ payload = files.build_webhook_payload(token, ["./notes.md"], project="my-project")
116
+ await client.submit_webhook("local_files", payload)
117
+
118
+ # Screenshot
119
+ payload = screenshot.build_webhook_payload(token, project="my-project")
120
+ await client.submit_webhook("local_screenshot", payload)
121
+
122
+ # Process snapshot
123
+ payload = process.build_webhook_payload(token, project="my-project")
124
+ await client.submit_webhook("local_process", payload)
125
+ ```
126
+
127
+ ## Size limits
128
+
129
+ | Collector | Limit |
130
+ |---|---|
131
+ | Single file | 50 MB |
132
+ | File batch | 200 MB |
133
+ | Screenshot | 10 MB (auto-recompressed) |
134
+
135
+ ## Error handling
136
+
137
+ ```python
138
+ from sdk import BackendUnreachable, BackendAuthFailed, BackendVersionTooOld, TokenNotConfigured
139
+
140
+ try:
141
+ client = BackendClient.from_config()
142
+ await client.ping()
143
+ except TokenNotConfigured:
144
+ print("Run: agentos configure")
145
+ except BackendAuthFailed:
146
+ print("Token expired — run: agentos configure --rotate")
147
+ except BackendVersionTooOld as e:
148
+ print(f"Upgrade required: {e}")
149
+ except BackendUnreachable as e:
150
+ print(f"Backend down: {e}")
151
+ ```
152
+
153
+ ## Versioning
154
+
155
+ The SDK is versioned independently from the backend. Every request carries
156
+ `X-SDK-Version: 1.0.0`. The backend may return HTTP 426 if the SDK is too
157
+ old to safely communicate — upgrade with `pip install --upgrade agentos-sdk`.
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "devops-bot-sdk"
7
+ version = "1.0.0"
8
+ description = "DevOps Bot Desktop SDK — thin client for the AgentOS Electron desktop app"
9
+ readme = "README.md"
10
+ license = { text = "Proprietary" }
11
+ requires-python = ">=3.11"
12
+ authors = [{ name = "noumanaziz2128" }]
13
+
14
+ # Core dependencies — always installed
15
+ dependencies = [
16
+ "httpx>=0.27",
17
+ "pydantic>=2.0",
18
+ "cryptography>=42", # Fernet encryption for config.toml token storage
19
+ ]
20
+
21
+ # Optional dependency groups
22
+ [project.optional-dependencies]
23
+ screenshot = [
24
+ "Pillow>=10.0", # collectors/screenshot.py — PIL.ImageGrab
25
+ ]
26
+ process = [
27
+ "psutil>=5.9", # collectors/process.py — process + port listing
28
+ ]
29
+ all = [
30
+ "Pillow>=10.0",
31
+ "psutil>=5.9",
32
+ ]
33
+
34
+ [project.scripts]
35
+ agentos = "sdk.config:configure_cli" # `agentos configure [--rotate]`
36
+
37
+ [project.urls]
38
+ Homepage = "https://agentos.io"
39
+ Repository = "https://github.com/consultancy-outfit/devops-bot-ai"
40
+
41
+ [tool.setuptools.packages.find]
42
+ where = [".."] # look one level up from sdk/pyproject.toml
43
+ include = ["sdk*"] # only package the sdk/ tree
44
+
45
+ [tool.setuptools.package-data]
46
+ sdk = ["py.typed"]
47
+
48
+ [tool.ruff]
49
+ line-length = 100
50
+ target-version = "py311"
51
+
52
+ [tool.mypy]
53
+ python_version = "3.11"
54
+ strict = true
55
+ ignore_missing_imports = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+