sidekick-agent-cli 0.1.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,12 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .venv/
8
+ .pytest_cache/
9
+ .coverage
10
+ htmlcov/
11
+ .DS_Store
12
+ *.swp
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Datex
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.
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.4
2
+ Name: sidekick-agent-cli
3
+ Version: 0.1.0
4
+ Summary: CLI for the Sidekick Agent Orchestrator
5
+ Project-URL: Homepage, https://github.com/datex-labs/sidekick
6
+ Project-URL: Repository, https://github.com/datex-labs/sidekick
7
+ Project-URL: Bug Tracker, https://github.com/datex-labs/sidekick/issues
8
+ Author-email: Datex <bbatchelder@datexcorp.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent,llm,runtime,sidekick
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: httpx-sse<0.5,>=0.4.0
24
+ Requires-Dist: httpx<0.28,>=0.27.0
25
+ Requires-Dist: pydantic<3.0,>=2.0.0
26
+ Requires-Dist: rich<14.0,>=13.0
27
+ Requires-Dist: websockets<15.0,>=14.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
30
+ Requires-Dist: pytest>=8.0; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Sidekick Agent Runtime
34
+
35
+ Portable agent execution engine for [Sidekick](https://github.com/datex/sidekick). Runs on user machines (laptops, VMs, self-hosted runners) and communicates with a Sidekick backend via HTTP and WebSocket.
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ pip install sidekick-agent-runtime
41
+ ```
42
+
43
+ ## Quick Start
44
+
45
+ ```bash
46
+ sidekick serve --url https://sidekick.example.com --token <your-runner-token>
47
+ ```
48
+
49
+ Or using environment variables:
50
+
51
+ ```bash
52
+ export SIDEKICK_URL=https://sidekick.example.com
53
+ export RUNNER_TOKEN=<your-runner-token>
54
+ sidekick serve
55
+ ```
56
+
57
+ ## Configuration
58
+
59
+ | Flag | Env Var | Default | Description |
60
+ |------|---------|---------|-------------|
61
+ | `--url` | `SIDEKICK_URL` | `http://localhost:8000` | Sidekick backend URL |
62
+ | `--token` | `RUNNER_TOKEN` | *(required)* | Runner authentication token |
63
+ | `--name` | `RUNNER_NAME` | hostname | Display name for this runner |
64
+ | `--workspace` | `RUNNER_WORKSPACE` | `~/.sidekick/<name>/workspace` | Override working directory |
65
+ | `--log-level` | `LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
66
+ | `--allow-insecure` | `SIDEKICK_ALLOW_INSECURE` | `false` | Allow unencrypted HTTP to non-localhost backends |
67
+ | `--allow-env-passthrough` | `SIDEKICK_ALLOW_ENV_PASSTHROUGH` | `false` | Pass all server-provided env vars to CLI tools |
68
+
69
+ > **Note:** The `--url` flag defaults to `http://localhost:8000` for local development.
70
+ > In production, always set this to your Sidekick instance URL (e.g. `https://sidekick.example.com`).
71
+
72
+ ## How It Works
73
+
74
+ The agent runtime connects to your Sidekick instance and executes agent turns:
75
+
76
+ 1. **Connects** via WebSocket for real-time notifications
77
+ 2. **Receives** turn assignments from Sidekick
78
+ 3. **Calls LLM** through Sidekick's proxy (SSE streaming)
79
+ 4. **Executes tools** locally (shell commands, file I/O) or remotely (via Sidekick)
80
+ 5. **Reports results** back to Sidekick
81
+
82
+ ## Local Tools
83
+
84
+ The runtime can execute these tools directly on the host machine:
85
+
86
+ - **RunCommand** — Execute shell commands
87
+ - **ReadFile** — Read file contents
88
+ - **WriteFile** — Write files
89
+ - **ListFiles** — List directory contents
90
+ - **CLI Tools** — Execute Python-based CLI tools defined in Sidekick
91
+
92
+ ## Requirements
93
+
94
+ - Python 3.11+
95
+ - A running [Sidekick](https://github.com/datex-labs/sidekick) backend instance
96
+ - Network access from the runner to the Sidekick backend (HTTP + WebSocket)
97
+ - A runner token (generated in Sidekick's admin UI)
98
+
99
+ ## Security Considerations
100
+
101
+ The agent runtime **executes commands on behalf of the connected Sidekick backend**. Only connect to Sidekick instances you trust.
102
+
103
+ Key security features:
104
+
105
+ - **HTTPS enforced by default** — Connections to non-localhost backends over plain HTTP are blocked. Use `--allow-insecure` to override (not recommended).
106
+ - **Sensitive env-var stripping** — Environment variables containing credentials, proxy settings, and path-injection vectors are stripped from CLI tool subprocesses by default. Use `--allow-env-passthrough` to override.
107
+ - **Atomic credential writes** — Token cache (`~/.sidekick/credentials.json`) is written atomically with `0600` permissions.
108
+ - **Token verification** — After browser-based authentication, the received token is verified against the backend before caching.
109
+
110
+ See [SECURITY.md](SECURITY.md) for the full trust model and vulnerability reporting instructions.
111
+
112
+ ## Compatibility
113
+
114
+ | Agent Runtime | Sidekick Backend |
115
+ |---------------|------------------|
116
+ | 0.1.x | >= 0.1.0 |
117
+
118
+ The runtime communicates via the `/api/runtime/v1` API. Breaking changes to this API will be reflected in the compatibility table above.
119
+
120
+ ## License
121
+
122
+ MIT
@@ -0,0 +1,90 @@
1
+ # Sidekick Agent Runtime
2
+
3
+ Portable agent execution engine for [Sidekick](https://github.com/datex/sidekick). Runs on user machines (laptops, VMs, self-hosted runners) and communicates with a Sidekick backend via HTTP and WebSocket.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install sidekick-agent-runtime
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ sidekick serve --url https://sidekick.example.com --token <your-runner-token>
15
+ ```
16
+
17
+ Or using environment variables:
18
+
19
+ ```bash
20
+ export SIDEKICK_URL=https://sidekick.example.com
21
+ export RUNNER_TOKEN=<your-runner-token>
22
+ sidekick serve
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ | Flag | Env Var | Default | Description |
28
+ |------|---------|---------|-------------|
29
+ | `--url` | `SIDEKICK_URL` | `http://localhost:8000` | Sidekick backend URL |
30
+ | `--token` | `RUNNER_TOKEN` | *(required)* | Runner authentication token |
31
+ | `--name` | `RUNNER_NAME` | hostname | Display name for this runner |
32
+ | `--workspace` | `RUNNER_WORKSPACE` | `~/.sidekick/<name>/workspace` | Override working directory |
33
+ | `--log-level` | `LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
34
+ | `--allow-insecure` | `SIDEKICK_ALLOW_INSECURE` | `false` | Allow unencrypted HTTP to non-localhost backends |
35
+ | `--allow-env-passthrough` | `SIDEKICK_ALLOW_ENV_PASSTHROUGH` | `false` | Pass all server-provided env vars to CLI tools |
36
+
37
+ > **Note:** The `--url` flag defaults to `http://localhost:8000` for local development.
38
+ > In production, always set this to your Sidekick instance URL (e.g. `https://sidekick.example.com`).
39
+
40
+ ## How It Works
41
+
42
+ The agent runtime connects to your Sidekick instance and executes agent turns:
43
+
44
+ 1. **Connects** via WebSocket for real-time notifications
45
+ 2. **Receives** turn assignments from Sidekick
46
+ 3. **Calls LLM** through Sidekick's proxy (SSE streaming)
47
+ 4. **Executes tools** locally (shell commands, file I/O) or remotely (via Sidekick)
48
+ 5. **Reports results** back to Sidekick
49
+
50
+ ## Local Tools
51
+
52
+ The runtime can execute these tools directly on the host machine:
53
+
54
+ - **RunCommand** — Execute shell commands
55
+ - **ReadFile** — Read file contents
56
+ - **WriteFile** — Write files
57
+ - **ListFiles** — List directory contents
58
+ - **CLI Tools** — Execute Python-based CLI tools defined in Sidekick
59
+
60
+ ## Requirements
61
+
62
+ - Python 3.11+
63
+ - A running [Sidekick](https://github.com/datex-labs/sidekick) backend instance
64
+ - Network access from the runner to the Sidekick backend (HTTP + WebSocket)
65
+ - A runner token (generated in Sidekick's admin UI)
66
+
67
+ ## Security Considerations
68
+
69
+ The agent runtime **executes commands on behalf of the connected Sidekick backend**. Only connect to Sidekick instances you trust.
70
+
71
+ Key security features:
72
+
73
+ - **HTTPS enforced by default** — Connections to non-localhost backends over plain HTTP are blocked. Use `--allow-insecure` to override (not recommended).
74
+ - **Sensitive env-var stripping** — Environment variables containing credentials, proxy settings, and path-injection vectors are stripped from CLI tool subprocesses by default. Use `--allow-env-passthrough` to override.
75
+ - **Atomic credential writes** — Token cache (`~/.sidekick/credentials.json`) is written atomically with `0600` permissions.
76
+ - **Token verification** — After browser-based authentication, the received token is verified against the backend before caching.
77
+
78
+ See [SECURITY.md](SECURITY.md) for the full trust model and vulnerability reporting instructions.
79
+
80
+ ## Compatibility
81
+
82
+ | Agent Runtime | Sidekick Backend |
83
+ |---------------|------------------|
84
+ | 0.1.x | >= 0.1.0 |
85
+
86
+ The runtime communicates via the `/api/runtime/v1` API. Breaking changes to this API will be reflected in the compatibility table above.
87
+
88
+ ## License
89
+
90
+ MIT
@@ -0,0 +1,43 @@
1
+ # Security Policy
2
+
3
+ ## Reporting Vulnerabilities
4
+
5
+ If you discover a security vulnerability in the Sidekick Agent Runtime, please report it responsibly:
6
+
7
+ - **Email**: security@datexlabs.com
8
+ - **Subject prefix**: `[sidekick-agent-runtime]`
9
+
10
+ Please include:
11
+ 1. A description of the vulnerability
12
+ 2. Steps to reproduce
13
+ 3. Potential impact
14
+ 4. Suggested fix (if any)
15
+
16
+ We will acknowledge receipt within 48 hours and aim to provide a fix or mitigation within 7 days for critical issues.
17
+
18
+ ## Scope
19
+
20
+ The following are in scope for security reports:
21
+
22
+ - Authentication bypass or token leakage
23
+ - Arbitrary code execution beyond intended tool boundaries
24
+ - Credential exposure via logs, environment, or filesystem
25
+ - Man-in-the-middle vulnerabilities
26
+ - Privilege escalation
27
+
28
+ The following are **out of scope** (intentional design decisions):
29
+
30
+ - **Package auto-install via `uvx`** (SEC-01): CLI tools are installed on demand. This is by design — the runtime trusts the connected Sidekick backend to provide valid tool definitions.
31
+ - **Filesystem access** (SEC-03): Local tools (ReadFile, WriteFile, ListFiles, RunCommand) have full filesystem access within the runtime's working directory. Sandboxing is the responsibility of the deployment environment (VM, container, etc.).
32
+
33
+ ## Trust Model
34
+
35
+ The Sidekick Agent Runtime operates under a **trusted server** model:
36
+
37
+ 1. **The runtime trusts the Sidekick backend it connects to.** It executes commands, installs packages, and accesses files as directed by the backend. Only connect to Sidekick instances you trust.
38
+
39
+ 2. **The backend authenticates the runtime** via runner tokens (for `serve` mode) or CLI tokens (for `chat` mode). Tokens are cached locally in `~/.sidekick/credentials.json` with `0600` permissions.
40
+
41
+ 3. **Transport security**: By default, the runtime refuses unencrypted HTTP connections to non-localhost backends. Use `--allow-insecure` to override (not recommended for production).
42
+
43
+ 4. **Environment isolation**: Sensitive environment variables (credentials, proxy settings, path manipulation) are stripped from CLI tool subprocesses by default. Use `--allow-env-passthrough` to override.
@@ -0,0 +1,63 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "sidekick-agent-cli"
7
+ version = "0.1.0"
8
+ description = "CLI for the Sidekick Agent Orchestrator"
9
+ requires-python = ">=3.11"
10
+ license = "MIT"
11
+ authors = [{name = "Datex", email = "bbatchelder@datexcorp.com"}]
12
+ readme = "README.md"
13
+ keywords = ["agent", "runtime", "llm", "sidekick"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
25
+ ]
26
+ dependencies = [
27
+ "httpx>=0.27.0,<0.28",
28
+ "httpx-sse>=0.4.0,<0.5",
29
+ "pydantic>=2.0.0,<3.0",
30
+ "rich>=13.0,<14.0",
31
+ "websockets>=14.0,<15.0",
32
+ ]
33
+
34
+ [project.urls]
35
+ "Homepage" = "https://github.com/datex-labs/sidekick"
36
+ "Repository" = "https://github.com/datex-labs/sidekick"
37
+ "Bug Tracker" = "https://github.com/datex-labs/sidekick/issues"
38
+
39
+ [project.scripts]
40
+ sidekick = "agent_runtime.cli:main"
41
+
42
+ [project.optional-dependencies]
43
+ dev = [
44
+ "pytest>=8.0",
45
+ "pytest-asyncio>=0.23",
46
+ ]
47
+
48
+ [tool.pytest.ini_options]
49
+ asyncio_mode = "auto"
50
+
51
+ [tool.hatch.build.targets.wheel]
52
+ packages = ["src/agent_runtime"]
53
+
54
+ [tool.hatch.build.targets.sdist]
55
+ exclude = [
56
+ ".claude/",
57
+ ".pytest_cache/",
58
+ ".venv/",
59
+ ".gitignore",
60
+ "publish.sh",
61
+ "tests/",
62
+ "uv.lock",
63
+ ]
@@ -0,0 +1,7 @@
1
+ """Agent Runtime — portable agent execution engine for Sidekick."""
2
+
3
+ from .runtime import AgentRuntime
4
+ from .api_client import RuntimeAPIClient
5
+ from .display import RuntimeDisplay
6
+
7
+ __all__ = ["AgentRuntime", "RuntimeAPIClient", "RuntimeDisplay"]
@@ -0,0 +1,4 @@
1
+ """Allow running as: python -m agent_runtime"""
2
+ from .cli import main
3
+
4
+ main()