@diegopetrucci/pi-annotate-last-message 0.1.10 → 0.1.11
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/README.md +1 -1
- package/glimpseui.d.ts +87 -78
- package/index.ts +210 -206
- package/package.json +1 -1
- package/prompt.ts +87 -66
- package/quiet-glimpse.ts +161 -155
- package/session.ts +94 -89
- package/theme.ts +199 -193
- package/types.ts +23 -23
- package/ui.ts +27 -25
- package/web/app.js +4 -7
- package/web/md-renderer.js +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ There is no runtime setting or toggle for submit behavior. To roll back the rend
|
|
|
34
34
|
|
|
35
35
|
## Requirements
|
|
36
36
|
|
|
37
|
-
- Interactive pi session
|
|
37
|
+
- Interactive pi TUI session.
|
|
38
38
|
- A completed assistant message with text on the active branch.
|
|
39
39
|
- Local desktop support for opening a native [Glimpse](https://github.com/mariozechner/glimpse) window.
|
|
40
40
|
|
package/glimpseui.d.ts
CHANGED
|
@@ -1,89 +1,98 @@
|
|
|
1
1
|
declare module "glimpseui" {
|
|
2
|
-
|
|
2
|
+
import { EventEmitter } from "node:events";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export type FollowMode = "snap" | "spring";
|
|
5
|
+
export type CursorAnchor =
|
|
6
|
+
| "top-left"
|
|
7
|
+
| "top-right"
|
|
8
|
+
| "right"
|
|
9
|
+
| "bottom-right"
|
|
10
|
+
| "bottom-left"
|
|
11
|
+
| "left";
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
export interface GlimpseOpenOptions {
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
title?: string;
|
|
17
|
+
x?: number;
|
|
18
|
+
y?: number;
|
|
19
|
+
frameless?: boolean;
|
|
20
|
+
floating?: boolean;
|
|
21
|
+
transparent?: boolean;
|
|
22
|
+
clickThrough?: boolean;
|
|
23
|
+
followCursor?: boolean;
|
|
24
|
+
followMode?: FollowMode;
|
|
25
|
+
cursorAnchor?: CursorAnchor;
|
|
26
|
+
cursorOffset?: {
|
|
27
|
+
x?: number;
|
|
28
|
+
y?: number;
|
|
29
|
+
};
|
|
30
|
+
hidden?: boolean;
|
|
31
|
+
autoClose?: boolean;
|
|
32
|
+
timeout?: number;
|
|
33
|
+
}
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
export interface GlimpseScreenInfo {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
scaleFactor: number;
|
|
39
|
+
visibleX?: number;
|
|
40
|
+
visibleY?: number;
|
|
41
|
+
visibleWidth?: number;
|
|
42
|
+
visibleHeight?: number;
|
|
43
|
+
x?: number;
|
|
44
|
+
y?: number;
|
|
45
|
+
}
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
export interface GlimpseAppearanceInfo {
|
|
48
|
+
darkMode: boolean;
|
|
49
|
+
accentColor: string;
|
|
50
|
+
reduceMotion: boolean;
|
|
51
|
+
increaseContrast: boolean;
|
|
52
|
+
}
|
|
47
53
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
export interface GlimpseCursorInfo {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
}
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
export interface GlimpseCursorTip {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
}
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
export interface GlimpseInfo {
|
|
65
|
+
screen: GlimpseScreenInfo;
|
|
66
|
+
screens: GlimpseScreenInfo[];
|
|
67
|
+
appearance: GlimpseAppearanceInfo;
|
|
68
|
+
cursor: GlimpseCursorInfo;
|
|
69
|
+
cursorTip: GlimpseCursorTip | null;
|
|
70
|
+
}
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
export class GlimpseWindow extends EventEmitter {
|
|
73
|
+
on(event: "ready", listener: (info: GlimpseInfo) => void): this;
|
|
74
|
+
on(event: "message", listener: (data: unknown) => void): this;
|
|
75
|
+
on(event: "info", listener: (info: GlimpseInfo) => void): this;
|
|
76
|
+
on(event: "closed", listener: () => void): this;
|
|
77
|
+
on(event: "error", listener: (error: Error) => void): this;
|
|
78
|
+
once(event: "ready", listener: (info: GlimpseInfo) => void): this;
|
|
79
|
+
once(event: "message", listener: (data: unknown) => void): this;
|
|
80
|
+
once(event: "info", listener: (info: GlimpseInfo) => void): this;
|
|
81
|
+
once(event: "closed", listener: () => void): this;
|
|
82
|
+
once(event: "error", listener: (error: Error) => void): this;
|
|
83
|
+
send(js: string): void;
|
|
84
|
+
setHTML(html: string): void;
|
|
85
|
+
show(options?: { title?: string }): void;
|
|
86
|
+
close(): void;
|
|
87
|
+
loadFile(path: string): void;
|
|
88
|
+
get info(): GlimpseInfo | null;
|
|
89
|
+
getInfo(): void;
|
|
90
|
+
followCursor(enabled: boolean, anchor?: CursorAnchor, mode?: FollowMode): void;
|
|
91
|
+
}
|
|
86
92
|
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
export function open(html: string, options?: GlimpseOpenOptions): GlimpseWindow;
|
|
94
|
+
export function prompt<T = unknown>(
|
|
95
|
+
html: string,
|
|
96
|
+
options?: GlimpseOpenOptions,
|
|
97
|
+
): Promise<T | null>;
|
|
89
98
|
}
|
package/index.ts
CHANGED
|
@@ -4,228 +4,232 @@ import { openQuietGlimpse, type QuietGlimpseWindow } from "./quiet-glimpse.js";
|
|
|
4
4
|
import { composeAnnotateLastMessagePrompt, hasAnnotateLastMessageFeedback } from "./prompt.js";
|
|
5
5
|
import { findLastAssistantMessage } from "./session.js";
|
|
6
6
|
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
AnnotateLastMessageCancelPayload,
|
|
8
|
+
AnnotateLastMessageInlineComment,
|
|
9
|
+
AnnotateLastMessageSectionComment,
|
|
10
|
+
AnnotateLastMessageSubmitPayload,
|
|
11
|
+
AnnotateLastMessageWindowMessage,
|
|
12
|
+
LastAssistantMessageData,
|
|
13
13
|
} from "./types.js";
|
|
14
14
|
import { buildAnnotateLastMessageHtml } from "./ui.js";
|
|
15
15
|
|
|
16
16
|
function isInlineComment(value: unknown): value is AnnotateLastMessageInlineComment {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
return (
|
|
18
|
+
typeof value === "object" &&
|
|
19
|
+
value != null &&
|
|
20
|
+
"line" in value &&
|
|
21
|
+
typeof value.line === "number" &&
|
|
22
|
+
Number.isInteger(value.line) &&
|
|
23
|
+
value.line > 0 &&
|
|
24
|
+
"body" in value &&
|
|
25
|
+
typeof value.body === "string"
|
|
26
|
+
);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function isSectionComment(value: unknown): value is AnnotateLastMessageSectionComment {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
return (
|
|
31
|
+
typeof value === "object" &&
|
|
32
|
+
value != null &&
|
|
33
|
+
"sectionId" in value &&
|
|
34
|
+
typeof value.sectionId === "string" &&
|
|
35
|
+
"body" in value &&
|
|
36
|
+
typeof value.body === "string"
|
|
37
|
+
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function isSubmitPayload(value: unknown): value is AnnotateLastMessageSubmitPayload {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
return (
|
|
42
|
+
typeof value === "object" &&
|
|
43
|
+
value != null &&
|
|
44
|
+
"type" in value &&
|
|
45
|
+
value.type === "submit" &&
|
|
46
|
+
"overallComment" in value &&
|
|
47
|
+
typeof value.overallComment === "string" &&
|
|
48
|
+
"inlineComments" in value &&
|
|
49
|
+
Array.isArray(value.inlineComments) &&
|
|
50
|
+
value.inlineComments.every(isInlineComment) &&
|
|
51
|
+
"sectionComments" in value &&
|
|
52
|
+
Array.isArray(value.sectionComments) &&
|
|
53
|
+
value.sectionComments.every(isSectionComment)
|
|
54
|
+
);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function isCancelPayload(value: unknown): value is AnnotateLastMessageCancelPayload {
|
|
58
|
-
|
|
58
|
+
return typeof value === "object" && value != null && "type" in value && value.type === "cancel";
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
61
|
+
function registerAnnotateLastMessageCommand(pi: ExtensionAPI): void {
|
|
62
|
+
let activeWindow: QuietGlimpseWindow | null = null;
|
|
63
|
+
let annotationOpening = false;
|
|
64
|
+
let annotationAttempt = 0;
|
|
65
|
+
const suppressedWindows = new WeakSet<QuietGlimpseWindow>();
|
|
66
|
+
|
|
67
|
+
function closeActiveWindow(options: { suppressResults?: boolean } = {}): void {
|
|
68
|
+
annotationAttempt += 1;
|
|
69
|
+
const windowToClose = activeWindow;
|
|
70
|
+
activeWindow = null;
|
|
71
|
+
if (windowToClose == null) return;
|
|
72
|
+
if (options.suppressResults) {
|
|
73
|
+
suppressedWindows.add(windowToClose);
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
windowToClose.close();
|
|
77
|
+
} catch {
|
|
78
|
+
// Ignore races when the native window is already closing.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function openAnnotationWindow(ctx: ExtensionCommandContext): Promise<void> {
|
|
83
|
+
if (ctx.mode !== "tui") {
|
|
84
|
+
ctx.ui.notify("annotate-last-message requires interactive mode.", "error");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (annotationOpening || activeWindow != null) {
|
|
88
|
+
ctx.ui.notify("A last-message annotation window is already open.", "warning");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const messageResult = findLastAssistantMessage(ctx.sessionManager.getBranch());
|
|
93
|
+
if (!messageResult.ok) {
|
|
94
|
+
ctx.ui.notify(messageResult.message, "error");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const messageData = messageResult.data;
|
|
99
|
+
annotationOpening = true;
|
|
100
|
+
const attempt = ++annotationAttempt;
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
const html = buildAnnotateLastMessageHtml(messageData, ctx.ui.theme);
|
|
104
|
+
const window = await openQuietGlimpse(html, {
|
|
105
|
+
width: 1440,
|
|
106
|
+
height: 980,
|
|
107
|
+
title: "annotate last message",
|
|
108
|
+
});
|
|
109
|
+
if (attempt !== annotationAttempt) {
|
|
110
|
+
suppressedWindows.add(window);
|
|
111
|
+
window.close();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
activeWindow = window;
|
|
115
|
+
if (window.failure != null) throw window.failure;
|
|
116
|
+
if (window.closed)
|
|
117
|
+
throw new Error("Glimpse closed while the annotation window was starting.");
|
|
118
|
+
|
|
119
|
+
const terminalMessagePromise = new Promise<
|
|
120
|
+
AnnotateLastMessageSubmitPayload | AnnotateLastMessageCancelPayload | null
|
|
121
|
+
>((resolve, reject) => {
|
|
122
|
+
let settled = false;
|
|
123
|
+
let closeTimer: ReturnType<typeof setTimeout> | null = null;
|
|
124
|
+
|
|
125
|
+
const requestWindowClose = (): void => {
|
|
126
|
+
try {
|
|
127
|
+
window.close();
|
|
128
|
+
} catch {
|
|
129
|
+
// Ignore races when the native process has already exited.
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const cleanup = (): void => {
|
|
134
|
+
if (closeTimer != null) {
|
|
135
|
+
clearTimeout(closeTimer);
|
|
136
|
+
closeTimer = null;
|
|
137
|
+
}
|
|
138
|
+
window.removeListener("message", onMessage);
|
|
139
|
+
window.removeListener("closed", onClosed);
|
|
140
|
+
window.removeListener("error", onError);
|
|
141
|
+
if (activeWindow === window) {
|
|
142
|
+
activeWindow = null;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const settle = (value: AnnotateLastMessageWindowMessage | null): void => {
|
|
147
|
+
if (settled) return;
|
|
148
|
+
settled = true;
|
|
149
|
+
cleanup();
|
|
150
|
+
resolve(value);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const onMessage = (data: unknown): void => {
|
|
154
|
+
if (isSubmitPayload(data) || isCancelPayload(data)) {
|
|
155
|
+
settle(data);
|
|
156
|
+
requestWindowClose();
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const onClosed = (): void => {
|
|
161
|
+
if (settled || closeTimer != null) return;
|
|
162
|
+
closeTimer = setTimeout(() => {
|
|
163
|
+
closeTimer = null;
|
|
164
|
+
settle(null);
|
|
165
|
+
}, 250);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const onError = (error: Error): void => {
|
|
169
|
+
if (settled) return;
|
|
170
|
+
settled = true;
|
|
171
|
+
requestWindowClose();
|
|
172
|
+
cleanup();
|
|
173
|
+
reject(error);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
window.on("message", onMessage);
|
|
177
|
+
window.on("closed", onClosed);
|
|
178
|
+
window.on("error", onError);
|
|
179
|
+
if (window.failure != null) onError(window.failure);
|
|
180
|
+
else if (window.closed) onClosed();
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
void (async (
|
|
184
|
+
windowMessageSource: QuietGlimpseWindow,
|
|
185
|
+
sourceData: LastAssistantMessageData,
|
|
186
|
+
) => {
|
|
187
|
+
try {
|
|
188
|
+
const result = await terminalMessagePromise;
|
|
189
|
+
if (suppressedWindows.has(windowMessageSource) || attempt !== annotationAttempt) return;
|
|
190
|
+
if (result == null) return;
|
|
191
|
+
if (result.type === "cancel") {
|
|
192
|
+
ctx.ui.notify("Annotation cancelled.", "info");
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (!hasAnnotateLastMessageFeedback(result)) {
|
|
196
|
+
ctx.ui.notify("No annotation feedback submitted.", "info");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const prompt = composeAnnotateLastMessagePrompt(sourceData, result);
|
|
201
|
+
pi.sendUserMessage(prompt, { deliverAs: "followUp" });
|
|
202
|
+
ctx.ui.notify("Annotation feedback sent to the agent.", "info");
|
|
203
|
+
} catch (error) {
|
|
204
|
+
if (suppressedWindows.has(windowMessageSource) || attempt !== annotationAttempt) return;
|
|
205
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
206
|
+
ctx.ui.notify(`Annotation failed: ${message}`, "error");
|
|
207
|
+
}
|
|
208
|
+
})(window, messageData);
|
|
209
|
+
|
|
210
|
+
ctx.ui.notify("Opened native annotation window.", "info");
|
|
211
|
+
} catch (error) {
|
|
212
|
+
if (attempt !== annotationAttempt) return;
|
|
213
|
+
closeActiveWindow({ suppressResults: true });
|
|
214
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
215
|
+
ctx.ui.notify(`Annotation failed: ${message}`, "error");
|
|
216
|
+
} finally {
|
|
217
|
+
annotationOpening = false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
pi.registerCommand("annotate-last-message", {
|
|
222
|
+
description: "Open a native annotation window for the latest assistant message",
|
|
223
|
+
handler: async (_args, ctx) => {
|
|
224
|
+
await openAnnotationWindow(ctx);
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
pi.on("session_shutdown", async () => {
|
|
229
|
+
closeActiveWindow({ suppressResults: true });
|
|
230
|
+
});
|
|
227
231
|
}
|
|
228
232
|
|
|
229
233
|
export default function (pi: ExtensionAPI): void {
|
|
230
|
-
|
|
234
|
+
registerAnnotateLastMessageCommand(pi);
|
|
231
235
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopetrucci/pi-annotate-last-message",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "A standalone pi extension that adds /annotate-last-message, a native Glimpse UI for annotating the latest assistant reply.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|