gsd-pi 2.10.0 → 2.10.2
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/node_modules/@gsd/native/dist/ast/index.d.ts +4 -0
- package/node_modules/@gsd/native/dist/ast/index.js +7 -0
- package/node_modules/@gsd/native/dist/ast/types.d.ts +69 -0
- package/node_modules/@gsd/native/dist/ast/types.js +1 -0
- package/node_modules/@gsd/native/{src/clipboard/index.ts → dist/clipboard/index.d.ts} +3 -15
- package/node_modules/@gsd/native/dist/clipboard/index.js +33 -0
- package/node_modules/@gsd/native/dist/clipboard/types.d.ts +7 -0
- package/node_modules/@gsd/native/dist/clipboard/types.js +1 -0
- package/node_modules/@gsd/native/dist/diff/index.d.ts +33 -0
- package/node_modules/@gsd/native/dist/diff/index.js +38 -0
- package/node_modules/@gsd/native/dist/diff/types.d.ts +23 -0
- package/node_modules/@gsd/native/dist/diff/types.js +1 -0
- package/node_modules/@gsd/native/{src/fd/index.ts → dist/fd/index.d.ts} +2 -12
- package/node_modules/@gsd/native/dist/fd/index.js +26 -0
- package/node_modules/@gsd/native/dist/fd/types.d.ts +29 -0
- package/node_modules/@gsd/native/dist/fd/types.js +1 -0
- package/node_modules/@gsd/native/{src/glob/index.ts → dist/glob/index.d.ts} +3 -19
- package/node_modules/@gsd/native/dist/glob/index.js +31 -0
- package/node_modules/@gsd/native/dist/glob/types.d.ts +50 -0
- package/node_modules/@gsd/native/dist/glob/types.js +1 -0
- package/node_modules/@gsd/native/dist/grep/index.d.ts +20 -0
- package/node_modules/@gsd/native/dist/grep/index.js +23 -0
- package/node_modules/@gsd/native/dist/grep/types.d.ts +99 -0
- package/node_modules/@gsd/native/dist/grep/types.js +1 -0
- package/node_modules/@gsd/native/dist/gsd-parser/index.d.ts +45 -0
- package/node_modules/@gsd/native/dist/gsd-parser/index.js +54 -0
- package/node_modules/@gsd/native/dist/gsd-parser/types.d.ts +55 -0
- package/node_modules/@gsd/native/dist/gsd-parser/types.js +7 -0
- package/node_modules/@gsd/native/{src/highlight/index.ts → dist/highlight/index.d.ts} +3 -19
- package/node_modules/@gsd/native/dist/highlight/index.js +33 -0
- package/node_modules/@gsd/native/dist/highlight/types.d.ts +25 -0
- package/node_modules/@gsd/native/dist/highlight/types.js +1 -0
- package/node_modules/@gsd/native/{src/html/index.ts → dist/html/index.d.ts} +1 -10
- package/node_modules/@gsd/native/dist/html/index.js +16 -0
- package/node_modules/@gsd/native/dist/html/types.d.ts +7 -0
- package/node_modules/@gsd/native/dist/html/types.js +1 -0
- package/node_modules/@gsd/native/{src/image/index.ts → dist/image/index.d.ts} +1 -14
- package/node_modules/@gsd/native/dist/image/index.js +18 -0
- package/node_modules/@gsd/native/dist/image/types.d.ts +35 -0
- package/node_modules/@gsd/native/dist/image/types.js +26 -0
- package/node_modules/@gsd/native/{src/index.ts → dist/index.d.ts} +12 -60
- package/node_modules/@gsd/native/dist/index.js +28 -0
- package/node_modules/@gsd/native/dist/native.d.ts +44 -0
- package/node_modules/@gsd/native/dist/native.js +34 -0
- package/node_modules/@gsd/native/dist/ps/index.d.ts +38 -0
- package/node_modules/@gsd/native/{src/ps/index.ts → dist/ps/index.js} +8 -13
- package/node_modules/@gsd/native/{src/ps/types.ts → dist/ps/types.d.ts} +2 -2
- package/node_modules/@gsd/native/dist/ps/types.js +1 -0
- package/node_modules/@gsd/native/{src/text/index.ts → dist/text/index.d.ts} +6 -76
- package/node_modules/@gsd/native/dist/text/index.js +66 -0
- package/node_modules/@gsd/native/dist/text/types.d.ts +27 -0
- package/node_modules/@gsd/native/dist/text/types.js +10 -0
- package/node_modules/@gsd/native/{src/ttsr/index.ts → dist/ttsr/index.d.ts} +3 -15
- package/node_modules/@gsd/native/dist/ttsr/index.js +32 -0
- package/node_modules/@gsd/native/{src/ttsr/types.ts → dist/ttsr/types.d.ts} +4 -5
- package/node_modules/@gsd/native/dist/ttsr/types.js +1 -0
- package/node_modules/@gsd/native/package.json +24 -23
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/edit-diff.d.ts +11 -5
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/edit-diff.js +19 -142
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/src/core/tools/edit-diff.ts +23 -157
- package/package.json +4 -2
- package/packages/native/dist/ast/index.d.ts +4 -0
- package/packages/native/dist/ast/index.js +7 -0
- package/packages/native/dist/ast/types.d.ts +69 -0
- package/packages/native/dist/ast/types.js +1 -0
- package/packages/native/dist/clipboard/index.d.ts +28 -0
- package/packages/native/dist/clipboard/index.js +33 -0
- package/packages/native/dist/clipboard/types.d.ts +7 -0
- package/packages/native/dist/clipboard/types.js +1 -0
- package/packages/native/dist/diff/index.d.ts +33 -0
- package/packages/native/dist/diff/index.js +38 -0
- package/packages/native/dist/diff/types.d.ts +23 -0
- package/packages/native/dist/diff/types.js +1 -0
- package/packages/native/dist/fd/index.d.ts +25 -0
- package/packages/native/dist/fd/index.js +26 -0
- package/packages/native/dist/fd/types.d.ts +29 -0
- package/packages/native/dist/fd/types.js +1 -0
- package/packages/native/dist/glob/index.d.ts +28 -0
- package/packages/native/dist/glob/index.js +31 -0
- package/packages/native/dist/glob/types.d.ts +50 -0
- package/packages/native/dist/glob/types.js +1 -0
- package/packages/native/dist/grep/index.d.ts +20 -0
- package/packages/native/dist/grep/index.js +23 -0
- package/packages/native/dist/grep/types.d.ts +99 -0
- package/packages/native/dist/grep/types.js +1 -0
- package/packages/native/dist/gsd-parser/index.d.ts +45 -0
- package/packages/native/dist/gsd-parser/index.js +54 -0
- package/packages/native/dist/gsd-parser/types.d.ts +55 -0
- package/packages/native/dist/gsd-parser/types.js +7 -0
- package/packages/native/dist/highlight/index.d.ts +28 -0
- package/packages/native/dist/highlight/index.js +33 -0
- package/packages/native/dist/highlight/types.d.ts +25 -0
- package/packages/native/dist/highlight/types.js +1 -0
- package/packages/native/dist/html/index.d.ts +15 -0
- package/packages/native/dist/html/index.js +16 -0
- package/packages/native/dist/html/types.d.ts +7 -0
- package/packages/native/dist/html/types.js +1 -0
- package/packages/native/dist/image/index.d.ts +15 -0
- package/packages/native/dist/image/index.js +18 -0
- package/packages/native/dist/image/types.d.ts +35 -0
- package/packages/native/dist/image/types.js +26 -0
- package/packages/native/dist/index.d.ts +40 -0
- package/packages/native/dist/index.js +28 -0
- package/packages/native/dist/native.d.ts +44 -0
- package/packages/native/dist/native.js +34 -0
- package/packages/native/dist/ps/index.d.ts +38 -0
- package/packages/native/dist/ps/index.js +47 -0
- package/packages/native/dist/ps/types.d.ts +5 -0
- package/packages/native/dist/ps/types.js +1 -0
- package/packages/native/dist/text/index.d.ts +55 -0
- package/packages/native/dist/text/index.js +66 -0
- package/packages/native/dist/text/types.d.ts +27 -0
- package/packages/native/dist/text/types.js +10 -0
- package/packages/native/dist/ttsr/index.d.ts +27 -0
- package/packages/native/dist/ttsr/index.js +32 -0
- package/packages/native/dist/ttsr/types.d.ts +9 -0
- package/packages/native/dist/ttsr/types.js +1 -0
- package/packages/native/package.json +24 -23
- package/packages/native/src/__tests__/diff.test.mjs +189 -0
- package/packages/native/src/__tests__/ttsr.test.mjs +135 -0
- package/packages/native/src/diff/index.ts +61 -0
- package/packages/native/src/diff/types.ts +24 -0
- package/packages/native/src/gsd-parser/index.ts +98 -0
- package/packages/native/src/gsd-parser/types.ts +62 -0
- package/packages/native/src/index.ts +23 -0
- package/packages/native/src/native.ts +8 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts +11 -5
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +19 -142
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -1
- package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +23 -157
- package/src/resources/extensions/gsd/files.ts +9 -0
- package/src/resources/extensions/gsd/native-parser-bridge.ts +135 -0
- package/src/resources/extensions/ttsr/ttsr-manager.ts +86 -0
- package/node_modules/@gsd/native/src/__tests__/clipboard.test.mjs +0 -79
- package/node_modules/@gsd/native/src/__tests__/fd.test.mjs +0 -164
- package/node_modules/@gsd/native/src/__tests__/glob.test.mjs +0 -237
- package/node_modules/@gsd/native/src/__tests__/grep.test.mjs +0 -162
- package/node_modules/@gsd/native/src/__tests__/highlight.test.mjs +0 -156
- package/node_modules/@gsd/native/src/__tests__/html.test.mjs +0 -98
- package/node_modules/@gsd/native/src/__tests__/image.test.mjs +0 -137
- package/node_modules/@gsd/native/src/__tests__/ps.test.mjs +0 -109
- package/node_modules/@gsd/native/src/__tests__/text.test.mjs +0 -262
- package/node_modules/@gsd/native/src/ast/index.ts +0 -12
- package/node_modules/@gsd/native/src/ast/types.ts +0 -75
- package/node_modules/@gsd/native/src/clipboard/types.ts +0 -7
- package/node_modules/@gsd/native/src/fd/types.ts +0 -31
- package/node_modules/@gsd/native/src/glob/types.ts +0 -53
- package/node_modules/@gsd/native/src/grep/index.ts +0 -48
- package/node_modules/@gsd/native/src/grep/types.ts +0 -105
- package/node_modules/@gsd/native/src/highlight/types.ts +0 -25
- package/node_modules/@gsd/native/src/html/types.ts +0 -7
- package/node_modules/@gsd/native/src/image/types.ts +0 -41
- package/node_modules/@gsd/native/src/native.ts +0 -94
- package/node_modules/@gsd/native/src/text/types.ts +0 -29
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Native ripgrep wrapper using N-API.
|
|
3
|
-
*
|
|
4
|
-
* High-performance regex search backed by Rust's grep-* crates
|
|
5
|
-
* (the same internals as ripgrep).
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { native } from "../native.js";
|
|
9
|
-
import type {
|
|
10
|
-
ContextLine,
|
|
11
|
-
GrepMatch,
|
|
12
|
-
GrepOptions,
|
|
13
|
-
GrepResult,
|
|
14
|
-
SearchMatch,
|
|
15
|
-
SearchOptions,
|
|
16
|
-
SearchResult,
|
|
17
|
-
} from "./types.js";
|
|
18
|
-
|
|
19
|
-
export type {
|
|
20
|
-
ContextLine,
|
|
21
|
-
GrepMatch,
|
|
22
|
-
GrepOptions,
|
|
23
|
-
GrepResult,
|
|
24
|
-
SearchMatch,
|
|
25
|
-
SearchOptions,
|
|
26
|
-
SearchResult,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Search in-memory content for a regex pattern.
|
|
31
|
-
*
|
|
32
|
-
* Accepts a Buffer/Uint8Array of UTF-8 encoded content.
|
|
33
|
-
*/
|
|
34
|
-
export function searchContent(
|
|
35
|
-
content: Buffer | Uint8Array,
|
|
36
|
-
options: SearchOptions,
|
|
37
|
-
): SearchResult {
|
|
38
|
-
return native.search(content, options) as SearchResult;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Search files on disk for a regex pattern.
|
|
43
|
-
*
|
|
44
|
-
* Walks the directory tree respecting .gitignore and optional glob filters.
|
|
45
|
-
*/
|
|
46
|
-
export function grep(options: GrepOptions): GrepResult {
|
|
47
|
-
return native.grep(options) as GrepResult;
|
|
48
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/** A context line adjacent to a match. */
|
|
2
|
-
export interface ContextLine {
|
|
3
|
-
/** 1-indexed line number. */
|
|
4
|
-
lineNumber: number;
|
|
5
|
-
/** Line content (trailing newline stripped). */
|
|
6
|
-
line: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** A single match from in-memory content search. */
|
|
10
|
-
export interface SearchMatch {
|
|
11
|
-
/** 1-indexed line number. */
|
|
12
|
-
lineNumber: number;
|
|
13
|
-
/** The matched line content. */
|
|
14
|
-
line: string;
|
|
15
|
-
/** Context lines before the match. */
|
|
16
|
-
contextBefore: ContextLine[];
|
|
17
|
-
/** Context lines after the match. */
|
|
18
|
-
contextAfter: ContextLine[];
|
|
19
|
-
/** Whether the line was truncated due to maxColumns. */
|
|
20
|
-
truncated: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** Result of searching in-memory content. */
|
|
24
|
-
export interface SearchResult {
|
|
25
|
-
/** All matches found. */
|
|
26
|
-
matches: SearchMatch[];
|
|
27
|
-
/** Total number of matches (may exceed matches.length due to limit). */
|
|
28
|
-
matchCount: number;
|
|
29
|
-
/** Whether the limit was reached. */
|
|
30
|
-
limitReached: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Options for in-memory content search. */
|
|
34
|
-
export interface SearchOptions {
|
|
35
|
-
/** Regex pattern to search for. */
|
|
36
|
-
pattern: string;
|
|
37
|
-
/** Case-insensitive matching. */
|
|
38
|
-
ignoreCase?: boolean;
|
|
39
|
-
/** Enable multiline regex mode. */
|
|
40
|
-
multiline?: boolean;
|
|
41
|
-
/** Maximum number of matches to return. */
|
|
42
|
-
maxCount?: number;
|
|
43
|
-
/** Lines of context before matches. */
|
|
44
|
-
contextBefore?: number;
|
|
45
|
-
/** Lines of context after matches. */
|
|
46
|
-
contextAfter?: number;
|
|
47
|
-
/** Truncate lines longer than this (characters). */
|
|
48
|
-
maxColumns?: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** A single match from filesystem search. */
|
|
52
|
-
export interface GrepMatch {
|
|
53
|
-
/** File path (relative for directory searches). */
|
|
54
|
-
path: string;
|
|
55
|
-
/** 1-indexed line number. */
|
|
56
|
-
lineNumber: number;
|
|
57
|
-
/** The matched line content. */
|
|
58
|
-
line: string;
|
|
59
|
-
/** Context lines before the match. */
|
|
60
|
-
contextBefore: ContextLine[];
|
|
61
|
-
/** Context lines after the match. */
|
|
62
|
-
contextAfter: ContextLine[];
|
|
63
|
-
/** Whether the line was truncated. */
|
|
64
|
-
truncated: boolean;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Result of a filesystem search. */
|
|
68
|
-
export interface GrepResult {
|
|
69
|
-
/** All matches found. */
|
|
70
|
-
matches: GrepMatch[];
|
|
71
|
-
/** Total matches across all files. */
|
|
72
|
-
totalMatches: number;
|
|
73
|
-
/** Number of files with at least one match. */
|
|
74
|
-
filesWithMatches: number;
|
|
75
|
-
/** Number of files searched. */
|
|
76
|
-
filesSearched: number;
|
|
77
|
-
/** Whether the limit stopped the search early. */
|
|
78
|
-
limitReached: boolean;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Options for filesystem search. */
|
|
82
|
-
export interface GrepOptions {
|
|
83
|
-
/** Regex pattern to search for. */
|
|
84
|
-
pattern: string;
|
|
85
|
-
/** Directory or file to search. */
|
|
86
|
-
path: string;
|
|
87
|
-
/** Glob filter for filenames (e.g. "*.ts"). */
|
|
88
|
-
glob?: string;
|
|
89
|
-
/** Case-insensitive matching. */
|
|
90
|
-
ignoreCase?: boolean;
|
|
91
|
-
/** Enable multiline regex mode. */
|
|
92
|
-
multiline?: boolean;
|
|
93
|
-
/** Include hidden files (default: false). */
|
|
94
|
-
hidden?: boolean;
|
|
95
|
-
/** Respect .gitignore files (default: true). */
|
|
96
|
-
gitignore?: boolean;
|
|
97
|
-
/** Maximum number of matches to return. */
|
|
98
|
-
maxCount?: number;
|
|
99
|
-
/** Lines of context before matches. */
|
|
100
|
-
contextBefore?: number;
|
|
101
|
-
/** Lines of context after matches. */
|
|
102
|
-
contextAfter?: number;
|
|
103
|
-
/** Truncate lines longer than this (characters). */
|
|
104
|
-
maxColumns?: number;
|
|
105
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** Theme colors for syntax highlighting as ANSI escape sequences. */
|
|
2
|
-
export interface HighlightColors {
|
|
3
|
-
/** ANSI color for comments. */
|
|
4
|
-
comment: string;
|
|
5
|
-
/** ANSI color for keywords. */
|
|
6
|
-
keyword: string;
|
|
7
|
-
/** ANSI color for function names. */
|
|
8
|
-
function: string;
|
|
9
|
-
/** ANSI color for variables and identifiers. */
|
|
10
|
-
variable: string;
|
|
11
|
-
/** ANSI color for string literals. */
|
|
12
|
-
string: string;
|
|
13
|
-
/** ANSI color for numeric literals. */
|
|
14
|
-
number: string;
|
|
15
|
-
/** ANSI color for type identifiers. */
|
|
16
|
-
type: string;
|
|
17
|
-
/** ANSI color for operators. */
|
|
18
|
-
operator: string;
|
|
19
|
-
/** ANSI color for punctuation tokens. */
|
|
20
|
-
punctuation: string;
|
|
21
|
-
/** ANSI color for diff inserted lines. */
|
|
22
|
-
inserted?: string;
|
|
23
|
-
/** ANSI color for diff deleted lines. */
|
|
24
|
-
deleted?: string;
|
|
25
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** Sampling filter for resize operations. */
|
|
2
|
-
export enum SamplingFilter {
|
|
3
|
-
/** Nearest-neighbor sampling (fast, low quality). */
|
|
4
|
-
Nearest = 1,
|
|
5
|
-
/** Triangle filter (linear interpolation). */
|
|
6
|
-
Triangle = 2,
|
|
7
|
-
/** Catmull-Rom filter with sharper edges. */
|
|
8
|
-
CatmullRom = 3,
|
|
9
|
-
/** Gaussian filter for smoother results. */
|
|
10
|
-
Gaussian = 4,
|
|
11
|
-
/** Lanczos3 filter for high-quality downscaling. */
|
|
12
|
-
Lanczos3 = 5,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** Output image format for encoding. */
|
|
16
|
-
export enum ImageFormat {
|
|
17
|
-
/** PNG (lossless, quality ignored). */
|
|
18
|
-
PNG = 0,
|
|
19
|
-
/** JPEG (lossy, quality 0-100). */
|
|
20
|
-
JPEG = 1,
|
|
21
|
-
/** WebP (lossless, quality ignored). */
|
|
22
|
-
WebP = 2,
|
|
23
|
-
/** GIF (quality ignored). */
|
|
24
|
-
GIF = 3,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Native image handle returned from parse(). */
|
|
28
|
-
export interface NativeImageHandle {
|
|
29
|
-
/** Image width in pixels. */
|
|
30
|
-
readonly width: number;
|
|
31
|
-
/** Image height in pixels. */
|
|
32
|
-
readonly height: number;
|
|
33
|
-
/** Encode to bytes in the specified format. Returns a Promise. */
|
|
34
|
-
encode(format: number, quality: number): Promise<number[]>;
|
|
35
|
-
/** Resize to the specified dimensions. Returns a new NativeImage Promise. */
|
|
36
|
-
resize(
|
|
37
|
-
width: number,
|
|
38
|
-
height: number,
|
|
39
|
-
filter: SamplingFilter,
|
|
40
|
-
): Promise<NativeImageHandle>;
|
|
41
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Native addon loader.
|
|
3
|
-
*
|
|
4
|
-
* Locates and loads the compiled Rust N-API addon (`.node` file).
|
|
5
|
-
* Tries platform-tagged release builds first, then falls back to dev builds.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { createRequire } from "node:module";
|
|
9
|
-
import * as path from "node:path";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
|
-
|
|
12
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const require = createRequire(import.meta.url);
|
|
14
|
-
|
|
15
|
-
const addonDir = path.resolve(__dirname, "..", "..", "..", "native", "addon");
|
|
16
|
-
const platformTag = `${process.platform}-${process.arch}`;
|
|
17
|
-
|
|
18
|
-
const candidates = [
|
|
19
|
-
path.join(addonDir, `gsd_engine.${platformTag}.node`),
|
|
20
|
-
path.join(addonDir, "gsd_engine.dev.node"),
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
function loadNative(): Record<string, unknown> {
|
|
24
|
-
const errors: string[] = [];
|
|
25
|
-
|
|
26
|
-
for (const candidate of candidates) {
|
|
27
|
-
try {
|
|
28
|
-
return require(candidate) as Record<string, unknown>;
|
|
29
|
-
} catch (err) {
|
|
30
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
31
|
-
errors.push(`${candidate}: ${message}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const details = errors.map((e) => ` - ${e}`).join("\n");
|
|
36
|
-
throw new Error(
|
|
37
|
-
`Failed to load gsd_engine native addon for ${platformTag}.\n\n` +
|
|
38
|
-
`Tried:\n${details}\n\n` +
|
|
39
|
-
`Build with: npm run build:native -w @gsd/native`,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const native = loadNative() as {
|
|
44
|
-
search: (content: Buffer | Uint8Array, options: unknown) => unknown;
|
|
45
|
-
grep: (options: unknown) => unknown;
|
|
46
|
-
killTree: (pid: number, signal: number) => number;
|
|
47
|
-
listDescendants: (pid: number) => number[];
|
|
48
|
-
processGroupId: (pid: number) => number | null;
|
|
49
|
-
killProcessGroup: (pgid: number, signal: number) => boolean;
|
|
50
|
-
glob: (
|
|
51
|
-
options: unknown,
|
|
52
|
-
onMatch?: ((match: unknown) => void) | undefined | null,
|
|
53
|
-
) => Promise<unknown>;
|
|
54
|
-
invalidateFsScanCache: (path?: string) => void;
|
|
55
|
-
highlightCode: (code: string, lang: string | null, colors: unknown) => unknown;
|
|
56
|
-
supportsLanguage: (lang: string) => unknown;
|
|
57
|
-
getSupportedLanguages: () => unknown;
|
|
58
|
-
copyToClipboard: (text: string) => void;
|
|
59
|
-
readTextFromClipboard: () => string | null;
|
|
60
|
-
readImageFromClipboard: () => Promise<unknown>;
|
|
61
|
-
astGrep: (options: unknown) => unknown;
|
|
62
|
-
astEdit: (options: unknown) => unknown;
|
|
63
|
-
htmlToMarkdown: (html: string, options: unknown) => unknown;
|
|
64
|
-
wrapTextWithAnsi: (text: string, width: number, tabWidth?: number) => string[];
|
|
65
|
-
truncateToWidth: (
|
|
66
|
-
text: string,
|
|
67
|
-
maxWidth: number,
|
|
68
|
-
ellipsisKind: number,
|
|
69
|
-
pad: boolean,
|
|
70
|
-
tabWidth?: number,
|
|
71
|
-
) => string;
|
|
72
|
-
sliceWithWidth: (
|
|
73
|
-
line: string,
|
|
74
|
-
startCol: number,
|
|
75
|
-
length: number,
|
|
76
|
-
strict: boolean,
|
|
77
|
-
tabWidth?: number,
|
|
78
|
-
) => unknown;
|
|
79
|
-
extractSegments: (
|
|
80
|
-
line: string,
|
|
81
|
-
beforeEnd: number,
|
|
82
|
-
afterStart: number,
|
|
83
|
-
afterLen: number,
|
|
84
|
-
strictAfter: boolean,
|
|
85
|
-
tabWidth?: number,
|
|
86
|
-
) => unknown;
|
|
87
|
-
sanitizeText: (text: string) => string;
|
|
88
|
-
visibleWidth: (text: string, tabWidth?: number) => number;
|
|
89
|
-
fuzzyFind: (options: unknown) => unknown;
|
|
90
|
-
NativeImage: unknown;
|
|
91
|
-
ttsrCompileRules: (rules: unknown[]) => number;
|
|
92
|
-
ttsrCheckBuffer: (handle: number, buffer: string) => string[];
|
|
93
|
-
ttsrFreeRules: (handle: number) => void;
|
|
94
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** Result of slicing a line by visible column range. */
|
|
2
|
-
export interface SliceResult {
|
|
3
|
-
/** The extracted text (may include ANSI codes). */
|
|
4
|
-
text: string;
|
|
5
|
-
/** Visible width of the extracted slice in terminal cells. */
|
|
6
|
-
width: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** Result of extracting before/after segments around an overlay. */
|
|
10
|
-
export interface ExtractSegmentsResult {
|
|
11
|
-
/** Text content before the overlay region. */
|
|
12
|
-
before: string;
|
|
13
|
-
/** Visible width of the `before` segment. */
|
|
14
|
-
beforeWidth: number;
|
|
15
|
-
/** Text content after the overlay region. */
|
|
16
|
-
after: string;
|
|
17
|
-
/** Visible width of the `after` segment. */
|
|
18
|
-
afterWidth: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** Ellipsis style for truncation. */
|
|
22
|
-
export enum EllipsisKind {
|
|
23
|
-
/** Unicode ellipsis character: \u2026 (width 1) */
|
|
24
|
-
Unicode = 0,
|
|
25
|
-
/** ASCII ellipsis: "..." (width 3) */
|
|
26
|
-
Ascii = 1,
|
|
27
|
-
/** No ellipsis (hard truncate) */
|
|
28
|
-
None = 2,
|
|
29
|
-
}
|