@introspection-ai/recipes 0.40.1 → 0.41.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/artifact-viewer-tui.d.ts +74 -0
- package/dist/artifact-viewer-tui.d.ts.map +1 -0
- package/dist/artifact-viewer-tui.js +179 -0
- package/dist/artifact-viewer-tui.js.map +1 -0
- package/dist/artifact-viewer.d.ts +148 -0
- package/dist/artifact-viewer.d.ts.map +1 -0
- package/dist/artifact-viewer.js +538 -0
- package/dist/artifact-viewer.js.map +1 -0
- package/dist/ask-user-question.d.ts +5 -1
- package/dist/ask-user-question.d.ts.map +1 -1
- package/dist/ask-user-question.js +43 -10
- package/dist/ask-user-question.js.map +1 -1
- package/dist/connector-tools.d.ts +2 -0
- package/dist/connector-tools.d.ts.map +1 -1
- package/dist/connector-tools.js +1 -0
- package/dist/connector-tools.js.map +1 -1
- package/dist/inspect.d.ts +3 -0
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +2 -0
- package/dist/inspect.js.map +1 -1
- package/dist/interaction-tui.d.ts +25 -3
- package/dist/interaction-tui.d.ts.map +1 -1
- package/dist/interaction-tui.js +145 -31
- package/dist/interaction-tui.js.map +1 -1
- package/dist/interactions.d.ts.map +1 -1
- package/dist/interactions.js +5 -0
- package/dist/interactions.js.map +1 -1
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +62 -4
- package/dist/pi-extension.js.map +1 -1
- package/dist/recipe/skills-prompt.d.ts +29 -1
- package/dist/recipe/skills-prompt.d.ts.map +1 -1
- package/dist/recipe/skills-prompt.js +42 -1
- package/dist/recipe/skills-prompt.js.map +1 -1
- package/dist/recipe/skills.d.ts +13 -0
- package/dist/recipe/skills.d.ts.map +1 -1
- package/dist/recipe/skills.js +37 -2
- package/dist/recipe/skills.js.map +1 -1
- package/dist/recipe/suggestions.d.ts +58 -0
- package/dist/recipe/suggestions.d.ts.map +1 -0
- package/dist/recipe/suggestions.js +157 -0
- package/dist/recipe/suggestions.js.map +1 -0
- package/dist/session.d.ts +5 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +19 -4
- package/dist/session.js.map +1 -1
- package/dist/suggestion-picker.d.ts +30 -0
- package/dist/suggestion-picker.d.ts.map +1 -0
- package/dist/suggestion-picker.js +124 -0
- package/dist/suggestion-picker.js.map +1 -0
- package/docs/host-api.md +3 -0
- package/docs/pi-extension.md +41 -0
- package/docs/recipe-format.md +58 -1
- package/package.json +9 -5
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The right-hand artifact panel: a non-capturing Pi overlay that renders one
|
|
3
|
+
* markdown file with a title line, a scroll position and a key hint.
|
|
4
|
+
*
|
|
5
|
+
* The panel owns no file access. `./artifact-viewer.ts` reads and watches the
|
|
6
|
+
* file and calls `setDocument()`; the panel only draws and handles keys.
|
|
7
|
+
*/
|
|
8
|
+
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import { type KeyId, type Component, type MarkdownTheme, type OverlayHandle, type OverlayOptions } from "@earendil-works/pi-tui";
|
|
10
|
+
/** Where the panel sits: the top-right corner, 45% wide, full height. */
|
|
11
|
+
export declare const ARTIFACT_PANEL_OVERLAY_OPTIONS: OverlayOptions;
|
|
12
|
+
/** The document the panel shows. */
|
|
13
|
+
export interface ArtifactDocument {
|
|
14
|
+
/** The path shown in the title, relative to the working directory. */
|
|
15
|
+
title: string;
|
|
16
|
+
/** Markdown source, or undefined when the file is gone. */
|
|
17
|
+
markdown: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** What the panel asks its owner to do in response to a key. */
|
|
20
|
+
export interface ArtifactPanelActions {
|
|
21
|
+
/** Open the file with the system opener (`o`). */
|
|
22
|
+
openExternal(): void;
|
|
23
|
+
/** Move input back to the editor (the focus shortcut, pressed in the panel). */
|
|
24
|
+
unfocus(): void;
|
|
25
|
+
/** Close the panel (Esc or `q`). */
|
|
26
|
+
close(): void;
|
|
27
|
+
/** Pi removed the overlay; release the file watcher. */
|
|
28
|
+
disposed(): void;
|
|
29
|
+
}
|
|
30
|
+
interface PanelTui {
|
|
31
|
+
requestRender(): void;
|
|
32
|
+
terminal?: {
|
|
33
|
+
rows?: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Pi's theme tokens for markdown, taken from the theme the overlay was given. */
|
|
37
|
+
export declare function artifactMarkdownTheme(theme: Theme): MarkdownTheme;
|
|
38
|
+
/**
|
|
39
|
+
* The panel component. Pi gives it input only while it has focus; the owner
|
|
40
|
+
* moves focus with the overlay handle.
|
|
41
|
+
*/
|
|
42
|
+
export declare class ArtifactPanel implements Component {
|
|
43
|
+
private readonly tui;
|
|
44
|
+
private readonly theme;
|
|
45
|
+
private readonly actions;
|
|
46
|
+
/** The focus shortcut, so pressing it in the panel returns to the editor. */
|
|
47
|
+
private readonly focusKey;
|
|
48
|
+
private readonly focusKeyLabel;
|
|
49
|
+
private document;
|
|
50
|
+
private readonly markdown;
|
|
51
|
+
private scrollTop;
|
|
52
|
+
private lastBodyHeight;
|
|
53
|
+
private lastMaxScroll;
|
|
54
|
+
private handle;
|
|
55
|
+
constructor(tui: PanelTui, theme: Theme, document: ArtifactDocument, actions: ArtifactPanelActions,
|
|
56
|
+
/** The focus shortcut, so pressing it in the panel returns to the editor. */
|
|
57
|
+
focusKey: KeyId, focusKeyLabel: string);
|
|
58
|
+
/** Called once Pi has shown the overlay. */
|
|
59
|
+
attach(handle: OverlayHandle): void;
|
|
60
|
+
isFocused(): boolean;
|
|
61
|
+
/** Replace what the panel shows; `keepScroll` holds the position on a re-render of the same file. */
|
|
62
|
+
setDocument(document: ArtifactDocument, keepScroll?: boolean): void;
|
|
63
|
+
get scrollPosition(): number;
|
|
64
|
+
private height;
|
|
65
|
+
private bodyLines;
|
|
66
|
+
render(width: number): string[];
|
|
67
|
+
invalidate(): void;
|
|
68
|
+
requestRender(): void;
|
|
69
|
+
dispose(): void;
|
|
70
|
+
private scrollBy;
|
|
71
|
+
handleInput(data: string): void;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=artifact-viewer-tui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer-tui.d.ts","sourceRoot":"","sources":["../src/artifact-viewer-tui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAEL,KAAK,KAAK,EAKV,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAEhC,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,EAAE,cAQ5C,CAAC;AAEF,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,YAAY,IAAI,IAAI,CAAC;IACrB,gFAAgF;IAChF,OAAO,IAAI,IAAI,CAAC;IAChB,oCAAoC;IACpC,KAAK,IAAI,IAAI,CAAC;IACd,wDAAwD;IACxD,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,UAAU,QAAQ;IAChB,aAAa,IAAI,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAiBjE;AAOD;;;GAGG;AACH,qBAAa,aAAc,YAAW,SAAS;IAS3C,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAdhC,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,MAAM,CAA4B;IAE1C,YACmB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,KAAK,EAC7B,QAAQ,EAAE,gBAAgB,EACT,OAAO,EAAE,oBAAoB;IAC9C,6EAA6E;IAC5D,QAAQ,EAAE,KAAK,EACf,aAAa,EAAE,MAAM,EASvC;IAED,4CAA4C;IAC5C,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAElC;IAED,SAAS,IAAI,OAAO,CAEnB;IAED,qGAAqG;IACrG,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE,UAAU,UAAQ,GAAG,IAAI,CAKhE;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,SAAS;IAUjB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAsC9B;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,aAAa,IAAI,IAAI,CAEpB;IAED,OAAO,IAAI,IAAI,CAEd;IAED,OAAO,CAAC,QAAQ;IAUhB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAqB9B;CACF"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The right-hand artifact panel: a non-capturing Pi overlay that renders one
|
|
3
|
+
* markdown file with a title line, a scroll position and a key hint.
|
|
4
|
+
*
|
|
5
|
+
* The panel owns no file access. `./artifact-viewer.ts` reads and watches the
|
|
6
|
+
* file and calls `setDocument()`; the panel only draws and handles keys.
|
|
7
|
+
*/
|
|
8
|
+
import { Key, Markdown, matchesKey, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
|
|
9
|
+
/** Where the panel sits: the top-right corner, 45% wide, full height. */
|
|
10
|
+
export const ARTIFACT_PANEL_OVERLAY_OPTIONS = {
|
|
11
|
+
anchor: "top-right",
|
|
12
|
+
width: "45%",
|
|
13
|
+
minWidth: 30,
|
|
14
|
+
maxHeight: "100%",
|
|
15
|
+
margin: 1,
|
|
16
|
+
// Opening the panel never takes input from the editor.
|
|
17
|
+
nonCapturing: true,
|
|
18
|
+
};
|
|
19
|
+
/** Pi's theme tokens for markdown, taken from the theme the overlay was given. */
|
|
20
|
+
export function artifactMarkdownTheme(theme) {
|
|
21
|
+
return {
|
|
22
|
+
heading: (text) => theme.fg("mdHeading", text),
|
|
23
|
+
link: (text) => theme.fg("mdLink", text),
|
|
24
|
+
linkUrl: (text) => theme.fg("mdLinkUrl", text),
|
|
25
|
+
code: (text) => theme.fg("mdCode", text),
|
|
26
|
+
codeBlock: (text) => theme.fg("mdCodeBlock", text),
|
|
27
|
+
codeBlockBorder: (text) => theme.fg("mdCodeBlockBorder", text),
|
|
28
|
+
quote: (text) => theme.fg("mdQuote", text),
|
|
29
|
+
quoteBorder: (text) => theme.fg("mdQuoteBorder", text),
|
|
30
|
+
hr: (text) => theme.fg("mdHr", text),
|
|
31
|
+
listBullet: (text) => theme.fg("mdListBullet", text),
|
|
32
|
+
bold: (text) => theme.bold(text),
|
|
33
|
+
italic: (text) => theme.italic(text),
|
|
34
|
+
underline: (text) => theme.underline(text),
|
|
35
|
+
strikethrough: (text) => theme.strikethrough(text),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function padToWidth(line, width) {
|
|
39
|
+
const clipped = truncateToWidth(line, width);
|
|
40
|
+
return clipped + " ".repeat(Math.max(0, width - visibleWidth(clipped)));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The panel component. Pi gives it input only while it has focus; the owner
|
|
44
|
+
* moves focus with the overlay handle.
|
|
45
|
+
*/
|
|
46
|
+
export class ArtifactPanel {
|
|
47
|
+
tui;
|
|
48
|
+
theme;
|
|
49
|
+
actions;
|
|
50
|
+
focusKey;
|
|
51
|
+
focusKeyLabel;
|
|
52
|
+
document;
|
|
53
|
+
markdown;
|
|
54
|
+
scrollTop = 0;
|
|
55
|
+
lastBodyHeight = 1;
|
|
56
|
+
lastMaxScroll = 0;
|
|
57
|
+
handle;
|
|
58
|
+
constructor(tui, theme, document, actions,
|
|
59
|
+
/** The focus shortcut, so pressing it in the panel returns to the editor. */
|
|
60
|
+
focusKey, focusKeyLabel) {
|
|
61
|
+
this.tui = tui;
|
|
62
|
+
this.theme = theme;
|
|
63
|
+
this.actions = actions;
|
|
64
|
+
this.focusKey = focusKey;
|
|
65
|
+
this.focusKeyLabel = focusKeyLabel;
|
|
66
|
+
this.document = document;
|
|
67
|
+
this.markdown = new Markdown(document.markdown ?? "", 0, 0, artifactMarkdownTheme(theme));
|
|
68
|
+
}
|
|
69
|
+
/** Called once Pi has shown the overlay. */
|
|
70
|
+
attach(handle) {
|
|
71
|
+
this.handle = handle;
|
|
72
|
+
}
|
|
73
|
+
isFocused() {
|
|
74
|
+
return this.handle?.isFocused() ?? false;
|
|
75
|
+
}
|
|
76
|
+
/** Replace what the panel shows; `keepScroll` holds the position on a re-render of the same file. */
|
|
77
|
+
setDocument(document, keepScroll = false) {
|
|
78
|
+
this.document = document;
|
|
79
|
+
this.markdown.setText(document.markdown ?? "");
|
|
80
|
+
if (!keepScroll)
|
|
81
|
+
this.scrollTop = 0;
|
|
82
|
+
this.tui.requestRender();
|
|
83
|
+
}
|
|
84
|
+
get scrollPosition() {
|
|
85
|
+
return this.scrollTop;
|
|
86
|
+
}
|
|
87
|
+
height() {
|
|
88
|
+
const rows = this.tui.terminal?.rows ?? 24;
|
|
89
|
+
// The overlay keeps a one-row margin top and bottom.
|
|
90
|
+
return Math.max(5, rows - 2);
|
|
91
|
+
}
|
|
92
|
+
bodyLines(contentWidth) {
|
|
93
|
+
if (this.document.markdown === undefined) {
|
|
94
|
+
return [this.theme.fg("warning", "This file was removed or cannot be read.")];
|
|
95
|
+
}
|
|
96
|
+
if (this.document.markdown.trim() === "") {
|
|
97
|
+
return [this.theme.fg("muted", "(empty file)")];
|
|
98
|
+
}
|
|
99
|
+
return this.markdown.render(contentWidth);
|
|
100
|
+
}
|
|
101
|
+
render(width) {
|
|
102
|
+
const height = this.height();
|
|
103
|
+
const bodyHeight = Math.max(1, height - 2);
|
|
104
|
+
this.lastBodyHeight = bodyHeight;
|
|
105
|
+
const border = (text) => this.theme.fg("border", text);
|
|
106
|
+
const contentWidth = Math.max(1, width - 2);
|
|
107
|
+
const body = this.bodyLines(contentWidth);
|
|
108
|
+
const maxScroll = Math.max(0, body.length - bodyHeight);
|
|
109
|
+
this.lastMaxScroll = maxScroll;
|
|
110
|
+
this.scrollTop = Math.min(this.scrollTop, maxScroll);
|
|
111
|
+
const first = body.length === 0 ? 0 : this.scrollTop + 1;
|
|
112
|
+
const last = Math.min(body.length, this.scrollTop + bodyHeight);
|
|
113
|
+
const position = ` ${first}-${last}/${body.length} `;
|
|
114
|
+
const focused = this.isFocused();
|
|
115
|
+
const titleText = ` ${this.document.title} `;
|
|
116
|
+
const fill = Math.max(1, width - 1 - visibleWidth(titleText) - visibleWidth(position));
|
|
117
|
+
const title = truncateToWidth(border("─") +
|
|
118
|
+
this.theme.fg(focused ? "accent" : "text", this.theme.bold(titleText)) +
|
|
119
|
+
border("─".repeat(fill)) +
|
|
120
|
+
this.theme.fg("muted", position), width);
|
|
121
|
+
const lines = [padToWidth(title, width)];
|
|
122
|
+
const visible = body.slice(this.scrollTop, this.scrollTop + bodyHeight);
|
|
123
|
+
for (let index = 0; index < bodyHeight; index += 1) {
|
|
124
|
+
lines.push(padToWidth(`${border("│")} ${visible[index] ?? ""}`, width));
|
|
125
|
+
}
|
|
126
|
+
const hint = focused
|
|
127
|
+
? `↑↓ PgUp/PgDn scroll · o open · q/Esc close · ${this.focusKeyLabel} editor`
|
|
128
|
+
: `/recipe close to close · ${this.focusKeyLabel} to scroll`;
|
|
129
|
+
lines.push(padToWidth(this.theme.fg("dim", ` ${hint}`), width));
|
|
130
|
+
return lines;
|
|
131
|
+
}
|
|
132
|
+
invalidate() {
|
|
133
|
+
this.markdown.invalidate();
|
|
134
|
+
}
|
|
135
|
+
requestRender() {
|
|
136
|
+
this.tui.requestRender();
|
|
137
|
+
}
|
|
138
|
+
dispose() {
|
|
139
|
+
this.actions.disposed();
|
|
140
|
+
}
|
|
141
|
+
scrollBy(lines) {
|
|
142
|
+
const next = Math.min(this.lastMaxScroll, Math.max(0, this.scrollTop + lines));
|
|
143
|
+
if (next === this.scrollTop)
|
|
144
|
+
return;
|
|
145
|
+
this.scrollTop = next;
|
|
146
|
+
this.tui.requestRender();
|
|
147
|
+
}
|
|
148
|
+
handleInput(data) {
|
|
149
|
+
const page = Math.max(1, this.lastBodyHeight - 1);
|
|
150
|
+
if (matchesKey(data, this.focusKey)) {
|
|
151
|
+
this.actions.unfocus();
|
|
152
|
+
}
|
|
153
|
+
else if (matchesKey(data, Key.up) || data === "k") {
|
|
154
|
+
this.scrollBy(-1);
|
|
155
|
+
}
|
|
156
|
+
else if (matchesKey(data, Key.down) || data === "j") {
|
|
157
|
+
this.scrollBy(1);
|
|
158
|
+
}
|
|
159
|
+
else if (matchesKey(data, Key.pageUp)) {
|
|
160
|
+
this.scrollBy(-page);
|
|
161
|
+
}
|
|
162
|
+
else if (matchesKey(data, Key.pageDown) || matchesKey(data, Key.space)) {
|
|
163
|
+
this.scrollBy(page);
|
|
164
|
+
}
|
|
165
|
+
else if (matchesKey(data, Key.home) || data === "g") {
|
|
166
|
+
this.scrollBy(-this.scrollTop);
|
|
167
|
+
}
|
|
168
|
+
else if (matchesKey(data, Key.end) || data === "G") {
|
|
169
|
+
this.scrollBy(this.lastMaxScroll - this.scrollTop);
|
|
170
|
+
}
|
|
171
|
+
else if (data === "o") {
|
|
172
|
+
this.actions.openExternal();
|
|
173
|
+
}
|
|
174
|
+
else if (matchesKey(data, Key.escape) || data === "q") {
|
|
175
|
+
this.actions.close();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=artifact-viewer-tui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer-tui.js","sourceRoot":"","sources":["../src/artifact-viewer-tui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,GAAG,EAEH,QAAQ,EACR,UAAU,EACV,eAAe,EACf,YAAY,GAKb,MAAM,wBAAwB,CAAC;AAEhC,yEAAyE;AACzE,MAAM,CAAC,MAAM,8BAA8B,GAAmB;IAC5D,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,CAAC;IACT,uDAAuD;IACvD,YAAY,EAAE,IAAI;CACnB,CAAC;AA2BF,kFAAkF;AAClF,MAAM,UAAU,qBAAqB,CAAC,KAAY;IAChD,OAAO;QACL,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;QAC9C,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;QACxC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;QAC9C,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;QACxC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC;QAClD,eAAe,EAAE,CAAC,IAAI,EAAE,EA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CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first-party artifact viewer: a `show_artifact` tool, `/recipe view` and `/recipe close`
|
|
3
|
+
* and a focus shortcut that show a markdown file the agent wrote in a panel on
|
|
4
|
+
* the right of Pi's terminal, so the user can read it before approving it.
|
|
5
|
+
*
|
|
6
|
+
* An agent gets it by listing `show_artifact` in its `tools`, like
|
|
7
|
+
* `ask_user_question`. Only markdown is shown for now; the tool is named for
|
|
8
|
+
* artifacts so other formats can join it without renaming a tool Recipes
|
|
9
|
+
* already list. The panel exists only in Pi's interactive terminal; anywhere
|
|
10
|
+
* else the tool returns the path as text.
|
|
11
|
+
*/
|
|
12
|
+
import type { ExtensionContext, ExtensionFactory, ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
13
|
+
import type { AutocompleteItem } from "@earendil-works/pi-tui";
|
|
14
|
+
import { Type, type Static } from "typebox";
|
|
15
|
+
import type { RecipeExtensionRegistrationRegistry } from "./extensions.js";
|
|
16
|
+
export declare const SHOW_ARTIFACT_TOOL_NAME = "show_artifact";
|
|
17
|
+
/** The viewer's commands, as subcommands of Recipes' own `/recipe` so they
|
|
18
|
+
* never clash with another extension's or the user's commands. */
|
|
19
|
+
export declare const VIEW_ARTIFACT_COMMAND = "recipe view";
|
|
20
|
+
export declare const CLOSE_ARTIFACT_COMMAND = "recipe close";
|
|
21
|
+
/** A `/recipe` subcommand an optional built-in adds: `/recipe <name> <args>`. */
|
|
22
|
+
export type RecipeSubcommand = (args: string, ctx: ExtensionContext) => Promise<void>;
|
|
23
|
+
/** The `/recipe` subcommand `name` registered for this Pi instance, if any. */
|
|
24
|
+
export declare function recipeSubcommand(pi: object, name: string): RecipeSubcommand | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Split `/recipe` arguments into the subcommand name and the rest, which keeps
|
|
27
|
+
* its own whitespace so a path such as `"a b.md"` reaches the handler intact.
|
|
28
|
+
*/
|
|
29
|
+
export declare function splitRecipeSubcommand(action: string): {
|
|
30
|
+
name: string;
|
|
31
|
+
args: string;
|
|
32
|
+
};
|
|
33
|
+
/** The `/recipe` subcommand names registered for this Pi instance. */
|
|
34
|
+
export declare function recipeSubcommandNames(pi: object): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Completions for `/recipe <prefix>` from the optional built-ins: their
|
|
37
|
+
* subcommand names while the first word is typed, then the subcommand's own
|
|
38
|
+
* argument completions (for `view`, the workspace's markdown files).
|
|
39
|
+
*/
|
|
40
|
+
export declare function recipeSubcommandCompletions(pi: object, prefix: string, cwd: string): AutocompleteItem[];
|
|
41
|
+
/**
|
|
42
|
+
* The markdown files under `cwd` matching `query` (a substring of the path,
|
|
43
|
+
* case-insensitive), the usual review files first. Bounded in depth and count
|
|
44
|
+
* so a large workspace stays quick; hidden folders and build output are skipped.
|
|
45
|
+
*/
|
|
46
|
+
export declare function markdownFilesFor(cwd: string, query: string): AutocompleteItem[];
|
|
47
|
+
/**
|
|
48
|
+
* Moves input between the editor and the panel. Alt+R ("recipe") is unbound
|
|
49
|
+
* in Pi's defaults; plain Ctrl letters are all taken, and Ctrl+Shift letters
|
|
50
|
+
* are indistinguishable from Ctrl letters in terminals without the Kitty
|
|
51
|
+
* keyboard protocol.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ARTIFACT_PANEL_FOCUS_KEY: "alt+r";
|
|
54
|
+
/** File extensions the panel renders. */
|
|
55
|
+
export declare const ARTIFACT_MARKDOWN_EXTENSIONS: readonly string[];
|
|
56
|
+
declare const parameters: Type.TObject<{
|
|
57
|
+
path: Type.TString;
|
|
58
|
+
}>;
|
|
59
|
+
export type ShowArtifactToolParams = Static<typeof parameters>;
|
|
60
|
+
/** Structured `details` of a `show_artifact` result. */
|
|
61
|
+
export interface ShowArtifactDetails {
|
|
62
|
+
/** The file, relative to the working directory. */
|
|
63
|
+
path: string;
|
|
64
|
+
/** Whether the panel is showing it (false outside the interactive terminal). */
|
|
65
|
+
shown: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** A validated artifact path. */
|
|
68
|
+
export interface ResolvedArtifactPath {
|
|
69
|
+
absolutePath: string;
|
|
70
|
+
/** Relative to the working directory, with `/` separators. */
|
|
71
|
+
relativePath: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ArtifactViewerOptions {
|
|
74
|
+
/**
|
|
75
|
+
* Opens a file with the system's default app (`o` in the panel). Defaults
|
|
76
|
+
* to `open` on macOS, `start` on Windows and `xdg-open` elsewhere.
|
|
77
|
+
*/
|
|
78
|
+
openExternal?: (absolutePath: string) => Promise<void> | void;
|
|
79
|
+
/**
|
|
80
|
+
* Calls `onChange` when the file may have changed and returns a function
|
|
81
|
+
* that stops watching. Defaults to `fs.watch` on the file's folder, which
|
|
82
|
+
* also sees editors that save by replacing the file.
|
|
83
|
+
*/
|
|
84
|
+
watchFile?: (absolutePath: string, onChange: () => void) => () => void;
|
|
85
|
+
/** How long to wait for a burst of changes to settle before re-rendering. */
|
|
86
|
+
debounceMs?: number;
|
|
87
|
+
}
|
|
88
|
+
/** Whether a path names a file the panel can render. */
|
|
89
|
+
export declare function isMarkdownPath(path: string): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Resolve `path` against `cwd` and check that it names an existing markdown
|
|
92
|
+
* file inside `cwd`, following symlinks. Throws an error the model or user can
|
|
93
|
+
* act on.
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveArtifactPath(cwd: string, path: string): ResolvedArtifactPath;
|
|
96
|
+
/** The default `o` action: the platform's "open with default app" command. */
|
|
97
|
+
export declare function openWithSystemApp(absolutePath: string): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* The default watcher: the file's folder, filtered to the file's name. When
|
|
100
|
+
* the path is a symlink, the folder of the file it points to is watched too,
|
|
101
|
+
* so an edit to the target is seen; replacing or retargeting the link is seen
|
|
102
|
+
* through its own folder, which moves the target watch along.
|
|
103
|
+
*/
|
|
104
|
+
export declare function watchFileWithFs(absolutePath: string, onChange: () => void): () => void;
|
|
105
|
+
/**
|
|
106
|
+
* One session's viewer: at most one panel, the file it shows, and the last
|
|
107
|
+
* markdown file the agent showed or wrote (for `/recipe view` with no argument).
|
|
108
|
+
*/
|
|
109
|
+
export declare class ArtifactViewer {
|
|
110
|
+
private open;
|
|
111
|
+
private last;
|
|
112
|
+
private readonly openExternal;
|
|
113
|
+
private readonly watchFile;
|
|
114
|
+
private readonly debounceMs;
|
|
115
|
+
constructor(options?: ArtifactViewerOptions);
|
|
116
|
+
/** The last markdown file shown or written, relative to the working directory. */
|
|
117
|
+
get lastPath(): string | undefined;
|
|
118
|
+
get isOpen(): boolean;
|
|
119
|
+
/** Remember a markdown file the agent wrote, for `/recipe view` with no argument. */
|
|
120
|
+
remember(cwd: string, path: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Show `target` in the panel, opening it if needed. The panel never takes
|
|
123
|
+
* focus unless `focus` is set.
|
|
124
|
+
*/
|
|
125
|
+
show(ctx: ExtensionContext, target: ResolvedArtifactPath, focus?: boolean): void;
|
|
126
|
+
/** The shortcut: move input to the panel, or back to the editor. */
|
|
127
|
+
toggleFocus(ctx: ExtensionContext): void;
|
|
128
|
+
/** Close the panel, if it is open. */
|
|
129
|
+
close(): void;
|
|
130
|
+
private focus;
|
|
131
|
+
private unfocus;
|
|
132
|
+
private openCurrent;
|
|
133
|
+
private watch;
|
|
134
|
+
private release;
|
|
135
|
+
}
|
|
136
|
+
/** Build the tool over a session's viewer. */
|
|
137
|
+
export declare function createShowArtifactTool(viewer: ArtifactViewer): ToolDefinition;
|
|
138
|
+
/**
|
|
139
|
+
* An extension factory registering the tool, `/recipe view` and `/recipe close`, and the focus shortcut,
|
|
140
|
+
* unless a Recipe or host extension already registered a `show_artifact`
|
|
141
|
+
* tool. Callers add it only when the agent lists `show_artifact` in `tools`,
|
|
142
|
+
* after the Recipe's own extensions.
|
|
143
|
+
*/
|
|
144
|
+
export declare function artifactViewerExtension(registrations?: RecipeExtensionRegistrationRegistry, options?: ArtifactViewerOptions): ExtensionFactory;
|
|
145
|
+
/** Whether the agent opted into the built-in viewer. */
|
|
146
|
+
export declare function wantsArtifactViewer(agentTools: readonly string[]): boolean;
|
|
147
|
+
export {};
|
|
148
|
+
//# sourceMappingURL=artifact-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer.d.ts","sourceRoot":"","sources":["../src/artifact-viewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAO5C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAE3E,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AACvD;kEACkE;AAClE,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAItF,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAEvF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAGpF;AAED,sEAAsE;AACtE,wBAA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