aoaoe 0.88.0 → 0.89.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.
package/dist/index.js CHANGED
@@ -480,6 +480,12 @@ async function main() {
480
480
  }
481
481
  }
482
482
  });
483
+ // wire /auto-pin toggle
484
+ input.onAutoPin(() => {
485
+ const enabled = !tui.isAutoPinEnabled();
486
+ tui.setAutoPin(enabled);
487
+ tui.log("system", `auto-pin on error: ${enabled ? "on" : "off"}`);
488
+ });
483
489
  // wire /note set/clear
484
490
  input.onNote((target, text) => {
485
491
  const num = /^\d+$/.test(target) ? parseInt(target, 10) : undefined;
package/dist/input.d.ts CHANGED
@@ -15,6 +15,7 @@ export type MuteHandler = (target: string) => void;
15
15
  export type UnmuteAllHandler = () => void;
16
16
  export type TagFilterHandler = (tag: string | null) => void;
17
17
  export type UptimeHandler = () => void;
18
+ export type AutoPinHandler = () => void;
18
19
  export type NoteHandler = (target: string, text: string) => void;
19
20
  export type NotesHandler = () => void;
20
21
  export interface MouseEvent {
@@ -54,6 +55,7 @@ export declare class InputReader {
54
55
  private unmuteAllHandler;
55
56
  private tagFilterHandler;
56
57
  private uptimeHandler;
58
+ private autoPinHandler;
57
59
  private noteHandler;
58
60
  private notesHandler;
59
61
  private mouseDataListener;
@@ -77,6 +79,7 @@ export declare class InputReader {
77
79
  onUnmuteAll(handler: UnmuteAllHandler): void;
78
80
  onTagFilter(handler: TagFilterHandler): void;
79
81
  onUptime(handler: UptimeHandler): void;
82
+ onAutoPin(handler: AutoPinHandler): void;
80
83
  onNote(handler: NoteHandler): void;
81
84
  onNotes(handler: NotesHandler): void;
82
85
  private notifyQueueChange;
package/dist/input.js CHANGED
@@ -47,6 +47,7 @@ export class InputReader {
47
47
  unmuteAllHandler = null;
48
48
  tagFilterHandler = null;
49
49
  uptimeHandler = null;
50
+ autoPinHandler = null;
50
51
  noteHandler = null;
51
52
  notesHandler = null;
52
53
  mouseDataListener = null;
@@ -130,6 +131,10 @@ export class InputReader {
130
131
  onUptime(handler) {
131
132
  this.uptimeHandler = handler;
132
133
  }
134
+ // register a callback for auto-pin toggle (/auto-pin)
135
+ onAutoPin(handler) {
136
+ this.autoPinHandler = handler;
137
+ }
133
138
  // register a callback for note commands (/note <target> <text>)
134
139
  onNote(handler) {
135
140
  this.noteHandler = handler;
@@ -324,6 +329,7 @@ ${BOLD}navigation:${RESET}
324
329
  /unmute-all unmute all sessions at once
325
330
  /filter [tag] filter activity by tag (error, system, etc. — no arg = clear)
326
331
  /uptime show session uptimes (time since first observed)
332
+ /auto-pin toggle auto-pin on error (pin sessions that emit errors)
327
333
  /note N|name text attach a note to a session (no text = clear)
328
334
  /notes list all session notes
329
335
  /mark bookmark current activity position
@@ -498,6 +504,14 @@ ${BOLD}other:${RESET}
498
504
  console.error(`${DIM}uptime not available (no TUI)${RESET}`);
499
505
  }
500
506
  break;
507
+ case "/auto-pin":
508
+ if (this.autoPinHandler) {
509
+ this.autoPinHandler();
510
+ }
511
+ else {
512
+ console.error(`${DIM}auto-pin not available (no TUI)${RESET}`);
513
+ }
514
+ break;
501
515
  case "/note": {
502
516
  const noteArg = line.slice("/note".length).trim();
503
517
  if (this.noteHandler) {
package/dist/tui.d.ts CHANGED
@@ -57,6 +57,8 @@ export declare function formatMuteBadge(count: number): string;
57
57
  export declare function matchesTagFilter(entry: ActivityEntry, tag: string): boolean;
58
58
  /** Format the tag filter indicator text for the separator bar. */
59
59
  export declare function formatTagFilterIndicator(tag: string, matchCount: number, totalCount: number): string;
60
+ /** Determine if a log entry should trigger auto-pin (error-like tags). */
61
+ export declare function shouldAutoPin(tag: string): boolean;
60
62
  /** Format milliseconds as human-readable uptime: "2h 15m", "45m", "3d 2h", "< 1m". */
61
63
  export declare function formatUptime(ms: number): string;
62
64
  export declare class TUI {
@@ -93,6 +95,7 @@ export declare class TUI {
93
95
  private mutedEntryCounts;
94
96
  private sessionNotes;
95
97
  private sessionFirstSeen;
98
+ private autoPinOnError;
96
99
  private viewMode;
97
100
  private drilldownSessionId;
98
101
  private sessionOutputs;
@@ -137,6 +140,10 @@ export declare class TUI {
137
140
  setBell(enabled: boolean): void;
138
141
  /** Return whether terminal bell is enabled. */
139
142
  isBellEnabled(): boolean;
143
+ /** Enable or disable auto-pin on error. */
144
+ setAutoPin(enabled: boolean): void;
145
+ /** Return whether auto-pin on error is enabled. */
146
+ isAutoPinEnabled(): boolean;
140
147
  /**
141
148
  * Toggle mute for a session (by 1-indexed number, ID, ID prefix, or title).
142
149
  * Muted sessions' activity entries are hidden from the log (still buffered + persisted).
package/dist/tui.js CHANGED
@@ -191,6 +191,12 @@ export function matchesTagFilter(entry, tag) {
191
191
  export function formatTagFilterIndicator(tag, matchCount, totalCount) {
192
192
  return `${SLATE}filter:${RESET} ${AMBER}${tag}${RESET} ${DIM}(${matchCount}/${totalCount})${RESET}`;
193
193
  }
194
+ // ── Auto-pin ─────────────────────────────────────────────────────────────────
195
+ /** Determine if a log entry should trigger auto-pin (error-like tags). */
196
+ export function shouldAutoPin(tag) {
197
+ const lower = tag.toLowerCase();
198
+ return lower === "! action" || lower === "error";
199
+ }
194
200
  // ── Uptime ───────────────────────────────────────────────────────────────────
195
201
  /** Format milliseconds as human-readable uptime: "2h 15m", "45m", "3d 2h", "< 1m". */
196
202
  export function formatUptime(ms) {
@@ -243,6 +249,7 @@ export class TUI {
243
249
  mutedEntryCounts = new Map(); // session ID → suppressed entry count since mute
244
250
  sessionNotes = new Map(); // session ID → note text
245
251
  sessionFirstSeen = new Map(); // session ID → epoch ms when first observed
252
+ autoPinOnError = false; // auto-pin sessions that emit errors
246
253
  // drill-down mode: show a single session's full output
247
254
  viewMode = "overview";
248
255
  drilldownSessionId = null;
@@ -398,6 +405,14 @@ export class TUI {
398
405
  isBellEnabled() {
399
406
  return this.bellEnabled;
400
407
  }
408
+ /** Enable or disable auto-pin on error. */
409
+ setAutoPin(enabled) {
410
+ this.autoPinOnError = enabled;
411
+ }
412
+ /** Return whether auto-pin on error is enabled. */
413
+ isAutoPinEnabled() {
414
+ return this.autoPinOnError;
415
+ }
401
416
  /**
402
417
  * Toggle mute for a session (by 1-indexed number, ID, ID prefix, or title).
403
418
  * Muted sessions' activity entries are hidden from the log (still buffered + persisted).
@@ -626,6 +641,12 @@ export class TUI {
626
641
  process.stderr.write("\x07");
627
642
  }
628
643
  }
644
+ // auto-pin sessions that emit errors (when enabled)
645
+ if (this.autoPinOnError && sessionId && shouldAutoPin(tag) && !this.pinnedIds.has(sessionId)) {
646
+ this.pinnedIds.add(sessionId);
647
+ if (this.active)
648
+ this.paintSessions();
649
+ }
629
650
  // track suppressed entry counts regardless of active state (for badge accuracy)
630
651
  if (shouldMuteEntry(entry, this.mutedIds) && entry.sessionId) {
631
652
  this.mutedEntryCounts.set(entry.sessionId, (this.mutedEntryCounts.get(entry.sessionId) ?? 0) + 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aoaoe",
3
- "version": "0.88.0",
3
+ "version": "0.89.0",
4
4
  "description": "Autonomous supervisor for agent-of-empires sessions using OpenCode or Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",