@infosupport/huddle-cli 0.0.0-experiment-137.146.1 → 0.0.0-experiment-137.148.1

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,201 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.STAGED_DIR = exports.BASE_NAME = exports.IDES = void 0;
7
+ exports.localImageName = localImageName;
8
+ exports.buildPlan = buildPlan;
9
+ exports.stageDockerfiles = stageDockerfiles;
10
+ exports.readStatus = readStatus;
11
+ exports.buildImages = buildImages;
12
+ exports.startBackgroundBuild = startBackgroundBuild;
13
+ exports.printStatus = printStatus;
14
+ exports.ensureImageForStart = ensureImageForStart;
15
+ const child_process_1 = require("child_process");
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const path_1 = __importDefault(require("path"));
18
+ const config_1 = require("./config");
19
+ const utils_1 = require("./utils");
20
+ /**
21
+ * Devcontainer base images are built on the user's machine instead of pulled
22
+ * from a registry. That way nobody has to publish a new image for every Claude
23
+ * Code (or Codex/Copilot) release: `huddle images build --refresh` picks up the
24
+ * latest versions.
25
+ *
26
+ * Names live under `localhost/` so a missing image can never be resolved to a
27
+ * public registry (e.g. a Docker Hub namespace called "huddle"); Podman also
28
+ * uses `localhost/` for local images.
29
+ */
30
+ exports.IDES = ['vscode', 'intellij', 'rider', 'webstorm'];
31
+ exports.BASE_NAME = 'base-devimage';
32
+ /** Local image for the shared base or one IDE, for a channel tag (`latest` or `experiment-<nr>`). */
33
+ function localImageName(ide, tag) {
34
+ return `localhost/huddle/${ide ? `${exports.BASE_NAME}-${ide}` : exports.BASE_NAME}:${tag}`;
35
+ }
36
+ /** Where `huddle init` stages the Dockerfiles; mounted into the gateway as /huddle-home/images. */
37
+ exports.STAGED_DIR = path_1.default.join(config_1.CONFIG_DIR, 'images');
38
+ const LOG_PATH = path_1.default.join(exports.STAGED_DIR, 'build.log');
39
+ const STATUS_PATH = path_1.default.join(exports.STAGED_DIR, 'build-status.json');
40
+ /**
41
+ * The images to build, base first (the IDE images build on top of it). Pure, so
42
+ * it is unit-tested. With `refresh` every image is rebuilt; otherwise images that
43
+ * already exist are skipped, except that a rebuilt base forces its IDE images.
44
+ */
45
+ function buildPlan(tag, ides, exists, refresh) {
46
+ const base = localImageName(undefined, tag);
47
+ const steps = [];
48
+ const baseNeeded = refresh || !exists(base);
49
+ if (baseNeeded)
50
+ steps.push({ name: exports.BASE_NAME, image: base, buildArgs: {} });
51
+ for (const ide of ides) {
52
+ const image = localImageName(ide, tag);
53
+ if (baseNeeded || !exists(image)) {
54
+ steps.push({ name: `${exports.BASE_NAME}-${ide}`, ide, image, buildArgs: { BASE_IMAGE: base } });
55
+ }
56
+ }
57
+ return steps;
58
+ }
59
+ /** The Dockerfiles shipped with the CLI package (copied there by scripts/copy-dockerfiles.js). */
60
+ function packagedDir() {
61
+ return path_1.default.resolve(__dirname, '..', 'images');
62
+ }
63
+ /**
64
+ * Copies the packaged Dockerfiles to ~/.huddle/images, so the gateway (which
65
+ * mounts ~/.huddle) can build a missing image itself on the first start.
66
+ */
67
+ function stageDockerfiles() {
68
+ const src = packagedDir();
69
+ if (!fs_1.default.existsSync(src))
70
+ throw new Error(`Dockerfiles not found in ${src}; is the CLI package complete?`);
71
+ for (const name of fs_1.default.readdirSync(src)) {
72
+ const from = path_1.default.join(src, name, 'Dockerfile');
73
+ if (!fs_1.default.existsSync(from))
74
+ continue;
75
+ fs_1.default.mkdirSync(path_1.default.join(exports.STAGED_DIR, name), { recursive: true });
76
+ fs_1.default.copyFileSync(from, path_1.default.join(exports.STAGED_DIR, name, 'Dockerfile'));
77
+ }
78
+ }
79
+ function imageExists(rt, image) {
80
+ return (0, child_process_1.spawnSync)(rt, ['image', 'inspect', image], { stdio: 'ignore' }).status === 0;
81
+ }
82
+ function writeStatus(status) {
83
+ fs_1.default.mkdirSync(exports.STAGED_DIR, { recursive: true });
84
+ fs_1.default.writeFileSync(STATUS_PATH, JSON.stringify({ ...status, updatedAt: new Date().toISOString() }, null, 2));
85
+ }
86
+ function readStatus() {
87
+ try {
88
+ return JSON.parse(fs_1.default.readFileSync(STATUS_PATH, 'utf8'));
89
+ }
90
+ catch {
91
+ return undefined;
92
+ }
93
+ }
94
+ /**
95
+ * Builds the images in the foreground (output to stdout/stderr). Returns false
96
+ * when a build failed; the rest of the plan is then skipped, because the IDE
97
+ * images cannot build without their base.
98
+ */
99
+ function buildImages(opts) {
100
+ stageDockerfiles();
101
+ const ides = opts.ides ?? exports.IDES;
102
+ const plan = buildPlan(opts.tag, ides, (img) => imageExists(opts.rt, img), !!opts.refresh);
103
+ if (plan.length === 0) {
104
+ console.log((0, utils_1.green)('[OK] All devcontainer base images are present.') + (0, utils_1.dim)(' Use --refresh to rebuild with the latest tools.'));
105
+ writeStatus({ state: 'done', tag: opts.tag });
106
+ return true;
107
+ }
108
+ for (const step of plan) {
109
+ console.log((0, utils_1.bold)(`Building ${step.image}`));
110
+ writeStatus({ state: 'building', tag: opts.tag, image: step.image });
111
+ const dir = path_1.default.join(exports.STAGED_DIR, step.name);
112
+ const args = ['build', '-t', step.image];
113
+ for (const [k, v] of Object.entries(step.buildArgs))
114
+ args.push('--build-arg', `${k}=${v}`);
115
+ // --pull refreshes the upstream images (Debian, devcontainers) but never our own
116
+ // localhost/ base, which only exists locally.
117
+ if (opts.refresh)
118
+ args.push('--no-cache', ...(step.ide ? [] : ['--pull']));
119
+ args.push('-f', path_1.default.join(dir, 'Dockerfile'), dir);
120
+ const res = (0, child_process_1.spawnSync)(opts.rt, args, { stdio: 'inherit' });
121
+ if (res.status !== 0) {
122
+ const error = `build of ${step.image} failed (exit ${res.status ?? res.signal})`;
123
+ console.log((0, utils_1.yellow)(`[!] ${error}`));
124
+ writeStatus({ state: 'failed', tag: opts.tag, image: step.image, error });
125
+ return false;
126
+ }
127
+ }
128
+ console.log((0, utils_1.green)(`[OK] Built ${plan.length} image(s).`));
129
+ writeStatus({ state: 'done', tag: opts.tag });
130
+ return true;
131
+ }
132
+ /**
133
+ * Starts the build in a detached process so `huddle init` does not wait for it.
134
+ * The gateway waits for a running build before it builds a missing image itself.
135
+ */
136
+ function startBackgroundBuild(rt, tag) {
137
+ stageDockerfiles();
138
+ writeStatus({ state: 'building', tag });
139
+ const out = fs_1.default.openSync(LOG_PATH, 'w');
140
+ const child = (0, child_process_1.spawn)(process.execPath, [process.argv[1], 'images', 'build', '--runtime', rt], {
141
+ detached: true,
142
+ stdio: ['ignore', out, out],
143
+ env: { ...process.env, HUDDLE_IMAGES_TAG: tag },
144
+ });
145
+ child.unref();
146
+ fs_1.default.closeSync(out);
147
+ console.log((0, utils_1.dim)(`Building devcontainer base images in the background (log: ${LOG_PATH})`));
148
+ console.log((0, utils_1.dim)(' The first start of a devcontainer waits for it; check progress with "huddle images status".'));
149
+ }
150
+ function printStatus(rt, tag) {
151
+ const status = readStatus();
152
+ console.log(`Channel tag: ${tag}`);
153
+ if (status) {
154
+ const detail = status.state === 'building' && status.image ? ` (${status.image})` : status.error ? ` (${status.error})` : '';
155
+ console.log(`Last build: ${status.state}${detail}, ${status.updatedAt}`);
156
+ }
157
+ for (const ide of [undefined, ...exports.IDES]) {
158
+ const image = localImageName(ide, tag);
159
+ console.log(` ${imageExists(rt, image) ? (0, utils_1.green)('present') : (0, utils_1.yellow)('missing')} ${image}`);
160
+ }
161
+ if (fs_1.default.existsSync(LOG_PATH))
162
+ console.log((0, utils_1.dim)(`Log: ${LOG_PATH}`));
163
+ }
164
+ const STALE_MS = 60 * 60 * 1000;
165
+ /**
166
+ * Called by `huddle start` before it asks the gateway to start a container.
167
+ * The gateway would otherwise block the request for the whole build and the
168
+ * CLI's HTTP call times out after 5 minutes. So: wait here for a running
169
+ * background build (with progress), or build in the foreground when nothing is
170
+ * building. Only for our own local images; a snapshot or custom image is left
171
+ * to the gateway.
172
+ */
173
+ async function ensureImageForStart(rt, ide, imageName) {
174
+ const m = /^localhost\/huddle\/base-devimage-[a-z]+:(.+)$/.exec(imageName);
175
+ if (!m || imageExists(rt, imageName))
176
+ return;
177
+ const tag = m[1];
178
+ let announced = false;
179
+ for (;;) {
180
+ const s = readStatus();
181
+ const building = s?.state === 'building' && Date.now() - Date.parse(s.updatedAt) < STALE_MS;
182
+ if (!building || imageExists(rt, imageName))
183
+ break;
184
+ if (!announced) {
185
+ console.log((0, utils_1.dim)(`Waiting for the base-image build to finish (${s?.image ?? imageName}); log: ${LOG_PATH}`));
186
+ announced = true;
187
+ }
188
+ else {
189
+ process.stdout.write((0, utils_1.dim)('.'));
190
+ }
191
+ await new Promise((r) => setTimeout(r, 10_000));
192
+ }
193
+ if (announced)
194
+ console.log();
195
+ if (imageExists(rt, imageName))
196
+ return;
197
+ console.log((0, utils_1.bold)(`Base image ${imageName} is missing; building it now (one-time, a few minutes).`));
198
+ if (!buildImages({ rt, tag, ides: [ide] })) {
199
+ throw new Error(`Could not build ${imageName}; see the output above or run "huddle images build"`);
200
+ }
201
+ }
package/dist/images.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveImages = resolveImages;
4
4
  exports.gatewayEnvArgs = gatewayEnvArgs;
