adhdev 0.8.56 → 0.8.57

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/index.js CHANGED
@@ -51677,7 +51677,7 @@ var init_adhdev_daemon = __esm({
51677
51677
  import_ws3 = require("ws");
51678
51678
  init_source2();
51679
51679
  init_version();
51680
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.56" });
51680
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.57" });
51681
51681
  ACTIVE_CHAT_POLL_STATUSES = /* @__PURE__ */ new Set([
51682
51682
  "generating",
51683
51683
  "waiting_approval",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adhdev",
3
- "version": "0.8.56",
3
+ "version": "0.8.57",
4
4
  "description": "ADHDev — Agent Dashboard Hub for Dev. Remote-control AI coding agents from anywhere.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
 
26
26
  // src/index.ts
27
27
  var import_child_process2 = require("child_process");
28
- var import_session_host_core = require("@adhdev/session-host-core");
28
+ var import_session_host_core2 = require("@adhdev/session-host-core");
29
29
 
30
30
  // src/clipboard.ts
31
31
  var import_child_process = require("child_process");
@@ -236,6 +236,37 @@ function searchPaneText(text, query) {
236
236
  var import_storage = require("@adhdev/terminal-mux-control/storage");
237
237
  var import_storage2 = require("@adhdev/terminal-mux-control/storage");
238
238
  var import_terminal_mux_core = require("@adhdev/terminal-mux-core");
239
+
240
+ // src/runtime-list.ts
241
+ var import_session_host_core = require("@adhdev/session-host-core");
242
+ function getRuntimeNextAction(record) {
243
+ const surfaceKind = (0, import_session_host_core.getSessionHostSurfaceKind)(record);
244
+ if (surfaceKind === "live_runtime") return "attach";
245
+ if (surfaceKind === "recovery_snapshot") return "recover";
246
+ return "restart";
247
+ }
248
+ function formatSurfaceKindLabel(record) {
249
+ const surfaceKind = (0, import_session_host_core.getSessionHostSurfaceKind)(record);
250
+ if (surfaceKind === "live_runtime") return "live runtime";
251
+ if (surfaceKind === "recovery_snapshot") return "recovery snapshot";
252
+ return "inactive record";
253
+ }
254
+ function formatMuxRuntimeListHeader() {
255
+ return "Raw session-host records visible to adhmux (may include recovery snapshots and stopped records). Use `adhdev runtime list` for the primary live/recovery view.";
256
+ }
257
+ function formatMuxRuntimeListLine(record) {
258
+ const recovery = (0, import_session_host_core.getSessionHostRecoveryLabel)(record.meta || void 0);
259
+ const extras = [
260
+ `surface=${formatSurfaceKindLabel(record)}`,
261
+ `next=${getRuntimeNextAction(record)}`,
262
+ recovery ? `recovery=${recovery}` : "",
263
+ `owner=${(0, import_session_host_core.formatRuntimeOwner)(record)}`,
264
+ `clients=${record.attachedClients.length}`
265
+ ].filter(Boolean).join(" ");
266
+ return `${record.runtimeKey} ${record.lifecycle} ${record.workspaceLabel} ${extras}`;
267
+ }
268
+
269
+ // src/index.ts
239
270
  var STARTUP_TIMEOUT_MS = 8e3;
240
271
  var STARTUP_POLL_MS = 200;
241
272
  var SESSION_HOST_APP_NAME = process.env.ADHDEV_SESSION_HOST_NAME || "adhdev";
@@ -249,7 +280,7 @@ function usage(exitCode = 1) {
249
280
  stream.write("Usage:\n");
250
281
  stream.write(" adhmux <command> [options] [runtimeKey...]\n\n");
251
282
  stream.write("Core commands:\n");
252
- stream.write(" list List hosted runtimes visible to session host\n");
283
+ stream.write(" list List raw session-host records visible to adhmux\n");
253
284
  stream.write(" open <runtimeKey> Open a mux workspace for a live runtime\n");
254
285
  stream.write(" snapshot <id> Print the latest terminal snapshot for a runtime\n");
255
286
  stream.write(" sessions List saved mux sessions\n");
@@ -324,7 +355,7 @@ async function waitForWorkspaceControlReady(workspaceName, timeoutMs = CONTROL_S
324
355
  }
325
356
  async function listRuntimes(flags = { json: false }) {
326
357
  await ensureSessionHostReady();
327
- const client = new import_session_host_core.SessionHostClient({ appName: SESSION_HOST_APP_NAME });
358
+ const client = new import_session_host_core2.SessionHostClient({ appName: SESSION_HOST_APP_NAME });
328
359
  const result = await client.request({ type: "list_sessions" });
329
360
  if (!result.success || !result.result) {
330
361
  throw new Error(result.error || "Failed to list runtimes");
@@ -335,11 +366,11 @@ async function listRuntimes(flags = { json: false }) {
335
366
  await client.close();
336
367
  return;
337
368
  }
369
+ process.stdout.write(`${formatMuxRuntimeListHeader()}
370
+ `);
338
371
  for (const record of result.result) {
339
- process.stdout.write(
340
- `${record.runtimeKey} ${record.lifecycle} ${record.workspaceLabel} ${record.writeOwner ? `${record.writeOwner.ownerType}:${record.writeOwner.clientId}` : "none"}
341
- `
342
- );
372
+ process.stdout.write(`${formatMuxRuntimeListLine(record)}
373
+ `);
343
374
  }
344
375
  await client.close();
345
376
  }
@@ -593,10 +624,10 @@ async function killWindow(sessionName, windowName) {
593
624
  }
594
625
  async function snapshotRuntime(target) {
595
626
  await ensureSessionHostReady();
596
- const client = new import_session_host_core.SessionHostClient({ appName: SESSION_HOST_APP_NAME });
627
+ const client = new import_session_host_core2.SessionHostClient({ appName: SESSION_HOST_APP_NAME });
597
628
  const list = await client.request({ type: "list_sessions" });
598
629
  if (!list.success || !list.result) throw new Error(list.error || "Failed to list runtimes");
599
- const record = (0, import_session_host_core.resolveRuntimeRecord)(list.result, target);
630
+ const record = (0, import_session_host_core2.resolveRuntimeRecord)(list.result, target);
600
631
  const snapshot = await client.request({
601
632
  type: "get_snapshot",
602
633
  payload: { sessionId: record.sessionId }
@@ -716,7 +747,7 @@ async function withWorkspace(workspaceName, fn) {
716
747
  }
717
748
  }
718
749
  async function canConnect() {
719
- const client = new import_session_host_core.SessionHostClient({ endpoint: (0, import_session_host_core.getDefaultSessionHostEndpoint)(SESSION_HOST_APP_NAME) });
750
+ const client = new import_session_host_core2.SessionHostClient({ endpoint: (0, import_session_host_core2.getDefaultSessionHostEndpoint)(SESSION_HOST_APP_NAME) });
720
751
  try {
721
752
  await client.connect();
722
753
  await client.close();
@@ -228,6 +228,41 @@ import { buildWorkspaceName, sanitizeWorkspaceName, toWorkspaceRef } from "@adhd
228
228
  import {
229
229
  SessionHostMuxClient
230
230
  } from "@adhdev/terminal-mux-core";
231
+
232
+ // src/runtime-list.ts
233
+ import {
234
+ formatRuntimeOwner,
235
+ getSessionHostRecoveryLabel,
236
+ getSessionHostSurfaceKind
237
+ } from "@adhdev/session-host-core";
238
+ function getRuntimeNextAction(record) {
239
+ const surfaceKind = getSessionHostSurfaceKind(record);
240
+ if (surfaceKind === "live_runtime") return "attach";
241
+ if (surfaceKind === "recovery_snapshot") return "recover";
242
+ return "restart";
243
+ }
244
+ function formatSurfaceKindLabel(record) {
245
+ const surfaceKind = getSessionHostSurfaceKind(record);
246
+ if (surfaceKind === "live_runtime") return "live runtime";
247
+ if (surfaceKind === "recovery_snapshot") return "recovery snapshot";
248
+ return "inactive record";
249
+ }
250
+ function formatMuxRuntimeListHeader() {
251
+ return "Raw session-host records visible to adhmux (may include recovery snapshots and stopped records). Use `adhdev runtime list` for the primary live/recovery view.";
252
+ }
253
+ function formatMuxRuntimeListLine(record) {
254
+ const recovery = getSessionHostRecoveryLabel(record.meta || void 0);
255
+ const extras = [
256
+ `surface=${formatSurfaceKindLabel(record)}`,
257
+ `next=${getRuntimeNextAction(record)}`,
258
+ recovery ? `recovery=${recovery}` : "",
259
+ `owner=${formatRuntimeOwner(record)}`,
260
+ `clients=${record.attachedClients.length}`
261
+ ].filter(Boolean).join(" ");
262
+ return `${record.runtimeKey} ${record.lifecycle} ${record.workspaceLabel} ${extras}`;
263
+ }
264
+
265
+ // src/index.ts
231
266
  var STARTUP_TIMEOUT_MS = 8e3;
232
267
  var STARTUP_POLL_MS = 200;
233
268
  var SESSION_HOST_APP_NAME = process.env.ADHDEV_SESSION_HOST_NAME || "adhdev";
@@ -241,7 +276,7 @@ function usage(exitCode = 1) {
241
276
  stream.write("Usage:\n");
242
277
  stream.write(" adhmux <command> [options] [runtimeKey...]\n\n");
243
278
  stream.write("Core commands:\n");
244
- stream.write(" list List hosted runtimes visible to session host\n");
279
+ stream.write(" list List raw session-host records visible to adhmux\n");
245
280
  stream.write(" open <runtimeKey> Open a mux workspace for a live runtime\n");
246
281
  stream.write(" snapshot <id> Print the latest terminal snapshot for a runtime\n");
247
282
  stream.write(" sessions List saved mux sessions\n");
@@ -327,11 +362,11 @@ async function listRuntimes(flags = { json: false }) {
327
362
  await client.close();
328
363
  return;
329
364
  }
365
+ process.stdout.write(`${formatMuxRuntimeListHeader()}
366
+ `);
330
367
  for (const record of result.result) {
331
- process.stdout.write(
332
- `${record.runtimeKey} ${record.lifecycle} ${record.workspaceLabel} ${record.writeOwner ? `${record.writeOwner.ownerType}:${record.writeOwner.clientId}` : "none"}
333
- `
334
- );
368
+ process.stdout.write(`${formatMuxRuntimeListLine(record)}
369
+ `);
335
370
  }
336
371
  await client.close();
337
372
  }