@prometheus-ai/natives 0.5.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/README.md +80 -0
- package/native/embedded-addon.js +31 -0
- package/native/index.d.ts +1405 -0
- package/native/index.js +124 -0
- package/native/loader-state.d.ts +65 -0
- package/native/loader-state.js +598 -0
- package/package.json +75 -0
package/native/index.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { loadNative } from "./loader-state.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native addon entrypoint.
|
|
5
|
+
*
|
|
6
|
+
* Hand-written surface area: one `loadNative()` call. Everything else in
|
|
7
|
+
* this file (the surface-area `export const` block between MARKER_START
|
|
8
|
+
* and MARKER_END) is rewritten by `packages/natives/scripts/gen-enums.ts`
|
|
9
|
+
* after `napi build` regenerates `index.d.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Loader logic lives in `./loader-state.js` so the pure helpers stay
|
|
12
|
+
* unit-testable without triggering AVX2 detection or filesystem probes on
|
|
13
|
+
* import. Types are auto-generated by napi-rs in `./index.d.ts`.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const nativeBindings = loadNative();
|
|
17
|
+
// --- generated native exports (do not edit) ---
|
|
18
|
+
// classes
|
|
19
|
+
export const MacAppearanceObserver = nativeBindings.MacAppearanceObserver;
|
|
20
|
+
export const MacOSPowerAssertion = nativeBindings.MacOSPowerAssertion;
|
|
21
|
+
export const Process = nativeBindings.Process;
|
|
22
|
+
export const PtySession = nativeBindings.PtySession;
|
|
23
|
+
export const Shell = nativeBindings.Shell;
|
|
24
|
+
|
|
25
|
+
// functions
|
|
26
|
+
export const __prometheusNativesV0_5_0 = nativeBindings.__prometheusNativesV0_5_0;
|
|
27
|
+
export const applyBashFixups = nativeBindings.applyBashFixups;
|
|
28
|
+
export const astEdit = nativeBindings.astEdit;
|
|
29
|
+
export const astGrep = nativeBindings.astGrep;
|
|
30
|
+
export const blockRangeAt = nativeBindings.blockRangeAt;
|
|
31
|
+
export const copyToClipboard = nativeBindings.copyToClipboard;
|
|
32
|
+
export const countTokens = nativeBindings.countTokens;
|
|
33
|
+
export const detectMacOSAppearance = nativeBindings.detectMacOSAppearance;
|
|
34
|
+
export const encodeSixel = nativeBindings.encodeSixel;
|
|
35
|
+
export const executeShell = nativeBindings.executeShell;
|
|
36
|
+
export const extractSegments = nativeBindings.extractSegments;
|
|
37
|
+
export const fuzzyFind = nativeBindings.fuzzyFind;
|
|
38
|
+
export const getSupportedLanguages = nativeBindings.getSupportedLanguages;
|
|
39
|
+
export const getWorkProfile = nativeBindings.getWorkProfile;
|
|
40
|
+
export const glob = nativeBindings.glob;
|
|
41
|
+
export const grep = nativeBindings.grep;
|
|
42
|
+
export const hasMatch = nativeBindings.hasMatch;
|
|
43
|
+
export const highlightCode = nativeBindings.highlightCode;
|
|
44
|
+
export const htmlToMarkdown = nativeBindings.htmlToMarkdown;
|
|
45
|
+
export const invalidateFsScanCache = nativeBindings.invalidateFsScanCache;
|
|
46
|
+
export const isoBackend = nativeBindings.isoBackend;
|
|
47
|
+
export const isoDiff = nativeBindings.isoDiff;
|
|
48
|
+
export const isoIsUnavailableError = nativeBindings.isoIsUnavailableError;
|
|
49
|
+
export const isoProbe = nativeBindings.isoProbe;
|
|
50
|
+
export const isoResolve = nativeBindings.isoResolve;
|
|
51
|
+
export const isoStart = nativeBindings.isoStart;
|
|
52
|
+
export const isoStop = nativeBindings.isoStop;
|
|
53
|
+
export const listWorkspace = nativeBindings.listWorkspace;
|
|
54
|
+
export const matchesKey = nativeBindings.matchesKey;
|
|
55
|
+
export const matchesKittySequence = nativeBindings.matchesKittySequence;
|
|
56
|
+
export const matchesLegacySequence = nativeBindings.matchesLegacySequence;
|
|
57
|
+
export const parseKey = nativeBindings.parseKey;
|
|
58
|
+
export const parseKittySequence = nativeBindings.parseKittySequence;
|
|
59
|
+
export const readImageFromClipboard = nativeBindings.readImageFromClipboard;
|
|
60
|
+
export const search = nativeBindings.search;
|
|
61
|
+
export const sliceWithWidth = nativeBindings.sliceWithWidth;
|
|
62
|
+
export const summarizeCode = nativeBindings.summarizeCode;
|
|
63
|
+
export const supportsLanguage = nativeBindings.supportsLanguage;
|
|
64
|
+
export const truncateToWidth = nativeBindings.truncateToWidth;
|
|
65
|
+
export const visibleWidth = nativeBindings.visibleWidth;
|
|
66
|
+
export const wrapTextWithAnsi = nativeBindings.wrapTextWithAnsi;
|
|
67
|
+
|
|
68
|
+
// string/numeric enums (napi-rs string_enum produces TS-only const enum)
|
|
69
|
+
export const AstMatchStrictness = {
|
|
70
|
+
Cst: "cst",
|
|
71
|
+
Smart: "smart",
|
|
72
|
+
Ast: "ast",
|
|
73
|
+
Relaxed: "relaxed",
|
|
74
|
+
Signature: "signature",
|
|
75
|
+
Template: "template",
|
|
76
|
+
};
|
|
77
|
+
export const Ellipsis = {
|
|
78
|
+
Unicode: 0,
|
|
79
|
+
Ascii: 1,
|
|
80
|
+
Omit: 2,
|
|
81
|
+
};
|
|
82
|
+
export const Encoding = {
|
|
83
|
+
O200kBase: "O200kBase",
|
|
84
|
+
Cl100kBase: "Cl100kBase",
|
|
85
|
+
};
|
|
86
|
+
export const FileType = {
|
|
87
|
+
File: 1,
|
|
88
|
+
Dir: 2,
|
|
89
|
+
Symlink: 3,
|
|
90
|
+
};
|
|
91
|
+
export const GrepOutputMode = {
|
|
92
|
+
Content: "content",
|
|
93
|
+
Count: "count",
|
|
94
|
+
FilesWithMatches: "filesWithMatches",
|
|
95
|
+
};
|
|
96
|
+
export const IsoBackendKind = {
|
|
97
|
+
Apfs: 0,
|
|
98
|
+
Btrfs: 1,
|
|
99
|
+
Zfs: 2,
|
|
100
|
+
LinuxReflink: 3,
|
|
101
|
+
Overlayfs: 4,
|
|
102
|
+
WindowsBlockClone: 5,
|
|
103
|
+
Projfs: 6,
|
|
104
|
+
Rcopy: 7,
|
|
105
|
+
};
|
|
106
|
+
export const IsoChangeKind = {
|
|
107
|
+
Added: 0,
|
|
108
|
+
Modified: 1,
|
|
109
|
+
Removed: 2,
|
|
110
|
+
};
|
|
111
|
+
export const KeyEventType = {
|
|
112
|
+
Press: 1,
|
|
113
|
+
Repeat: 2,
|
|
114
|
+
Release: 3,
|
|
115
|
+
};
|
|
116
|
+
export const MacOSAppearance = {
|
|
117
|
+
Dark: "dark",
|
|
118
|
+
Light: "light",
|
|
119
|
+
};
|
|
120
|
+
export const ProcessStatus = {
|
|
121
|
+
Running: "running",
|
|
122
|
+
Exited: "exited",
|
|
123
|
+
};
|
|
124
|
+
// --- end generated native exports ---
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface EmbeddedAddonFile {
|
|
2
|
+
variant: "modern" | "baseline" | "default";
|
|
3
|
+
filename: string;
|
|
4
|
+
size?: number;
|
|
5
|
+
filePath?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface EmbeddedAddonArchive {
|
|
9
|
+
format: "tar.gz";
|
|
10
|
+
filename: string;
|
|
11
|
+
filePath: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface EmbeddedAddon {
|
|
15
|
+
platformTag: string;
|
|
16
|
+
version: string;
|
|
17
|
+
files: EmbeddedAddonFile[];
|
|
18
|
+
archive?: EmbeddedAddonArchive;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface DetectCompiledBinaryInput {
|
|
22
|
+
embeddedAddon: EmbeddedAddon | null | undefined;
|
|
23
|
+
env: Record<string, string | undefined>;
|
|
24
|
+
importMetaUrl: string | null | undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function detectCompiledBinary(input: DetectCompiledBinaryInput): boolean;
|
|
28
|
+
|
|
29
|
+
export interface GetAddonFilenamesInput {
|
|
30
|
+
tag: string;
|
|
31
|
+
arch: string;
|
|
32
|
+
variant: "modern" | "baseline" | null | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getAddonFilenames(input: GetAddonFilenamesInput): string[];
|
|
36
|
+
|
|
37
|
+
export interface ShouldStageNodeModulesAddonInput {
|
|
38
|
+
platform: NodeJS.Platform | string;
|
|
39
|
+
isCompiledBinary: boolean;
|
|
40
|
+
nativeDir: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function shouldStageNodeModulesAddon(input: ShouldStageNodeModulesAddonInput): boolean;
|
|
44
|
+
|
|
45
|
+
export interface ResolveLoaderCandidatesInput {
|
|
46
|
+
addonFilenames: string[];
|
|
47
|
+
isCompiledBinary: boolean;
|
|
48
|
+
stageFromNodeModules?: boolean;
|
|
49
|
+
nativeDir: string;
|
|
50
|
+
leafPackageDir?: string | null;
|
|
51
|
+
execDir: string;
|
|
52
|
+
versionedDir: string;
|
|
53
|
+
userDataDir: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function resolveLoaderCandidates(input: ResolveLoaderCandidatesInput): string[];
|
|
57
|
+
|
|
58
|
+
export interface ExtractEmbeddedAddonArchiveInput {
|
|
59
|
+
archivePath: string;
|
|
60
|
+
files: EmbeddedAddonFile[];
|
|
61
|
+
targetDir: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function extractEmbeddedAddonArchive(input: ExtractEmbeddedAddonArchiveInput): string[];
|
|
65
|
+
export function loadNative(): Record<string, unknown>;
|