5
5
  const config_1 = require("./config");
6
+ const base_images_1 = require("./base-images");
6
7
  function resolveImages() {
7
8
  const experiment = (0, config_1.activeExperiment)();
8
9
  const tag = (0, config_1.imageTag)();
@@ -10,27 +11,28 @@ function resolveImages() {
10
11
  experiment,
11
12
  tag,
12
13
  image: process.env.HUDDLE_IMAGE ?? `ghcr.io/infosupport/huddle:${tag}`,
14
+ // Built locally (see base-images.ts), never pulled. BASE_IMAGE_<IDE> still
15
+ // overrides, e.g. to point at a self-built or team-registry image.
13
16
  baseImages: [
14
- { image: process.env.BASE_IMAGE ?? `ghcr.io/infosupport/base-devimage:${tag}` },
15
- { image: process.env.BASE_IMAGE_RIDER ?? `ghcr.io/infosupport/base-devimage-rider:${tag}`, gatewayEnv: 'BASE_IMAGE_RIDER' },
16
- { image: process.env.BASE_IMAGE_INTELLIJ ?? `ghcr.io/infosupport/base-devimage-intellij:${tag}`, gatewayEnv: 'BASE_IMAGE_INTELLIJ' },
17
- { image: process.env.BASE_IMAGE_WEBSTORM ?? `ghcr.io/infosupport/base-devimage-webstorm:${tag}`, gatewayEnv: 'BASE_IMAGE_WEBSTORM' },
18
- { image: process.env.BASE_IMAGE_VSCODE ?? `ghcr.io/infosupport/base-devimage-vscode:${tag}`, gatewayEnv: 'BASE_IMAGE_VSCODE' },
17
+ { image: process.env.BASE_IMAGE ?? (0, base_images_1.localImageName)(undefined, tag), gatewayEnv: 'BASE_IMAGE' },
18
+ { image: process.env.BASE_IMAGE_RIDER ?? (0, base_images_1.localImageName)('rider', tag), gatewayEnv: 'BASE_IMAGE_RIDER' },
19
+ { image: process.env.BASE_IMAGE_INTELLIJ ?? (0, base_images_1.localImageName)('intellij', tag), gatewayEnv: 'BASE_IMAGE_INTELLIJ' },
20
+ { image: process.env.BASE_IMAGE_WEBSTORM ?? (0, base_images_1.localImageName)('webstorm', tag), gatewayEnv: 'BASE_IMAGE_WEBSTORM' },
21
+ { image: process.env.BASE_IMAGE_VSCODE ?? (0, base_images_1.localImageName)('vscode', tag), gatewayEnv: 'BASE_IMAGE_VSCODE' },
19
22
  ],
20
23
  };
21
24
  }
