@infosupport/huddle-cli 0.0.0-experiment-147.93.1 → 0.0.0-experiment-147.95.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.
package/dist/extension.js CHANGED
@@ -124,8 +124,13 @@ function hasHuddleContainer(rt) {
124
124
  * extension inactive.
125
125
  */
126
126
  function restartRuntime(explicit, hasContainer = hasHuddleContainer, detect = () => (0, runtime_1.resolveRuntime)().name) {
127
- if (explicit ?? process.env.HUDDLE_RUNTIME)
128
- return (0, runtime_1.resolveRuntime)(explicit).name;
127
+ const requested = explicit ?? process.env.HUDDLE_RUNTIME;
128
+ if (requested !== undefined) {
129
+ // An empty value is a typo, not a request to auto-detect: probing could pick another engine's container.
130
+ if (!requested)
131
+ throw new Error('--runtime must not be empty; choose docker or podman.');
132
+ return (0, runtime_1.resolveRuntime)(requested).name;
133
+ }
129
134
  const owners = ['docker', 'podman'].filter((rt) => hasContainer(rt));
130
135
  if (owners.length === 1)
131
136
  return owners[0];
package/dist/index.js CHANGED
@@ -170,7 +170,8 @@ Start options:
170
170
  --workspace-root <path> Container path the IDE opens as project root when using
171
171
  --mount (default: common parent of the mount targets)
172
172
  --name <name> Container name (default: devcontainer-<foldername>)
173
- --image <image> Use a specific image
173
+ --image <image> Use a specific image. Any Debian/Ubuntu/Alpine image works:
174
+ Huddle builds it once with its own layer on top
174
175
  --empty Empty container without a workspace
175
176
 
176
177
  Migrate options:
package/dist/start.js CHANGED
@@ -80,18 +80,19 @@ async function runStart(opts) {
80
80
  console.log(`Open in VS Code: ${(0, utils_1.cyan)('Dev Containers: Attach to Running Container')} -> ${(0, utils_1.bold)(result.containerName)}`);
81
81
  return;
82
82
  }
83
- console.log(`Open in JetBrains Gateway: ${(0, utils_1.cyan)('Remote Development > Dev Containers')} -> ${(0, utils_1.bold)(result.containerName)}`);
84
- await tryPrintIdeLink(result.containerName);
83
+ await tryPrintSshLink(result.containerName);
85
84
  }
86
- async function tryPrintIdeLink(containerName) {
87
- await new Promise((resolve) => setTimeout(resolve, 3000));
85
+ // Same link as the portal's Connect IDE button: sets up sshd + the localhost
86
+ // relay and returns a jetbrains-gateway:// link. Best-effort: without an SSH key
87
+ // in Settings, or on an older image, the portal button explains what is missing.
88
+ async function tryPrintSshLink(containerName) {
88
89
  try {
89
- const res = await (0, api_1.get)(`/api/docker/containers/${encodeURIComponent(containerName)}/ide-link`);
90
+ const res = await (0, api_1.get)(`/api/docker/containers/${encodeURIComponent(containerName)}/ssh-link`);
90
91
  if (res?.link)
91
- console.log((0, utils_1.dim)(`Gateway-link: ${res.link}`));
92
+ console.log(`Open in JetBrains Gateway: ${(0, utils_1.cyan)(res.link)}`);
92
93
  }
93
- catch {
94
- // The IDE link is best-effort; JetBrains may still be starting the backend.
94
+ catch (err) {
95
+ console.log((0, utils_1.dim)(`No SSH link yet (${err?.message ?? err}); use Connect IDE in the Huddle portal.`));
95
96
  }
96
97
  }
97
98
  function resolveWorkspace(workspace) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infosupport/huddle-cli",
3
- "version": "0.0.0-experiment-147.93.1",
3
+ "version": "0.0.0-experiment-147.95.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.",