gdkbox 0.1.21 → 0.1.22

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed8db8e33eb456eab81c33ec420fccbb86294d1569373da95d4eab9aebf1ee79
4
- data.tar.gz: 23812d9d52938ddbdbd5613f412bdb5e35ed588ec177c5f1ad8acfbfa76fe214
3
+ metadata.gz: a353b949138be45d989c30863cb5c6b3e1a1a649f00e7522a867be70c12c4d01
4
+ data.tar.gz: 6b9f387c0afc7ea1e5ce3ba20f9c33f5dbf797b726e160e9c29fbfc9aa17f701
5
5
  SHA512:
6
- metadata.gz: 588e9c4a5beaa9f7ddcfd0cdfe3c897de80b230646a24b1c580bdb1cf008ec9aa86531d5f5a03d2234bf128918dd821f02dba7b41a79470b172d5607b2abd8c2
7
- data.tar.gz: d1369eb4dadb712a8e2cacef481c55475e4239f447daad5ef952bdb956d5651ca13ac7fe80a29e8390ac609228514ed3bbcac3cf659f1c050bcc22ce8d679ca5
6
+ metadata.gz: 4534fe9792143d6377788468efd38868f95581cd9c8d257e42c2df5cf370f8c16e11833331b670d7798bfba7e39063f1046fffdcb8369abe63721684c4ae52ff
7
+ data.tar.gz: 4276196feb72afa6ded3609aa8f18d4790a3291efb6c346437bd455879b48d7a7a8c7da0bf8b3c22842935ba7a6e40e6bb2e5c987254c4149d87d7300495e772
data/README.md CHANGED
@@ -103,7 +103,7 @@ Or run it straight from the checkout without installing:
103
103
  | `gdkbox skills` | List agent skills available to install (bundled + `~/.claude/skills` + `./.claude/skills`). |
104
104
  | `gdkbox add-skill BOX [SKILL...]` | Install skill(s) into a **box** so dispatched agents can use them; interactive picker if no SKILL (`--force`). |
105
105
  | `gdkbox completion SHELL` | Set up bash/zsh completion — `--install` makes it permanent (writes the script + wires your rc file once); without it, prints the script. |
106
- | `gdkbox harnesses` | List the agent harnesses gdkbox can install (claude, codex, opencode, pi). |
106
+ | `gdkbox harnesses` | List the agent harnesses gdkbox can install (claude, codex, opencode, opencode2, pi). |
107
107
  | `gdkbox install-agent NAME` | (Re)install the box's agent harness inside it. |
108
108
 
109
109
  ### `gdkbox up` options
@@ -114,7 +114,7 @@ Or run it straight from the checkout without installing:
114
114
  | `--ssh-port` | next free from 2222 | Host port to publish SSH on. Auto-allocation skips ports in use on the host (e.g. a local GDK). |
115
115
  | `--web-port` | next free from 3000 | Host port to publish the GDK web UI on. Auto-allocation skips ports in use on the host. |
116
116
  | `--vite-port` | next free from 3038 | Port for vite assets. Published with the **same number inside and outside** the box (asset URLs embed it); GDK in the box is reconfigured to match. |
117
- | `--harness ID` | `claude` (or config.yml) | Agent harness to install: claude, codex, opencode, pi. |
117
+ | `--harness ID` | `claude` (or config.yml) | Agent harness to install: claude, codex, opencode, opencode2, pi. |
118
118
  | `--no-agent` | (agent installed) | Skip installing the agent harness. |
119
119
  | `--skill NAME [NAME...]` | (none) | Seed skill(s) into the box at creation for dispatched agents. |
120
120
  | `--gitlab-remote REMOTE` | config.yml, else image default | Point the GitLab checkout at this remote (URL or `namespace/project`); the image ships pointing at the community mirror. |
@@ -123,7 +123,7 @@ Or run it straight from the checkout without installing:
123
123
  | `--docker` | off | Mount the host Docker socket + per-box network so docker-executor CI jobs work. **Grants the box root-equivalent host access** — see "Docker inside a box". |