22
25
  /**
23
- * `-e KEY=val` argv pairs for the gateway container. During an experiment (or
24
- * with an explicit override) the gateway must start devcontainers from the same
25
- * base images the CLI just pulled. Returned as an argv array (not a shell
26
- * string) so init can spawn `docker run` without a shell.
26
+ * `-e KEY=val` argv pairs for the gateway container, so it starts devcontainers
27
+ * from (and, if missing, builds) exactly the local images of the active channel.
28
+ * Returned as an argv array (not a shell string) so init can spawn `docker run`
29
+ * without a shell.
27
30
  */
28
31
  function gatewayEnvArgs(resolved) {
29
32
  const args = [];
30
33
  for (const b of resolved.baseImages) {
31
- if (b.gatewayEnv && (resolved.experiment !== undefined || process.env[b.gatewayEnv])) {
34
+ if (b.gatewayEnv)
32
35
  args.push('-e', `${b.gatewayEnv}=${b.image}`);
33
- }
34
36
  }
35
37
  return args;
36
38
  }
package/dist/index.js CHANGED
@@ -15,12 +15,15 @@ const indexfolder_1 = require("./indexfolder");
15
15
  const triage_agent_1 = require("./triage-agent");
16
16
  const update_agent_1 = require("./update-agent");
17
17
  const images_1 = require("./images");
