@nicomatt69/streamdown-tty 2.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/CHANGELOG.md +113 -0
- package/LICENSE +21 -0
- package/README.md +287 -0
- package/dist/adapters/index.d.ts +185 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/ai-sdk-adapter.d.ts +113 -0
- package/dist/ai-sdk-adapter.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/core/index.d.ts +209 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/math-renderer.d.ts +40 -0
- package/dist/core/math-renderer.d.ts.map +1 -0
- package/dist/core/parser.d.ts +139 -0
- package/dist/core/parser.d.ts.map +1 -0
- package/dist/core/protocol.d.ts +319 -0
- package/dist/core/protocol.d.ts.map +1 -0
- package/dist/core/remend-tty.d.ts +68 -0
- package/dist/core/remend-tty.d.ts.map +1 -0
- package/dist/core/renderer.d.ts +286 -0
- package/dist/core/renderer.d.ts.map +1 -0
- package/dist/errors.d.ts +131 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/events.d.ts +185 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12921 -0
- package/dist/parser/streaming-parser.d.ts +81 -0
- package/dist/parser/streaming-parser.d.ts.map +1 -0
- package/dist/performance.d.ts +139 -0
- package/dist/performance.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/plugin-system-inline.d.ts +116 -0
- package/dist/plugins/plugin-system-inline.d.ts.map +1 -0
- package/dist/plugins/plugin-system.d.ts +65 -0
- package/dist/plugins/plugin-system.d.ts.map +1 -0
- package/dist/plugins/rehype/harden.d.ts +15 -0
- package/dist/plugins/rehype/harden.d.ts.map +1 -0
- package/dist/plugins/rehype/index.d.ts +5 -0
- package/dist/plugins/rehype/index.d.ts.map +1 -0
- package/dist/plugins/remark/index.d.ts +6 -0
- package/dist/plugins/remark/index.d.ts.map +1 -0
- package/dist/plugins/remark/math.d.ts +7 -0
- package/dist/plugins/remark/math.d.ts.map +1 -0
- package/dist/plugins/remark/mermaid.d.ts +7 -0
- package/dist/plugins/remark/mermaid.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +72 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/renderer/ansi-renderer.d.ts +76 -0
- package/dist/renderer/ansi-renderer.d.ts.map +1 -0
- package/dist/renderers/index.d.ts +7 -0
- package/dist/renderers/index.d.ts.map +1 -0
- package/dist/renderers/math-renderer.d.ts +49 -0
- package/dist/renderers/math-renderer.d.ts.map +1 -0
- package/dist/renderers/mermaid-ascii.d.ts +14 -0
- package/dist/renderers/mermaid-ascii.d.ts.map +1 -0
- package/dist/renderers/mermaid-renderer.d.ts +79 -0
- package/dist/renderers/mermaid-renderer.d.ts.map +1 -0
- package/dist/renderers/shiki-ansi.d.ts +48 -0
- package/dist/renderers/shiki-ansi.d.ts.map +1 -0
- package/dist/renderers/table-ascii.d.ts +30 -0
- package/dist/renderers/table-ascii.d.ts.map +1 -0
- package/dist/renderers/unicode-math.d.ts +29 -0
- package/dist/renderers/unicode-math.d.ts.map +1 -0
- package/dist/security/ansi-sanitizer.d.ts +71 -0
- package/dist/security/ansi-sanitizer.d.ts.map +1 -0
- package/dist/security/chunk-processor.d.ts +81 -0
- package/dist/security/chunk-processor.d.ts.map +1 -0
- package/dist/security/index.d.ts +6 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/input-validator.d.ts +55 -0
- package/dist/security/input-validator.d.ts.map +1 -0
- package/dist/stream-protocol.d.ts +61 -0
- package/dist/stream-protocol.d.ts.map +1 -0
- package/dist/streamdown-compat.d.ts +72 -0
- package/dist/streamdown-compat.d.ts.map +1 -0
- package/dist/streaming/stream-stats.d.ts +97 -0
- package/dist/streaming/stream-stats.d.ts.map +1 -0
- package/dist/streaming-integration.d.ts +71 -0
- package/dist/streaming-integration.d.ts.map +1 -0
- package/dist/themes/index.d.ts +59 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +168 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugin-types.d.ts +5 -0
- package/dist/types/plugin-types.d.ts.map +1 -0
- package/dist/types/stream-events.d.ts +71 -0
- package/dist/types/stream-events.d.ts.map +1 -0
- package/dist/utils/blessed-syntax-highlighter.d.ts +124 -0
- package/dist/utils/blessed-syntax-highlighter.d.ts.map +1 -0
- package/dist/utils/enhanced-table-renderer.d.ts +77 -0
- package/dist/utils/enhanced-table-renderer.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +100 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/math-unicode-renderer.d.ts +38 -0
- package/dist/utils/math-unicode-renderer.d.ts.map +1 -0
- package/dist/utils/mermaid-ascii-renderer.d.ts +20 -0
- package/dist/utils/mermaid-ascii-renderer.d.ts.map +1 -0
- package/dist/utils/mermaid-ascii.d.ts +53 -0
- package/dist/utils/mermaid-ascii.d.ts.map +1 -0
- package/dist/utils/shiki-ansi-renderer.d.ts +29 -0
- package/dist/utils/shiki-ansi-renderer.d.ts.map +1 -0
- package/dist/utils/syntax-highlighter.d.ts +87 -0
- package/dist/utils/syntax-highlighter.d.ts.map +1 -0
- package/dist/utils/table-formatter-inline.d.ts +37 -0
- package/dist/utils/table-formatter-inline.d.ts.map +1 -0
- package/dist/utils/table.d.ts +35 -0
- package/dist/utils/table.d.ts.map +1 -0
- package/dist/widgets/stream-indicator.d.ts +130 -0
- package/dist/widgets/stream-indicator.d.ts.map +1 -0
- package/package.json +129 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export interface TableData {
|
|
2
|
+
headers: string[];
|
|
3
|
+
rows: string[][];
|
|
4
|
+
align?: ('left' | 'center' | 'right')[];
|
|
5
|
+
}
|
|
6
|
+
export interface ChartData {
|
|
7
|
+
values: number[];
|
|
8
|
+
labels?: string[];
|
|
9
|
+
config?: {
|
|
10
|
+
height?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
colors?: string[];
|
|
13
|
+
format?: (x: number, i: number) => string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Enhanced table and chart renderer using tty-table and asciichart
|
|
18
|
+
*/
|
|
19
|
+
export declare class EnhancedTableRenderer {
|
|
20
|
+
/**
|
|
21
|
+
* Render a table using tty-table
|
|
22
|
+
*/
|
|
23
|
+
static renderTable(data: TableData, options?: {
|
|
24
|
+
borderStyle?: 'solid' | 'dashed' | 'none';
|
|
25
|
+
headerAlign?: 'left' | 'center' | 'right';
|
|
26
|
+
compact?: boolean;
|
|
27
|
+
width?: number;
|
|
28
|
+
}): string;
|
|
29
|
+
/**
|
|
30
|
+
* Render a line chart using asciichart
|
|
31
|
+
*/
|
|
32
|
+
static renderChart(data: ChartData): string;
|
|
33
|
+
/**
|
|
34
|
+
* Render multiple data series as a chart
|
|
35
|
+
*/
|
|
36
|
+
static renderMultiChart(datasets: {
|
|
37
|
+
label: string;
|
|
38
|
+
values: number[];
|
|
39
|
+
color?: string;
|
|
40
|
+
}[]): string;
|
|
41
|
+
/**
|
|
42
|
+
* Auto-detect if data looks like chart data
|
|
43
|
+
*/
|
|
44
|
+
static isChartData(content: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Auto-detect if content is table data
|
|
47
|
+
*/
|
|
48
|
+
static isTableData(content: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Parse markdown table to TableData
|
|
51
|
+
*/
|
|
52
|
+
static parseMarkdownTable(markdown: string): TableData | null;
|
|
53
|
+
/**
|
|
54
|
+
* Parse CSV data to chart data
|
|
55
|
+
*/
|
|
56
|
+
static parseCSVToChart(csv: string): ChartData | null;
|
|
57
|
+
/**
|
|
58
|
+
* Convert table corners to rounded Unicode characters
|
|
59
|
+
*/
|
|
60
|
+
private static convertToRoundedCorners;
|
|
61
|
+
/**
|
|
62
|
+
* Fallback table renderer
|
|
63
|
+
*/
|
|
64
|
+
private static renderFallbackTable;
|
|
65
|
+
/**
|
|
66
|
+
* Fallback chart renderer
|
|
67
|
+
*/
|
|
68
|
+
private static renderFallbackChart;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Convenience functions
|
|
72
|
+
*/
|
|
73
|
+
export declare function renderTable(data: TableData, options?: any): string;
|
|
74
|
+
export declare function renderChart(data: ChartData): string;
|
|
75
|
+
export declare function parseMarkdownTable(markdown: string): TableData | null;
|
|
76
|
+
export declare function parseCSVToChart(csv: string): ChartData | null;
|
|
77
|
+
//# sourceMappingURL=enhanced-table-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhanced-table-renderer.d.ts","sourceRoot":"","sources":["../../src/utils/enhanced-table-renderer.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;KAC3C,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,qBAAqB;IAChC;;OAEG;IACH,MAAM,CAAC,WAAW,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,GAAG,IAAI,CAErE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAE7D"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI color codes for terminal output
|
|
3
|
+
*/
|
|
4
|
+
export declare const colors: {
|
|
5
|
+
black: string;
|
|
6
|
+
red: string;
|
|
7
|
+
green: string;
|
|
8
|
+
yellow: string;
|
|
9
|
+
blue: string;
|
|
10
|
+
magenta: string;
|
|
11
|
+
cyan: string;
|
|
12
|
+
white: string;
|
|
13
|
+
gray: string;
|
|
14
|
+
brightRed: string;
|
|
15
|
+
brightGreen: string;
|
|
16
|
+
brightYellow: string;
|
|
17
|
+
brightBlue: string;
|
|
18
|
+
brightMagenta: string;
|
|
19
|
+
brightCyan: string;
|
|
20
|
+
brightWhite: string;
|
|
21
|
+
bgBlack: string;
|
|
22
|
+
bgRed: string;
|
|
23
|
+
bgGreen: string;
|
|
24
|
+
bgYellow: string;
|
|
25
|
+
bgBlue: string;
|
|
26
|
+
bgMagenta: string;
|
|
27
|
+
bgCyan: string;
|
|
28
|
+
bgWhite: string;
|
|
29
|
+
reset: string;
|
|
30
|
+
bold: string;
|
|
31
|
+
dim: string;
|
|
32
|
+
italic: string;
|
|
33
|
+
underline: string;
|
|
34
|
+
inverse: string;
|
|
35
|
+
hidden: string;
|
|
36
|
+
strikethrough: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Colorize text with ANSI codes
|
|
40
|
+
*/
|
|
41
|
+
export declare function colorize(text: string, color: keyof typeof colors): string;
|
|
42
|
+
/**
|
|
43
|
+
* Apply multiple styles to text
|
|
44
|
+
*/
|
|
45
|
+
export declare function style(text: string, styles: Array<keyof typeof colors>): string;
|
|
46
|
+
/**
|
|
47
|
+
* Strip ANSI codes from text
|
|
48
|
+
*/
|
|
49
|
+
export declare function stripAnsi(text: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Get visual length of text (accounting for ANSI codes)
|
|
52
|
+
*/
|
|
53
|
+
export declare function visualLength(text: string): number;
|
|
54
|
+
/**
|
|
55
|
+
* Pad text to specified width
|
|
56
|
+
*/
|
|
57
|
+
export declare function pad(text: string, width: number, align?: 'left' | 'center' | 'right'): string;
|
|
58
|
+
/**
|
|
59
|
+
* Truncate text to specified width with ellipsis
|
|
60
|
+
*/
|
|
61
|
+
export declare function truncate(text: string, width: number, ellipsis?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Wrap text to specified width
|
|
64
|
+
*/
|
|
65
|
+
export declare function wordWrap(text: string, width: number): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Create a horizontal line
|
|
68
|
+
*/
|
|
69
|
+
export declare function horizontalLine(width: number, char?: string, color?: keyof typeof colors): string;
|
|
70
|
+
/**
|
|
71
|
+
* Create a box around text
|
|
72
|
+
*/
|
|
73
|
+
export declare function box(text: string, options?: {
|
|
74
|
+
width?: number;
|
|
75
|
+
padding?: number;
|
|
76
|
+
title?: string;
|
|
77
|
+
borderColor?: keyof typeof colors;
|
|
78
|
+
}): string;
|
|
79
|
+
/**
|
|
80
|
+
* Indent text
|
|
81
|
+
*/
|
|
82
|
+
export declare function indent(text: string, spaces: number): string;
|
|
83
|
+
/**
|
|
84
|
+
* Create a progress bar
|
|
85
|
+
*/
|
|
86
|
+
export declare function progressBar(current: number, total: number, width?: number, options?: {
|
|
87
|
+
showPercent?: boolean;
|
|
88
|
+
completeChar?: string;
|
|
89
|
+
incompleteChar?: string;
|
|
90
|
+
color?: keyof typeof colors;
|
|
91
|
+
}): string;
|
|
92
|
+
/**
|
|
93
|
+
* Format bytes to human readable
|
|
94
|
+
*/
|
|
95
|
+
export declare function formatBytes(bytes: number, decimals?: number): string;
|
|
96
|
+
/**
|
|
97
|
+
* Format duration to human readable
|
|
98
|
+
*/
|
|
99
|
+
export declare function formatDuration(ms: number): string;
|
|
100
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@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KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC;CAC9B,GACL,MAAM,CA+BR;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,MAAW,EAClB,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC;CACxB,GACL,MAAM,CAwBR;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CAQvE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LaTeX to Unicode Math Renderer
|
|
3
|
+
* Converts LaTeX math expressions to beautiful Unicode representations
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Render LaTeX expression to Unicode inline format
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderMathToUnicode(latex: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Render math in block format with box
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderMathBlock(latex: string, options?: {
|
|
13
|
+
width?: number;
|
|
14
|
+
boxStyle?: 'simple' | 'rounded';
|
|
15
|
+
}): string;
|
|
16
|
+
/**
|
|
17
|
+
* Detect if text contains LaTeX math
|
|
18
|
+
*/
|
|
19
|
+
export declare function containsMath(text: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Extract math expressions from text
|
|
22
|
+
*/
|
|
23
|
+
export interface MathMatch {
|
|
24
|
+
type: 'inline' | 'block';
|
|
25
|
+
content: string;
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function extractMath(text: string): MathMatch[];
|
|
30
|
+
/**
|
|
31
|
+
* Replace math in text with rendered Unicode
|
|
32
|
+
*/
|
|
33
|
+
export declare function replaceMathInText(text: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Format math expression with pretty printing
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatMathExpression(latex: string): string;
|
|
38
|
+
//# sourceMappingURL=math-unicode-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-unicode-renderer.d.ts","sourceRoot":"","sources":["../../src/utils/math-unicode-renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyMH;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAwDzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,GAC5D,MAAM,CA6BR;AA4BD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKlD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CA+CrD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAwBtD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAW1D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid to ASCII Art Renderer
|
|
3
|
+
* Converts Mermaid diagram syntax to beautiful ASCII art
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Main rendering function
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderMermaidToASCII(mermaidCode: string, options?: {
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
boxStyle?: 'simple' | 'rounded';
|
|
11
|
+
}): string;
|
|
12
|
+
/**
|
|
13
|
+
* Detect if code is Mermaid syntax
|
|
14
|
+
*/
|
|
15
|
+
export declare function isMermaidCode(code: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Format mermaid code for better readability
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatMermaidCode(code: string): string;
|
|
20
|
+
//# sourceMappingURL=mermaid-ascii-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid-ascii-renderer.d.ts","sourceRoot":"","sources":["../../src/utils/mermaid-ascii-renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmUH;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,GAC/D,MAAM,CAuBR;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAoBnD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAStD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface MermaidASCIIOptions {
|
|
2
|
+
paddingX?: number;
|
|
3
|
+
paddingY?: number;
|
|
4
|
+
borderPadding?: number;
|
|
5
|
+
ascii?: boolean;
|
|
6
|
+
coords?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Wrapper for mermaid-ascii binary integration
|
|
10
|
+
* Converts Mermaid diagrams to ASCII art using the external mermaid-ascii tool
|
|
11
|
+
*/
|
|
12
|
+
export declare class MermaidASCIIWrapper {
|
|
13
|
+
private binaryPath;
|
|
14
|
+
private tempDir;
|
|
15
|
+
constructor(binaryPath?: string);
|
|
16
|
+
/**
|
|
17
|
+
* Convert mermaid code to ASCII diagram
|
|
18
|
+
*/
|
|
19
|
+
convertToASCII(mermaidCode: string, options?: MermaidASCIIOptions): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Build command line arguments for mermaid-ascii
|
|
22
|
+
*/
|
|
23
|
+
private buildCommandArgs;
|
|
24
|
+
/**
|
|
25
|
+
* Check if mermaid-ascii binary is available
|
|
26
|
+
*/
|
|
27
|
+
isBinaryAvailable(): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Generate fallback ASCII diagram when mermaid-ascii is not available
|
|
30
|
+
*/
|
|
31
|
+
private getFallbackDiagram;
|
|
32
|
+
/**
|
|
33
|
+
* Check if content looks like a mermaid diagram
|
|
34
|
+
*/
|
|
35
|
+
static isMermaidCode(content: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Extract mermaid code from markdown code block
|
|
38
|
+
*/
|
|
39
|
+
static extractMermaidFromMarkdown(markdown: string): string | null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Singleton instance with default settings
|
|
43
|
+
*/
|
|
44
|
+
export declare const mermaidASCII: MermaidASCIIWrapper;
|
|
45
|
+
/**
|
|
46
|
+
* Quick conversion function for mermaid code
|
|
47
|
+
*/
|
|
48
|
+
export declare function convertMermaidToASCII(mermaidCode: string, options?: MermaidASCIIOptions): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Check if mermaid-ascii binary is available on the system
|
|
51
|
+
*/
|
|
52
|
+
export declare function isMermaidASCIIAvailable(): Promise<boolean>;
|
|
53
|
+
//# sourceMappingURL=mermaid-ascii.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid-ascii.d.ts","sourceRoot":"","sources":["../../src/utils/mermaid-ascii.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAS;gBAEZ,UAAU,CAAC,EAAE,MAAM;IAY/B;;OAEG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IA6C7F;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA0BxB;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAS3C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAuB9C;;OAEG;IACH,MAAM,CAAC,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAWnE;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,qBAA4B,CAAC;AAEtD;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEhE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Highlight code using Shiki with ANSI output
|
|
3
|
+
*/
|
|
4
|
+
export declare function highlightCodeWithShiki(code: string, lang?: string, theme?: string): Promise<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Get ANSI theme from Shiki theme name
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAnsiThemeColors(theme: string): Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Format code with syntax highlighting for terminal output
|
|
11
|
+
* Returns ready-to-display ANSI string
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatCodeForTerminal(code: string, lang?: string, options?: {
|
|
14
|
+
theme?: 'nord' | 'github-light' | 'github-dark' | 'one-dark-pro' | 'dracula';
|
|
15
|
+
lineNumbers?: boolean;
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
}): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Clear Shiki cache (for testing or memory pressure)
|
|
20
|
+
*/
|
|
21
|
+
export declare function clearShikiCache(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Get cache stats
|
|
24
|
+
*/
|
|
25
|
+
export declare function getShikiCacheStats(): {
|
|
26
|
+
size: number;
|
|
27
|
+
keys: string[];
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=shiki-ansi-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki-ansi-renderer.d.ts","sourceRoot":"","sources":["../../src/utils/shiki-ansi-renderer.ts"],"names":[],"mappings":"AA2HA;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAe,EACrB,KAAK,GAAE,MAAe,GACrB,OAAO,CAAC,MAAM,CAAC,CA6BjB;AA0FD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmDxE;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAe,EACrB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,SAAS,CAAC;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAAC,MAAM,CAAC,CAejB;AA8ED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;GAEG;AACH,wBAAgB,kBAAkB;;;EAKjC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI-based syntax highlighting for terminal output
|
|
3
|
+
* Uses standard ANSI color codes for highlighting paths, keywords, and other elements
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* ANSI color codes for syntax highlighting
|
|
7
|
+
*/
|
|
8
|
+
export declare const syntaxColors: {
|
|
9
|
+
path: string;
|
|
10
|
+
lineNumber: string;
|
|
11
|
+
keyword: string;
|
|
12
|
+
string: string;
|
|
13
|
+
number: string;
|
|
14
|
+
comment: string;
|
|
15
|
+
title: string;
|
|
16
|
+
error: string;
|
|
17
|
+
success: string;
|
|
18
|
+
warning: string;
|
|
19
|
+
codeBlock: string;
|
|
20
|
+
package: string;
|
|
21
|
+
reset: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Highlight file paths in text
|
|
25
|
+
* Matches: /path/to/file.ts, ./relative/path.js, ~/home/path
|
|
26
|
+
* NOTE: Disabled to avoid ANSI code injection issues
|
|
27
|
+
*/
|
|
28
|
+
export declare function highlightPaths(text: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Highlight file references with line numbers
|
|
31
|
+
* Matches: file.ts:123, /path/to/file.js:45:10
|
|
32
|
+
* NOTE: Disabled to avoid ANSI code injection issues
|
|
33
|
+
*/
|
|
34
|
+
export declare function highlightFileRefs(text: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Highlight programming keywords
|
|
37
|
+
*/
|
|
38
|
+
export declare function highlightKeywords(text: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Highlight markdown-style titles
|
|
41
|
+
* Matches: # Title, ## Subtitle, etc.
|
|
42
|
+
*/
|
|
43
|
+
export declare function highlightTitles(text: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Highlight string literals in quotes
|
|
46
|
+
*/
|
|
47
|
+
export declare function highlightStrings(text: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Highlight numbers
|
|
50
|
+
*/
|
|
51
|
+
export declare function highlightNumbers(text: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Highlight code comments
|
|
54
|
+
* Matches single-line and multi-line comments, bash comments
|
|
55
|
+
*/
|
|
56
|
+
export declare function highlightComments(text: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Highlight shell/bash commands
|
|
59
|
+
*/
|
|
60
|
+
export declare function highlightShellCommands(text: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Highlight package names like @scope/package or package-name
|
|
63
|
+
*/
|
|
64
|
+
export declare function highlightPackages(text: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Highlight markdown code blocks with syntax highlighting
|
|
67
|
+
*/
|
|
68
|
+
export declare function highlightCodeBlocks(text: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Apply comprehensive syntax highlighting to text
|
|
71
|
+
* Applies all highlighting rules in the correct order
|
|
72
|
+
*/
|
|
73
|
+
export declare function applySyntaxHighlight(text: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Apply syntax highlighting only to specific elements (more conservative)
|
|
76
|
+
*/
|
|
77
|
+
export declare function applyLightSyntaxHighlight(text: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Strip all ANSI color codes from text
|
|
80
|
+
* Handles multiple ANSI escape sequence formats
|
|
81
|
+
*/
|
|
82
|
+
export declare function stripAnsiColors(text: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Colorize entire text block with a specific color
|
|
85
|
+
*/
|
|
86
|
+
export declare function colorizeBlock(text: string, color: string): string;
|
|
87
|
+
//# sourceMappingURL=syntax-highlighter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax-highlighter.d.ts","sourceRoot":"","sources":["../../src/utils/syntax-highlighter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAcxB,CAAA;AAqBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUtD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA0BtD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBxD;AAkCD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsCzD;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU9D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table Formatter for ASCII output
|
|
3
|
+
* Converts markdown tables to beautiful ASCII formatted tables
|
|
4
|
+
*/
|
|
5
|
+
export interface TableData {
|
|
6
|
+
headers: string[];
|
|
7
|
+
rows: string[][];
|
|
8
|
+
align?: ('left' | 'center' | 'right')[];
|
|
9
|
+
}
|
|
10
|
+
export interface TableFormatOptions {
|
|
11
|
+
maxWidth?: number;
|
|
12
|
+
align?: ('left' | 'center' | 'right')[];
|
|
13
|
+
borderStyle?: 'simple' | 'rounded' | 'double' | 'minimal';
|
|
14
|
+
stripMarkdown?: boolean;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse markdown table to structured data
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseMarkdownTable(markdown: string): TableData | null;
|
|
21
|
+
/**
|
|
22
|
+
* Format table to ASCII art
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatTableToASCII(table: TableData, options?: TableFormatOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Format table with multi-line cells
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatTableMultiline(table: TableData, options?: TableFormatOptions): string;
|
|
29
|
+
/**
|
|
30
|
+
* CSV to table data
|
|
31
|
+
*/
|
|
32
|
+
export declare function csvToTable(csv: string): TableData;
|
|
33
|
+
/**
|
|
34
|
+
* Detect if text is a table
|
|
35
|
+
*/
|
|
36
|
+
export declare function isTableMarkdown(text: string): boolean;
|
|
37
|
+
//# sourceMappingURL=table-formatter-inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-formatter-inline.d.ts","sourceRoot":"","sources":["../../src/utils/table-formatter-inline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;IACxC,WAAW,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC1D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CA4CrE;AA2ID;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CA+DR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CA8ER;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAYjD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAcrD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface TableColumn {
|
|
2
|
+
header: string;
|
|
3
|
+
width?: number;
|
|
4
|
+
align?: 'left' | 'center' | 'right';
|
|
5
|
+
}
|
|
6
|
+
export interface TableRow {
|
|
7
|
+
[key: string]: string | number | boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface TableOptions {
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
borderStyle?: 'single' | 'double' | 'rounded' | 'none';
|
|
12
|
+
headerColor?: string;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
padding?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parse markdown table to structured data
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseMarkdownTable(markdown: string): {
|
|
20
|
+
columns: TableColumn[];
|
|
21
|
+
rows: TableRow[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Calculate column widths based on content
|
|
25
|
+
*/
|
|
26
|
+
export declare function calculateColumnWidths(columns: TableColumn[], rows: TableRow[], maxWidth?: number): number[];
|
|
27
|
+
/**
|
|
28
|
+
* Render table with blessed-style borders
|
|
29
|
+
*/
|
|
30
|
+
export declare function renderTable(columns: TableColumn[], rows: TableRow[], options?: TableOptions): string;
|
|
31
|
+
/**
|
|
32
|
+
* Format table from markdown string
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatMarkdownTable(markdown: string, options?: TableOptions): string;
|
|
35
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/utils/table.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACpD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB,CAkDA;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EAAE,EACtB,IAAI,EAAE,QAAQ,EAAE,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,EAAE,CA4BV;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,WAAW,EAAE,EACtB,IAAI,EAAE,QAAQ,EAAE,EAChB,OAAO,GAAE,YAAiB,GACzB,MAAM,CAgDR;AAoFD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,YAAiB,GACzB,MAAM,CAGR"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream Progress Indicator
|
|
3
|
+
* Lightweight visual feedback for streaming
|
|
4
|
+
*/
|
|
5
|
+
export interface IndicatorOptions {
|
|
6
|
+
prefix?: string;
|
|
7
|
+
showBar?: boolean;
|
|
8
|
+
barWidth?: number;
|
|
9
|
+
showStats?: boolean;
|
|
10
|
+
hideOnComplete?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Animated progress indicator for terminal
|
|
14
|
+
*/
|
|
15
|
+
export declare class StreamIndicator {
|
|
16
|
+
private spinnerFrames;
|
|
17
|
+
private currentFrame;
|
|
18
|
+
private visible;
|
|
19
|
+
private options;
|
|
20
|
+
private lastOutput;
|
|
21
|
+
constructor(options?: IndicatorOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Show indicator with initial status
|
|
24
|
+
*/
|
|
25
|
+
show(status?: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Update indicator
|
|
28
|
+
*/
|
|
29
|
+
update(status: string, options?: {
|
|
30
|
+
progress?: number;
|
|
31
|
+
total?: number;
|
|
32
|
+
stats?: string;
|
|
33
|
+
}): void;
|
|
34
|
+
/**
|
|
35
|
+
* Show completion state
|
|
36
|
+
*/
|
|
37
|
+
complete(message?: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Show error state
|
|
40
|
+
*/
|
|
41
|
+
error(message: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Hide indicator
|
|
44
|
+
*/
|
|
45
|
+
hide(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Build output string
|
|
48
|
+
*/
|
|
49
|
+
private buildOutput;
|
|
50
|
+
/**
|
|
51
|
+
* Render output to stdout
|
|
52
|
+
*/
|
|
53
|
+
private render;
|
|
54
|
+
/**
|
|
55
|
+
* Clear line
|
|
56
|
+
*/
|
|
57
|
+
private clear;
|
|
58
|
+
/**
|
|
59
|
+
* Log message without clearing indicator
|
|
60
|
+
*/
|
|
61
|
+
log(message: string): void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Multi-line indicator for complex progress
|
|
65
|
+
*/
|
|
66
|
+
export declare class DetailedIndicator {
|
|
67
|
+
private spinner;
|
|
68
|
+
private currentFrame;
|
|
69
|
+
private visible;
|
|
70
|
+
private lines;
|
|
71
|
+
private cursorRow;
|
|
72
|
+
show(title: string, initialLines?: string[]): void;
|
|
73
|
+
updateLine(index: number, content: string): void;
|
|
74
|
+
addLine(content: string): number;
|
|
75
|
+
private render;
|
|
76
|
+
complete(): void;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Simple progress bar
|
|
80
|
+
*/
|
|
81
|
+
export declare class ProgressBar {
|
|
82
|
+
private width;
|
|
83
|
+
private lastPct;
|
|
84
|
+
constructor(width?: number);
|
|
85
|
+
/**
|
|
86
|
+
* Update and display progress bar
|
|
87
|
+
*/
|
|
88
|
+
show(current: number, total: number, label?: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* Complete
|
|
91
|
+
*/
|
|
92
|
+
complete(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Clear
|
|
95
|
+
*/
|
|
96
|
+
clear(): void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Convenience functions
|
|
100
|
+
*/
|
|
101
|
+
export declare function createQuickIndicator(): StreamIndicator;
|
|
102
|
+
export declare function createQuickProgressBar(): ProgressBar;
|
|
103
|
+
/**
|
|
104
|
+
* Status line updater for multiple concurrent operations
|
|
105
|
+
*/
|
|
106
|
+
export declare class StatusLine {
|
|
107
|
+
private status;
|
|
108
|
+
private interval;
|
|
109
|
+
/**
|
|
110
|
+
* Set and display status
|
|
111
|
+
*/
|
|
112
|
+
set(status: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Start auto-update (useful for animations)
|
|
115
|
+
*/
|
|
116
|
+
startAnimation(frames: string[], intervalMs?: number): void;
|
|
117
|
+
/**
|
|
118
|
+
* Stop auto-update
|
|
119
|
+
*/
|
|
120
|
+
stopAnimation(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Update display
|
|
123
|
+
*/
|
|
124
|
+
private update;
|
|
125
|
+
/**
|
|
126
|
+
* Clear status
|
|
127
|
+
*/
|
|
128
|
+
private clear;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=stream-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-indicator.d.ts","sourceRoot":"","sources":["../../src/widgets/stream-indicator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,M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