sandbox 3.3.0 → 3.4.0

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.
@@ -7286,7 +7286,7 @@ const scope = {
7286
7286
 
7287
7287
  //#endregion
7288
7288
  //#region package.json
7289
- var version = "3.3.0";
7289
+ var version = "3.4.0";
7290
7290
 
7291
7291
  //#endregion
7292
7292
  //#region src/error.ts
@@ -7584,8 +7584,19 @@ const TERM = "xterm-256color";
7584
7584
  * A custom prompt so interactive sessions show the Vercel triangle and the
7585
7585
  * working directory (e.g. `▲ /vercel/sandbox/ `) instead of the shell's
7586
7586
  * default prompt. The server passes this through to the shell verbatim.
7587
+ *
7588
+ * This is built from primitives every POSIX shell honors so it renders the
7589
+ * same regardless of which shell a customer image ships as `/bin/sh`.
7590
+ *
7591
+ * The color escapes are wrapped in the raw readline "ignore" markers
7592
+ * `\x01` (RL_PROMPT_START_IGNORE) and `\x02` (RL_PROMPT_END_IGNORE) — the
7593
+ * same bytes that bash's `\[` / `\]` decode into. This lets bash's readline
7594
+ * exclude the (zero-width) escape sequences from its prompt-width calculation
7595
+ * so cursor positioning stays correct on long/wrapping lines and during line
7596
+ * editing. In non-bash shells these are C0 control bytes that terminals treat
7597
+ * as non-printing, so they don't affect rendering there.
7587
7598
  */
7588
- const PS1 = `▲ \\[\\e[2m\\]\\w/\\[\\e[0m\\] `;
7599
+ const PS1 = `▲ \x01\x1b[2m\x02$PWD/\x01\x1b[0m\x02 `;
7589
7600
  /**
7590
7601
  * Starts an interactive shell session with a sandbox. The API hands us a
7591
7602
  * WebSocket URL and token, and we tunnel stdin/stdout over it.
@@ -8368,7 +8379,11 @@ const list = import_cjs$12.command({
8368
8379
  MEMORY: { value: (s$1) => s$1.memory != null ? memoryFormatter.format(s$1.memory) : "-" },
8369
8380
  VCPUS: { value: (s$1) => s$1.vcpus ?? "-" },
8370
8381
  RUNTIME: { value: (s$1) => s$1.runtime ?? "-" },
8371
- TIMEOUT: { value: (s$1) => s$1.timeout != null ? timeAgo(s$1.createdAt + s$1.timeout) : "-" },
8382
+ TIMEOUT: { value: (s$1) => {
8383
+ if (s$1.expiresAt != null) return timeAgo(s$1.expiresAt);
8384
+ if (s$1.timeout != null) return timeAgo(s$1.createdAt + s$1.timeout);
8385
+ return "-";
8386
+ } },
8372
8387
  SNAPSHOT: { value: (s$1) => s$1.currentSnapshotId ?? "-" },
8373
8388
  TAGS: { value: (s$1) => s$1.tags && Object.keys(s$1.tags).length > 0 ? Object.entries(s$1.tags).map(([k, v]) => `${k}:${v}`).join(", ") : "-" }
8374
8389
  };
@@ -12056,4 +12071,4 @@ const app = (opts) => (0, import_cjs.subcommands)({
12056
12071
 
12057
12072
  //#endregion
12058
12073
  export { source_exports as a, init_source as i, printTopLevelError as n, require_cjs as r, app as t };
12059
- //# sourceMappingURL=app-BBJJ-3sX.mjs.map
12074
+ //# sourceMappingURL=app-CsBNEDNb.mjs.map