@getmonoceros/workbench 1.33.2 → 1.33.4

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/bin.js CHANGED
@@ -2239,6 +2239,10 @@ function runtimeSupportsHostKeyPinning(version) {
2239
2239
  if (!version) return false;
2240
2240
  return compareRuntimeVersions(version, MIN_RUNTIME_FOR_HOST_KEY_PINNING) >= 0;
2241
2241
  }
2242
+ function runtimeSupportsEntrypointSshd(version) {
2243
+ if (!version) return false;
2244
+ return compareRuntimeVersions(version, MIN_RUNTIME_FOR_ENTRYPOINT_SSHD) >= 0;
2245
+ }
2242
2246
  function descriptorOptionDefaults(options) {
2243
2247
  const out = {};
2244
2248
  for (const [key, spec] of Object.entries(options)) {
@@ -2365,7 +2369,7 @@ function deriveServiceName(image) {
2365
2369
  const noTag = lastSegment.split("@")[0].split(":")[0];
2366
2370
  return noTag.toLowerCase().replace(/[^a-z0-9_-]/g, "-");
2367
2371
  }
2368
- var DEFAULT_BASE_IMAGE, override, BASE_IMAGE, RUNTIME_IMAGE_REPO, DEFAULT_RUNTIME_VERSION, MIN_RUNTIME_FOR_SSH_ATTACH, MIN_RUNTIME_FOR_HOST_KEY_PINNING, MIN_RUNTIME_FOR_BROWSER_BRIDGE, DESCRIPTORS, BUILTIN_LANGUAGES, LANGUAGE_CATALOG, LANGUAGE_SPEC_RE, SERVICE_CATALOG, DEFERRED_SERVICE_PROFILE;
2372
+ var DEFAULT_BASE_IMAGE, override, BASE_IMAGE, RUNTIME_IMAGE_REPO, DEFAULT_RUNTIME_VERSION, MIN_RUNTIME_FOR_SSH_ATTACH, MIN_RUNTIME_FOR_HOST_KEY_PINNING, MIN_RUNTIME_FOR_ENTRYPOINT_SSHD, MIN_RUNTIME_FOR_BROWSER_BRIDGE, DESCRIPTORS, BUILTIN_LANGUAGES, LANGUAGE_CATALOG, LANGUAGE_SPEC_RE, SERVICE_CATALOG, DEFERRED_SERVICE_PROFILE;
2369
2373
  var init_catalog = __esm({
2370
2374
  "src/create/catalog.ts"() {
2371
2375
  "use strict";
@@ -2374,7 +2378,7 @@ var init_catalog = __esm({
2374
2378
  override = process.env.MONOCEROS_BASE_IMAGE_OVERRIDE?.trim();
2375
2379
  BASE_IMAGE = override && override.length > 0 ? override : DEFAULT_BASE_IMAGE;
2376
2380
  RUNTIME_IMAGE_REPO = "ghcr.io/getmonoceros/monoceros-runtime";
2377
- DEFAULT_RUNTIME_VERSION = true ? "1.3.5" : readFileSync3(
2381
+ DEFAULT_RUNTIME_VERSION = true ? "1.3.6" : readFileSync3(
2378
2382
  fileURLToPath2(
2379
2383
  new URL("../../../../images/runtime/VERSION", import.meta.url)
2380
2384
  ),
@@ -2382,6 +2386,7 @@ var init_catalog = __esm({
2382
2386
  ).trim();
2383
2387
  MIN_RUNTIME_FOR_SSH_ATTACH = "1.2.0";
2384
2388
  MIN_RUNTIME_FOR_HOST_KEY_PINNING = "1.3.5";
2389
+ MIN_RUNTIME_FOR_ENTRYPOINT_SSHD = "1.3.6";
2385
2390
  MIN_RUNTIME_FOR_BROWSER_BRIDGE = "1.3.3";
2386
2391
  DESCRIPTORS = loadDescriptorCatalogSync();
2387
2392
  BUILTIN_LANGUAGES = new Set(
@@ -2718,16 +2723,25 @@ fi
2718
2723
  exec docker exec -i "$cid" socat - TCP:127.0.0.1:22
2719
2724
  `;
2720
2725
  }
2721
- function configEntryContent(name, hostAlias, privateKey, proxyScript) {
2722
- return `# Generated by Monoceros (ADR 0022) - do not edit.
2726
+ function configEntryContent(name, hostAlias, privateKey, proxyScript, directPort) {
2727
+ const head = `# Generated by Monoceros (ADR 0022) - do not edit.
2723
2728
  # Attach an SSH-capable IDE (Codium, IntelliJ, Zed) to host
2724
2729
  # '${hostAlias}', or run: ssh ${hostAlias}
2725
- Host ${hostAlias}
2726
- User node
2730
+ Host ${hostAlias}`;
2731
+ const common = ` User node
2727
2732
  IdentityFile "${privateKey}"
2728
2733
  IdentitiesOnly yes
2729
2734
  StrictHostKeyChecking no
2730
- UserKnownHostsFile /dev/null
2735
+ UserKnownHostsFile /dev/null`;
2736
+ if (directPort !== null) {
2737
+ return `${head}
2738
+ HostName 127.0.0.1
2739
+ Port ${directPort}
2740
+ ${common}
2741
+ `;
2742
+ }
2743
+ return `${head}
2744
+ ${common}
2731
2745
  ProxyCommand "${proxyScript}"
2732
2746
  `;
2733
2747
  }
@@ -2933,6 +2947,8 @@ async function setupSshAttach(opts) {
2933
2947
  if (!keys) return { hostAlias, configured: false };
2934
2948
  const proxyScript = sshProxyScriptPath(opts.home, opts.name);
2935
2949
  const configEntry = sshConfigEntryPath(opts.home, opts.name);
2950
+ const winDeps = resolveWindowsDeps(opts.windows);
2951
+ const directPort = winDeps.isWsl() ? opts.windowsDirectPort ?? null : null;
2936
2952
  await fs7.mkdir(path9.dirname(proxyScript), { recursive: true });
2937
2953
  await fs7.mkdir(path9.dirname(configEntry), { recursive: true });
2938
2954
  await fs7.writeFile(
@@ -2944,7 +2960,13 @@ async function setupSshAttach(opts) {
2944
2960
  });
2945
2961
  await fs7.writeFile(
2946
2962
  configEntry,
2947
- configEntryContent(opts.name, hostAlias, keys.privateKey, proxyScript)
2963
+ configEntryContent(
2964
+ opts.name,
2965
+ hostAlias,
2966
+ keys.privateKey,
2967
+ proxyScript,
2968
+ directPort
2969
+ )
2948
2970
  );
2949
2971
  await ensureInclude(userSshDir, opts.home);
2950
2972
  try {
@@ -2952,8 +2974,8 @@ async function setupSshAttach(opts) {
2952
2974
  opts.name,
2953
2975
  hostAlias,
2954
2976
  keys.privateKey,
2955
- opts.windowsDirectPort ?? null,
2956
- resolveWindowsDeps(opts.windows),
2977
+ directPort,
2978
+ winDeps,
2957
2979
  logger
2958
2980
  );
2959
2981
  } catch (err) {
@@ -3635,6 +3657,9 @@ function buildDevcontainerJson(opts, dockerMode = "rootful") {
3635
3657
  if (sshBridgePort !== null) {
3636
3658
  runArgs.push("-p", `127.0.0.1:${sshBridgePort}:${sshBridgePort}`);
3637
3659
  }
3660
+ const overrideCommandField = runtimeSupportsEntrypointSshd(
3661
+ opts.runtimeVersion
3662
+ ) ? { overrideCommand: false } : {};
3638
3663
  return {
3639
3664
  name: opts.name,
3640
3665
  image: resolveRuntimeImage(opts.runtimeVersion),
@@ -3645,6 +3670,7 @@ function buildDevcontainerJson(opts, dockerMode = "rootful") {
3645
3670
  forwardPorts: ports,
3646
3671
  postCreateCommand: ".devcontainer/post-create.sh",
3647
3672
  ...sshPostStart,
3673
+ ...overrideCommandField,
3648
3674
  ...containerEnvField ?? {},
3649
3675
  ...featuresField ?? {},
3650
3676
  ...customizationsField ?? {}
@@ -8612,7 +8638,7 @@ var CLI_VERSION;
8612
8638
  var init_version = __esm({
8613
8639
  "src/version.ts"() {
8614
8640
  "use strict";
8615
- CLI_VERSION = true ? "1.33.2" : "dev";
8641
+ CLI_VERSION = true ? "1.33.4" : "dev";
8616
8642
  }
8617
8643
  });
8618
8644