@getmonoceros/workbench 1.33.1 → 1.33.3

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
@@ -2374,14 +2374,14 @@ var init_catalog = __esm({
2374
2374
  override = process.env.MONOCEROS_BASE_IMAGE_OVERRIDE?.trim();
2375
2375
  BASE_IMAGE = override && override.length > 0 ? override : DEFAULT_BASE_IMAGE;
2376
2376
  RUNTIME_IMAGE_REPO = "ghcr.io/getmonoceros/monoceros-runtime";
2377
- DEFAULT_RUNTIME_VERSION = true ? "1.3.4" : readFileSync3(
2377
+ DEFAULT_RUNTIME_VERSION = true ? "1.3.5" : readFileSync3(
2378
2378
  fileURLToPath2(
2379
2379
  new URL("../../../../images/runtime/VERSION", import.meta.url)
2380
2380
  ),
2381
2381
  "utf8"
2382
2382
  ).trim();
2383
2383
  MIN_RUNTIME_FOR_SSH_ATTACH = "1.2.0";
2384
- MIN_RUNTIME_FOR_HOST_KEY_PINNING = "1.3.4";
2384
+ MIN_RUNTIME_FOR_HOST_KEY_PINNING = "1.3.5";
2385
2385
  MIN_RUNTIME_FOR_BROWSER_BRIDGE = "1.3.3";
2386
2386
  DESCRIPTORS = loadDescriptorCatalogSync();
2387
2387
  BUILTIN_LANGUAGES = new Set(
@@ -2718,16 +2718,25 @@ fi
2718
2718
  exec docker exec -i "$cid" socat - TCP:127.0.0.1:22
2719
2719
  `;
2720
2720
  }
2721
- function configEntryContent(name, hostAlias, privateKey, proxyScript) {
2722
- return `# Generated by Monoceros (ADR 0022) - do not edit.
2721
+ function configEntryContent(name, hostAlias, privateKey, proxyScript, directPort) {
2722
+ const head = `# Generated by Monoceros (ADR 0022) - do not edit.
2723
2723
  # Attach an SSH-capable IDE (Codium, IntelliJ, Zed) to host
2724
2724
  # '${hostAlias}', or run: ssh ${hostAlias}
2725
- Host ${hostAlias}
2726
- User node
2725
+ Host ${hostAlias}`;
2726
+ const common = ` User node
2727
2727
  IdentityFile "${privateKey}"
2728
2728
  IdentitiesOnly yes
2729
2729
  StrictHostKeyChecking no
2730
- UserKnownHostsFile /dev/null
2730
+ UserKnownHostsFile /dev/null`;
2731
+ if (directPort !== null) {
2732
+ return `${head}
2733
+ HostName 127.0.0.1
2734
+ Port ${directPort}
2735
+ ${common}
2736
+ `;
2737
+ }
2738
+ return `${head}
2739
+ ${common}
2731
2740
  ProxyCommand "${proxyScript}"
2732
2741
  `;
2733
2742
  }
@@ -2933,6 +2942,8 @@ async function setupSshAttach(opts) {
2933
2942
  if (!keys) return { hostAlias, configured: false };
2934
2943
  const proxyScript = sshProxyScriptPath(opts.home, opts.name);
2935
2944
  const configEntry = sshConfigEntryPath(opts.home, opts.name);
2945
+ const winDeps = resolveWindowsDeps(opts.windows);
2946
+ const directPort = winDeps.isWsl() ? opts.windowsDirectPort ?? null : null;
2936
2947
  await fs7.mkdir(path9.dirname(proxyScript), { recursive: true });
2937
2948
  await fs7.mkdir(path9.dirname(configEntry), { recursive: true });
2938
2949
  await fs7.writeFile(
@@ -2944,7 +2955,13 @@ async function setupSshAttach(opts) {
2944
2955
  });
2945
2956
  await fs7.writeFile(
2946
2957
  configEntry,
2947
- configEntryContent(opts.name, hostAlias, keys.privateKey, proxyScript)
2958
+ configEntryContent(
2959
+ opts.name,
2960
+ hostAlias,
2961
+ keys.privateKey,
2962
+ proxyScript,
2963
+ directPort
2964
+ )
2948
2965
  );
2949
2966
  await ensureInclude(userSshDir, opts.home);
2950
2967
  try {
@@ -2952,8 +2969,8 @@ async function setupSshAttach(opts) {
2952
2969
  opts.name,
2953
2970
  hostAlias,
2954
2971
  keys.privateKey,
2955
- opts.windowsDirectPort ?? null,
2956
- resolveWindowsDeps(opts.windows),
2972
+ directPort,
2973
+ winDeps,
2957
2974
  logger
2958
2975
  );
2959
2976
  } catch (err) {
@@ -3592,8 +3609,10 @@ function buildDevcontainerJson(opts, dockerMode = "rootful") {
3592
3609
  }
3593
3610
  }
3594
3611
  } : void 0;
3595
- const sshPostStart = runtimeSupportsSshAttach(opts.runtimeVersion) ? { postStartCommand: "sudo /usr/local/bin/monoceros-sshd-up.sh" } : {};
3596
3612
  const sshBridgePort = windowsBridgePort(opts);
3613
+ const sshPostStart = runtimeSupportsSshAttach(opts.runtimeVersion) ? {
3614
+ postStartCommand: `sudo /usr/local/bin/monoceros-sshd-up.sh${sshBridgePort !== null ? ` ${sshBridgePort}` : ""}`
3615
+ } : {};
3597
3616
  const workspaceEnv = {
3598
3617
  ...featureWorkspaceEnv(resolvedFeatures),
3599
3618
  ...sshBridgePort ? { MONOCEROS_SSH_PUBLISH_PORT: String(sshBridgePort) } : {}
@@ -6589,6 +6608,7 @@ async function runBridgeDaemon(opts) {
6589
6608
  const dockerExec = opts.dockerExec ?? spawnDocker;
6590
6609
  const lifecheckMs = opts.lifecheckMs ?? 5e3;
6591
6610
  await fsp5.mkdir(relayDir(root), { recursive: true });
6611
+ await fsp5.rm(relayUrlFile(root), { force: true });
6592
6612
  await fsp5.writeFile(bridgePidFile(root), String(process.pid));
6593
6613
  const watcher = watchRelayUrl({
6594
6614
  urlFile: relayUrlFile(root),
@@ -8108,7 +8128,7 @@ Fix the value in the env file (or the yml).`
8108
8128
  targetDir,
8109
8129
  home,
8110
8130
  // Direct-port Windows block only when the runtime publishes the port
8111
- // (>= 1.3.4); otherwise the Windows block keeps the ProxyCommand.
8131
+ // (>= 1.3.5); otherwise the Windows block keeps the ProxyCommand.
8112
8132
  windowsDirectPort: runtimeSupportsHostKeyPinning(
8113
8133
  createOpts.runtimeVersion
8114
8134
  ) ? windowsSshPort(opts.name) : null,
@@ -8609,7 +8629,7 @@ var CLI_VERSION;
8609
8629
  var init_version = __esm({
8610
8630
  "src/version.ts"() {
8611
8631
  "use strict";
8612
- CLI_VERSION = true ? "1.33.1" : "dev";
8632
+ CLI_VERSION = true ? "1.33.3" : "dev";
8613
8633
  }
8614
8634
  });
8615
8635