my-durable 0.0.77 → 0.0.79

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.
@@ -239,7 +239,7 @@ export function renderNetwork(
239
239
  const seen = d.lastSeenAt ? ageOf(d.lastSeenAt) : "never";
240
240
  label =
241
241
  `${dot} ${c.bold(row.label)}${row.current ? c.accent(" ▌") : ""} ${c.muted(`[${d.kind}]`)} ` +
242
- `${c.muted(d.transport === "tunnel" ? "tunnel" : "lan")} ${c.muted(d.lastStatus === "online" ? seen : `${sanitizeTerminal(d.lastStatus)} · ${seen}`)}`;
242
+ `${c.muted(d.transport === "tunnel" ? "tunnel" : "lan")} ${c.muted(d.lastStatus === "online" ? seen : `${oneLine(d.lastStatus)} · ${seen}`)}`;
243
243
  } else {
244
244
  const selected = row.sessionId === opts.currentSessionId;
245
245
  const marker = selected ? c.accent("▌") : " ";
@@ -21,7 +21,7 @@ import type { App, DeviceRef } from "./app.ts";
21
21
  import { Picker } from "./pickers.ts";
22
22
  import { parsePairArgs, runPairing, type PairArgs } from "./pairing.ts";
23
23
  import { c } from "./theme.ts";
24
- import { sanitizeTerminal } from "./sanitize.ts";
24
+ import { oneLine, sanitizeTerminal } from "./sanitize.ts";
25
25
 
26
26
  const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
27
27
 
@@ -277,8 +277,11 @@ export class WelcomePicker extends Picker {
277
277
  /** Open the welcome screen overlay. `notice` names an unreachable auto-connect. */
278
278
  export function showWelcome(app: App, opts: { notice?: string } = {}) {
279
279
  const devices = app.registry?.list() ?? [];
280
+ // run-8 U6: oneLine, not just sanitizeTerminal — a hostile device JSON
281
+ // error.message carries LFs, and truncateToWidth passes an embedded LF
282
+ // through inside ONE logical row (probe: forged row + cursor drift).
280
283
  const subtitle = opts.notice
281
- ? c.err(sanitizeTerminal(opts.notice))
284
+ ? c.err(oneLine(opts.notice))
282
285
  : c.muted("This is the app — connect a device to get started:");
283
286
  let picked = false; // an action was chosen: closing the overlay is a step, not a quit
284
287
  app.overlay(
@@ -426,7 +429,7 @@ async function welcomeLocal(app: App) {
426
429
  const id = suggestDeviceId(probe.info.hostname, probe.info.name);
427
430
  stepPicker(
428
431
  app,
429
- `Local backend: ${sanitizeTerminal(probe.info.name || probe.info.hostname || url)}`,
432
+ `Local backend: ${oneLine(probe.info.name || probe.info.hostname || url)}`,
430
433
  [{ value: "open", label: `Save as "${id}" and open`, description: `${url} │ token from DPI_TOKEN / backend.env` }],
431
434
  // local.token was read BEFORE a first boot may have written backend.env —
432
435
  // re-resolve, the file exists now.
@@ -454,7 +457,9 @@ function welcomeSwitch(app: App) {
454
457
  async function saveAndOpen(app: App, id: string, url: string, token: string, name?: string) {
455
458
  if (!app.registry) return app.flash("No registry — start with --url/--token.", true);
456
459
  try {
457
- app.registry.upsert({ id, name: name || id, url, kind: "url", source: "ui", token });
460
+ // run-8 U6: the device-supplied name is persisted for EVERY later render —
461
+ // collapse and bound it at the write boundary, not per render site.
462
+ app.registry.upsert({ id, name: oneLine(name || id).slice(0, 128) || id, url, kind: "url", source: "ui", token });
458
463
  } catch (e) {
459
464
  app.flash((e as Error).message, true);
460
465
  return showWelcome(app);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-durable",
3
- "version": "0.0.77",
3
+ "version": "0.0.79",
4
4
  "description": "Durable Pi — the durable agent network: hub web UI, device backend daemon, TUI admin and the shared SDK, packaged as one runnable monorepo install",
5
5
  "license": "MIT",
6
6
  "repository": {