sidekick-agent-cli 0.4.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 (62) hide show
  1. {sidekick_agent_cli-0.4.0 → sidekick_agent_cli-0.5.0}/PKG-INFO +41 -33
  2. sidekick_agent_cli-0.5.0/README.md +98 -0
  3. {sidekick_agent_cli-0.4.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.4.0 → sidekick_agent_cli-0.5.0}/pyproject.toml +21 -13
  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.4.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/auth.py +36 -36
  25. sidekick_agent_cli-0.5.0/src/agent_runtime/chat.py +683 -0
  26. {sidekick_agent_cli-0.4.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/cli.py +218 -17
  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.4.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.4.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.4.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.4.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/ws_transport.py +37 -13
  43. sidekick_agent_cli-0.4.0/README.md +0 -90
  44. sidekick_agent_cli-0.4.0/poetry.lock +0 -1192
  45. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/__init__.py +0 -29
  46. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/base.py +0 -60
  47. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/claude_code.py +0 -336
  48. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/claude_code_sdk.py +0 -575
  49. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/codex.py +0 -264
  50. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/events.py +0 -87
  51. sidekick_agent_cli-0.4.0/src/agent_runtime/adapters/registry.py +0 -35
  52. sidekick_agent_cli-0.4.0/src/agent_runtime/api_client.py +0 -886
  53. sidekick_agent_cli-0.4.0/src/agent_runtime/chat.py +0 -182
  54. sidekick_agent_cli-0.4.0/src/agent_runtime/cli_common.py +0 -104
  55. sidekick_agent_cli-0.4.0/src/agent_runtime/runner.py +0 -427
  56. sidekick_agent_cli-0.4.0/src/agent_runtime/runtime.py +0 -825
  57. sidekick_agent_cli-0.4.0/src/agent_runtime/ws_api_client.py +0 -526
  58. {sidekick_agent_cli-0.4.0 → sidekick_agent_cli-0.5.0}/.gitignore +0 -0
  59. {sidekick_agent_cli-0.4.0 → sidekick_agent_cli-0.5.0}/LICENSE +0 -0
  60. {sidekick_agent_cli-0.4.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/__init__.py +0 -0
  61. {sidekick_agent_cli-0.4.0 → sidekick_agent_cli-0.5.0}/src/agent_runtime/__main__.py +0 -0
  62. {sidekick_agent_cli-0.4.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.4.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,56 +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: claude-agent-sdk<0.2.0,>=0.1.48
24
- Requires-Dist: httpx-sse<0.5,>=0.4.0
25
- Requires-Dist: httpx<0.28,>=0.27.0
26
- Requires-Dist: pydantic<3.0,>=2.0.0
27
- Requires-Dist: rich<14.0,>=13.0
28
- 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
29
29
  Provides-Extra: dev
30
- Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
31
- 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'
32
32
  Description-Content-Type: text/markdown
33
33
 
34
34
  # Sidekick Agent Runtime
35
35
 
36
- 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.
37
37
 
38
38
  ## Installation
39
39
 
40
40
  ```bash
41
- pip install sidekick-agent-runtime
41
+ pip install sidekick-agent-cli
42
42
  ```
43
43
 
44
44
  ## Quick Start
45
45
 
46
46
  ```bash
47
- sidekick serve --url https://sidekick.example.com --token <your-runner-token>
47
+ sidekick-agent-cli serve --url https://sidekick.example.com
48
48
  ```
49
49
 
50
- 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:
51
53
 
52
54
  ```bash
53
55
  export SIDEKICK_URL=https://sidekick.example.com
54
- export RUNNER_TOKEN=<your-runner-token>
55
- sidekick serve
56
+ export OUTPOST_TOKEN=<your-outpost-token>
57
+ sidekick-agent-cli serve
56
58
  ```
57
59
 
58
60
  ## Configuration
59
61
 
60
62
  | Flag | Env Var | Default | Description |
61
63
  |------|---------|---------|-------------|
62
- | `--url` | `SIDEKICK_URL` | `http://localhost:8000` | Sidekick backend URL |
63
- | `--token` | `RUNNER_TOKEN` | *(required)* | Runner authentication token |
64
- | `--name` | `RUNNER_NAME` | hostname | Display name for this runner |
65
- | `--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 |
66
68
  | `--log-level` | `LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
67
69
  | `--allow-insecure` | `SIDEKICK_ALLOW_INSECURE` | `false` | Allow unencrypted HTTP to non-localhost backends |
68
70
  | `--allow-env-passthrough` | `SIDEKICK_ALLOW_ENV_PASSTHROUGH` | `false` | Pass all server-provided env vars to CLI tools |
69
71
 
70
- > **Note:** The `--url` flag defaults to `http://localhost:8000` for local development.
71
- > In production, always set this to your Sidekick instance URL (e.g. `https://sidekick.example.com`).
72
-
73
72
  ## How It Works
74
73
 
75
74
  The agent runtime connects to your Sidekick instance and executes agent turns:
@@ -80,6 +79,13 @@ The agent runtime connects to your Sidekick instance and executes agent turns:
80
79
  4. **Executes tools** locally (shell commands, file I/O) or remotely (via Sidekick)
81
80
  5. **Reports results** back to Sidekick
82
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
+
83
89
  ## Local Tools
84
90
 
85
91
  The runtime can execute these tools directly on the host machine:
@@ -93,9 +99,9 @@ The runtime can execute these tools directly on the host machine:
93
99
  ## Requirements
94
100
 
95
101
  - Python 3.11+
96
- - A running [Sidekick](https://github.com/datex-labs/sidekick) backend instance
97
- - Network access from the runner to the Sidekick backend (HTTP + WebSocket)
98
- - 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
99
105
 
100
106
  ## Security Considerations
101
107
 
@@ -107,16 +113,18 @@ Key security features:
107
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.
108
114
  - **Atomic credential writes** — Token cache (`~/.sidekick/credentials.json`) is written atomically with `0600` permissions.
109
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.
110
118
 
111
119
  See [SECURITY.md](SECURITY.md) for the full trust model and vulnerability reporting instructions.
112
120
 
113
121
  ## Compatibility
114
122
 
115
- | Agent Runtime | Sidekick Backend |
116
- |---------------|------------------|
117
- | 0.1.x | >= 0.1.0 |
123
+ | `sidekick-agent-cli` | Sidekick |
124
+ |----------------------|----------|
125
+ | 0.5.x | build 20261203.419 or later |
118
126
 
119
- 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.
120
128
 
121
129
  ## License
122
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