124
124
  | `--publish PORT [PORT...]` | (none) | Publish extra container ports on `127.0.0.1`, same number on both sides (e.g. AI Gateway `5052`, Duo Workflow `50052`). |
125
125
  | `--key-env NAME` | the harness's | Env var this box's API key is seeded under (e.g. `GITLAB_TOKEN`); see "opencode with GitLab Duo". |
126
- | `--model ID` | the harness's own | Model the box's agent runs with on `dispatch` (claude, codex, opencode; e.g. `gitlab/duo-chat-sonnet-4-5`). |
126
+ | `--model ID` | the harness's own | Model the box's agent runs with on `dispatch` (claude, codex, opencode, opencode2; e.g. `gitlab/duo-chat-sonnet-4-5`). |
127
127
 
128
128
  ## Typical workflow
129
129
 
@@ -375,7 +375,8 @@ harness the box was created with.
375
375
  | --- | --- | --- | --- | --- |
376
376
  | `claude` | Claude Code | `claude -p` | `ANTHROPIC_API_KEY` | `~/.claude/skills` |
377
377
  | `codex` | OpenAI Codex | `codex exec` | `OPENAI_API_KEY` | `~/.codex/skills` |
378
- | `opencode` | opencode (sst) | `opencode run` | `GITLAB_TOKEN` | `~/.config/opencode/skills` |
378
+ | `opencode` | opencode V1 (opencode-ai) | `opencode run` | `GITLAB_TOKEN` | `~/.config/opencode/skills` |
379
+ | `opencode2` | opencode V2 (@opencode/cli) | `opencode2 run` | `GITLAB_TOKEN` | `~/.config/opencode/skills` |
379
380
  | `pi` | pi (earendil-works) | `pi -p` | `GITLAB_TOKEN` | `~/.pi/skills` |
380
381
 
381
382
  ```sh
@@ -386,23 +387,32 @@ gdkbox dispatch reviewer --task "review the diff"
386
387
  gdkbox harnesses # list available harnesses
387
388
  ```
388
389
 
389
- Skills use the same `SKILL.md` format across all four, so a skill installed by
390
- `add-skill`/`--skill` works regardless of harness. The key env is a per-harness
391
- default (claude → `ANTHROPIC_API_KEY`, codex → `OPENAI_API_KEY`, opencode and
392
- pi → `GITLAB_TOKEN`): point a box at another provider with
390
+ Skills use the same `SKILL.md` format across all harnesses, so a skill installed
391
+ by `add-skill`/`--skill` works regardless of harness. The key env is a
392
+ per-harness default (claude → `ANTHROPIC_API_KEY`, codex → `OPENAI_API_KEY`,
393
+ opencode/opencode2/pi → `GITLAB_TOKEN`): point a box at another provider with
393
394
  `gdkbox up --key-env NAME`.
394
395
  `gdkbox up --model ID` pins the model a box's agent is dispatched with
