@hheei/pi-ext-ui 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/apply-patch-glyph.d.ts +10 -0
- package/dist/apply-patch-glyph.js +29 -0
- package/dist/apply-patch-preview.d.ts +30 -0
- package/dist/apply-patch-preview.js +89 -0
- package/dist/apply-patch-view.d.ts +47 -0
- package/dist/apply-patch-view.js +198 -0
- package/dist/collapsible-tool-frame.d.ts +1 -0
- package/dist/collapsible-tool-frame.js +1 -0
- package/dist/diff-view.d.ts +46 -0
- package/dist/diff-view.js +184 -0
- package/dist/extension.d.ts +2 -0
- package/dist/extension.js +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/renderer.d.ts +42 -0
- package/dist/renderer.js +1274 -0
- package/dist/tool-view.d.ts +53 -0
- package/dist/tool-view.js +270 -0
- package/dist/turn-copy.d.ts +11 -0
- package/dist/turn-copy.js +20 -0
- package/package.json +49 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type DiffHunk, type DiffLine, type DiffSource, type DiffStats, DiffView, type DiffViewOptions, diffStats, } from "./diff-view.js";
|
|
2
|
+
export { type CollapsibleToolRendererOptions, createCollapsibleToolRendererResolver, estimateStreamingTokens, type NestedCallRecord, registerCollapsibleToolRenderer, SPECIALIZED_TOOL_RENDERERS, type SpecializedToolRendererName, type ToolRenderContext, WEB_ACCESS_TOOLS, type WebAccessToolName, } from "./renderer.js";
|
|
3
|
+
export { CollapsibleToolFrame, type CollapsibleToolFrameOptions, createToolView, type FoldLevel, type RailColorToken, type RailSection, type ToolStatusKind, ToolView, type ToolViewCopySpec, type ToolViewHeaderSpec, type ToolViewSpec, transitionFoldLevel, } from "./tool-view.js";
|
|
4
|
+
export { formatTurnFlow, type TurnFlowData, type TurnToolCallSummary, } from "./turn-copy.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DiffView, diffStats, } from "./diff-view.js";
|
|
2
|
+
export { createCollapsibleToolRendererResolver, estimateStreamingTokens, registerCollapsibleToolRenderer, SPECIALIZED_TOOL_RENDERERS, WEB_ACCESS_TOOLS, } from "./renderer.js";
|
|
3
|
+
export { CollapsibleToolFrame, createToolView, ToolView, transitionFoldLevel, } from "./tool-view.js";
|
|
4
|
+
export { formatTurnFlow, } from "./turn-copy.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ExtensionAPI, ToolRendererResolver, ToolRenderers } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { type ToolStatusKind } from "./tool-view.js";
|
|
3
|
+
export type ToolRenderContext = Parameters<NonNullable<ToolRenderers["renderCall"]>>[2];
|
|
4
|
+
/** Tools with a pi-ext-ui-owned renderer. Other tools stay on Pi's renderer. */
|
|
5
|
+
export declare const SPECIALIZED_TOOL_RENDERERS: readonly ["edit", "write", "apply_patch", "python_eval", "codemode"];
|
|
6
|
+
export type SpecializedToolRendererName = (typeof SPECIALIZED_TOOL_RENDERERS)[number];
|
|
7
|
+
/** Web-access tools use the shared folding shell while retaining their native body renderer. */
|
|
8
|
+
export declare const WEB_ACCESS_TOOLS: readonly ["web_search", "web_fetch", "web_open"];
|
|
9
|
+
export type WebAccessToolName = (typeof WEB_ACCESS_TOOLS)[number];
|
|
10
|
+
export interface CollapsibleToolRendererOptions {
|
|
11
|
+
readonly tools?: readonly string[] | undefined;
|
|
12
|
+
readonly match?: ((toolName: string) => boolean) | undefined;
|
|
13
|
+
readonly catchAll?: boolean | undefined;
|
|
14
|
+
readonly defaultCollapsed?: boolean | undefined;
|
|
15
|
+
readonly copyToClipboard?: ((text: string) => Promise<void>) | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface NestedCallRecord {
|
|
18
|
+
readonly toolName: string;
|
|
19
|
+
readonly summary?: string | undefined;
|
|
20
|
+
readonly status?: "running" | "ok" | "error" | "cancelled" | undefined;
|
|
21
|
+
readonly isError?: boolean | undefined;
|
|
22
|
+
readonly isWarning?: boolean | undefined;
|
|
23
|
+
readonly durationMs?: number | undefined;
|
|
24
|
+
readonly cost?: number | undefined;
|
|
25
|
+
readonly error?: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
export declare function estimateStreamingTokens(args: unknown): number;
|
|
28
|
+
export declare function extractCodemodeHeaderFacts(args: unknown): string;
|
|
29
|
+
/** Compact nested-row result: a one-line summary plus the status it reports. */
|
|
30
|
+
interface InlinePresentation {
|
|
31
|
+
readonly summary: string;
|
|
32
|
+
readonly status: ToolStatusKind;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One compact nested summary for a file tool. Reports the delta only when the
|
|
36
|
+
* caller actually has result details; a codemode nested record keeps arguments
|
|
37
|
+
* alone, so it degrades to `<tool> <path>` instead of inventing counts.
|
|
38
|
+
*/
|
|
39
|
+
export declare function inlinePresentation(toolName: string, args: unknown, details: unknown, isError: boolean): InlinePresentation | undefined;
|
|
40
|
+
export declare function createCollapsibleToolRendererResolver(options?: CollapsibleToolRendererOptions): ToolRendererResolver;
|
|
41
|
+
export declare function registerCollapsibleToolRenderer(pi: ExtensionAPI, options?: CollapsibleToolRendererOptions): void;
|
|
42
|
+
export {};
|