aoaoe 0.80.0 → 0.81.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 +6 -0
- package/dist/input.d.ts +3 -0
- package/dist/input.js +14 -0
- package/dist/tui.d.ts +10 -0
- package/dist/tui.js +29 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -378,6 +378,12 @@ async function main() {
|
|
|
378
378
|
tui.setCompact(enabled);
|
|
379
379
|
tui.log("system", `compact mode: ${enabled ? "on" : "off"}`);
|
|
380
380
|
});
|
|
381
|
+
// wire /bell toggle
|
|
382
|
+
input.onBell(() => {
|
|
383
|
+
const enabled = !tui.isBellEnabled();
|
|
384
|
+
tui.setBell(enabled);
|
|
385
|
+
tui.log("system", `bell notifications: ${enabled ? "on" : "off"}`);
|
|
386
|
+
});
|
|
381
387
|
// wire /pin toggle
|
|
382
388
|
input.onPin((target) => {
|
|
383
389
|
const num = /^\d+$/.test(target) ? parseInt(target, 10) : undefined;
|
package/dist/input.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type QuickSwitchHandler = (sessionNum: number) => void;
|
|
|
6
6
|
export type SortHandler = (mode: string | null) => void;
|
|
7
7
|
export type CompactHandler = () => void;
|
|
8
8
|
export type PinHandler = (target: string) => void;
|
|
9
|
+
export type BellHandler = () => void;
|
|
9
10
|
export interface MouseEvent {
|
|
10
11
|
button: number;
|
|
11
12
|
col: number;
|
|
@@ -34,6 +35,7 @@ export declare class InputReader {
|
|
|
34
35
|
private sortHandler;
|
|
35
36
|
private compactHandler;
|
|
36
37
|
private pinHandler;
|
|
38
|
+
private bellHandler;
|
|
37
39
|
private mouseDataListener;
|
|
38
40
|
onScroll(handler: (dir: ScrollDirection) => void): void;
|
|
39
41
|
onQueueChange(handler: (count: number) => void): void;
|
|
@@ -46,6 +48,7 @@ export declare class InputReader {
|
|
|
46
48
|
onSort(handler: SortHandler): void;
|
|
47
49
|
onCompact(handler: CompactHandler): void;
|
|
48
50
|
onPin(handler: PinHandler): void;
|
|
51
|
+
onBell(handler: BellHandler): void;
|
|
49
52
|
private notifyQueueChange;
|
|
50
53
|
start(): void;
|
|
51
54
|
drain(): string[];
|
package/dist/input.js
CHANGED
|
@@ -38,6 +38,7 @@ export class InputReader {
|
|
|
38
38
|
sortHandler = null;
|
|
39
39
|
compactHandler = null;
|
|
40
40
|
pinHandler = null;
|
|
41
|
+
bellHandler = null;
|
|
41
42
|
mouseDataListener = null;
|
|
42
43
|
// register a callback for scroll key events (PgUp/PgDn/Home/End)
|
|
43
44
|
onScroll(handler) {
|
|
@@ -83,6 +84,10 @@ export class InputReader {
|
|
|
83
84
|
onPin(handler) {
|
|
84
85
|
this.pinHandler = handler;
|
|
85
86
|
}
|
|
87
|
+
// register a callback for bell toggle (/bell)
|
|
88
|
+
onBell(handler) {
|
|
89
|
+
this.bellHandler = handler;
|
|
90
|
+
}
|
|
86
91
|
notifyQueueChange() {
|
|
87
92
|
this.queueChangeHandler?.(this.queue.length);
|
|
88
93
|
}
|
|
@@ -263,6 +268,7 @@ ${BOLD}navigation:${RESET}
|
|
|
263
268
|
/sort [mode] sort sessions: status, name, activity, default (or cycle)
|
|
264
269
|
/compact toggle compact mode (dense session panel)
|
|
265
270
|
/pin [N|name] pin/unpin a session to the top (toggle)
|
|
271
|
+
/bell toggle terminal bell on errors/completions
|
|
266
272
|
/search <pattern> filter activity entries by substring (case-insensitive)
|
|
267
273
|
/search clear active search filter
|
|
268
274
|
click session click an agent card to drill down (click again to go back)
|
|
@@ -375,6 +381,14 @@ ${BOLD}other:${RESET}
|
|
|
375
381
|
}
|
|
376
382
|
break;
|
|
377
383
|
}
|
|
384
|
+
case "/bell":
|
|
385
|
+
if (this.bellHandler) {
|
|
386
|
+
this.bellHandler();
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
console.error(`${DIM}bell not available (no TUI)${RESET}`);
|
|
390
|
+
}
|
|
391
|
+
break;
|
|
378
392
|
case "/search": {
|
|
379
393
|
const searchArg = line.slice("/search".length).trim();
|
|
380
394
|
if (this.searchHandler) {
|
package/dist/tui.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ declare const SORT_MODES: SortMode[];
|
|
|
6
6
|
declare function sortSessions(sessions: DaemonSessionState[], mode: SortMode, lastChangeAt?: Map<string, number>, pinnedIds?: Set<string>): DaemonSessionState[];
|
|
7
7
|
/** Cycle to the next sort mode. */
|
|
8
8
|
declare function nextSortMode(current: SortMode): SortMode;
|
|
9
|
+
/** Cooldown between terminal bells to avoid buzzing. */
|
|
10
|
+
export declare const BELL_COOLDOWN_MS = 5000;
|
|
11
|
+
/** Determine if an activity entry should trigger a terminal bell. High-signal events only. */
|
|
12
|
+
export declare function shouldBell(tag: string, text: string): boolean;
|
|
9
13
|
/** Max name length in compact token. */
|
|
10
14
|
declare const COMPACT_NAME_LEN = 10;
|
|
11
15
|
/** Pin indicator for pinned sessions. */
|
|
@@ -49,6 +53,8 @@ export declare class TUI {
|
|
|
49
53
|
private prevLastActivity;
|
|
50
54
|
private compactMode;
|
|
51
55
|
private pinnedIds;
|
|
56
|
+
private bellEnabled;
|
|
57
|
+
private lastBellAt;
|
|
52
58
|
private viewMode;
|
|
53
59
|
private drilldownSessionId;
|
|
54
60
|
private sessionOutputs;
|
|
@@ -83,6 +89,10 @@ export declare class TUI {
|
|
|
83
89
|
isPinned(id: string): boolean;
|
|
84
90
|
/** Return count of pinned sessions. */
|
|
85
91
|
getPinnedCount(): number;
|
|
92
|
+
/** Enable or disable terminal bell notifications. */
|
|
93
|
+
setBell(enabled: boolean): void;
|
|
94
|
+
/** Return whether terminal bell is enabled. */
|
|
95
|
+
isBellEnabled(): boolean;
|
|
86
96
|
updateState(opts: {
|
|
87
97
|
phase?: DaemonPhase;
|
|
88
98
|
pollCount?: number;
|
package/dist/tui.js
CHANGED
|
@@ -52,6 +52,17 @@ function nextSortMode(current) {
|
|
|
52
52
|
const idx = SORT_MODES.indexOf(current);
|
|
53
53
|
return SORT_MODES[(idx + 1) % SORT_MODES.length];
|
|
54
54
|
}
|
|
55
|
+
// ── Bell notifications ──────────────────────────────────────────────────────
|
|
56
|
+
/** Cooldown between terminal bells to avoid buzzing. */
|
|
57
|
+
export const BELL_COOLDOWN_MS = 5000;
|
|
58
|
+
/** Determine if an activity entry should trigger a terminal bell. High-signal events only. */
|
|
59
|
+
export function shouldBell(tag, text) {
|
|
60
|
+
if (tag === "! action" || tag === "error")
|
|
61
|
+
return true;
|
|
62
|
+
if (tag === "+ action" && text.toLowerCase().includes("complete"))
|
|
63
|
+
return true;
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
55
66
|
// ── Compact mode ────────────────────────────────────────────────────────────
|
|
56
67
|
/** Max name length in compact token. */
|
|
57
68
|
const COMPACT_NAME_LEN = 10;
|
|
@@ -150,6 +161,8 @@ export class TUI {
|
|
|
150
161
|
prevLastActivity = new Map(); // session ID → previous lastActivity string
|
|
151
162
|
compactMode = false;
|
|
152
163
|
pinnedIds = new Set(); // pinned session IDs (always sort to top)
|
|
164
|
+
bellEnabled = false;
|
|
165
|
+
lastBellAt = 0;
|
|
153
166
|
// drill-down mode: show a single session's full output
|
|
154
167
|
viewMode = "overview";
|
|
155
168
|
drilldownSessionId = null;
|
|
@@ -272,6 +285,14 @@ export class TUI {
|
|
|
272
285
|
getPinnedCount() {
|
|
273
286
|
return this.pinnedIds.size;
|
|
274
287
|
}
|
|
288
|
+
/** Enable or disable terminal bell notifications. */
|
|
289
|
+
setBell(enabled) {
|
|
290
|
+
this.bellEnabled = enabled;
|
|
291
|
+
}
|
|
292
|
+
/** Return whether terminal bell is enabled. */
|
|
293
|
+
isBellEnabled() {
|
|
294
|
+
return this.bellEnabled;
|
|
295
|
+
}
|
|
275
296
|
// ── State updates ───────────────────────────────────────────────────────
|
|
276
297
|
updateState(opts) {
|
|
277
298
|
if (opts.phase !== undefined)
|
|
@@ -325,6 +346,14 @@ export class TUI {
|
|
|
325
346
|
this.activityBuffer = this.activityBuffer.slice(-this.maxActivity);
|
|
326
347
|
this.activityTimestamps = this.activityTimestamps.slice(-this.maxActivity);
|
|
327
348
|
}
|
|
349
|
+
// terminal bell for high-signal events (with cooldown)
|
|
350
|
+
if (this.bellEnabled && shouldBell(tag, text)) {
|
|
351
|
+
const nowMs = now.getTime();
|
|
352
|
+
if (nowMs - this.lastBellAt >= BELL_COOLDOWN_MS) {
|
|
353
|
+
this.lastBellAt = nowMs;
|
|
354
|
+
process.stderr.write("\x07");
|
|
355
|
+
}
|
|
356
|
+
}
|
|
328
357
|
if (this.active) {
|
|
329
358
|
if (this.searchPattern) {
|
|
330
359
|
// search active: only show new entry if it matches
|