395
- (claude, codex, and opencode; not pi yet). Both are fixed when the box is
396
- created.
396
+ (claude, codex, opencode, and opencode2; not pi yet). Both are fixed when the
397
+ box is created.
398
+
399
+ `opencode` installs opencode V1 (`opencode-ai`); `opencode2` installs opencode
400
+ V2 (`@opencode/cli`, which ships both an `opencode` and an `opencode2` binary —
401
+ gdkbox pins `opencode2` to keep the two harnesses from clashing). V2 is
402
+ config-compatible with V1 (it reads V1's `permission` object config) and adds
403
+ `--auto` to auto-approve non-denied permissions on headless dispatch.
397
404
 
398
405
  ### opencode with GitLab Duo
399
406
 
400
- The `opencode` harness defaults to opencode's GitLab Duo provider, which reads
401
- a personal access token from `GITLAB_TOKEN`. Pin a Duo model with `--model`:
407
+ The `opencode` and `opencode2` harnesses default to opencode's GitLab Duo
408
+ provider, which reads a personal access token from `GITLAB_TOKEN`. Pin a Duo
409
+ model with `--model`:
402
410
 
403
411
  ```sh
404
412
  GITLAB_TOKEN=<token> gdkbox up duo --harness opencode --model gitlab/duo-chat-sonnet-4-5
405
413
  gdkbox dispatch duo --task "review the diff"
414
+ # or opencode V2:
415
+ GITLAB_TOKEN=<token> gdkbox up duo2 --harness opencode2 --model gitlab/duo-chat-opus-5-5
406
416
  ```
407
417
 
408
418
  - The `duo-chat-*` models are GitLab Duo Agentic Chat and work with the token
@@ -146,15 +146,41 @@ module GDKBox
146
146
  # OPENAI_API_KEY).
147
147
  key_env: "GITLAB_TOKEN",
148
148
  config_key: "gitlab_token",
149
- summary: "opencode (sst)",
149
+ summary: "opencode V1 (opencode-ai)",
150
150
  skills_subdir: ".config/opencode/skills",
151
151
  model_flag: "-m",
152
152
  run: lambda do |json:, yolo:|
153
- # `opencode run` is non-interactive and has no skip-permissions flag.
153
+ # opencode V1's `run` is non-interactive and has no skip-permissions
154
+ # flag, so json/yolo are no-ops here (use the opencode2 harness for
155
+ # those).
154
156
  +%(opencode run "$GDKBOX_TASK")
155
157
  end
156
158
  )
157
159
 
