aoaoe 0.90.0 → 0.91.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 +23 -0
- package/dist/input.d.ts +3 -0
- package/dist/input.js +20 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -411,6 +411,29 @@ async function main() {
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
});
|
|
414
|
+
// wire /diff N to show activity since a bookmark
|
|
415
|
+
input.onDiff((num) => {
|
|
416
|
+
const bms = tui.getBookmarks();
|
|
417
|
+
const bm = bms[num - 1];
|
|
418
|
+
if (!bm) {
|
|
419
|
+
tui.log("system", `bookmark #${num} not found`);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const buffer = tui.getActivityBuffer();
|
|
423
|
+
const entries = buffer.slice(bm.index);
|
|
424
|
+
if (entries.length === 0) {
|
|
425
|
+
tui.log("system", `no activity since bookmark #${num}`);
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
tui.log("system", `${entries.length} entries since bookmark #${num} (${bm.label}):`);
|
|
429
|
+
for (const e of entries.slice(-30)) { // cap at last 30 to avoid spam
|
|
430
|
+
tui.log("system", ` [${e.time}] ${e.tag}: ${e.text}`);
|
|
431
|
+
}
|
|
432
|
+
if (entries.length > 30) {
|
|
433
|
+
tui.log("system", ` ... (${entries.length - 30} more — use /clip to export all)`);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
});
|
|
414
437
|
// wire /focus toggle
|
|
415
438
|
input.onFocus(() => {
|
|
416
439
|
const enabled = !tui.isFocused();
|
package/dist/input.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type AutoPinHandler = () => void;
|
|
|
19
19
|
export type NoteHandler = (target: string, text: string) => void;
|
|
20
20
|
export type NotesHandler = () => void;
|
|
21
21
|
export type ClipHandler = (count: number) => void;
|
|
22
|
+
export type DiffHandler = (bookmarkNum: number) => void;
|
|
22
23
|
export interface MouseEvent {
|
|
23
24
|
button: number;
|
|
24
25
|
col: number;
|
|
@@ -60,6 +61,7 @@ export declare class InputReader {
|
|
|
60
61
|
private noteHandler;
|
|
61
62
|
private notesHandler;
|
|
62
63
|
private clipHandler;
|
|
64
|
+
private diffHandler;
|
|
63
65
|
private mouseDataListener;
|
|
64
66
|
onScroll(handler: (dir: ScrollDirection) => void): void;
|
|
65
67
|
onQueueChange(handler: (count: number) => void): void;
|
|
@@ -85,6 +87,7 @@ export declare class InputReader {
|
|
|
85
87
|
onNote(handler: NoteHandler): void;
|
|
86
88
|
onNotes(handler: NotesHandler): void;
|
|
87
89
|
onClip(handler: ClipHandler): void;
|
|
90
|
+
onDiff(handler: DiffHandler): void;
|
|
88
91
|
private notifyQueueChange;
|
|
89
92
|
start(): void;
|
|
90
93
|
drain(): string[];
|
package/dist/input.js
CHANGED
|
@@ -51,6 +51,7 @@ export class InputReader {
|
|
|
51
51
|
noteHandler = null;
|
|
52
52
|
notesHandler = null;
|
|
53
53
|
clipHandler = null;
|
|
54
|
+
diffHandler = null;
|
|
54
55
|
mouseDataListener = null;
|
|
55
56
|
// register a callback for scroll key events (PgUp/PgDn/Home/End)
|
|
56
57
|
onScroll(handler) {
|
|
@@ -148,6 +149,10 @@ export class InputReader {
|
|
|
148
149
|
onClip(handler) {
|
|
149
150
|
this.clipHandler = handler;
|
|
150
151
|
}
|
|
152
|
+
// register a callback for bookmark diff (/diff N)
|
|
153
|
+
onDiff(handler) {
|
|
154
|
+
this.diffHandler = handler;
|
|
155
|
+
}
|
|
151
156
|
notifyQueueChange() {
|
|
152
157
|
this.queueChangeHandler?.(this.queue.length);
|
|
153
158
|
}
|
|
@@ -338,6 +343,7 @@ ${BOLD}navigation:${RESET}
|
|
|
338
343
|
/note N|name text attach a note to a session (no text = clear)
|
|
339
344
|
/notes list all session notes
|
|
340
345
|
/clip [N] copy last N activity entries to clipboard (default 20)
|
|
346
|
+
/diff N show activity since bookmark N
|
|
341
347
|
/mark bookmark current activity position
|
|
342
348
|
/jump N jump to bookmark N
|
|
343
349
|
/marks list all bookmarks
|
|
@@ -563,6 +569,20 @@ ${BOLD}other:${RESET}
|
|
|
563
569
|
}
|
|
564
570
|
break;
|
|
565
571
|
}
|
|
572
|
+
case "/diff": {
|
|
573
|
+
const diffArg = line.slice("/diff".length).trim();
|
|
574
|
+
const diffNum = parseInt(diffArg, 10);
|
|
575
|
+
if (this.diffHandler && !isNaN(diffNum) && diffNum > 0) {
|
|
576
|
+
this.diffHandler(diffNum);
|
|
577
|
+
}
|
|
578
|
+
else if (!this.diffHandler) {
|
|
579
|
+
console.error(`${DIM}diff not available (no TUI)${RESET}`);
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
console.error(`${DIM}usage: /diff N — show activity since bookmark N${RESET}`);
|
|
583
|
+
}
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
566
586
|
case "/mark":
|
|
567
587
|
if (this.markHandler) {
|
|
568
588
|
this.markHandler();
|