bamboo-coding 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.
- bamboo_coding-0.1.0/PKG-INFO +284 -0
- bamboo_coding-0.1.0/README.md +270 -0
- bamboo_coding-0.1.0/agent/__init__.py +0 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/__init__.py +0 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/capabilities/__init__.py +0 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/capabilities/repo.py +189 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/config.py +76 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/controller_client.py +73 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/journal.py +209 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/main.py +164 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/protocol.py +21 -0
- bamboo_coding-0.1.0/agent/bamboo_git_agent/status.py +59 -0
- bamboo_coding-0.1.0/api/__init__.py +2 -0
- bamboo_coding-0.1.0/api/commit.py +82 -0
- bamboo_coding-0.1.0/api/repository.py +592 -0
- bamboo_coding-0.1.0/bamboo_coding/__init__.py +3 -0
- bamboo_coding-0.1.0/bamboo_coding/client/__init__.py +3 -0
- bamboo_coding-0.1.0/bamboo_coding/client/capabilities/__init__.py +1 -0
- bamboo_coding-0.1.0/bamboo_coding/client/capabilities/repo.py +279 -0
- bamboo_coding-0.1.0/bamboo_coding/client/config.py +179 -0
- bamboo_coding-0.1.0/bamboo_coding/client/controller_client.py +112 -0
- bamboo_coding-0.1.0/bamboo_coding/client/journal.py +1 -0
- bamboo_coding-0.1.0/bamboo_coding/client/main.py +425 -0
- bamboo_coding-0.1.0/bamboo_coding/client/status.py +59 -0
- bamboo_coding-0.1.0/bamboo_coding/client/terminal_runtime.py +251 -0
- bamboo_coding-0.1.0/bamboo_coding/server/__init__.py +3 -0
- bamboo_coding-0.1.0/bamboo_coding/server/core/__init__.py +1 -0
- bamboo_coding-0.1.0/bamboo_coding/server/core/config.py +1 -0
- bamboo_coding-0.1.0/bamboo_coding/server/main.py +39 -0
- bamboo_coding-0.1.0/bamboo_coding/shared/__init__.py +39 -0
- bamboo_coding-0.1.0/bamboo_coding/shared/protocol.py +1 -0
- bamboo_coding-0.1.0/bamboo_coding.egg-info/PKG-INFO +284 -0
- bamboo_coding-0.1.0/bamboo_coding.egg-info/SOURCES.txt +70 -0
- bamboo_coding-0.1.0/bamboo_coding.egg-info/dependency_links.txt +1 -0
- bamboo_coding-0.1.0/bamboo_coding.egg-info/entry_points.txt +3 -0
- bamboo_coding-0.1.0/bamboo_coding.egg-info/requires.txt +7 -0
- bamboo_coding-0.1.0/bamboo_coding.egg-info/top_level.txt +6 -0
- bamboo_coding-0.1.0/controller/__init__.py +0 -0
- bamboo_coding-0.1.0/controller/app/__init__.py +0 -0
- bamboo_coding-0.1.0/controller/app/api/__init__.py +0 -0
- bamboo_coding-0.1.0/controller/app/api/agents/__init__.py +3 -0
- bamboo_coding-0.1.0/controller/app/api/agents/ws.py +133 -0
- bamboo_coding-0.1.0/controller/app/api/public/__init__.py +11 -0
- bamboo_coding-0.1.0/controller/app/api/public/repos.py +207 -0
- bamboo_coding-0.1.0/controller/app/api/public/terminals.py +64 -0
- bamboo_coding-0.1.0/controller/app/core/__init__.py +0 -0
- bamboo_coding-0.1.0/controller/app/core/config.py +20 -0
- bamboo_coding-0.1.0/controller/app/core/errors.py +14 -0
- bamboo_coding-0.1.0/controller/app/db/__init__.py +0 -0
- bamboo_coding-0.1.0/controller/app/db/models.py +42 -0
- bamboo_coding-0.1.0/controller/app/db/session.py +74 -0
- bamboo_coding-0.1.0/controller/app/main.py +71 -0
- bamboo_coding-0.1.0/controller/app/schemas/__init__.py +23 -0
- bamboo_coding-0.1.0/controller/app/schemas/agent_messages.py +21 -0
- bamboo_coding-0.1.0/controller/app/schemas/public.py +3 -0
- bamboo_coding-0.1.0/controller/app/services/__init__.py +0 -0
- bamboo_coding-0.1.0/controller/app/services/agents.py +108 -0
- bamboo_coding-0.1.0/controller/app/services/registrations.py +17 -0
- bamboo_coding-0.1.0/controller/app/services/repositories.py +85 -0
- bamboo_coding-0.1.0/controller/app/services/router.py +140 -0
- bamboo_coding-0.1.0/controller/app/services/tasks.py +104 -0
- bamboo_coding-0.1.0/controller/app/services/terminals.py +148 -0
- bamboo_coding-0.1.0/git_utils.py +2238 -0
- bamboo_coding-0.1.0/pyproject.toml +29 -0
- bamboo_coding-0.1.0/setup.cfg +4 -0
- bamboo_coding-0.1.0/shared/__init__.py +39 -0
- bamboo_coding-0.1.0/shared/protocol.py +253 -0
- bamboo_coding-0.1.0/tests/test_api.py +140 -0
- bamboo_coding-0.1.0/tests/test_container_contract.py +7 -0
- bamboo_coding-0.1.0/tests/test_frontend_contract.py +3275 -0
- bamboo_coding-0.1.0/tests/test_git_utils.py +286 -0
- bamboo_coding-0.1.0/tests/test_makefile.py +62 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bamboo-coding
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Bamboo Coding controller and client
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: fastapi==0.115.0
|
|
8
|
+
Requires-Dist: uvicorn==0.30.6
|
|
9
|
+
Requires-Dist: gitpython==3.1.40
|
|
10
|
+
Requires-Dist: python-dotenv==1.0.0
|
|
11
|
+
Requires-Dist: websockets==13.1
|
|
12
|
+
Requires-Dist: httpx==0.27.2
|
|
13
|
+
Requires-Dist: bamboo-ssh
|
|
14
|
+
|
|
15
|
+
# Bamboo Coding
|
|
16
|
+
|
|
17
|
+
Bamboo Coding is a FastAPI-based workspace and Git review system with an outbound Python client and a browser UI.
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
- `bamboo_coding/server/`: packaged server entrypoint and public app surface
|
|
22
|
+
- `bamboo_coding/client/`: packaged outbound client runtime
|
|
23
|
+
- `controller/app/`: controller internals used by the packaged server entrypoint
|
|
24
|
+
- `shared/`: legacy shared protocol implementation backing the new namespace
|
|
25
|
+
- `static/`: browser UI assets
|
|
26
|
+
|
|
27
|
+
The controller never reads arbitrary local paths itself. Clients connect outward, advertise allowed roots, wait for approval, and then handle tasks for paths inside those roots.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Web approval for pending clients
|
|
32
|
+
- Client-first workspace selection in the UI
|
|
33
|
+
- Direct folder browsing, including non-Git folders
|
|
34
|
+
- Automatic Git mode when the selected path is inside a repository
|
|
35
|
+
- Changed-files-first tree, diff viewer, commit history, branches, stage/unstage, and commit
|
|
36
|
+
- Durable client token storage and task journal
|
|
37
|
+
- Multi-terminal browser dialogs bound to the selected client and path
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
- Python 3.12+
|
|
42
|
+
- Git 2.x+
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
python3 -m venv .venv
|
|
48
|
+
. .venv/bin/activate
|
|
49
|
+
pip install -e .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Client Config
|
|
53
|
+
|
|
54
|
+
The client reads `~/.bamboo-coding/bamboo-coding.toml` by default.
|
|
55
|
+
|
|
56
|
+
Quick start:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bamboo-coding setup
|
|
60
|
+
bamboo-coding run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`setup` creates the config file if it is missing. By default it uses the current working directory as the first allowed root. You can override the generated values:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
bamboo-coding setup --root /work/project-a --root /work/project-b --client-id worker-1 --hostname devbox
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Example generated config:
|
|
70
|
+
|
|
71
|
+
```toml
|
|
72
|
+
[client]
|
|
73
|
+
controller_url = "ws://127.0.0.1:8100/ws/agents"
|
|
74
|
+
client_id = "worker-1"
|
|
75
|
+
hostname = "devbox"
|
|
76
|
+
allowed_roots = ["/work/project-a", "/work/project-b"]
|
|
77
|
+
max_concurrent_tasks = 1
|
|
78
|
+
|
|
79
|
+
[storage]
|
|
80
|
+
token_path = "~/.bamboo-coding/token.json"
|
|
81
|
+
journal_path = "~/.bamboo-coding/journal.db"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Environment variables still override TOML values. Existing `AGENT_*` overrides remain supported during the transition.
|
|
85
|
+
|
|
86
|
+
## Makefile Commands
|
|
87
|
+
|
|
88
|
+
The repository now includes a root `Makefile` as the quick command hub.
|
|
89
|
+
|
|
90
|
+
Common targets:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
make help # list available commands
|
|
94
|
+
make dev # run the server locally
|
|
95
|
+
make start # start the server with docker compose
|
|
96
|
+
make stop # stop the docker compose stack
|
|
97
|
+
make restart # restart the docker compose stack
|
|
98
|
+
make logs # follow server logs
|
|
99
|
+
make ps # show compose service state
|
|
100
|
+
make test # run the full pytest suite
|
|
101
|
+
make client-install # install editable package plus build/upload tooling
|
|
102
|
+
make client-clean # remove build artifacts and Python cache files
|
|
103
|
+
make client-build # build wheel and sdist into dist/
|
|
104
|
+
make client-reinstall # clean and reinstall the editable package
|
|
105
|
+
make client-deploy # publish dist/* to real PyPI
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`client-deploy` publishes to the real PyPI index. It prompts for a PyPI deploy
|
|
109
|
+
token when one is missing:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
make client-deploy
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
You can also provide the token through the environment for non-interactive runs:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
export PYPI_TOKEN=<pypi-token>
|
|
119
|
+
make client-deploy
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The Makefile maps `PYPI_TOKEN` to Twine's token auth internally by setting
|
|
123
|
+
`TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<pypi-token>`.
|
|
124
|
+
|
|
125
|
+
## Docker Folder
|
|
126
|
+
|
|
127
|
+
The server Docker assets live under `docker/`:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
docker/
|
|
131
|
+
compose.server.yml
|
|
132
|
+
server.Dockerfile
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Run Locally
|
|
136
|
+
|
|
137
|
+
### 1. Start the server
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bamboo-coding-server --dev --host 127.0.0.1 --port 8100
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The legacy launcher also still works:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
.venv/bin/python app.py --dev --host 127.0.0.1 --port 8100
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 2. Setup and run a client
|
|
150
|
+
|
|
151
|
+
First write the default config:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
bamboo-coding setup
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Then start the long-running client:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
bamboo-coding run
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Bare `bamboo-coding` is an alias for `bamboo-coding run`.
|
|
164
|
+
|
|
165
|
+
For one-off value overrides you can still use environment variables, but `run` still expects a config file to exist:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
CONTROLLER_URL=ws://127.0.0.1:8100/ws/agents AGENT_CLIENT_ID=worker-1 AGENT_ALLOWED_ROOTS=/work/project-a:/work/project-b bamboo-coding run
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The module entrypoint is also available:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
.venv/bin/python -m bamboo_coding.client.main run
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 3. Approve the client in the web UI
|
|
178
|
+
|
|
179
|
+
Open:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
http://127.0.0.1:8100/
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The start page shows:
|
|
186
|
+
|
|
187
|
+
- approved clients first, with live root counts
|
|
188
|
+
- pending clients with an `Approve` button
|
|
189
|
+
- roots and immediate children only after you pick a specific client
|
|
190
|
+
|
|
191
|
+
Once approved, the client stores its token under `~/.bamboo-coding/` by default and reconnects automatically on the next start.
|
|
192
|
+
|
|
193
|
+
### 4. Open terminals from the web UI
|
|
194
|
+
|
|
195
|
+
After you pick a client and workspace, use the `Terminal` button in the header.
|
|
196
|
+
|
|
197
|
+
Terminal behavior:
|
|
198
|
+
|
|
199
|
+
- each terminal attaches to the currently selected client
|
|
200
|
+
- the initial shell directory uses the current selected path
|
|
201
|
+
- you can open multiple terminals in the same page
|
|
202
|
+
- windows can be dragged, resized, and maximized inside the page
|
|
203
|
+
- `Hide` moves a terminal into the bottom-right dock; click the dock item to restore it
|
|
204
|
+
- the header `Layout` control supports `Hidden`, `1`, `1|2`, `1|2|3`, and `2x2` presets
|
|
205
|
+
- applying `Hidden` docks every open terminal without closing the sessions
|
|
206
|
+
- applying a layout restores all open terminals, fills the preset slots by open order, and docks overflow terminals
|
|
207
|
+
- with an active layout, new terminals join the preset only while free slots remain; after that they open as floating windows
|
|
208
|
+
- the main page `Shortcuts` button opens browser-local terminal shortcut settings
|
|
209
|
+
- default terminal shortcuts are `Ctrl+Down` for `Hidden` and `Ctrl+Up` for `2x2`
|
|
210
|
+
- leaving or refreshing the page while any terminal windows remain open triggers the browser unload warning
|
|
211
|
+
|
|
212
|
+
There is also a standalone terminal page that reuses the same component:
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
http://127.0.0.1:8100/terminal?agent_id=<agent-id>&path=/absolute/path
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 5. Open a specific workspace directly
|
|
219
|
+
|
|
220
|
+
When multiple clients may advertise the same path, include both the client and the path:
|
|
221
|
+
|
|
222
|
+
```text
|
|
223
|
+
http://127.0.0.1:8100/?agent_id=<agent-id>&path=/absolute/path/inside/an/approved/root
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Path-only links still work when the owner is unambiguous:
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
http://127.0.0.1:8100/?path=/absolute/path/inside/an/approved/root
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
If the path is inside a Git repository, Git actions are enabled. If it is only a normal folder, the UI still shows the file tree and editor.
|
|
233
|
+
|
|
234
|
+
## Public API
|
|
235
|
+
|
|
236
|
+
### Discovery and approval
|
|
237
|
+
|
|
238
|
+
- `GET /api/health`
|
|
239
|
+
- `GET /api/agents` (includes live `roots` for connected approved clients)
|
|
240
|
+
- `POST /api/agents/{agent_id}/approve`
|
|
241
|
+
- `GET /api/roots`
|
|
242
|
+
|
|
243
|
+
### Filesystem
|
|
244
|
+
|
|
245
|
+
- `GET /api/fs/tree?path=...&agent_id=...`
|
|
246
|
+
- `GET /api/fs/browse?path=...&agent_id=...`
|
|
247
|
+
- `GET /api/fs/file?path=...&agent_id=...`
|
|
248
|
+
- `PUT /api/fs/file?path=...&agent_id=...`
|
|
249
|
+
|
|
250
|
+
### Git
|
|
251
|
+
|
|
252
|
+
- `GET /api/git/status?path=...&agent_id=...`
|
|
253
|
+
- `GET /api/git/diff?path=...&file=...&agent_id=...`
|
|
254
|
+
- `GET /api/git/commits?path=...&agent_id=...`
|
|
255
|
+
- `GET /api/git/commit/{commit_hash}?path=...&agent_id=...`
|
|
256
|
+
- `POST /api/git/stage?path=...&agent_id=...`
|
|
257
|
+
- `POST /api/git/unstage?path=...&agent_id=...`
|
|
258
|
+
- `GET /api/git/branches?path=...&agent_id=...`
|
|
259
|
+
- `POST /api/git/branches?path=...&agent_id=...`
|
|
260
|
+
- `PUT /api/git/branches/checkout?path=...&agent_id=...`
|
|
261
|
+
- `DELETE /api/git/branches/{name}?path=...&agent_id=...`
|
|
262
|
+
- `POST /api/git/branches/merge?path=...&agent_id=...`
|
|
263
|
+
- `POST /api/git/commit?path=...&agent_id=...`
|
|
264
|
+
|
|
265
|
+
### Client transport
|
|
266
|
+
|
|
267
|
+
- `WS /ws/agents`
|
|
268
|
+
- `WS /ws/terminal?agent_id=...&path=...&terminal_id=...&cols=...&rows=...`
|
|
269
|
+
|
|
270
|
+
## Testing
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
.venv/bin/python -m pytest -q
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Repository Layout
|
|
277
|
+
|
|
278
|
+
- `app.py`: legacy server launcher pointing at `bamboo_coding.server.main`
|
|
279
|
+
- `bamboo_coding/server/`: packaged server entrypoint
|
|
280
|
+
- `bamboo_coding/client/`: packaged client runtime
|
|
281
|
+
- `controller/app/`: controller internals
|
|
282
|
+
- `static/`: SPA assets
|
|
283
|
+
- `docker/`: server Docker Compose and Dockerfile assets
|
|
284
|
+
- `tests/`: controller, client, protocol, and Git utility tests
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Bamboo Coding
|
|
2
|
+
|
|
3
|
+
Bamboo Coding is a FastAPI-based workspace and Git review system with an outbound Python client and a browser UI.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
- `bamboo_coding/server/`: packaged server entrypoint and public app surface
|
|
8
|
+
- `bamboo_coding/client/`: packaged outbound client runtime
|
|
9
|
+
- `controller/app/`: controller internals used by the packaged server entrypoint
|
|
10
|
+
- `shared/`: legacy shared protocol implementation backing the new namespace
|
|
11
|
+
- `static/`: browser UI assets
|
|
12
|
+
|
|
13
|
+
The controller never reads arbitrary local paths itself. Clients connect outward, advertise allowed roots, wait for approval, and then handle tasks for paths inside those roots.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- Web approval for pending clients
|
|
18
|
+
- Client-first workspace selection in the UI
|
|
19
|
+
- Direct folder browsing, including non-Git folders
|
|
20
|
+
- Automatic Git mode when the selected path is inside a repository
|
|
21
|
+
- Changed-files-first tree, diff viewer, commit history, branches, stage/unstage, and commit
|
|
22
|
+
- Durable client token storage and task journal
|
|
23
|
+
- Multi-terminal browser dialogs bound to the selected client and path
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- Python 3.12+
|
|
28
|
+
- Git 2.x+
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python3 -m venv .venv
|
|
34
|
+
. .venv/bin/activate
|
|
35
|
+
pip install -e .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Client Config
|
|
39
|
+
|
|
40
|
+
The client reads `~/.bamboo-coding/bamboo-coding.toml` by default.
|
|
41
|
+
|
|
42
|
+
Quick start:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bamboo-coding setup
|
|
46
|
+
bamboo-coding run
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`setup` creates the config file if it is missing. By default it uses the current working directory as the first allowed root. You can override the generated values:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
bamboo-coding setup --root /work/project-a --root /work/project-b --client-id worker-1 --hostname devbox
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Example generated config:
|
|
56
|
+
|
|
57
|
+
```toml
|
|
58
|
+
[client]
|
|
59
|
+
controller_url = "ws://127.0.0.1:8100/ws/agents"
|
|
60
|
+
client_id = "worker-1"
|
|
61
|
+
hostname = "devbox"
|
|
62
|
+
allowed_roots = ["/work/project-a", "/work/project-b"]
|
|
63
|
+
max_concurrent_tasks = 1
|
|
64
|
+
|
|
65
|
+
[storage]
|
|
66
|
+
token_path = "~/.bamboo-coding/token.json"
|
|
67
|
+
journal_path = "~/.bamboo-coding/journal.db"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Environment variables still override TOML values. Existing `AGENT_*` overrides remain supported during the transition.
|
|
71
|
+
|
|
72
|
+
## Makefile Commands
|
|
73
|
+
|
|
74
|
+
The repository now includes a root `Makefile` as the quick command hub.
|
|
75
|
+
|
|
76
|
+
Common targets:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
make help # list available commands
|
|
80
|
+
make dev # run the server locally
|
|
81
|
+
make start # start the server with docker compose
|
|
82
|
+
make stop # stop the docker compose stack
|
|
83
|
+
make restart # restart the docker compose stack
|
|
84
|
+
make logs # follow server logs
|
|
85
|
+
make ps # show compose service state
|
|
86
|
+
make test # run the full pytest suite
|
|
87
|
+
make client-install # install editable package plus build/upload tooling
|
|
88
|
+
make client-clean # remove build artifacts and Python cache files
|
|
89
|
+
make client-build # build wheel and sdist into dist/
|
|
90
|
+
make client-reinstall # clean and reinstall the editable package
|
|
91
|
+
make client-deploy # publish dist/* to real PyPI
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`client-deploy` publishes to the real PyPI index. It prompts for a PyPI deploy
|
|
95
|
+
token when one is missing:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
make client-deploy
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
You can also provide the token through the environment for non-interactive runs:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
export PYPI_TOKEN=<pypi-token>
|
|
105
|
+
make client-deploy
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The Makefile maps `PYPI_TOKEN` to Twine's token auth internally by setting
|
|
109
|
+
`TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<pypi-token>`.
|
|
110
|
+
|
|
111
|
+
## Docker Folder
|
|
112
|
+
|
|
113
|
+
The server Docker assets live under `docker/`:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
docker/
|
|
117
|
+
compose.server.yml
|
|
118
|
+
server.Dockerfile
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Run Locally
|
|
122
|
+
|
|
123
|
+
### 1. Start the server
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bamboo-coding-server --dev --host 127.0.0.1 --port 8100
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The legacy launcher also still works:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
.venv/bin/python app.py --dev --host 127.0.0.1 --port 8100
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 2. Setup and run a client
|
|
136
|
+
|
|
137
|
+
First write the default config:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bamboo-coding setup
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Then start the long-running client:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
bamboo-coding run
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Bare `bamboo-coding` is an alias for `bamboo-coding run`.
|
|
150
|
+
|
|
151
|
+
For one-off value overrides you can still use environment variables, but `run` still expects a config file to exist:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
CONTROLLER_URL=ws://127.0.0.1:8100/ws/agents AGENT_CLIENT_ID=worker-1 AGENT_ALLOWED_ROOTS=/work/project-a:/work/project-b bamboo-coding run
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The module entrypoint is also available:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
.venv/bin/python -m bamboo_coding.client.main run
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 3. Approve the client in the web UI
|
|
164
|
+
|
|
165
|
+
Open:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
http://127.0.0.1:8100/
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The start page shows:
|
|
172
|
+
|
|
173
|
+
- approved clients first, with live root counts
|
|
174
|
+
- pending clients with an `Approve` button
|
|
175
|
+
- roots and immediate children only after you pick a specific client
|
|
176
|
+
|
|
177
|
+
Once approved, the client stores its token under `~/.bamboo-coding/` by default and reconnects automatically on the next start.
|
|
178
|
+
|
|
179
|
+
### 4. Open terminals from the web UI
|
|
180
|
+
|
|
181
|
+
After you pick a client and workspace, use the `Terminal` button in the header.
|
|
182
|
+
|
|
183
|
+
Terminal behavior:
|
|
184
|
+
|
|
185
|
+
- each terminal attaches to the currently selected client
|
|
186
|
+
- the initial shell directory uses the current selected path
|
|
187
|
+
- you can open multiple terminals in the same page
|
|
188
|
+
- windows can be dragged, resized, and maximized inside the page
|
|
189
|
+
- `Hide` moves a terminal into the bottom-right dock; click the dock item to restore it
|
|
190
|
+
- the header `Layout` control supports `Hidden`, `1`, `1|2`, `1|2|3`, and `2x2` presets
|
|
191
|
+
- applying `Hidden` docks every open terminal without closing the sessions
|
|
192
|
+
- applying a layout restores all open terminals, fills the preset slots by open order, and docks overflow terminals
|
|
193
|
+
- with an active layout, new terminals join the preset only while free slots remain; after that they open as floating windows
|
|
194
|
+
- the main page `Shortcuts` button opens browser-local terminal shortcut settings
|
|
195
|
+
- default terminal shortcuts are `Ctrl+Down` for `Hidden` and `Ctrl+Up` for `2x2`
|
|
196
|
+
- leaving or refreshing the page while any terminal windows remain open triggers the browser unload warning
|
|
197
|
+
|
|
198
|
+
There is also a standalone terminal page that reuses the same component:
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
http://127.0.0.1:8100/terminal?agent_id=<agent-id>&path=/absolute/path
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 5. Open a specific workspace directly
|
|
205
|
+
|
|
206
|
+
When multiple clients may advertise the same path, include both the client and the path:
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
http://127.0.0.1:8100/?agent_id=<agent-id>&path=/absolute/path/inside/an/approved/root
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Path-only links still work when the owner is unambiguous:
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
http://127.0.0.1:8100/?path=/absolute/path/inside/an/approved/root
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
If the path is inside a Git repository, Git actions are enabled. If it is only a normal folder, the UI still shows the file tree and editor.
|
|
219
|
+
|
|
220
|
+
## Public API
|
|
221
|
+
|
|
222
|
+
### Discovery and approval
|
|
223
|
+
|
|
224
|
+
- `GET /api/health`
|
|
225
|
+
- `GET /api/agents` (includes live `roots` for connected approved clients)
|
|
226
|
+
- `POST /api/agents/{agent_id}/approve`
|
|
227
|
+
- `GET /api/roots`
|
|
228
|
+
|
|
229
|
+
### Filesystem
|
|
230
|
+
|
|
231
|
+
- `GET /api/fs/tree?path=...&agent_id=...`
|
|
232
|
+
- `GET /api/fs/browse?path=...&agent_id=...`
|
|
233
|
+
- `GET /api/fs/file?path=...&agent_id=...`
|
|
234
|
+
- `PUT /api/fs/file?path=...&agent_id=...`
|
|
235
|
+
|
|
236
|
+
### Git
|
|
237
|
+
|
|
238
|
+
- `GET /api/git/status?path=...&agent_id=...`
|
|
239
|
+
- `GET /api/git/diff?path=...&file=...&agent_id=...`
|
|
240
|
+
- `GET /api/git/commits?path=...&agent_id=...`
|
|
241
|
+
- `GET /api/git/commit/{commit_hash}?path=...&agent_id=...`
|
|
242
|
+
- `POST /api/git/stage?path=...&agent_id=...`
|
|
243
|
+
- `POST /api/git/unstage?path=...&agent_id=...`
|
|
244
|
+
- `GET /api/git/branches?path=...&agent_id=...`
|
|
245
|
+
- `POST /api/git/branches?path=...&agent_id=...`
|
|
246
|
+
- `PUT /api/git/branches/checkout?path=...&agent_id=...`
|
|
247
|
+
- `DELETE /api/git/branches/{name}?path=...&agent_id=...`
|
|
248
|
+
- `POST /api/git/branches/merge?path=...&agent_id=...`
|
|
249
|
+
- `POST /api/git/commit?path=...&agent_id=...`
|
|
250
|
+
|
|
251
|
+
### Client transport
|
|
252
|
+
|
|
253
|
+
- `WS /ws/agents`
|
|
254
|
+
- `WS /ws/terminal?agent_id=...&path=...&terminal_id=...&cols=...&rows=...`
|
|
255
|
+
|
|
256
|
+
## Testing
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
.venv/bin/python -m pytest -q
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Repository Layout
|
|
263
|
+
|
|
264
|
+
- `app.py`: legacy server launcher pointing at `bamboo_coding.server.main`
|
|
265
|
+
- `bamboo_coding/server/`: packaged server entrypoint
|
|
266
|
+
- `bamboo_coding/client/`: packaged client runtime
|
|
267
|
+
- `controller/app/`: controller internals
|
|
268
|
+
- `static/`: SPA assets
|
|
269
|
+
- `docker/`: server Docker Compose and Dockerfile assets
|
|
270
|
+
- `tests/`: controller, client, protocol, and Git utility tests
|
|
File without changes
|
|
File without changes
|
|
File without changes
|