@getmonoceros/workbench 1.33.0 → 1.33.2

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(
@@ -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
  );
@@ -3581,8 +3592,10 @@ function buildDevcontainerJson(opts, dockerMode = "rootful") {
3581
3592
  }
3582
3593
  }
3583
3594
  } : void 0;
3584
- const sshPostStart = runtimeSupportsSshAttach(opts.runtimeVersion) ? { postStartCommand: "sudo /usr/local/bin/monoceros-sshd-up.sh" } : {};
3585
3595
  const sshBridgePort = windowsBridgePort(opts);
3596
+ const sshPostStart = runtimeSupportsSshAttach(opts.runtimeVersion) ? {
3597
+ postStartCommand: `sudo /usr/local/bin/monoceros-sshd-up.sh${sshBridgePort !== null ? ` ${sshBridgePort}` : ""}`
3598
+ } : {};
3586
3599
  const workspaceEnv = {
3587
3600
  ...featureWorkspaceEnv(resolvedFeatures),
3588
3601
  ...sshBridgePort ? { MONOCEROS_SSH_PUBLISH_PORT: String(sshBridgePort) } : {}
@@ -6578,6 +6591,7 @@ async function runBridgeDaemon(opts) {
6578
6591
  const dockerExec = opts.dockerExec ?? spawnDocker;
6579
6592
  const lifecheckMs = opts.lifecheckMs ?? 5e3;
6580
6593
  await fsp5.mkdir(relayDir(root), { recursive: true });
6594
+ await fsp5.rm(relayUrlFile(root), { force: true });
6581
6595
  await fsp5.writeFile(bridgePidFile(root), String(process.pid));
6582
6596
  const watcher = watchRelayUrl({
6583
6597
  urlFile: relayUrlFile(root),
@@ -8096,6 +8110,11 @@ Fix the value in the env file (or the yml).`
8096
8110
  name: opts.name,
8097
8111
  targetDir,
8098
8112
  home,
8113
+ // Direct-port Windows block only when the runtime publishes the port
8114
+ // (>= 1.3.5); otherwise the Windows block keeps the ProxyCommand.
8115
+ windowsDirectPort: runtimeSupportsHostKeyPinning(
8116
+ createOpts.runtimeVersion
8117
+ ) ? windowsSshPort(opts.name) : null,
8099
8118
  ...opts.sshKeygen ? { keygen: opts.sshKeygen } : {},
8100
8119
  ...opts.sshUserSshDir ? { userSshDir: opts.sshUserSshDir } : {},
8101
8120
  logger: idLogger
@@ -8593,7 +8612,7 @@ var CLI_VERSION;
8593
8612
  var init_version = __esm({
8594
8613
  "src/version.ts"() {
8595
8614
  "use strict";
8596
- CLI_VERSION = true ? "1.33.0" : "dev";
8615
+ CLI_VERSION = true ? "1.33.2" : "dev";
8597
8616
  }
8598
8617
  });
8599
8618