sidekick-agent-cli 0.3.0__tar.gz → 0.5.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 (54) hide show
  1. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/PKG-INFO +41 -32
  2. sidekick_agent_cli-0.5.0/README.md +98 -0
  3. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/SECURITY.md +2 -2
  4. sidekick_agent_cli-0.5.0/poetry.lock +1399 -0
  5. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/pyproject.toml +21 -12
  6. sidekick_agent_cli-0.5.0/run.sh +1 -0
  7. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/__init__.py +14 -0
  8. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/_process.py +53 -0
  9. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/acp/__init__.py +10 -0
  10. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/acp/adapter.py +740 -0
  11. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/acp/client.py +264 -0
  12. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/acp/profiles.py +295 -0
  13. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/acp/translation.py +555 -0
  14. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/base.py +104 -0
  15. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/claude/__init__.py +1 -0
  16. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/claude/message_translator.py +460 -0
  17. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/claude_code_sdk.py +1401 -0
  18. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/compliance.py +298 -0
  19. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/drops.py +80 -0
  20. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/manifest.py +36 -0
  21. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/persistent.py +70 -0
  22. sidekick_agent_cli-0.5.0/src/agent_runtime/adapters/registry.py +114 -0
  23. sidekick_agent_cli-0.5.0/src/agent_runtime/api_client.py +915 -0
  24. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/auth.py +195 -52
  25. sidekick_agent_cli-0.5.0/src/agent_runtime/chat.py +683 -0
  26. sidekick_agent_cli-0.5.0/src/agent_runtime/cli.py +1608 -0
  27. sidekick_agent_cli-0.5.0/src/agent_runtime/cli_common.py +209 -0
  28. sidekick_agent_cli-0.5.0/src/agent_runtime/directory_browse.py +64 -0
  29. sidekick_agent_cli-0.5.0/src/agent_runtime/dispatch_dedupe.py +110 -0
  30. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/display.py +12 -12
  31. sidekick_agent_cli-0.5.0/src/agent_runtime/ids.py +18 -0
  32. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/local_tools.py +54 -36
  33. sidekick_agent_cli-0.5.0/src/agent_runtime/protocol/__init__.py +21 -0
  34. sidekick_agent_cli-0.5.0/src/agent_runtime/protocol/types.py +198 -0
  35. sidekick_agent_cli-0.5.0/src/agent_runtime/reattach.py +215 -0
  36. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/run.py +128 -33
  37. sidekick_agent_cli-0.5.0/src/agent_runtime/runtime.py +592 -0
  38. sidekick_agent_cli-0.5.0/src/agent_runtime/serve.py +976 -0
  39. sidekick_agent_cli-0.5.0/src/agent_runtime/tool_execution_handler.py +164 -0
  40. sidekick_agent_cli-0.5.0/src/agent_runtime/turn_usage.py +122 -0
  41. sidekick_agent_cli-0.5.0/src/agent_runtime/ws_api_client.py +236 -0
  42. sidekick_agent_cli-0.5.0/src/agent_runtime/ws_transport.py +282 -0
  43. sidekick_agent_cli-0.3.0/README.md +0 -90
  44. sidekick_agent_cli-0.3.0/src/agent_runtime/api_client.py +0 -567
  45. sidekick_agent_cli-0.3.0/src/agent_runtime/chat.py +0 -182
  46. sidekick_agent_cli-0.3.0/src/agent_runtime/cli.py +0 -722
  47. sidekick_agent_cli-0.3.0/src/agent_runtime/cli_common.py +0 -104
  48. sidekick_agent_cli-0.3.0/src/agent_runtime/runner.py +0 -387
  49. sidekick_agent_cli-0.3.0/src/agent_runtime/runtime.py +0 -360
  50. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/.gitignore +0 -0
  51. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/LICENSE +0 -0
  52. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/__init__.py +0 -0
  53. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/__main__.py +0 -0
  54. {sidekick_agent_cli-0.3.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/chat_display.py +0 -0
@@ -1,10 +1,10 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: sidekick-agent-cli
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
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
5
+ Project-URL: Homepage, https://github.com/datex/sidekick
6
+ Project-URL: Repository, https://github.com/datex/sidekick
7
+ Project-URL: Bug Tracker, https://github.com/datex/sidekick/issues
8
8
  Author-email: Datex <bbatchelder@datexcorp.com>
9
9
  License-Expression: MIT
10
10
  License-File: LICENSE
@@ -20,55 +20,55 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
22
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
23
+ Requires-Dist: claude-agent-sdk<0.3,>=0.2.189
24
+ Requires-Dist: httpx-sse<0.5,>=0.4.3
25
+ Requires-Dist: httpx<0.29,>=0.28.1
26
+ Requires-Dist: pydantic<3,>=2.14.3
27
+ Requires-Dist: rich<16,>=15.0.0
28
+ Requires-Dist: websockets<18,>=17.4
28
29
  Provides-Extra: dev
29
- Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
30
- Requires-Dist: pytest>=8.0; extra == 'dev'
30
+ Requires-Dist: pytest-asyncio<2,>=1.5.0; extra == 'dev'
31
+ Requires-Dist: pytest<10,>=9.2.0; extra == 'dev'
31
32
  Description-Content-Type: text/markdown
32
33
 
33
34
  # Sidekick Agent Runtime
34
35
 
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
+ Portable agent execution engine for [Sidekick](https://github.com/datex/sidekick). Runs on user machines (laptops, VMs, self-hosted outposts) and communicates with a Sidekick backend via HTTP and WebSocket.
36
37
 
37
38
  ## Installation
38
39
 
39
40
  ```bash
40
- pip install sidekick-agent-runtime
41
+ pip install sidekick-agent-cli
41
42
  ```
42
43
 
43
44
  ## Quick Start
44
45
 
45
46
  ```bash
46
- sidekick serve --url https://sidekick.example.com --token <your-runner-token>
47
+ sidekick-agent-cli serve --url https://sidekick.example.com
47
48
  ```
48
49
 
49
- Or using environment variables:
50
+ The first run opens your browser to register this machine as an outpost, then caches the URL and the outpost's token in `~/.sidekick/credentials.json`. Later runs need only `sidekick-agent-cli serve`.
51
+
52
+ On a machine with no browser, pass a token generated in Sidekick's admin UI:
50
53
 
51
54
  ```bash
52
55
  export SIDEKICK_URL=https://sidekick.example.com
53
- export RUNNER_TOKEN=<your-runner-token>
54
- sidekick serve
56
+ export OUTPOST_TOKEN=<your-outpost-token>
57
+ sidekick-agent-cli serve
55
58
  ```
56
59
 
57
60
  ## Configuration
58
61
 
59
62
  | Flag | Env Var | Default | Description |
60
63
  |------|---------|---------|-------------|
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 |
64
+ | `--url` | `SIDEKICK_URL` | cached from the last run | Sidekick URL, the address you open in the browser |
65
+ | `--token` | `OUTPOST_TOKEN` | browser registration | Outpost authentication token |
66
+ | `--name` | `OUTPOST_NAME` | hostname | Display name for this outpost |
67
+ | `--workspace` | `OUTPOST_WORKSPACE` | `~/.sidekick/<name>/workspace` | Override working directory |
65
68
  | `--log-level` | `LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
66
69
  | `--allow-insecure` | `SIDEKICK_ALLOW_INSECURE` | `false` | Allow unencrypted HTTP to non-localhost backends |
67
70
  | `--allow-env-passthrough` | `SIDEKICK_ALLOW_ENV_PASSTHROUGH` | `false` | Pass all server-provided env vars to CLI tools |
68
71
 
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
72
  ## How It Works
73
73
 
74
74
  The agent runtime connects to your Sidekick instance and executes agent turns:
@@ -79,6 +79,13 @@ The agent runtime connects to your Sidekick instance and executes agent turns:
79
79
  4. **Executes tools** locally (shell commands, file I/O) or remotely (via Sidekick)
80
80
  5. **Reports results** back to Sidekick
81
81
 
82
+ Facade agents resolve their system prompt from `instructions.system_prompt`,
83
+ which is the shape saved by the Agent Builder. A missing or empty nested prompt
84
+ falls back to the legacy top-level `system_prompt`. The resolved value is used
85
+ for persistent-session creation, per-turn execution and fresh-adapter retries.
86
+ Changing the prompt of an already-running harness session still follows that
87
+ harness's existing session behavior.
88
+
82
89
  ## Local Tools
83
90
 
84
91
  The runtime can execute these tools directly on the host machine:
@@ -92,9 +99,9 @@ The runtime can execute these tools directly on the host machine:
92
99
  ## Requirements
93
100
 
94
101
  - 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)
102
+ - A running [Sidekick](https://github.com/datex/sidekick) backend instance
103
+ - Network access from the outpost to the Sidekick backend (HTTP + WebSocket)
104
+ - A Sidekick account that can register an outpost, or an outpost token generated in Sidekick's admin UI
98
105
 
99
106
  ## Security Considerations
100
107
 
@@ -106,16 +113,18 @@ Key security features:
106
113
  - **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
114
  - **Atomic credential writes** — Token cache (`~/.sidekick/credentials.json`) is written atomically with `0600` permissions.
108
115
  - **Token verification** — After browser-based authentication, the received token is verified against the backend before caching.
116
+ - **Loopback CLI authorization** — The browser's CLI authorization page accepts only a one-to-five-digit callback port in the range 1–65535, rejecting invalid requests before token creation. Callbacks use `127.0.0.1`; the opaque state survives the sign-in round trip unchanged.
117
+ - **Re-registration on token rejection** — If the backend rejects the outpost's token (e.g. it was deleted or rotated in the admin UI), an interactive `serve` session offers to re-register via the browser and reconnects with the new token. Headless sessions keep the retry behavior.
109
118
 
110
119
  See [SECURITY.md](SECURITY.md) for the full trust model and vulnerability reporting instructions.
111
120
 
112
121
  ## Compatibility
113
122
 
114
- | Agent Runtime | Sidekick Backend |
115
- |---------------|------------------|
116
- | 0.1.x | >= 0.1.0 |
123
+ | `sidekick-agent-cli` | Sidekick |
124
+ |----------------------|----------|
125
+ | 0.5.x | build 20261203.419 or later |
117
126
 
118
- The runtime communicates via the `/api/runtime/v1` API. Breaking changes to this API will be reflected in the compatibility table above.
127
+ Each release is built from the same source revision as the Sidekick build it is listed with, and is not tested against older builds. A Sidekick instance reports its build at `/build.txt`. The runtime communicates via the `/api/runtime/v1` API.
119
128
 
120
129
  ## License
121
130
 
@@ -0,0 +1,98 @@
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 outposts) and communicates with a Sidekick backend via HTTP and WebSocket.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install sidekick-agent-cli
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ sidekick-agent-cli serve --url https://sidekick.example.com
15
+ ```
16
+
17
+ The first run opens your browser to register this machine as an outpost, then caches the URL and the outpost's token in `~/.sidekick/credentials.json`. Later runs need only `sidekick-agent-cli serve`.
18
+
19
+ On a machine with no browser, pass a token generated in Sidekick's admin UI:
20
+
21
+ ```bash
22
+ export SIDEKICK_URL=https://sidekick.example.com
23
+ export OUTPOST_TOKEN=<your-outpost-token>
24
+ sidekick-agent-cli serve
25
+ ```
26
+
27
+ ## Configuration
28
+
29
+ | Flag | Env Var | Default | Description |
30
+ |------|---------|---------|-------------|
31
+ | `--url` | `SIDEKICK_URL` | cached from the last run | Sidekick URL, the address you open in the browser |
32
+ | `--token` | `OUTPOST_TOKEN` | browser registration | Outpost authentication token |
33
+ | `--name` | `OUTPOST_NAME` | hostname | Display name for this outpost |
34
+ | `--workspace` | `OUTPOST_WORKSPACE` | `~/.sidekick/<name>/workspace` | Override working directory |
35
+ | `--log-level` | `LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
36
+ | `--allow-insecure` | `SIDEKICK_ALLOW_INSECURE` | `false` | Allow unencrypted HTTP to non-localhost backends |
37
+ | `--allow-env-passthrough` | `SIDEKICK_ALLOW_ENV_PASSTHROUGH` | `false` | Pass all server-provided env vars to CLI tools |
38
+
39
+ ## How It Works
40
+
41
+ The agent runtime connects to your Sidekick instance and executes agent turns:
42
+
43
+ 1. **Connects** via WebSocket for real-time notifications
44
+ 2. **Receives** turn assignments from Sidekick
45
+ 3. **Calls LLM** through Sidekick's proxy (SSE streaming)
46
+ 4. **Executes tools** locally (shell commands, file I/O) or remotely (via Sidekick)
47
+ 5. **Reports results** back to Sidekick
48
+
49
+ Facade agents resolve their system prompt from `instructions.system_prompt`,
50
+ which is the shape saved by the Agent Builder. A missing or empty nested prompt
51
+ falls back to the legacy top-level `system_prompt`. The resolved value is used
52
+ for persistent-session creation, per-turn execution and fresh-adapter retries.
53
+ Changing the prompt of an already-running harness session still follows that
54
+ harness's existing session behavior.
55
+
56
+ ## Local Tools
57
+
58
+ The runtime can execute these tools directly on the host machine:
59
+
60
+ - **RunCommand** — Execute shell commands
61
+ - **ReadFile** — Read file contents
62
+ - **WriteFile** — Write files
63
+ - **ListFiles** — List directory contents
64
+ - **CLI Tools** — Execute Python-based CLI tools defined in Sidekick
65
+
66
+ ## Requirements
67
+
68
+ - Python 3.11+
69
+ - A running [Sidekick](https://github.com/datex/sidekick) backend instance
70
+ - Network access from the outpost to the Sidekick backend (HTTP + WebSocket)
71
+ - A Sidekick account that can register an outpost, or an outpost token generated in Sidekick's admin UI
72
+
73
+ ## Security Considerations
74
+
75
+ The agent runtime **executes commands on behalf of the connected Sidekick backend**. Only connect to Sidekick instances you trust.
76
+
77
+ Key security features:
78
+
79
+ - **HTTPS enforced by default** — Connections to non-localhost backends over plain HTTP are blocked. Use `--allow-insecure` to override (not recommended).
80
+ - **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.
81
+ - **Atomic credential writes** — Token cache (`~/.sidekick/credentials.json`) is written atomically with `0600` permissions.
82
+ - **Token verification** — After browser-based authentication, the received token is verified against the backend before caching.
83
+ - **Loopback CLI authorization** — The browser's CLI authorization page accepts only a one-to-five-digit callback port in the range 1–65535, rejecting invalid requests before token creation. Callbacks use `127.0.0.1`; the opaque state survives the sign-in round trip unchanged.
84
+ - **Re-registration on token rejection** — If the backend rejects the outpost's token (e.g. it was deleted or rotated in the admin UI), an interactive `serve` session offers to re-register via the browser and reconnects with the new token. Headless sessions keep the retry behavior.
85
+
86
+ See [SECURITY.md](SECURITY.md) for the full trust model and vulnerability reporting instructions.
87
+
88
+ ## Compatibility
89
+
90
+ | `sidekick-agent-cli` | Sidekick |
91
+ |----------------------|----------|
92
+ | 0.5.x | build 20261203.419 or later |
93
+
94
+ Each release is built from the same source revision as the Sidekick build it is listed with, and is not tested against older builds. A Sidekick instance reports its build at `/build.txt`. The runtime communicates via the `/api/runtime/v1` API.
95
+
96
+ ## License
97
+
98
+ MIT
@@ -5,7 +5,7 @@
5
5
  If you discover a security vulnerability in the Sidekick Agent Runtime, please report it responsibly:
6
6
 
7
7
  - **Email**: security@datexlabs.com
8
- - **Subject prefix**: `[sidekick-agent-runtime]`
8
+ - **Subject prefix**: `[sidekick-agent-cli]`
9
9
 
10
10
  Please include:
11
11
  1. A description of the vulnerability
@@ -36,7 +36,7 @@ The Sidekick Agent Runtime operates under a **trusted server** model:
36
36
 
37
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
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.
39
+ 2. **The backend authenticates the runtime** via outpost tokens (for `serve` mode) or CLI tokens (for `chat` mode). Tokens are cached locally in `~/.sidekick/credentials.json` with `0600` permissions.
40
40
 
41
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
42