@getmonoceros/workbench 1.33.0 → 1.33.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/bin.js CHANGED
@@ -2817,15 +2817,25 @@ function windowsSshPort(name) {
2817
2817
  return 49152 + h % 16384;
2818
2818
  }
2819
2819
  function windowsHostBlock(hostAlias, keyWin, port) {
2820
- return [
2820
+ const head = [
2821
2821
  `Host ${hostAlias}`,
2822
- ` HostName 127.0.0.1`,
2823
- ` Port ${port}`,
2824
2822
  ` User node`,
2825
2823
  ` IdentityFile ${keyWin}`,
2826
2824
  ` IdentitiesOnly yes`,
2827
2825
  ` StrictHostKeyChecking no`,
2828
2826
  ` UserKnownHostsFile NUL`
2827
+ ];
2828
+ if (port !== null) {
2829
+ return [
2830
+ `Host ${hostAlias}`,
2831
+ ` HostName 127.0.0.1`,
2832
+ ` Port ${port}`,
2833
+ ...head.slice(1)
2834
+ ].join("\n");
2835
+ }
2836
+ return [
2837
+ ...head,
2838
+ ` ProxyCommand docker exec -i ${hostAlias} socat - TCP:127.0.0.1:22`
2829
2839
  ].join("\n");
2830
2840
  }
2831
2841
  function escapeRegExp2(s) {
@@ -2875,7 +2885,7 @@ async function removeMarkedBlock(configPath, hostAlias) {
2875
2885
  existing.replace(re, "\n").replace(/\n{3,}/g, "\n\n")
2876
2886
  );
2877
2887
  }
2878
- async function setupWindowsBridge(name, hostAlias, privateKey, deps, logger) {
2888
+ async function setupWindowsBridge(name, hostAlias, privateKey, directPort, deps, logger) {
2879
2889
  if (!deps.isWsl()) return;
2880
2890
  const profile = await deps.resolveProfile();
2881
2891
  if (!profile) {
@@ -2893,7 +2903,7 @@ async function setupWindowsBridge(name, hostAlias, privateKey, deps, logger) {
2893
2903
  await upsertMarkedBlock(
2894
2904
  path9.join(profile.homeWsl, ".ssh", "config"),
2895
2905
  hostAlias,
2896
- windowsHostBlock(hostAlias, keyWin, windowsSshPort(name))
2906
+ windowsHostBlock(hostAlias, keyWin, directPort)
2897
2907
  );
2898
2908
  await deps.lockKey(keyWin, profile.user);
2899
2909
  logger.info(
@@ -2942,6 +2952,7 @@ async function setupSshAttach(opts) {
2942
2952
  opts.name,
2943
2953
  hostAlias,
2944
2954
  keys.privateKey,
2955
+ opts.windowsDirectPort ?? null,
2945
2956
  resolveWindowsDeps(opts.windows),
2946
2957
  logger
2947
2958
  );
@@ -8096,6 +8107,11 @@ Fix the value in the env file (or the yml).`
8096
8107
  name: opts.name,
8097
8108
  targetDir,
8098
8109
  home,
8110
+ // Direct-port Windows block only when the runtime publishes the port
8111
+ // (>= 1.3.4); otherwise the Windows block keeps the ProxyCommand.
8112
+ windowsDirectPort: runtimeSupportsHostKeyPinning(
8113
+ createOpts.runtimeVersion
8114
+ ) ? windowsSshPort(opts.name) : null,
8099
8115
  ...opts.sshKeygen ? { keygen: opts.sshKeygen } : {},
8100
8116
  ...opts.sshUserSshDir ? { userSshDir: opts.sshUserSshDir } : {},
8101
8117
  logger: idLogger
@@ -8593,7 +8609,7 @@ var CLI_VERSION;
8593
8609
  var init_version = __esm({
8594
8610
  "src/version.ts"() {
8595
8611
  "use strict";
8596
- CLI_VERSION = true ? "1.33.0" : "dev";
8612
+ CLI_VERSION = true ? "1.33.1" : "dev";
8597
8613
  }
8598
8614
  });
8599
8615