@getmonoceros/workbench 1.33.2 → 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
@@ -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) {
@@ -8612,7 +8629,7 @@ var CLI_VERSION;
8612
8629
  var init_version = __esm({
8613
8630
  "src/version.ts"() {
8614
8631
  "use strict";
8615
- CLI_VERSION = true ? "1.33.2" : "dev";
8632
+ CLI_VERSION = true ? "1.33.3" : "dev";
8616
8633
  }
8617
8634
  });
8618
8635