@boxes-dev/dvb 1.0.98 → 1.0.99

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/dvb.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e4952253-6b01-5464-8cec-44fa0b046c22")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c89c7337-d26d-5d0e-9378-e2535af1df44")}catch(e){}}();
4
4
 
5
5
  var __create = Object.create;
6
6
  var __defProp = Object.defineProperty;
@@ -88688,8 +88688,8 @@ var init_otel = __esm({
88688
88688
  return trimmed && trimmed.length > 0 ? trimmed : void 0;
88689
88689
  };
88690
88690
  readBuildMetadata = () => {
88691
- const rawPackageVersion = "1.0.98";
88692
- const rawGitSha = "e205a3b6f0be3a8d153bbc904250d65d3f3a340b";
88691
+ const rawPackageVersion = "1.0.99";
88692
+ const rawGitSha = "6e1d4cbe7aabab2526d50776d8007a85d5800b43";
88693
88693
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
88694
88694
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
88695
88695
  return { packageVersion, gitSha };
@@ -120679,9 +120679,9 @@ var init_sentry = __esm({
120679
120679
  sentryEnabled = false;
120680
120680
  uncaughtExceptionMonitorInstalled = false;
120681
120681
  readBuildMetadata2 = () => {
120682
- const rawPackageVersion = "1.0.98";
120683
- const rawGitSha = "e205a3b6f0be3a8d153bbc904250d65d3f3a340b";
120684
- const rawSentryRelease = "boxes-dev-dvb@1.0.98+e205a3b6f0be3a8d153bbc904250d65d3f3a340b";
120682
+ const rawPackageVersion = "1.0.99";
120683
+ const rawGitSha = "6e1d4cbe7aabab2526d50776d8007a85d5800b43";
120684
+ const rawSentryRelease = "boxes-dev-dvb@1.0.99+6e1d4cbe7aabab2526d50776d8007a85d5800b43";
120685
120685
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
120686
120686
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
120687
120687
  const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
@@ -138191,7 +138191,7 @@ var init_osc = __esm({
138191
138191
  });
138192
138192
 
138193
138193
  // src/devbox/terminal/sessionProtocol.ts
138194
- var HEARTBEAT_INTERVAL_MS, INPUT_PROBE_TIMEOUT_MS, STREAM_STALL_PROBE_MISS_THRESHOLD, CONNECT_OPEN_TIMEOUT_MS, WS_OPEN_STATE, streamExecSession;
138194
+ var HEARTBEAT_INTERVAL_MS, INPUT_PROBE_TIMEOUT_MS, STREAM_STALL_PROBE_MISS_THRESHOLD, CONNECT_OPEN_TIMEOUT_MS, WS_OPEN_STATE, decodeBase642, parseExitCode, streamExecSession;
138195
138195
  var init_sessionProtocol = __esm({
138196
138196
  "src/devbox/terminal/sessionProtocol.ts"() {
138197
138197
  "use strict";
@@ -138202,6 +138202,24 @@ var init_sessionProtocol = __esm({
138202
138202
  STREAM_STALL_PROBE_MISS_THRESHOLD = 2;
138203
138203
  CONNECT_OPEN_TIMEOUT_MS = 2e4;
138204
138204
  WS_OPEN_STATE = 1;
138205
+ decodeBase642 = (value) => {
138206
+ if (typeof value !== "string") return Buffer.alloc(0);
138207
+ try {
138208
+ return Buffer.from(value, "base64");
138209
+ } catch {
138210
+ return Buffer.alloc(0);
138211
+ }
138212
+ };
138213
+ parseExitCode = (value) => {
138214
+ if (typeof value === "number" && Number.isFinite(value)) {
138215
+ return Math.max(0, Math.min(255, Math.floor(value)));
138216
+ }
138217
+ const parsed = Number.parseInt(String(value ?? "0"), 10);
138218
+ if (!Number.isFinite(parsed)) {
138219
+ return 0;
138220
+ }
138221
+ return Math.max(0, Math.min(255, parsed));
138222
+ };
138205
138223
  streamExecSession = async (ws, options) => new Promise((resolve2, reject) => {
138206
138224
  let exitCode = null;
138207
138225
  let resolved = false;
@@ -138320,6 +138338,36 @@ var init_sessionProtocol = __esm({
138320
138338
  }
138321
138339
  return;
138322
138340
  }
138341
+ if (payload.type === "tty_ready") {
138342
+ const rawId = payload.sessionId ?? payload.session_id ?? payload.id;
138343
+ if (rawId !== void 0) {
138344
+ options.onSessionInfo?.(String(rawId));
138345
+ }
138346
+ return;
138347
+ }
138348
+ if (payload.type === "tty_data") {
138349
+ const bytes = decodeBase642(payload.data);
138350
+ if (bytes.length === 0) {
138351
+ return;
138352
+ }
138353
+ options.onOutputChunk?.(bytes);
138354
+ options.onOutput?.();
138355
+ if (options.tty) {
138356
+ writeTtyOutput(bytes);
138357
+ return;
138358
+ }
138359
+ if (payload.stream === "stderr") {
138360
+ stderr.write(bytes);
138361
+ return;
138362
+ }
138363
+ stdout.write(bytes);
138364
+ return;
138365
+ }
138366
+ if (payload.type === "tty_exit") {
138367
+ exitCode = parseExitCode(payload.code ?? payload.exit_code);
138368
+ ws.close();
138369
+ return;
138370
+ }
138323
138371
  if (payload.type === "exit" && typeof payload.exit_code === "number") {
138324
138372
  exitCode = payload.exit_code;
138325
138373
  ws.close();
@@ -199664,7 +199712,7 @@ var init_modalLifecycle = __esm({
199664
199712
  });
199665
199713
 
199666
199714
  // src/devbox/commands/provider/modalRuntime.ts
199667
- var import_node_path15, import_node_net3, import_ws4, SERVICE_NAME_PATTERN, CORE_SERVICE_NAMES2, MODAL_DAEMON_REQUEST_TIMEOUT_MS, MODAL_DAEMON_TTY_HANDSHAKE_TIMEOUT_MS, MODAL_SANDBOX_RESOLVE_TIMEOUT_MS, MODAL_DAEMON_CONTROL_HTTP_TIMEOUT_MS, MODAL_DAEMON_TTY_WS_PATH, validateServiceName, isSandboxNotFoundError, resolveReadPath, decodeBase642, parseJsonRecord2, withTimeout3, parseControlError, mapControlSessionRecord, normalizeServiceScope, normalizeServiceRestartPolicy, normalizeServiceStatus2, ModalDaemonExecSocket, createModalRuntimeClient;
199715
+ var import_node_path15, import_node_net3, import_ws4, SERVICE_NAME_PATTERN, CORE_SERVICE_NAMES2, MODAL_DAEMON_REQUEST_TIMEOUT_MS, MODAL_DAEMON_TTY_HANDSHAKE_TIMEOUT_MS, MODAL_SANDBOX_RESOLVE_TIMEOUT_MS, MODAL_DAEMON_CONTROL_HTTP_TIMEOUT_MS, MODAL_DAEMON_TTY_WS_PATH, validateServiceName, isSandboxNotFoundError, resolveReadPath, parseJsonRecord2, withTimeout3, parseControlError, mapControlSessionRecord, normalizeServiceScope, normalizeServiceRestartPolicy, normalizeServiceStatus2, ModalDaemonExecSocket, createModalRuntimeClient;
199668
199716
  var init_modalRuntime = __esm({
199669
199717
  "src/devbox/commands/provider/modalRuntime.ts"() {
199670
199718
  "use strict";
@@ -199697,14 +199745,6 @@ var init_modalRuntime = __esm({
199697
199745
  }
199698
199746
  return import_node_path15.default.posix.normalize(readPath);
199699
199747
  };
199700
- decodeBase642 = (value) => {
199701
- if (typeof value !== "string") return Buffer.alloc(0);
199702
- try {
199703
- return Buffer.from(value, "base64");
199704
- } catch {
199705
- return Buffer.alloc(0);
199706
- }
199707
- };
199708
199748
  parseJsonRecord2 = (raw) => {
199709
199749
  let text = "";
199710
199750
  if (typeof raw === "string") {
@@ -199836,13 +199876,6 @@ var init_modalRuntime = __esm({
199836
199876
  }, MODAL_DAEMON_TTY_HANDSHAKE_TIMEOUT_MS);
199837
199877
  this.handshakeTimer.unref();
199838
199878
  }
199839
- emitMessagePayload(streamId, payload) {
199840
- if (this.closed) return;
199841
- const framed = new Uint8Array(payload.length + 1);
199842
- framed[0] = streamId;
199843
- framed.set(payload, 1);
199844
- this.emit("message", { data: framed });
199845
- }
199846
199879
  sendJson(payload) {
199847
199880
  if (!this.ws || this.ws.readyState !== import_ws4.default.OPEN) {
199848
199881
  throw new Error("Modal daemon socket is not open.");
@@ -199881,58 +199914,34 @@ var init_modalRuntime = __esm({
199881
199914
  handleDaemonMessage(message) {
199882
199915
  const type = typeof message.type === "string" ? message.type : "";
199883
199916
  if (type === "tty_ready") {
199884
- const sessionId = typeof message.sessionId === "string" ? message.sessionId : typeof message.session_id === "string" ? message.session_id : "";
199885
199917
  this.clearHandshakeTimer();
199886
199918
  this.readyState = 1;
199887
199919
  this.emit("open");
199888
199920
  queueMicrotask(() => {
199889
199921
  if (this.closed) return;
199890
- this.emit("message", {
199891
- data: JSON.stringify({ type: "session_info", session_id: sessionId })
199892
- });
199922
+ this.emit("message", { data: JSON.stringify(message) });
199893
199923
  });
199894
199924
  return;
199895
199925
  }
199896
199926
  if (type === "tty_replay_start") {
199897
199927
  this.replayInProgress = true;
199898
199928
  this.markReplayActivity();
199899
- this.emit("message", {
199900
- data: JSON.stringify({ type: "tty_replay_start" })
199901
- });
199929
+ this.emit("message", { data: JSON.stringify(message) });
199902
199930
  return;
199903
199931
  }
199904
199932
  if (type === "tty_replay_done") {
199905
199933
  this.replayInProgress = false;
199906
199934
  this.markReplayActivity();
199907
199935
  this.flushReplayBufferedOutbound();
199908
- this.emit("message", {
199909
- data: JSON.stringify({ type: "tty_replay_done" })
199910
- });
199936
+ this.emit("message", { data: JSON.stringify(message) });
199911
199937
  return;
199912
199938
  }
199913
199939
  if (type === "tty_data") {
199914
- const bytes = decodeBase642(message.data);
199915
- if (bytes.length === 0) {
199916
- return;
199917
- }
199918
- if (this.options.tty) {
199919
- this.emit("message", { data: bytes });
199920
- } else {
199921
- const stream = message.stream === "stderr" ? 2 : 1;
199922
- this.emitMessagePayload(stream, bytes);
199923
- }
199940
+ this.emit("message", { data: JSON.stringify(message) });
199924
199941
  return;
199925
199942
  }
199926
199943
  if (type === "tty_exit") {
199927
- const rawCode = typeof message.code === "number" ? message.code : Number.parseInt(String(message.code ?? "0"), 10);
199928
- const codeByte = Number.isFinite(rawCode) ? Math.max(0, Math.min(255, rawCode)) : 0;
199929
- if (this.options.tty) {
199930
- this.emit("message", {
199931
- data: JSON.stringify({ type: "exit", exit_code: codeByte })
199932
- });
199933
- } else {
199934
- this.emitMessagePayload(3, Uint8Array.of(codeByte));
199935
- }
199944
+ this.emit("message", { data: JSON.stringify(message) });
199936
199945
  this.close();
199937
199946
  return;
199938
199947
  }
@@ -201465,7 +201474,10 @@ var init_connect2 = __esm({
201465
201474
  return env2;
201466
201475
  };
201467
201476
  formatEnvExports = (env2) => Object.entries(env2).map(([key, value]) => `export ${key}=${shellQuote2(value)}`).join("; ");
201468
- buildModalInteractiveCommand = () => "exec bash -il || exec sh -i";
201477
+ buildModalInteractiveCommand = ({ tty: tty2 }) => {
201478
+ const nonCanonicalPrelude = tty2 ? "stty -icanon min 1 time 0 -echoctl; " : "";
201479
+ return `${nonCanonicalPrelude}exec bash -il || exec sh -i`;
201480
+ };
201469
201481
  parseEnvSize = (value) => {
201470
201482
  if (!value) return void 0;
201471
201483
  const parsed = Number(value);
@@ -202352,7 +202364,7 @@ var init_connect2 = __esm({
202352
202364
  return [connectShell, "-lc", `${envCommandPrefix}${parsed.command}`];
202353
202365
  }
202354
202366
  if (computeProvider === "modal") {
202355
- const interactiveCommand = buildModalInteractiveCommand();
202367
+ const interactiveCommand = buildModalInteractiveCommand({ tty: isTty });
202356
202368
  if (projectWorkdir) {
202357
202369
  return [
202358
202370
  "/bin/sh",
@@ -220035,4 +220047,4 @@ smol-toml/dist/index.js:
220035
220047
  */
220036
220048
  //# sourceMappingURL=dvb.cjs.map
220037
220049
 
220038
- //# debugId=e4952253-6b01-5464-8cec-44fa0b046c22
220050
+ //# debugId=c89c7337-d26d-5d0e-9378-e2535af1df44