160
+ # opencode V2 (`@opencode/cli`, ships both `opencode` and `opencode2`
161
+ # binaries). Registered alongside V1 so a box can run either; this harness
162
+ # pins the `opencode2` binary to avoid clashing with V1's `opencode`. V2
163
+ # reads the same GitLab Duo provider and config as V1 — it accepts V1's
164
+ # `permission` object config and normalises it to its own `permissions`
165
+ # array — so the fleet skill's opencode config snippet works unchanged.
166
+ register(
167
+ id: "opencode2",
168
+ npm_package: "@opencode/cli",
169
+ bin: "opencode2",
170
+ key_env: "GITLAB_TOKEN",
171
+ config_key: "gitlab_token",
172
+ summary: "opencode V2 (@opencode/cli)",
173
+ skills_subdir: ".config/opencode/skills",
174
+ model_flag: "-m",
175
+ run: lambda do |json:, yolo:|
176
+ cmd = +%(opencode2 run "$GDKBOX_TASK")
177
+ cmd << " --format json" if json
178
+ # V2 adds `--auto`: auto-approve permissions not explicitly denied.
179
+ cmd << " --auto" if yolo
180
+ cmd
181
+ end
182
+ )
183
+
158
184
  register(
159
185
  id: "pi",
160
186
  npm_package: "@earendil-works/pi-coding-agent",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GDKBox
4
- VERSION = "0.1.21"
4
+ VERSION = "0.1.22"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gdkbox-fleet
3
- version: 1.0.0
3
+ version: 1.0.1
4
4
  description: >-
5
5
  Orchestrate a fleet of GDK-in-a-box environments with the `gdkbox` CLI:
6
6
  provision a reusable pool of GitLab Development Kit boxes, then dispatch
@@ -90,6 +90,24 @@ gdkbox up "pool-$i" --owner "$OWNER" --ttl 7200 --json \
90
90
  match what you asked for, and `"api_key_set"` must be `true`.
91
91
  - `dispatch --json` output is harness-specific. For opencode it is plain text,
92
92
  so rely on the exit status rather than parsing it.
93
+ - An opencode dispatch starts in the GDK root, so opencode treats the GitLab
94
+ checkout (a git repository of its own) and `/tmp` as outside directories
95
+ and rejects every command there. Before the first dispatch, allow them in
96
+ the box's `~/.config/opencode/opencode.jsonc`:
97
+
98
+ ```json
99
+ {"$schema": "https://opencode.ai/config.json",
100
+ "permission": {"external_directory": {
101
+ "/home/gdk/gitlab-development-kit/gitlab/**": "allow",
102
+ "/tmp/**": "allow"}}}
103
+ ```
104
+
105
+ Use the singular `permission` **object** form above. opencode's config
106
+ schema also defines an ordered `permissions` ruleset array, but that is a
107
+ **V2-only** feature: opencode V1 — what the box installs (`opencode-ai`,
108
+ 1.19.x) — rejects it outright (`Configuration is invalid … V2 permissions
109
+ are not supported by OpenCode V1`). Keep the object form while the harness
110
+ runs opencode V1.
93
111
 
94
112
  In the examples below, `gdkbox` means "the gdkbox CLI, however it is invoked".
95
113
 
@@ -122,7 +140,7 @@ In the examples below, `gdkbox` means "the gdkbox CLI, however it is invoked".
122
140
  "ssh_port": 2222,
123
141
  "web_port": 3000,
124
142
  "web_url": "http://127.0.0.1:3000",
125
- "remote_path": "/home/gdk/gdk",
143
+ "remote_path": "/home/gdk/gitlab-development-kit",
126
144
  "harness": "claude",
127
145
  "claude_installed": true,
128
146
  "api_key_set": true,
@@ -208,9 +226,16 @@ can parse per task.
208
226
  tree so tasks don't interfere, e.g.:
209
227
 
210
228
  ```sh
211
- gdkbox ssh pool-1 -t 'cd /home/gdk/gdk && git reset --hard && git clean -fd'
229
+ ssh -o ForwardAgent=no gdkbox-pool-1 'cd /home/gdk/gitlab-development-kit/gitlab && git reset --hard && git clean -fd'
212
230
  ```
213
231
 
232
+ `gdkbox ssh <box>` is interactive only and takes no command, so run
233
+ commands through the `gdkbox-<box>` ssh alias that `up` writes. The GitLab
234
+ checkout is `/home/gdk/gitlab-development-kit/gitlab` (a box's
235
+ `remote_path` is the GDK root, not the checkout). Pass
236
+ `-o ForwardAgent=no` when the box runs untrusted code (an MR under
237
+ review): the alias forwards your ssh agent by default.
238
+
214
239
  Skip this only when tasks are meant to build on each other.
215
240
 
216
241
  5. **Collect and report.** Read each task's output file, parse the JSON result,
@@ -269,7 +294,7 @@ Reuse a box for the next task after resetting it (keep the claim while the
269
294
  box is yours; release only when you are done with it):
270
295
 
271
296
  ```sh
272
- gdkbox ssh pool-1 -t 'cd /home/gdk/gdk && git reset --hard && git clean -fd'
297
+ ssh -o ForwardAgent=no gdkbox-pool-1 'cd /home/gdk/gitlab-development-kit/gitlab && git reset --hard && git clean -fd'
273
298
  gdkbox dispatch pool-1 --task-file tasks/next.md --json
274
299
  ```
275
300
 
@@ -291,7 +316,7 @@ gdkbox up duo-1 --owner "$OWNER" --ttl 14400 --docker --publish 5052 50052
291
316
  gdkbox set-gcloud duo-1 # Vertex AI credentials for the flow model
292
317
  ```
293
318
 
294
- Then, inside the box (dispatch these as tasks or run them over `gdkbox ssh`),
319
+ Then, inside the box (dispatch these as tasks or run them over the `gdkbox-<box>` ssh alias),
295
320
  follow the README's "Running Duo agentic flows in a box" steps — in short:
296
321
  `gdk rake setup_ai_services` (~20 min, needs a valid `ANTHROPIC_API_KEY`);
297
322
  put the workflow service's env in **`env.runit`** (not `.env` — the two
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdkbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - jotolo
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 4.0.11
99
+ rubygems_version: 4.0.24
100
100
  specification_version: 4
101
101
  summary: Spin up a GitLab Development Kit (GDK) in a box, ready for VS Code and Claude
102
102
  Code.