@femtomc/mu-agent 26.2.92 → 26.2.94

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.
@@ -1 +1 @@
1
- {"version":3,"file":"subagents-ui.d.ts","sourceRoot":"","sources":["../../src/extensions/subagents-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AA63BpF,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,QAkoBpD;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"subagents-ui.d.ts","sourceRoot":"","sources":["../../src/extensions/subagents-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAi6BpF,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,QAkoBpD;AAED,eAAe,oBAAoB,CAAC"}
@@ -404,6 +404,10 @@ function renderActivitySentence(event) {
404
404
  }
405
405
  return null;
406
406
  }
407
+ function isActivityEndpointUnavailable(errorMessage) {
408
+ const normalized = errorMessage.toLowerCase();
409
+ return normalized.includes("mu server 404") && normalized.includes("not found");
410
+ }
407
411
  async function fetchRecentActivity(opts) {
408
412
  if (!muServerUrl()) {
409
413
  return { lines: [], error: null };
@@ -416,6 +420,9 @@ async function fetchRecentActivity(opts) {
416
420
  }
417
421
  catch (err) {
418
422
  const message = err instanceof Error ? err.message : String(err);
423
+ if (isActivityEndpointUnavailable(message)) {
424
+ return { lines: [], error: null };
425
+ }
419
426
  return { lines: [], error: `activity refresh failed: ${truncateOneLine(message, 60)}` };
420
427
  }
421
428
  if (!Array.isArray(events) || events.length === 0) {
@@ -502,7 +509,9 @@ function subagentsSnapshot(state, format) {
502
509
  const drift = computeQueueDrift(state.sessions, state.activeIssues);
503
510
  const refreshStale = isRefreshStale(state.lastUpdatedMs, state.staleAfterMs);
504
511
  const staleCount = drift.activeWithoutSessionIds.length + drift.orphanSessions.length;
505
- const health = state.issueError || state.sessionError || refreshStale || staleCount > 0 ? "degraded" : "healthy";
512
+ const health = state.issueError || state.sessionError || state.activityError || refreshStale || staleCount > 0
513
+ ? "degraded"
514
+ : "healthy";
506
515
  const refreshAge = formatRefreshAge(state.lastUpdatedMs);
507
516
  const paused = state.spawnPaused ? "yes" : "no";
508
517
  const refreshSeconds = Math.round(state.refreshIntervalMs / 1_000);
@@ -553,13 +562,14 @@ function renderSubagentsUi(ctx, state) {
553
562
  return;
554
563
  }
555
564
  const issueScope = state.issueRootId ? `root:${state.issueRootId}` : "all-roots";
556
- const tagScope = state.issueTagFilter ? state.issueTagFilter : "(all tags)";
557
- const scopeCompact = truncateOneLine(`${issueScope} · ${tagScope}`, WIDGET_SCOPE_MAX);
565
+ const tagScope = state.issueTagFilter ? `tag:${state.issueTagFilter}` : null;
566
+ const scopeLabel = [issueScope, tagScope].filter((value) => value != null).join(" · ");
567
+ const scopeCompact = truncateOneLine(scopeLabel, WIDGET_SCOPE_MAX);
558
568
  const prefixCompact = truncateOneLine(state.prefix || "(all sessions)", WIDGET_PREFIX_MAX);
559
569
  const refreshStale = isRefreshStale(state.lastUpdatedMs, state.staleAfterMs);
560
570
  const drift = computeQueueDrift(state.sessions, state.activeIssues);
561
571
  const staleCount = drift.activeWithoutSessionIds.length + drift.orphanSessions.length;
562
- const hasError = Boolean(state.sessionError || state.issueError || refreshStale || staleCount > 0);
572
+ const hasError = Boolean(state.sessionError || state.issueError || state.activityError || refreshStale || staleCount > 0);
563
573
  const healthColor = hasError ? "warning" : "success";
564
574
  const healthLabel = hasError ? "degraded" : "healthy";
565
575
  const queueTotal = state.readyIssues.length + state.activeIssues.length;
@@ -570,50 +580,72 @@ function renderSubagentsUi(ctx, state) {
570
580
  const refreshSeconds = Math.round(state.refreshIntervalMs / 1_000);
571
581
  const staleAfterSeconds = Math.round(state.staleAfterMs / 1_000);
572
582
  const activityLines = state.activityLines.slice(0, ACTIVITY_LINE_LIMIT);
573
- ctx.ui.setStatus("mu-subagents", [
583
+ const statusParts = [
574
584
  ctx.ui.theme.fg("dim", "subagents"),
575
585
  ctx.ui.theme.fg(healthColor, healthLabel),
576
586
  ctx.ui.theme.fg("dim", `mode:${state.spawnMode}`),
577
- ctx.ui.theme.fg(pausedColor, `paused:${pausedLabel}`),
578
587
  ctx.ui.theme.fg("dim", `q:${state.readyIssues.length}/${state.activeIssues.length}`),
579
588
  ctx.ui.theme.fg("dim", `tmux:${state.sessions.length}`),
580
- ctx.ui.theme.fg(staleCount > 0 ? "warning" : "dim", `drift:${staleCount}`),
581
- ctx.ui.theme.fg("muted", truncateOneLine(issueScope, 18)),
582
- ].join(` ${ctx.ui.theme.fg("muted", "·")} `));
583
- ctx.ui.setStatus("mu-subagents-meta", `health:${healthLabel} q:${state.readyIssues.length}/${state.activeIssues.length} tmux:${state.sessions.length} drift:${staleCount} refresh:${refreshAge}`);
589
+ ];
590
+ if (state.spawnPaused) {
591
+ statusParts.push(ctx.ui.theme.fg(pausedColor, `paused:${pausedLabel}`));
592
+ }
593
+ if (staleCount > 0) {
594
+ statusParts.push(ctx.ui.theme.fg("warning", `drift:${staleCount}`));
595
+ }
596
+ if (state.issueRootId) {
597
+ statusParts.push(ctx.ui.theme.fg("muted", truncateOneLine(issueScope, 18)));
598
+ }
599
+ ctx.ui.setStatus("mu-subagents", statusParts.join(` ${ctx.ui.theme.fg("muted", "·")} `));
600
+ const footerMetaParts = [`q:${state.readyIssues.length}/${state.activeIssues.length}`, `tmux:${state.sessions.length}`];
601
+ if (staleCount > 0) {
602
+ footerMetaParts.push(`drift:${staleCount}`);
603
+ }
604
+ if (refreshStale) {
605
+ footerMetaParts.push("refresh:stale");
606
+ }
607
+ if (state.issueError || state.sessionError || state.activityError) {
608
+ footerMetaParts.push("err");
609
+ }
610
+ ctx.ui.setStatus("mu-subagents-meta", footerMetaParts.join(" "));
611
+ const titleParts = [
612
+ ctx.ui.theme.fg("accent", ctx.ui.theme.bold("Subagents")),
613
+ ctx.ui.theme.fg("muted", "·"),
614
+ ctx.ui.theme.fg(healthColor, healthLabel),
615
+ ctx.ui.theme.fg("muted", "·"),
616
+ ctx.ui.theme.fg("accent", `mode:${state.spawnMode}`),
617
+ ];
618
+ if (state.spawnPaused) {
619
+ titleParts.push(ctx.ui.theme.fg("muted", "·"), ctx.ui.theme.fg(pausedColor, `paused:${pausedLabel}`));
620
+ }
621
+ const queueParts = [
622
+ ctx.ui.theme.fg("muted", "queues:"),
623
+ ctx.ui.theme.fg("accent", `${state.readyIssues.length}r`),
624
+ ctx.ui.theme.fg("muted", "/"),
625
+ ctx.ui.theme.fg("warning", `${state.activeIssues.length}a`),
626
+ ctx.ui.theme.fg("dim", queueBar),
627
+ ctx.ui.theme.fg("muted", "·"),
628
+ ctx.ui.theme.fg("muted", "tmux:"),
629
+ ctx.ui.theme.fg("dim", `${state.sessions.length}`),
630
+ ];
631
+ if (staleCount > 0) {
632
+ queueParts.push(ctx.ui.theme.fg("muted", "·"), ctx.ui.theme.fg("warning", `drift:${staleCount}`));
633
+ }
634
+ const refreshParts = [
635
+ ctx.ui.theme.fg("muted", "refresh:"),
636
+ ctx.ui.theme.fg(refreshStale ? "warning" : "dim", refreshAge),
637
+ ctx.ui.theme.fg("muted", "·"),
638
+ ctx.ui.theme.fg("muted", "every:"),
639
+ ctx.ui.theme.fg("dim", `${refreshSeconds}s`),
640
+ ];
641
+ if (refreshStale) {
642
+ refreshParts.push(ctx.ui.theme.fg("muted", "·"), ctx.ui.theme.fg("muted", "stale:"), ctx.ui.theme.fg("dim", `${staleAfterSeconds}s`));
643
+ }
584
644
  const lines = [
585
- [
586
- ctx.ui.theme.fg("accent", ctx.ui.theme.bold("Subagents")),
587
- ctx.ui.theme.fg("muted", "·"),
588
- ctx.ui.theme.fg(healthColor, healthLabel),
589
- ctx.ui.theme.fg("muted", "·"),
590
- ctx.ui.theme.fg("accent", `mode:${state.spawnMode}`),
591
- ctx.ui.theme.fg("muted", "·"),
592
- ctx.ui.theme.fg(pausedColor, `paused:${pausedLabel}`),
593
- ].join(" "),
645
+ titleParts.join(" "),
594
646
  `${ctx.ui.theme.fg("muted", "scope:")} ${ctx.ui.theme.fg("dim", scopeCompact)} ${ctx.ui.theme.fg("muted", "· prefix:")} ${ctx.ui.theme.fg("dim", prefixCompact)}`,
595
- [
596
- ctx.ui.theme.fg("muted", "queues:"),
597
- ctx.ui.theme.fg("accent", `${state.readyIssues.length}r`),
598
- ctx.ui.theme.fg("muted", "/"),
599
- ctx.ui.theme.fg("warning", `${state.activeIssues.length}a`),
600
- ctx.ui.theme.fg("dim", queueBar),
601
- ctx.ui.theme.fg("muted", "·"),
602
- ctx.ui.theme.fg("muted", "tmux:"),
603
- ctx.ui.theme.fg("dim", `${state.sessions.length}`),
604
- ctx.ui.theme.fg("muted", "·"),
605
- ctx.ui.theme.fg(staleCount > 0 ? "warning" : "dim", `drift:${staleCount}`),
606
- ].join(" "),
607
- [
608
- ctx.ui.theme.fg("muted", "refresh:"),
609
- ctx.ui.theme.fg(refreshStale ? "warning" : "dim", refreshAge),
610
- ctx.ui.theme.fg("muted", "·"),
611
- ctx.ui.theme.fg("muted", "every:"),
612
- ctx.ui.theme.fg("dim", `${refreshSeconds}s`),
613
- ctx.ui.theme.fg("muted", "·"),
614
- ctx.ui.theme.fg("muted", "stale:"),
615
- ctx.ui.theme.fg("dim", `${staleAfterSeconds}s`),
616
- ].join(" "),
647
+ queueParts.join(" "),
648
+ refreshParts.join(" "),
617
649
  ];
618
650
  if (state.issueError) {
619
651
  lines.push(ctx.ui.theme.fg("warning", `issue_error: ${truncateOneLine(state.issueError, WIDGET_ERROR_MAX)}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.92",
3
+ "version": "26.2.94",
4
4
  "description": "Shared operator runtime for mu assistant sessions and serve extensions.",
5
5
  "keywords": [
6
6
  "mu",
@@ -24,7 +24,7 @@
24
24
  "themes/**"
25
25
  ],
26
26
  "dependencies": {
27
- "@femtomc/mu-core": "26.2.92",
27
+ "@femtomc/mu-core": "26.2.94",
28
28
  "@mariozechner/pi-agent-core": "^0.53.0",
29
29
  "@mariozechner/pi-ai": "^0.53.0",
30
30
  "@mariozechner/pi-coding-agent": "^0.53.0",