@hheei/pi-ext-ui 0.2.0 → 0.3.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/extension.js +12 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/message-view.d.ts +15 -0
- package/dist/message-view.js +130 -0
- package/dist/nested-calls-view.js +24 -25
- package/dist/payload-parser.d.ts +3 -68
- package/dist/payload-parser.js +5 -279
- package/dist/renderer.d.ts +8 -2
- package/dist/renderer.js +72 -472
- package/package.json +6 -6
- package/dist/apply-patch-glyph.d.ts +0 -10
- package/dist/apply-patch-glyph.js +0 -29
- package/dist/apply-patch-preview.d.ts +0 -30
- package/dist/apply-patch-preview.js +0 -89
- package/dist/apply-patch-view.d.ts +0 -47
- package/dist/apply-patch-view.js +0 -198
package/dist/extension.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { messageViewPoint, registerExtensionHook, registerExtensionLifecycle, toolRendererPoint, } from "@hheei/pi-ext-core";
|
|
2
|
+
import { createMessageView } from "./message-view.js";
|
|
3
|
+
import { createOptionalToolRendererFactory, registerCollapsibleToolRenderer } from "./renderer.js";
|
|
2
4
|
export default function (pi) {
|
|
3
5
|
registerCollapsibleToolRenderer(pi);
|
|
6
|
+
registerExtensionLifecycle(pi, {
|
|
7
|
+
key: "@hheei/pi-ext-ui",
|
|
8
|
+
start(context) {
|
|
9
|
+
const toolRenderers = registerExtensionHook(pi, toolRendererPoint, createOptionalToolRendererFactory(pi));
|
|
10
|
+
context.resources.add("tool-renderer", () => toolRenderers.dispose());
|
|
11
|
+
const handle = registerExtensionHook(context.pi, messageViewPoint, createMessageView);
|
|
12
|
+
context.resources.add("message-view", () => handle.dispose());
|
|
13
|
+
},
|
|
14
|
+
});
|
|
4
15
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { type DiffHunk, type DiffLine, type DiffSource, type DiffStats, DiffView, type DiffViewOptions, diffStats, } from "./diff-view.js";
|
|
2
|
+
export { createMessageView, type MessageRows, type MessageTone, MessageView, type MessageViewHeader, type MessageViewSpec, } from "./message-view.js";
|
|
2
3
|
export { extractChildToolCopyText, NestedCallsView, type NestedCallsViewProps, } from "./nested-calls-view.js";
|
|
3
4
|
export { type CollapsibleToolRendererOptions, createCollapsibleToolRendererResolver, estimateStreamingTokens, inlinePresentation, type NestedCallRecord, registerCollapsibleToolRenderer, SPECIALIZED_TOOL_RENDERERS, type SpecializedToolRendererName, type ToolRenderContext, WEB_ACCESS_TOOLS, type WebAccessToolName, } from "./renderer.js";
|
|
4
5
|
export { type Collapsible, createToolView, type FoldLevel, formatStatusGlyph, formatToolHeaderText, isCollapsible, type RailColorToken, type RailSection, type ToolStatusKind, ToolView, type ToolViewCopySpec, type ToolViewHeaderSpec, type ToolViewSpec, transitionFoldLevel, } from "./tool-view.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { DiffView, diffStats, } from "./diff-view.js";
|
|
2
|
+
export { createMessageView, MessageView, } from "./message-view.js";
|
|
2
3
|
export { extractChildToolCopyText, NestedCallsView, } from "./nested-calls-view.js";
|
|
3
4
|
export { createCollapsibleToolRendererResolver, estimateStreamingTokens, inlinePresentation, registerCollapsibleToolRenderer, SPECIALIZED_TOOL_RENDERERS, WEB_ACCESS_TOOLS, } from "./renderer.js";
|
|
4
5
|
export { createToolView, formatStatusGlyph, formatToolHeaderText, isCollapsible, ToolView, transitionFoldLevel, } from "./tool-view.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Component, type TuiMouseEvent, type TuiMouseEventResult } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { MessageViewSpec } from "@hheei/pi-ext-core";
|
|
3
|
+
export type { MessageRows, MessageTone, MessageViewHeader, MessageViewSpec, } from "@hheei/pi-ext-core";
|
|
4
|
+
export declare function createMessageView(spec: MessageViewSpec): MessageView;
|
|
5
|
+
export declare class MessageView implements Component {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(spec: MessageViewSpec);
|
|
8
|
+
get expandable(): boolean;
|
|
9
|
+
/** What the user sees. Host ctrl+o wins over the remembered collapse. */
|
|
10
|
+
get expanded(): boolean;
|
|
11
|
+
toggle(): void;
|
|
12
|
+
render(width: number): string[];
|
|
13
|
+
invalidate(): void;
|
|
14
|
+
handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { truncateToWidth, } from "@earendil-works/pi-tui";
|
|
2
|
+
import { toContentRows, toSingleRow } from "./tool-view.js";
|
|
3
|
+
/**
|
|
4
|
+
* A transcript notice, not a tool execution.
|
|
5
|
+
*
|
|
6
|
+
* ToolView owns status, copy, rails, and the three-level fold. A message is a kind plus a
|
|
7
|
+
* summary, optional preview lines, and a body that opens in one step. Expansion is remembered
|
|
8
|
+
* on `stateHolder` by identity, so a host rebuild does not write a field into a session entry.
|
|
9
|
+
*/
|
|
10
|
+
const expansion = new WeakMap();
|
|
11
|
+
const truncate = (text, width) => truncateToWidth(text, width, "…");
|
|
12
|
+
function remembered(holder, fallback) {
|
|
13
|
+
if (holder === undefined)
|
|
14
|
+
return fallback;
|
|
15
|
+
return expansion.get(holder) ?? fallback;
|
|
16
|
+
}
|
|
17
|
+
function remember(holder, value) {
|
|
18
|
+
if (holder === undefined)
|
|
19
|
+
return;
|
|
20
|
+
expansion.set(holder, value);
|
|
21
|
+
}
|
|
22
|
+
function hasRows(source) {
|
|
23
|
+
if (source === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (typeof source === "string")
|
|
26
|
+
return source.trim() !== "";
|
|
27
|
+
if (Array.isArray(source))
|
|
28
|
+
return source.some((line) => line.trim() !== "");
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function isComponent(source) {
|
|
32
|
+
return typeof source !== "string" && !Array.isArray(source);
|
|
33
|
+
}
|
|
34
|
+
function layRows(source, width) {
|
|
35
|
+
if (source === undefined || !hasRows(source))
|
|
36
|
+
return [];
|
|
37
|
+
const inner = Math.max(1, width - 2);
|
|
38
|
+
const raw = isComponent(source)
|
|
39
|
+
? source.render(inner).flatMap((line) => toContentRows(line))
|
|
40
|
+
: (typeof source === "string" ? [source] : source).flatMap((line) => toContentRows(line));
|
|
41
|
+
return raw.map((line) => truncate(` ${line}`, width));
|
|
42
|
+
}
|
|
43
|
+
function invalidateRows(source) {
|
|
44
|
+
if (source !== undefined && isComponent(source))
|
|
45
|
+
source.invalidate();
|
|
46
|
+
}
|
|
47
|
+
export function createMessageView(spec) {
|
|
48
|
+
return new MessageView(spec);
|
|
49
|
+
}
|
|
50
|
+
export class MessageView {
|
|
51
|
+
#spec;
|
|
52
|
+
#localExpanded;
|
|
53
|
+
#lastWidth = 80;
|
|
54
|
+
#lastHeight = 0;
|
|
55
|
+
#cache;
|
|
56
|
+
constructor(spec) {
|
|
57
|
+
this.#spec = spec;
|
|
58
|
+
this.#localExpanded = remembered(spec.stateHolder, spec.defaultExpanded === true);
|
|
59
|
+
}
|
|
60
|
+
get expandable() {
|
|
61
|
+
return hasRows(this.#spec.body);
|
|
62
|
+
}
|
|
63
|
+
/** What the user sees. Host ctrl+o wins over the remembered collapse. */
|
|
64
|
+
get expanded() {
|
|
65
|
+
return this.expandable && (this.#spec.forcedExpanded === true || this.#localExpanded);
|
|
66
|
+
}
|
|
67
|
+
toggle() {
|
|
68
|
+
if (!this.expandable)
|
|
69
|
+
return;
|
|
70
|
+
const next = !this.expanded;
|
|
71
|
+
this.#localExpanded = next;
|
|
72
|
+
remember(this.#spec.stateHolder, next);
|
|
73
|
+
this.#cache = undefined;
|
|
74
|
+
this.#spec.invalidate?.();
|
|
75
|
+
}
|
|
76
|
+
render(width) {
|
|
77
|
+
const expanded = this.expanded;
|
|
78
|
+
if (this.#cache !== undefined &&
|
|
79
|
+
this.#cache.width === width &&
|
|
80
|
+
this.#cache.expanded === expanded) {
|
|
81
|
+
return this.#cache.lines;
|
|
82
|
+
}
|
|
83
|
+
const pad = Math.max(0, this.#spec.outputPad ?? 0);
|
|
84
|
+
const safeWidth = Math.max(1, width - pad * 2);
|
|
85
|
+
this.#lastWidth = width;
|
|
86
|
+
const leftPad = pad > 0 ? " ".repeat(pad) : "";
|
|
87
|
+
const lines = [
|
|
88
|
+
this.#header(safeWidth, expanded),
|
|
89
|
+
...layRows(this.#spec.preview, safeWidth),
|
|
90
|
+
...(expanded ? layRows(this.#spec.body, safeWidth) : []),
|
|
91
|
+
].map((line) => (leftPad === "" ? line : `${leftPad}${line}`));
|
|
92
|
+
this.#lastHeight = lines.length;
|
|
93
|
+
this.#cache = { width, expanded, lines };
|
|
94
|
+
return lines;
|
|
95
|
+
}
|
|
96
|
+
invalidate() {
|
|
97
|
+
this.#cache = undefined;
|
|
98
|
+
invalidateRows(this.#spec.preview);
|
|
99
|
+
invalidateRows(this.#spec.body);
|
|
100
|
+
}
|
|
101
|
+
handleMouse(event) {
|
|
102
|
+
if (!this.expandable ||
|
|
103
|
+
event.type === "wheel" ||
|
|
104
|
+
event.type !== "click" ||
|
|
105
|
+
event.button !== "left") {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
const effectiveWidth = event.width > 0 ? event.width : this.#lastWidth;
|
|
109
|
+
const pad = Math.max(0, this.#spec.outputPad ?? 0);
|
|
110
|
+
const innerX = event.x - pad;
|
|
111
|
+
const innerWidth = Math.max(1, effectiveWidth - pad * 2);
|
|
112
|
+
if (innerX < 0 || innerX >= innerWidth)
|
|
113
|
+
return undefined;
|
|
114
|
+
if (this.#lastHeight > 0 && (event.y < 0 || event.y >= this.#lastHeight))
|
|
115
|
+
return undefined;
|
|
116
|
+
if (event.y !== 0)
|
|
117
|
+
return undefined;
|
|
118
|
+
this.toggle();
|
|
119
|
+
return { handled: true, render: true };
|
|
120
|
+
}
|
|
121
|
+
#header(width, expanded) {
|
|
122
|
+
const { theme, header } = this.#spec;
|
|
123
|
+
const kind = theme.fg("dim", toSingleRow(header.kind));
|
|
124
|
+
const summaryRaw = header.summary === undefined ? "" : toSingleRow(header.summary);
|
|
125
|
+
const summary = summaryRaw === "" ? "" : theme.fg(header.tone ?? "dim", summaryRaw);
|
|
126
|
+
const label = summary === "" ? kind : `${kind}${theme.fg("dim", " · ")}${summary}`;
|
|
127
|
+
const pin = this.expandable ? `${theme.fg("dim", expanded ? "▾" : "▸")} ` : "";
|
|
128
|
+
return truncate(`${pin}${label}`, width);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -15,14 +15,9 @@ export function extractChildToolCopyText(call, full) {
|
|
|
15
15
|
if (toolName === "write" && isRecord(args) && typeof args.content === "string") {
|
|
16
16
|
return args.content;
|
|
17
17
|
}
|
|
18
|
-
if (toolName === "apply_patch" && isRecord(args) && typeof args.patch === "string") {
|
|
19
|
-
return args.patch;
|
|
20
|
-
}
|
|
21
18
|
const heavyCommand = toolName === "bash" && isRecord(args) && typeof args.command === "string"
|
|
22
19
|
? args.command
|
|
23
|
-
:
|
|
24
|
-
isRecord(args) &&
|
|
25
|
-
typeof args.code === "string"
|
|
20
|
+
: toolName === "codemode" && isRecord(args) && typeof args.code === "string"
|
|
26
21
|
? args.code
|
|
27
22
|
: undefined;
|
|
28
23
|
if (heavyCommand !== undefined && heavyCommand.trim() !== "") {
|
|
@@ -31,17 +26,6 @@ export function extractChildToolCopyText(call, full) {
|
|
|
31
26
|
const output = resultText(result);
|
|
32
27
|
return output === undefined ? heavyCommand : `${heavyCommand}\n---\n${output}`;
|
|
33
28
|
}
|
|
34
|
-
if (toolName === "edit" && result && isRecord(result.details)) {
|
|
35
|
-
const editView = result.details.__piExtToolsEditView;
|
|
36
|
-
if (isRecord(editView) && Array.isArray(editView.ops)) {
|
|
37
|
-
const opsText = editView.ops
|
|
38
|
-
.map((op) => isRecord(op) && typeof op.newContent === "string" ? op.newContent : "")
|
|
39
|
-
.filter(Boolean)
|
|
40
|
-
.join("\n---\n");
|
|
41
|
-
if (opsText)
|
|
42
|
-
return opsText;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
29
|
if (result && Array.isArray(result.content)) {
|
|
46
30
|
const texts = result.content
|
|
47
31
|
.filter((c) => isRecord(c) && c.type === "text" && typeof c.text === "string")
|
|
@@ -172,12 +156,31 @@ export class NestedCallsView {
|
|
|
172
156
|
state[NESTED_CALLS_EXPANDED_KEY] = record;
|
|
173
157
|
}
|
|
174
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* The render context of one nested call. A nested call has no host-mounted component, so its
|
|
161
|
+
* context is the parent's with the child's own args, id, duration and failure state.
|
|
162
|
+
*/
|
|
163
|
+
#callContext(call) {
|
|
164
|
+
const { context } = this.#props;
|
|
165
|
+
const toolCallId = "toolCallId" in call && typeof call.toolCallId === "string"
|
|
166
|
+
? call.toolCallId
|
|
167
|
+
: context.toolCallId;
|
|
168
|
+
return {
|
|
169
|
+
...context,
|
|
170
|
+
args: "args" in call ? call.args : undefined,
|
|
171
|
+
toolCallId,
|
|
172
|
+
durationMs: call.durationMs,
|
|
173
|
+
isError: Boolean(call.isError || ("status" in call && call.status === "error")),
|
|
174
|
+
isPartial: false,
|
|
175
|
+
argsComplete: true,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
175
178
|
#triggerCopy(callIndex, full) {
|
|
176
179
|
const call = this.#props.calls[callIndex];
|
|
177
180
|
if (!call)
|
|
178
181
|
return;
|
|
179
182
|
const provider = this.#props.resolvePresentation?.(call.toolName);
|
|
180
|
-
const presentation = provider?.("args" in call ? call.args : undefined, "result" in call ? call.result : undefined, this.#props.theme);
|
|
183
|
+
const presentation = provider?.("args" in call ? call.args : undefined, "result" in call ? call.result : undefined, this.#props.theme, this.#callContext(call));
|
|
181
184
|
const text = stripTerminalSequences((full ? presentation?.copy?.full : presentation?.copy?.primary) ??
|
|
182
185
|
extractChildToolCopyText(call, full));
|
|
183
186
|
if (!text)
|
|
@@ -239,7 +242,7 @@ export class NestedCallsView {
|
|
|
239
242
|
const inline = inlinePresentation(toolName, rawArgs ?? rawSummary, "result" in call ? call.result?.details : undefined, isError);
|
|
240
243
|
const argText = typeof rawArgs === "string" ? rawArgs : typeof rawSummary === "string" ? rawSummary : "";
|
|
241
244
|
const provider = this.#props.resolvePresentation?.(toolName);
|
|
242
|
-
const presentation = provider?.(rawArgs, "result" in call ? call.result : undefined, theme);
|
|
245
|
+
const presentation = provider?.(rawArgs, "result" in call ? call.result : undefined, theme, this.#callContext(call));
|
|
243
246
|
// The child row is the child's own header minus the fold pin, so it carries the same token
|
|
244
247
|
// assignment as the row the same call would draw at top level.
|
|
245
248
|
const childSummary = stripTerminalSequences(presentation?.summary ?? inline?.summary ?? argText);
|
|
@@ -288,7 +291,7 @@ export class NestedCallsView {
|
|
|
288
291
|
return lines;
|
|
289
292
|
}
|
|
290
293
|
#renderChildBody(call, width, expansionLevel = 1) {
|
|
291
|
-
const { theme,
|
|
294
|
+
const { theme, resolveChildRenderer } = this.#props;
|
|
292
295
|
const toolName = "toolName" in call ? call.toolName : call.name;
|
|
293
296
|
const result = "result" in call ? call.result : undefined;
|
|
294
297
|
const args = "args" in call ? call.args : undefined;
|
|
@@ -297,11 +300,7 @@ export class NestedCallsView {
|
|
|
297
300
|
if (renderer?.renderResult) {
|
|
298
301
|
try {
|
|
299
302
|
const childContext = {
|
|
300
|
-
...
|
|
301
|
-
toolCallId: "toolCallId" in call ? call.toolCallId : context.toolCallId,
|
|
302
|
-
args,
|
|
303
|
-
durationMs: call.durationMs,
|
|
304
|
-
isError: Boolean(call.isError || ("status" in call && call.status === "error")),
|
|
303
|
+
...this.#callContext(call),
|
|
305
304
|
state: undefined,
|
|
306
305
|
};
|
|
307
306
|
const comp = renderer.renderResult(result, { expanded: expansionLevel === 2, isPartial: false }, theme, childContext);
|
package/dist/payload-parser.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type
|
|
1
|
+
import { type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { type DiffSource } from "./diff-view.js";
|
|
3
3
|
import type { ToolStatusKind } from "./tool-view.js";
|
|
4
|
-
export declare const APPLY_PATCH_TOOL_NAME = "apply_patch";
|
|
5
|
-
export declare const PYTHON_EVAL_TOOL_NAME = "python_eval";
|
|
6
|
-
export declare const PYTHON_EVAL_DETAILS_FORMAT = "pi-ext-tools-python-eval";
|
|
7
4
|
export declare const EDIT_TOOL_NAME = "edit";
|
|
8
5
|
export declare const WRITE_TOOL_NAME = "write";
|
|
9
|
-
export declare const EDIT_VIEW_KEY = "__piExtToolsEditView";
|
|
10
|
-
export declare const WRITE_VIEW_KEY = "__piExtToolsWriteView";
|
|
11
6
|
export declare const CODEMODE_OPTIONS_PREFIX = "// @options:";
|
|
12
7
|
export declare const CODEMODE_SCRIPT_HEADER: RegExp;
|
|
13
8
|
export interface NestedCallRecord {
|
|
@@ -43,78 +38,18 @@ export declare function resolveContainerStatus(params: {
|
|
|
43
38
|
readonly selfFailed: boolean;
|
|
44
39
|
}): ToolStatusKind;
|
|
45
40
|
export declare function toolPath(args: unknown): string;
|
|
46
|
-
export declare function editPath(args: unknown): string;
|
|
47
|
-
export declare function numericField(value: unknown, key: string): number | undefined;
|
|
48
|
-
export type WritePresentation = {
|
|
49
|
-
readonly kind: "diff";
|
|
50
|
-
readonly source: DiffSource;
|
|
51
|
-
readonly added: number;
|
|
52
|
-
readonly removed: number;
|
|
53
|
-
} | {
|
|
54
|
-
readonly kind: "content";
|
|
55
|
-
readonly label: string;
|
|
56
|
-
readonly content: string;
|
|
57
|
-
} | {
|
|
58
|
-
readonly kind: "noChange";
|
|
59
|
-
};
|
|
60
|
-
export declare function writeStoredDiff(lines: readonly unknown[]): DiffSource | undefined;
|
|
61
|
-
/** Uses only the baseline and content already stored by the write tool. */
|
|
62
|
-
export declare function writePresentation(args: unknown, details: unknown): WritePresentation | undefined;
|
|
63
41
|
/** Compact nested-row result: a one-line summary plus the status it reports. */
|
|
64
42
|
export interface InlinePresentation {
|
|
65
43
|
readonly summary: string;
|
|
66
44
|
readonly status: ToolStatusKind;
|
|
67
45
|
}
|
|
68
|
-
export declare function fileToolPresentation(toolName: string, args: unknown,
|
|
46
|
+
export declare function fileToolPresentation(toolName: string, args: unknown, _details: unknown, isError: boolean): InlinePresentation | undefined;
|
|
69
47
|
/** Pi native edit persists a unified patch plus the same change as a numbered display diff. */
|
|
70
48
|
export declare function editDiffSource(details: unknown): DiffSource | undefined;
|
|
71
49
|
export declare function displayDiffSource(diff: string): DiffSource | undefined;
|
|
72
|
-
export declare function editViewSource(view: unknown): DiffSource | undefined;
|
|
73
|
-
export declare function editViewHunks(view: unknown): readonly {
|
|
74
|
-
readonly lines: readonly DiffLine[];
|
|
75
|
-
}[];
|
|
76
|
-
export declare function hunksForEditOp(op: Record<string, unknown>): readonly {
|
|
77
|
-
readonly lines: readonly DiffLine[];
|
|
78
|
-
}[];
|
|
79
|
-
export declare function splitFragment(text: string): readonly string[];
|
|
80
|
-
/** Line LCS of one stored before/after fragment. No file context is invented. */
|
|
81
|
-
export declare function lineHunks(before: string, after: string, startLine: number): readonly {
|
|
82
|
-
readonly lines: readonly DiffLine[];
|
|
83
|
-
}[];
|
|
84
|
-
export declare function patchTextForCopy(details: unknown): string | undefined;
|
|
85
|
-
export declare function patchSummary(files: number, added: number, removed: number): string;
|
|
86
50
|
/**
|
|
87
51
|
* One compact nested summary for a tool call. Adopts the tool's standard collapsed
|
|
88
52
|
* single-line format when recognized, degrading to undefined so callers can use
|
|
89
53
|
* the default argument rendering.
|
|
90
54
|
*/
|
|
91
55
|
export declare function inlinePresentation(toolName: string, args: unknown, details: unknown, isError: boolean): InlinePresentation | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* One row of the eval cell transcript: printed text, display value, nested call, the final
|
|
94
|
-
* value, or the kernel's namespace report.
|
|
95
|
-
*/
|
|
96
|
-
export type EvalRow = {
|
|
97
|
-
readonly kind: "text";
|
|
98
|
-
readonly text: string;
|
|
99
|
-
} | {
|
|
100
|
-
readonly kind: "display";
|
|
101
|
-
readonly text: string;
|
|
102
|
-
} | {
|
|
103
|
-
readonly kind: "tool";
|
|
104
|
-
readonly name: string;
|
|
105
|
-
readonly args: unknown;
|
|
106
|
-
readonly durationMs: number | undefined;
|
|
107
|
-
readonly error: string | undefined;
|
|
108
|
-
} | {
|
|
109
|
-
readonly kind: "result";
|
|
110
|
-
readonly text: string;
|
|
111
|
-
} | {
|
|
112
|
-
readonly kind: "state";
|
|
113
|
-
readonly text: string;
|
|
114
|
-
};
|
|
115
|
-
export interface EvalFacts {
|
|
116
|
-
readonly rows: readonly EvalRow[];
|
|
117
|
-
readonly error: string | undefined;
|
|
118
|
-
}
|
|
119
|
-
/** Reads only the persisted `pi-ext-tools-eval` details; other shapes degrade to plain output. */
|
|
120
|
-
export declare function pythonEvalFacts(details: unknown): EvalFacts | undefined;
|