18
+ const base_images_1 = require("./base-images");
19
+ const config_1 = require("./config");
20
+ const runtime_1 = require("./runtime");
18
21
  const self_update_1 = require("./self-update");
19
22
  const utils_1 = require("./utils");
20
23
  const experiment_1 = require("./experiment");
21
24
  const VALUE_FLAGS = new Set(['url', 'ide', 'name', 'image', 'workspace', 'container', 'status', 'runtime', 'experiment', 'path', 'ca-path', 'output', 'out', 'workspace-root', 'depth']);
22
25
  const BOOLEAN_FLAGS = new Set(['help', 'h', 'empty', 'i', 'interactive', 'version', 'v', 'deny', 'docker-socket', 'force', 'replace', 'all', 'list', 'clear']);
23
- const COMMANDS = new Set(['start', 'firewall', 'fw', 'init', 'restart', 'experiment', 'migrate', 'indexfolder', 'indexfolders', 'update-agent', 'triage-agent', 'help', 'version']);
26
+ const COMMANDS = new Set(['start', 'firewall', 'fw', 'init', 'restart', 'experiment', 'migrate', 'indexfolder', 'indexfolders', 'update-agent', 'triage-agent', 'images', 'help', 'version']);
24
27
  function parseArgs(argv) {
25
28
  const positional = [];
26
29
  const flags = {};
@@ -154,6 +157,10 @@ Usage:
154
157
  and run init
155
158
  huddle experiment reset Back to the stable release
156
159
  huddle experiment status Show the active channel and CLI version
160
+ huddle images build [--refresh] Build the devcontainer base images on this machine
161
+ (--refresh: rebuild with the latest Claude Code,
162
+ Codex and Copilot CLIs; --ide <ide>: one IDE only)
163
+ huddle images status Show which base images are present
157
164
 
158
165
  Init options:
159
166
  --runtime <docker|podman> Container runtime (default: auto-detected;
@@ -300,6 +307,31 @@ async function main() {
300
307
  await (0, init_1.runInit)(initOpts, (0, images_1.resolveImages)());
301
308
  return;
302
309
  }
310
+ if (cmd === 'images') {
311
+ const subCmd = sub ?? 'status';
312
+ const rt = (0, runtime_1.resolveRuntime)(flagString(flags, 'runtime')).name;
313
+ // The background build from `huddle init` passes the channel tag explicitly.
314
+ const tag = process.env.HUDDLE_IMAGES_TAG?.trim() || (0, config_1.imageTag)();
315
+ if (subCmd === 'build') {
316
+ const ide = flagString(flags, 'ide');
317
+ if (ide !== undefined && !base_images_1.IDES.includes(ide)) {
318
+ console.error(`Unknown IDE: ${ide} (choose from ${base_images_1.IDES.join(', ')})`);
319
+ process.exit(1);
320
+ }
321
+ const ok = (0, base_images_1.buildImages)({ rt, tag, ides: ide ? [ide] : undefined, refresh: flagBool(flags, 'refresh') });
322
+ if (!ok)
323
+ process.exit(1);
324
+ }
325
+ else if (subCmd === 'status') {
326
+ (0, base_images_1.printStatus)(rt, tag);
327
+ }
328
+ else {
329
+ console.error(`Unknown images subcommand: ${subCmd}`);
330
+ console.error('Usage: huddle images <build [--refresh] [--ide <ide>]|status>');
331
+ process.exit(1);
332
+ }
333
+ return;
334
+ }
303
335
  if (cmd === 'experiment') {
304
336
  const subCmd = sub ?? 'status';
305
337
  if (subCmd === 'use') {
package/dist/init.js CHANGED
@@ -11,6 +11,7 @@ const utils_1 = require("./utils");
11
11
  const runtime_1 = require("./runtime");
12
12
  const images_1 = require("./images");
13
13
  const config_1 = require("./config");
14
+ const base_images_1 = require("./base-images");
14
15
  const fs_1 = __importDefault(require("fs"));
15
16
  const CONTAINER = 'huddle';
16
17
  const VOLUME = 'huddle-data';
@@ -45,28 +46,6 @@ function runArgsSilent(file, args) {
45
46
  return false;
46
47
  }
47
48
  }
48
- /**
49
- * Pulls the devcontainer base images ahead of time. Best-effort: if an image is
50
- * not (yet) available in the registry, we only warn — the gateway then builds it
51
- * from the bundled Dockerfile on the first start.
52
- */
53
- function pullBaseImages(rt, images) {
54
- console.log((0, utils_1.dim)(`Pulling devcontainer base images (${images.length})`));
55
- const failed = [];
56
- for (const image of images) {
57
- console.log((0, utils_1.dim)(` Pulling ${image}`));
58
- try {
59
- runArgs(rt, ['pull', image]);
60
- }
61
- catch {
62
- failed.push(image);
63
- console.log((0, utils_1.yellow)(` [!] Could not pull ${image} — the gateway will build it later if needed.`));
64
- }
65
- }
66
- if (failed.length === images.length) {
67
- console.log((0, utils_1.yellow)('[!] No base image could be pulled. Are the images published and reachable?'));
68
- }
69
- }
70
49
  /**
71
50
  * Starts the Huddle gateway. Which images run (stable or experiment) is decided
72
51
  * by the caller via `images` (see resolveImages() in images.ts); this function
@@ -87,7 +66,6 @@ async function runInit(opts, images) {
87
66
  else {
88
67
  console.log((0, utils_1.dim)(`Pulling ${IMAGE}`));
89
68
  runArgs(rt, ['pull', IMAGE]);
90
- pullBaseImages(rt, images.baseImages.map((b) => b.image));
91
69
  }
92
70
  console.log((0, utils_1.dim)(`Volume: ${VOLUME}`));
93
71
  runArgsSilent(rt, ['volume', 'inspect', VOLUME]) || runArgs(rt, ['volume', 'create', VOLUME]);
@@ -180,6 +158,20 @@ async function runInit(opts, images) {
180
158
  dockerArgs.push(...(0, images_1.gatewayEnvArgs)(images));
181
159
  dockerArgs.push(IMAGE);
182
160
  runArgs(rt, dockerArgs);
161
+ // Devcontainer base images are built on this machine, not pulled. Non-blocking:
162
+ // init returns right away; a devcontainer that starts before the build is done
163
+ // waits for it in the gateway. HUDDLE_NO_BUILD=1 skips it (CI builds itself).
164
+ if (process.env.HUDDLE_NO_BUILD === '1') {
165
+ console.log((0, utils_1.dim)('HUDDLE_NO_BUILD=1 → not building devcontainer base images'));
166
+ }
167
+ else {
168
+ try {
169
+ (0, base_images_1.startBackgroundBuild)(rt, images.tag);
170
+ }
171
+ catch (err) {
172
+ console.log((0, utils_1.yellow)(`[!] Could not start the base-image build: ${err}. Run "huddle images build".`));
173
+ }
174
+ }
183
175
  // Attaching devcontainer-net after the container has started pollutes
184
176
  // resolv.conf on Podman with that network's internal aardvark-DNS; the
185
177
  // gateway cleans that up itself (see dns-egress.ts / the startup sanitize in
package/dist/start.js CHANGED
@@ -8,6 +8,8 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const api_1 = require("./api");
10
10
  const utils_1 = require("./utils");
11
+ const base_images_1 = require("./base-images");
12
+ const runtime_1 = require("./runtime");
11
13
  async function runStart(opts) {
12
14
  const ide = parseIde(opts.ide);
13
15
  const hasMounts = !!opts.mounts && opts.mounts.length > 0;
@@ -73,6 +75,17 @@ async function runStart(opts) {
73
75
  else {
74
76
  body.workspaceDir = workspaceDir;
75
77
  }
78
+ // Our base images are built on this machine; make sure this one exists before the
79
+ // gateway starts the container (it would otherwise build it inside the request).
80
+ let rt;
81
+ try {
82
+ rt = (0, runtime_1.resolveRuntime)().name;
83
+ }
84
+ catch {
85
+ // No local container runtime (e.g. HUDDLE_URL points elsewhere): leave it to the gateway.
86
+ }
87
+ if (rt)
88
+ await (0, base_images_1.ensureImageForStart)(rt, ide, imageName);
76
89
  const result = await (0, api_1.post)('/api/docker/start', body);
77
90
  console.log((0, utils_1.green)(`[OK] Container started: ${result.containerName} (${result.id.slice(0, 12)})`));
78
91
  console.log();
@@ -0,0 +1,58 @@
1
+ FROM mcr.microsoft.com/devcontainers/base:debian
2
+
3
+ # mcr base levert al: vscode user (uid 1000) — passwordless sudo wordt hieronder verwijderd,
4
+ # zsh + oh-my-zsh, git, curl, wget, common-utils.
5
+
6
+ # Non-interactive frontend for apt-get to avoid warnings or prompts during build.
7
+ ARG DEBIAN_FRONTEND=noninteractive
8
+
9
+ # Docker apt repo + iptables (NAT-rule huddle) + Docker CLI + compose plugin
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ ca-certificates \
12
+ curl \
13
+ gnupg \
14
+ inotify-tools \
15
+ iptables \
16
+ && install -m 0755 -d /etc/apt/keyrings \
17
+ && curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
18
+ && chmod a+r /etc/apt/keyrings/docker.asc \
19
+ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian bookworm stable" \
20
+ > /etc/apt/sources.list.d/docker.list \
21
+ && apt-get update \
22
+ && apt-get install -y --no-install-recommends docker-ce-cli docker-compose-plugin \
23
+ && rm -rf /var/lib/apt/lists/*
24
+
25
+ # Node.js 24 (vereist voor claude-code, codex en copilot CLIs)
26
+ RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
27
+ && apt-get install -y --no-install-recommends nodejs \
28
+ && rm -rf /var/lib/apt/lists/*
29
+
30
+ # Global CLIs
31
+ RUN npm install -g @anthropic-ai/claude-code @openai/codex @github/copilot opencode-ai
32
+
33
+ # markitdown: converteert PDF/Office/HTML/afbeeldingen → Markdown.
34
+ # Wordt gebruikt door de markitdown-skill (.ai/claude/skills/markitdown.md).
35
+ RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip \
36
+ && pip install --break-system-packages 'markitdown[all]' \
37
+ && rm -rf /var/lib/apt/lists/*
38
+
39
+ # Mappen aanmaken voor AI CLI-tools. Inhoud wordt bij container-start
40
+ # via de instelbare folder mappings (Huddle Instellingen) gemount.
41
+ RUN mkdir -p /home/vscode/.claude/agents /home/vscode/.claude/skills \
42
+ /home/vscode/.codex /home/vscode/.copilot \
43
+ /home/vscode/.config/opencode/agents \
44
+ /home/vscode/.ai/mcp \
45
+ && chown -R vscode:vscode /home/vscode/.claude /home/vscode/.codex \
46
+ /home/vscode/.copilot /home/vscode/.config \
47
+ /home/vscode/.ai
48
+
49
+ # Verwijder sudo-rechten van vscode (mcr base geeft ze standaard, wij willen dit niet)
50
+ RUN gpasswd -d vscode sudo 2>/dev/null || true \
51
+ && find /etc/sudoers.d -name '*vscode*' -delete 2>/dev/null || true
52
+
53
+ # vscode user lid maken van docker group (mcr base zet hem er niet automatisch in)
54
+ RUN groupadd -f docker && usermod -aG docker vscode
55
+
56
+ # Draai als non-root. Root-only setup (iptables NAT) doet de spawn-flow via een
57
+ # aparte `docker exec -u root` (zie huddle.ps1), dus pid 1 hoeft geen root te zijn.
58
+ USER vscode
@@ -0,0 +1,12 @@
1
+ # Bouwt lokaal op de gedeelde base-devimage (gebouwd door `huddle images build` of de gateway).
2
+ ARG BASE_IMAGE=localhost/huddle/base-devimage:latest
3
+ FROM ${BASE_IMAGE}
4
+
5
+ # JB Gateway downloadt zelf de JBR/JDK in de RemoteDev-dist. Als je java/mvn
6
+ # ook in je terminal wil, voeg dan apt-install temurin-21-jdk maven toe.
7
+
8
+ LABEL com.devcontainer.snapshot=true
9
+ LABEL com.devcontainer.source=base-devimage-intellij
10
+ LABEL com.devcontainer.ide=intellij
11
+
12
+ # Geen ENTRYPOINT/CMD override — huddle's spawn-flow zet die zelf.
@@ -0,0 +1,20 @@
1
+ # Bouwt lokaal op de gedeelde base-devimage (gebouwd door `huddle images build` of de gateway).
2
+ ARG BASE_IMAGE=localhost/huddle/base-devimage:latest
3
+ FROM ${BASE_IMAGE}
4
+
5
+ # JB Gateway downloadt zelf de .NET-runtime in de RemoteDev-dist. Als je dotnet
6
+ # ook in je terminal wil, voeg dan apt-install dotnet-sdk-8.0 toe.
7
+ # LET OP: pid 1 draait als vscode (non-root). Als de Rider-backend hierop breekt
8
+ # (RemoteDev-dist-volume kan root-ownership nodig hebben), verplaats USER vscode
9
+ # dan naar dit Dockerfile i.p.v. de base.
10
+
11
+ LABEL com.devcontainer.snapshot=true
12
+ LABEL com.devcontainer.source=base-devimage-rider
13
+ LABEL com.devcontainer.ide=rider
14
+
15
+ # Rider 2026.3 crashes when opening a solution if ~/Downloads does not exist.
16
+ RUN mkdir -p /home/vscode/Downloads
17
+
18
+ # Geen ENTRYPOINT/CMD override — huddle's spawn-flow zet die zelf.
19
+
20
+
@@ -0,0 +1,13 @@
1
+ # Bouwt lokaal op de gedeelde base-devimage (gebouwd door `huddle images build` of de gateway).
2
+ ARG BASE_IMAGE=localhost/huddle/base-devimage:latest
3
+ FROM ${BASE_IMAGE}
4
+
5
+ # Voor VS Code hoeft er hier GEEN backend geïnstalleerd te worden. VS Code installeert
6
+ # zijn eigen "VS Code Server" automatisch in de container zodra je via de Dev Containers-
7
+ # extensie attached ("Attach to Running Container").
8
+
9
+ LABEL com.devcontainer.snapshot=true
10
+ LABEL com.devcontainer.source=base-devimage-vscode
11
+ LABEL com.devcontainer.ide=vscode
12
+
13
+ # Geen ENTRYPOINT/CMD override — huddle's spawn-flow zet die zelf.
@@ -0,0 +1,14 @@
1
+ # Bouwt lokaal op de gedeelde base-devimage (gebouwd door `huddle images build` of de gateway).
2
+ ARG BASE_IMAGE=localhost/huddle/base-devimage:latest
3
+ FROM ${BASE_IMAGE}
4
+
5
+ # JB Gateway downloadt zelf de WebStorm-backend (RemoteDev-dist). Node.js 24 zit al
6
+ # in base-devimage (nodesource), dus node/npm zijn direct beschikbaar in de terminal
7
+ # en voor WebStorm's Node-interpreter. Wil je een andere Node-versie of pnpm/yarn,
8
+ # installeer die dan hier.
9
+
10
+ LABEL com.devcontainer.snapshot=true
11
+ LABEL com.devcontainer.source=base-devimage-webstorm
12
+ LABEL com.devcontainer.ide=webstorm
13
+
14
+ # Geen ENTRYPOINT/CMD override — huddle's spawn-flow zet die zelf.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infosupport/huddle-cli",
3
- "version": "0.0.0-experiment-137.146.1",
3
+ "version": "0.0.0-experiment-137.148.1",
4
4
  "description": "Huddle CLI — start devcontainers and manage firewall rules",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Info Support B.V.",
@@ -17,11 +17,11 @@
17
17
  "huddle": "dist/index.js"
18
18
  },
19
19
  "scripts": {
20
- "build": "tsc",
20
+ "build": "node scripts/copy-dockerfiles.js && tsc",
21
21
  "dev": "tsc --watch",
22
22
  "install-global": "npm run build && npm install -g .",
23
23
  "typecheck": "tsc --noEmit",
24
- "test": "tsc && node --test"
24
+ "test": "npm run build && node --test"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^22.0.0",
@@ -31,7 +31,8 @@
31
31
  "node": ">=22"
32
32
  },
33
33
  "files": [
34
- "dist"
34
+ "dist",
35
+ "images"
35
36
  ],
36
37
  "publishConfig": {
37
38
  "registry": "https://registry.npmjs.org",