@xberg-io/liter-llm 1.19.2 → 2.0.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/index.d.ts +17 -6
- package/index.js +59 -781
- package/liter-llm-node.darwin-arm64.node +0 -0
- package/liter-llm-node.darwin-x64.node +0 -0
- package/liter-llm-node.linux-arm64-gnu.node +0 -0
- package/liter-llm-node.linux-x64-gnu.node +0 -0
- package/liter-llm-node.win32-arm64-msvc.node +0 -0
- package/liter-llm-node.win32-x64-msvc.node +0 -0
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:dcf86ef638e55c8ff83fc5348d3b0956f1df8e68e355d7ff816ee026e432cee1
|
|
3
3
|
// To regenerate: alef generate
|
|
4
4
|
// To verify freshness: alef verify
|
|
5
5
|
/* eslint-disable */
|
|
@@ -211,7 +211,7 @@ export declare function installCatalogOverlayFromStr(catalogJson: string): void;
|
|
|
211
211
|
*/
|
|
212
212
|
export type AssistantContent =
|
|
213
213
|
| string
|
|
214
|
-
| Array<
|
|
214
|
+
| Array<__AlefWireAssistantPart>
|
|
215
215
|
|
|
216
216
|
/** Assistant's response to a user message. */
|
|
217
217
|
export interface AssistantMessage {
|
|
@@ -959,7 +959,7 @@ export declare enum EmbeddingFormat {
|
|
|
959
959
|
export type EmbeddingInput =
|
|
960
960
|
| string
|
|
961
961
|
| Array<string>
|
|
962
|
-
| Array<
|
|
962
|
+
| Array<__AlefWireEmbeddingContentPart>
|
|
963
963
|
|
|
964
964
|
/** A single embedding vector. */
|
|
965
965
|
export interface EmbeddingObject {
|
|
@@ -1989,8 +1989,8 @@ export interface ToolCall {
|
|
|
1989
1989
|
|
|
1990
1990
|
/** Tool usage mode or a specific tool to call. */
|
|
1991
1991
|
export type ToolChoice =
|
|
1992
|
-
|
|
|
1993
|
-
|
|
|
1992
|
+
| __AlefWireToolChoiceMode
|
|
1993
|
+
| __AlefWireSpecificToolChoice
|
|
1994
1994
|
|
|
1995
1995
|
/** Tool choice mode. */
|
|
1996
1996
|
export declare enum ToolChoiceMode {
|
|
@@ -2073,7 +2073,7 @@ export interface Usage {
|
|
|
2073
2073
|
/** User message content as either plain text or a list of multimodal parts. */
|
|
2074
2074
|
export type UserContent =
|
|
2075
2075
|
| string
|
|
2076
|
-
| Array<
|
|
2076
|
+
| Array<__AlefWireContentPart>
|
|
2077
2077
|
|
|
2078
2078
|
/** User message in the conversation. */
|
|
2079
2079
|
export interface UserMessage {
|
|
@@ -2166,6 +2166,17 @@ export declare function registerCustomProvider(config: CustomProviderConfig): vo
|
|
|
2166
2166
|
* @throws Returns an error if the custom-provider registry cannot be updated.
|
|
2167
2167
|
*/
|
|
2168
2168
|
export declare function unregisterCustomProvider(name: string): boolean;
|
|
2169
|
+
export type __AlefWireImageDetail = "low" | "high" | "auto";
|
|
2170
|
+
export type __AlefWireImageUrl = { url: string; detail?: (__AlefWireImageDetail | null) };
|
|
2171
|
+
export type __AlefWireAudioContent = { data: string; format: string };
|
|
2172
|
+
export type __AlefWireAssistantPart = ({ type: "text" } & { text: string }) | ({ type: "refusal" } & { refusal: string }) | ({ type: "output_image" } & { image_url: __AlefWireImageUrl }) | ({ type: "output_audio" } & { audio: __AlefWireAudioContent });
|
|
2173
|
+
export type __AlefWireEmbeddingContentPart = ({ type: "text" } & { text: string }) | ({ type: "image_url" } & { image_url: __AlefWireImageUrl }) | ({ type: "image_base64" } & { image_base64: string });
|
|
2174
|
+
export type __AlefWireToolChoiceMode = "auto" | "required" | "none";
|
|
2175
|
+
export type __AlefWireToolType = "function";
|
|
2176
|
+
export type __AlefWireSpecificFunction = { name: string };
|
|
2177
|
+
export type __AlefWireSpecificToolChoice = { type: __AlefWireToolType; "function": __AlefWireSpecificFunction };
|
|
2178
|
+
export type __AlefWireDocumentContent = { data: string; media_type: string };
|
|
2179
|
+
export type __AlefWireContentPart = ({ type: "text" } & { text: string }) | ({ type: "image_url" } & { image_url: __AlefWireImageUrl }) | ({ type: "document" } & { document: __AlefWireDocumentContent }) | ({ type: "input_audio" } & { input_audio: __AlefWireAudioContent });
|
|
2169
2180
|
|
|
2170
2181
|
export declare class ChatStreamIterator {
|
|
2171
2182
|
next(value?: undefined): Promise<IteratorResult<ChatCompletionChunk, void>>
|
package/index.js
CHANGED
|
@@ -1,812 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
/* auto-generated by NAPI-RS */
|
|
5
|
-
|
|
6
|
-
const { readFileSync } = require('fs')
|
|
7
|
-
let nativeBinding = null;
|
|
8
|
-
const loadErrors = [];
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
3
|
+
const { platform, arch } = process;
|
|
10
4
|
const isMusl = () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
// Prefer the report-header `glibcVersion` string when present — fastest and
|
|
6
|
+
// unambiguous on Node builds that populate it. On Node 22+, certain CI
|
|
7
|
+
// environments leave `glibcVersion` undefined even on glibc systems, so the
|
|
8
|
+
// `=== undefined` branch from older napi-rs templates produces a false
|
|
9
|
+
// "is musl" positive. Fall through to the filesystem heuristic instead: on
|
|
10
|
+
// glibc systems `/lib64/ld-musl-x86_64.so.1` does not exist; on musl systems
|
|
11
|
+
// it always does. statSync errors → not musl.
|
|
12
|
+
if (typeof process.report === "object" && typeof process.report.getReport === "function") {
|
|
13
|
+
const report = process.report.getReport();
|
|
14
|
+
if (report && report.header && typeof report.header.glibcVersion === "string") {
|
|
15
|
+
return false;
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
return musl;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
25
|
-
|
|
26
|
-
const isMuslFromFilesystem = () => {
|
|
27
18
|
try {
|
|
28
|
-
|
|
19
|
+
require("fs").statSync("/lib64/ld-musl-x86_64.so.1");
|
|
20
|
+
return true;
|
|
29
21
|
} catch {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const isMuslFromReport = () => {
|
|
35
|
-
let report = null;
|
|
36
|
-
if (process.report && typeof process.report.getReport === "function") {
|
|
37
|
-
process.report.excludeNetwork = true;
|
|
38
|
-
report = process.report.getReport();
|
|
39
|
-
}
|
|
40
|
-
if (!report) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
if (report.header && report.header.glibcVersionRuntime) {
|
|
44
22
|
return false;
|
|
45
23
|
}
|
|
46
|
-
if (Array.isArray(report.sharedObjects)) {
|
|
47
|
-
if (report.sharedObjects.some(isFileMusl)) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
24
|
};
|
|
53
25
|
|
|
54
|
-
|
|
26
|
+
let nativeBinding = null;
|
|
27
|
+
const loadErrors = [];
|
|
28
|
+
|
|
29
|
+
function requireOptionalDependency(name) {
|
|
55
30
|
try {
|
|
56
|
-
return require(
|
|
31
|
+
return require(name);
|
|
57
32
|
} catch (e) {
|
|
58
|
-
|
|
59
|
-
return
|
|
33
|
+
loadErrors.push(`Optional dependency ${name}: ${e.message}`);
|
|
34
|
+
return null;
|
|
60
35
|
}
|
|
61
|
-
}
|
|
36
|
+
}
|
|
62
37
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-android-arm64/package.json").version;
|
|
80
|
-
if (
|
|
81
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
82
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
83
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
84
|
-
) {
|
|
85
|
-
throw new Error(
|
|
86
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
return binding;
|
|
90
|
-
} catch (e) {
|
|
91
|
-
loadErrors.push(e);
|
|
92
|
-
}
|
|
93
|
-
} else if (process.arch === "arm") {
|
|
94
|
-
try {
|
|
95
|
-
return require("./liter-llm-node.android-arm-eabi.node");
|
|
96
|
-
} catch (e) {
|
|
97
|
-
loadErrors.push(e);
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const binding = require("@xberg-io/liter-llm-android-arm-eabi");
|
|
101
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-android-arm-eabi/package.json").version;
|
|
102
|
-
if (
|
|
103
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
104
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
105
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
106
|
-
) {
|
|
107
|
-
throw new Error(
|
|
108
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
return binding;
|
|
112
|
-
} catch (e) {
|
|
113
|
-
loadErrors.push(e);
|
|
114
|
-
}
|
|
115
|
-
} else {
|
|
116
|
-
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
38
|
+
const tryLoadBinding = () => {
|
|
39
|
+
// Local `.node` files are named after `napi.binaryName` (binary file name on disk).
|
|
40
|
+
// Optional-dep packages are named after `napi.packageName` (npm subpackage names),
|
|
41
|
+
// which inherits any scope prefix from the parent package.
|
|
42
|
+
const targets = [
|
|
43
|
+
["linux", "x64", "gnu", "./liter-llm-node.linux-x64-gnu.node", "@xberg-io/liter-llm-linux-x64-gnu"],
|
|
44
|
+
["linux", "arm64", "gnu", "./liter-llm-node.linux-arm64-gnu.node", "@xberg-io/liter-llm-linux-arm64-gnu"],
|
|
45
|
+
["darwin", "x64", null, "./liter-llm-node.darwin-x64.node", "@xberg-io/liter-llm-darwin-x64"],
|
|
46
|
+
["darwin", "arm64", null, "./liter-llm-node.darwin-arm64.node", "@xberg-io/liter-llm-darwin-arm64"],
|
|
47
|
+
["win32", "x64", null, "./liter-llm-node.win32-x64-msvc.node", "@xberg-io/liter-llm-win32-x64-msvc"],
|
|
48
|
+
["win32", "arm64", null, "./liter-llm-node.win32-arm64-msvc.node", "@xberg-io/liter-llm-win32-arm64-msvc"],
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
for (const [plat, a, abi, localPath, optionalDep] of targets) {
|
|
52
|
+
if (platform !== plat || arch !== a) {
|
|
53
|
+
continue;
|
|
117
54
|
}
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
) {
|
|
124
|
-
try {
|
|
125
|
-
return require("./liter-llm-node.win32-x64-gnu.node");
|
|
126
|
-
} catch (e) {
|
|
127
|
-
loadErrors.push(e);
|
|
128
|
-
}
|
|
129
|
-
try {
|
|
130
|
-
const binding = require("@xberg-io/liter-llm-win32-x64-gnu");
|
|
131
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-win32-x64-gnu/package.json").version;
|
|
132
|
-
if (
|
|
133
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
134
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
135
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
136
|
-
) {
|
|
137
|
-
throw new Error(
|
|
138
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
return binding;
|
|
142
|
-
} catch (e) {
|
|
143
|
-
loadErrors.push(e);
|
|
144
|
-
}
|
|
145
|
-
} else {
|
|
146
|
-
try {
|
|
147
|
-
return require("./liter-llm-node.win32-x64-msvc.node");
|
|
148
|
-
} catch (e) {
|
|
149
|
-
loadErrors.push(e);
|
|
150
|
-
}
|
|
151
|
-
try {
|
|
152
|
-
const binding = require("@xberg-io/liter-llm-win32-x64-msvc");
|
|
153
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-win32-x64-msvc/package.json").version;
|
|
154
|
-
if (
|
|
155
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
156
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
157
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
158
|
-
) {
|
|
159
|
-
throw new Error(
|
|
160
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
return binding;
|
|
164
|
-
} catch (e) {
|
|
165
|
-
loadErrors.push(e);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
} else if (process.arch === "ia32") {
|
|
169
|
-
try {
|
|
170
|
-
return require("./liter-llm-node.win32-ia32-msvc.node");
|
|
171
|
-
} catch (e) {
|
|
172
|
-
loadErrors.push(e);
|
|
173
|
-
}
|
|
174
|
-
try {
|
|
175
|
-
const binding = require("@xberg-io/liter-llm-win32-ia32-msvc");
|
|
176
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-win32-ia32-msvc/package.json").version;
|
|
177
|
-
if (
|
|
178
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
179
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
180
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
181
|
-
) {
|
|
182
|
-
throw new Error(
|
|
183
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
return binding;
|
|
187
|
-
} catch (e) {
|
|
188
|
-
loadErrors.push(e);
|
|
189
|
-
}
|
|
190
|
-
} else if (process.arch === "arm64") {
|
|
191
|
-
try {
|
|
192
|
-
return require("./liter-llm-node.win32-arm64-msvc.node");
|
|
193
|
-
} catch (e) {
|
|
194
|
-
loadErrors.push(e);
|
|
195
|
-
}
|
|
196
|
-
try {
|
|
197
|
-
const binding = require("@xberg-io/liter-llm-win32-arm64-msvc");
|
|
198
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-win32-arm64-msvc/package.json").version;
|
|
199
|
-
if (
|
|
200
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
201
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
202
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
203
|
-
) {
|
|
204
|
-
throw new Error(
|
|
205
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
return binding;
|
|
209
|
-
} catch (e) {
|
|
210
|
-
loadErrors.push(e);
|
|
55
|
+
|
|
56
|
+
if (plat === "linux" && abi) {
|
|
57
|
+
const isCurMusl = isMusl();
|
|
58
|
+
if ((abi === "musl") !== isCurMusl) {
|
|
59
|
+
continue;
|
|
211
60
|
}
|
|
212
|
-
} else {
|
|
213
|
-
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
214
|
-
}
|
|
215
|
-
} else if (process.platform === "darwin") {
|
|
216
|
-
try {
|
|
217
|
-
return require("./liter-llm-node.darwin-universal.node");
|
|
218
|
-
} catch (e) {
|
|
219
|
-
loadErrors.push(e);
|
|
220
61
|
}
|
|
62
|
+
|
|
221
63
|
try {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
226
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
227
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
228
|
-
) {
|
|
229
|
-
throw new Error(
|
|
230
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
231
|
-
);
|
|
64
|
+
nativeBinding = require(localPath);
|
|
65
|
+
if (nativeBinding) {
|
|
66
|
+
return;
|
|
232
67
|
}
|
|
233
|
-
return binding;
|
|
234
68
|
} catch (e) {
|
|
235
|
-
loadErrors.push(e);
|
|
69
|
+
loadErrors.push(e.message);
|
|
236
70
|
}
|
|
237
|
-
if (process.arch === "x64") {
|
|
238
|
-
try {
|
|
239
|
-
return require("./liter-llm-node.darwin-x64.node");
|
|
240
|
-
} catch (e) {
|
|
241
|
-
loadErrors.push(e);
|
|
242
|
-
}
|
|
243
|
-
try {
|
|
244
|
-
const binding = require("@xberg-io/liter-llm-darwin-x64");
|
|
245
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-darwin-x64/package.json").version;
|
|
246
|
-
if (
|
|
247
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
248
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
249
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
250
|
-
) {
|
|
251
|
-
throw new Error(
|
|
252
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
return binding;
|
|
256
|
-
} catch (e) {
|
|
257
|
-
loadErrors.push(e);
|
|
258
|
-
}
|
|
259
|
-
} else if (process.arch === "arm64") {
|
|
260
|
-
try {
|
|
261
|
-
return require("./liter-llm-node.darwin-arm64.node");
|
|
262
|
-
} catch (e) {
|
|
263
|
-
loadErrors.push(e);
|
|
264
|
-
}
|
|
265
|
-
try {
|
|
266
|
-
const binding = require("@xberg-io/liter-llm-darwin-arm64");
|
|
267
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-darwin-arm64/package.json").version;
|
|
268
|
-
if (
|
|
269
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
270
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
271
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
272
|
-
) {
|
|
273
|
-
throw new Error(
|
|
274
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
return binding;
|
|
278
|
-
} catch (e) {
|
|
279
|
-
loadErrors.push(e);
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
283
|
-
}
|
|
284
|
-
} else if (process.platform === "freebsd") {
|
|
285
|
-
if (process.arch === "x64") {
|
|
286
|
-
try {
|
|
287
|
-
return require("./liter-llm-node.freebsd-x64.node");
|
|
288
|
-
} catch (e) {
|
|
289
|
-
loadErrors.push(e);
|
|
290
|
-
}
|
|
291
|
-
try {
|
|
292
|
-
const binding = require("@xberg-io/liter-llm-freebsd-x64");
|
|
293
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-freebsd-x64/package.json").version;
|
|
294
|
-
if (
|
|
295
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
296
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
297
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
298
|
-
) {
|
|
299
|
-
throw new Error(
|
|
300
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
return binding;
|
|
304
|
-
} catch (e) {
|
|
305
|
-
loadErrors.push(e);
|
|
306
|
-
}
|
|
307
|
-
} else if (process.arch === "arm64") {
|
|
308
|
-
try {
|
|
309
|
-
return require("./liter-llm-node.freebsd-arm64.node");
|
|
310
|
-
} catch (e) {
|
|
311
|
-
loadErrors.push(e);
|
|
312
|
-
}
|
|
313
|
-
try {
|
|
314
|
-
const binding = require("@xberg-io/liter-llm-freebsd-arm64");
|
|
315
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-freebsd-arm64/package.json").version;
|
|
316
|
-
if (
|
|
317
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
318
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
319
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
320
|
-
) {
|
|
321
|
-
throw new Error(
|
|
322
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
return binding;
|
|
326
|
-
} catch (e) {
|
|
327
|
-
loadErrors.push(e);
|
|
328
|
-
}
|
|
329
|
-
} else {
|
|
330
|
-
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
331
|
-
}
|
|
332
|
-
} else if (process.platform === "linux") {
|
|
333
|
-
if (process.arch === "x64") {
|
|
334
|
-
if (isMusl()) {
|
|
335
|
-
try {
|
|
336
|
-
return require("./liter-llm-node.linux-x64-musl.node");
|
|
337
|
-
} catch (e) {
|
|
338
|
-
loadErrors.push(e);
|
|
339
|
-
}
|
|
340
|
-
try {
|
|
341
|
-
const binding = require("@xberg-io/liter-llm-linux-x64-musl");
|
|
342
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-x64-musl/package.json").version;
|
|
343
|
-
if (
|
|
344
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
345
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
346
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
347
|
-
) {
|
|
348
|
-
throw new Error(
|
|
349
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
350
|
-
);
|
|
351
|
-
}
|
|
352
|
-
return binding;
|
|
353
|
-
} catch (e) {
|
|
354
|
-
loadErrors.push(e);
|
|
355
|
-
}
|
|
356
|
-
} else {
|
|
357
|
-
try {
|
|
358
|
-
return require("./liter-llm-node.linux-x64-gnu.node");
|
|
359
|
-
} catch (e) {
|
|
360
|
-
loadErrors.push(e);
|
|
361
|
-
}
|
|
362
|
-
try {
|
|
363
|
-
const binding = require("@xberg-io/liter-llm-linux-x64-gnu");
|
|
364
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-x64-gnu/package.json").version;
|
|
365
|
-
if (
|
|
366
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
367
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
369
|
-
) {
|
|
370
|
-
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
return binding;
|
|
375
|
-
} catch (e) {
|
|
376
|
-
loadErrors.push(e);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
} else if (process.arch === "arm64") {
|
|
380
|
-
if (isMusl()) {
|
|
381
|
-
try {
|
|
382
|
-
return require("./liter-llm-node.linux-arm64-musl.node");
|
|
383
|
-
} catch (e) {
|
|
384
|
-
loadErrors.push(e);
|
|
385
|
-
}
|
|
386
|
-
try {
|
|
387
|
-
const binding = require("@xberg-io/liter-llm-linux-arm64-musl");
|
|
388
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-arm64-musl/package.json").version;
|
|
389
|
-
if (
|
|
390
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
391
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
392
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
393
|
-
) {
|
|
394
|
-
throw new Error(
|
|
395
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
return binding;
|
|
399
|
-
} catch (e) {
|
|
400
|
-
loadErrors.push(e);
|
|
401
|
-
}
|
|
402
|
-
} else {
|
|
403
|
-
try {
|
|
404
|
-
return require("./liter-llm-node.linux-arm64-gnu.node");
|
|
405
|
-
} catch (e) {
|
|
406
|
-
loadErrors.push(e);
|
|
407
|
-
}
|
|
408
|
-
try {
|
|
409
|
-
const binding = require("@xberg-io/liter-llm-linux-arm64-gnu");
|
|
410
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-arm64-gnu/package.json").version;
|
|
411
|
-
if (
|
|
412
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
413
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
414
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
415
|
-
) {
|
|
416
|
-
throw new Error(
|
|
417
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
return binding;
|
|
421
|
-
} catch (e) {
|
|
422
|
-
loadErrors.push(e);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
} else if (process.arch === "arm") {
|
|
426
|
-
if (isMusl()) {
|
|
427
|
-
try {
|
|
428
|
-
return require("./liter-llm-node.linux-arm-musleabihf.node");
|
|
429
|
-
} catch (e) {
|
|
430
|
-
loadErrors.push(e);
|
|
431
|
-
}
|
|
432
|
-
try {
|
|
433
|
-
const binding = require("@xberg-io/liter-llm-linux-arm-musleabihf");
|
|
434
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-arm-musleabihf/package.json").version;
|
|
435
|
-
if (
|
|
436
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
437
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
438
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
439
|
-
) {
|
|
440
|
-
throw new Error(
|
|
441
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
442
|
-
);
|
|
443
|
-
}
|
|
444
|
-
return binding;
|
|
445
|
-
} catch (e) {
|
|
446
|
-
loadErrors.push(e);
|
|
447
|
-
}
|
|
448
|
-
} else {
|
|
449
|
-
try {
|
|
450
|
-
return require("./liter-llm-node.linux-arm-gnueabihf.node");
|
|
451
|
-
} catch (e) {
|
|
452
|
-
loadErrors.push(e);
|
|
453
|
-
}
|
|
454
|
-
try {
|
|
455
|
-
const binding = require("@xberg-io/liter-llm-linux-arm-gnueabihf");
|
|
456
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-arm-gnueabihf/package.json").version;
|
|
457
|
-
if (
|
|
458
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
459
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
461
|
-
) {
|
|
462
|
-
throw new Error(
|
|
463
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
return binding;
|
|
467
|
-
} catch (e) {
|
|
468
|
-
loadErrors.push(e);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
} else if (process.arch === "loong64") {
|
|
472
|
-
if (isMusl()) {
|
|
473
|
-
try {
|
|
474
|
-
return require("./liter-llm-node.linux-loong64-musl.node");
|
|
475
|
-
} catch (e) {
|
|
476
|
-
loadErrors.push(e);
|
|
477
|
-
}
|
|
478
|
-
try {
|
|
479
|
-
const binding = require("@xberg-io/liter-llm-linux-loong64-musl");
|
|
480
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-loong64-musl/package.json").version;
|
|
481
|
-
if (
|
|
482
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
483
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
484
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
485
|
-
) {
|
|
486
|
-
throw new Error(
|
|
487
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
488
|
-
);
|
|
489
|
-
}
|
|
490
|
-
return binding;
|
|
491
|
-
} catch (e) {
|
|
492
|
-
loadErrors.push(e);
|
|
493
|
-
}
|
|
494
|
-
} else {
|
|
495
|
-
try {
|
|
496
|
-
return require("./liter-llm-node.linux-loong64-gnu.node");
|
|
497
|
-
} catch (e) {
|
|
498
|
-
loadErrors.push(e);
|
|
499
|
-
}
|
|
500
|
-
try {
|
|
501
|
-
const binding = require("@xberg-io/liter-llm-linux-loong64-gnu");
|
|
502
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-loong64-gnu/package.json").version;
|
|
503
|
-
if (
|
|
504
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
505
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
506
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
507
|
-
) {
|
|
508
|
-
throw new Error(
|
|
509
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
return binding;
|
|
513
|
-
} catch (e) {
|
|
514
|
-
loadErrors.push(e);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
} else if (process.arch === "riscv64") {
|
|
518
|
-
if (isMusl()) {
|
|
519
|
-
try {
|
|
520
|
-
return require("./liter-llm-node.linux-riscv64-musl.node");
|
|
521
|
-
} catch (e) {
|
|
522
|
-
loadErrors.push(e);
|
|
523
|
-
}
|
|
524
|
-
try {
|
|
525
|
-
const binding = require("@xberg-io/liter-llm-linux-riscv64-musl");
|
|
526
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-riscv64-musl/package.json").version;
|
|
527
|
-
if (
|
|
528
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
529
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
530
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
531
|
-
) {
|
|
532
|
-
throw new Error(
|
|
533
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
534
|
-
);
|
|
535
|
-
}
|
|
536
|
-
return binding;
|
|
537
|
-
} catch (e) {
|
|
538
|
-
loadErrors.push(e);
|
|
539
|
-
}
|
|
540
|
-
} else {
|
|
541
|
-
try {
|
|
542
|
-
return require("./liter-llm-node.linux-riscv64-gnu.node");
|
|
543
|
-
} catch (e) {
|
|
544
|
-
loadErrors.push(e);
|
|
545
|
-
}
|
|
546
|
-
try {
|
|
547
|
-
const binding = require("@xberg-io/liter-llm-linux-riscv64-gnu");
|
|
548
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-riscv64-gnu/package.json").version;
|
|
549
|
-
if (
|
|
550
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
551
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
552
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
553
|
-
) {
|
|
554
|
-
throw new Error(
|
|
555
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
556
|
-
);
|
|
557
|
-
}
|
|
558
|
-
return binding;
|
|
559
|
-
} catch (e) {
|
|
560
|
-
loadErrors.push(e);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
} else if (process.arch === "ppc64") {
|
|
564
|
-
try {
|
|
565
|
-
return require("./liter-llm-node.linux-ppc64-gnu.node");
|
|
566
|
-
} catch (e) {
|
|
567
|
-
loadErrors.push(e);
|
|
568
|
-
}
|
|
569
|
-
try {
|
|
570
|
-
const binding = require("@xberg-io/liter-llm-linux-ppc64-gnu");
|
|
571
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-ppc64-gnu/package.json").version;
|
|
572
|
-
if (
|
|
573
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
574
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
575
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
576
|
-
) {
|
|
577
|
-
throw new Error(
|
|
578
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
|
-
return binding;
|
|
582
|
-
} catch (e) {
|
|
583
|
-
loadErrors.push(e);
|
|
584
|
-
}
|
|
585
|
-
} else if (process.arch === "s390x") {
|
|
586
|
-
try {
|
|
587
|
-
return require("./liter-llm-node.linux-s390x-gnu.node");
|
|
588
|
-
} catch (e) {
|
|
589
|
-
loadErrors.push(e);
|
|
590
|
-
}
|
|
591
|
-
try {
|
|
592
|
-
const binding = require("@xberg-io/liter-llm-linux-s390x-gnu");
|
|
593
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-linux-s390x-gnu/package.json").version;
|
|
594
|
-
if (
|
|
595
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
596
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
597
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
598
|
-
) {
|
|
599
|
-
throw new Error(
|
|
600
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
601
|
-
);
|
|
602
|
-
}
|
|
603
|
-
return binding;
|
|
604
|
-
} catch (e) {
|
|
605
|
-
loadErrors.push(e);
|
|
606
|
-
}
|
|
607
|
-
} else {
|
|
608
|
-
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
609
|
-
}
|
|
610
|
-
} else if (process.platform === "openharmony") {
|
|
611
|
-
if (process.arch === "arm64") {
|
|
612
|
-
try {
|
|
613
|
-
return require("./liter-llm-node.openharmony-arm64.node");
|
|
614
|
-
} catch (e) {
|
|
615
|
-
loadErrors.push(e);
|
|
616
|
-
}
|
|
617
|
-
try {
|
|
618
|
-
const binding = require("@xberg-io/liter-llm-openharmony-arm64");
|
|
619
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-openharmony-arm64/package.json").version;
|
|
620
|
-
if (
|
|
621
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
622
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
623
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
624
|
-
) {
|
|
625
|
-
throw new Error(
|
|
626
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
627
|
-
);
|
|
628
|
-
}
|
|
629
|
-
return binding;
|
|
630
|
-
} catch (e) {
|
|
631
|
-
loadErrors.push(e);
|
|
632
|
-
}
|
|
633
|
-
} else if (process.arch === "x64") {
|
|
634
|
-
try {
|
|
635
|
-
return require("./liter-llm-node.openharmony-x64.node");
|
|
636
|
-
} catch (e) {
|
|
637
|
-
loadErrors.push(e);
|
|
638
|
-
}
|
|
639
|
-
try {
|
|
640
|
-
const binding = require("@xberg-io/liter-llm-openharmony-x64");
|
|
641
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-openharmony-x64/package.json").version;
|
|
642
|
-
if (
|
|
643
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
644
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
645
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
646
|
-
) {
|
|
647
|
-
throw new Error(
|
|
648
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
649
|
-
);
|
|
650
|
-
}
|
|
651
|
-
return binding;
|
|
652
|
-
} catch (e) {
|
|
653
|
-
loadErrors.push(e);
|
|
654
|
-
}
|
|
655
|
-
} else if (process.arch === "arm") {
|
|
656
|
-
try {
|
|
657
|
-
return require("./liter-llm-node.openharmony-arm.node");
|
|
658
|
-
} catch (e) {
|
|
659
|
-
loadErrors.push(e);
|
|
660
|
-
}
|
|
661
|
-
try {
|
|
662
|
-
const binding = require("@xberg-io/liter-llm-openharmony-arm");
|
|
663
|
-
const bindingPackageVersion = require("@xberg-io/liter-llm-openharmony-arm/package.json").version;
|
|
664
|
-
if (
|
|
665
|
-
bindingPackageVersion !== "1.17.1" &&
|
|
666
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
667
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
668
|
-
) {
|
|
669
|
-
throw new Error(
|
|
670
|
-
`Native binding package version mismatch, expected 1.17.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
671
|
-
);
|
|
672
|
-
}
|
|
673
|
-
return binding;
|
|
674
|
-
} catch (e) {
|
|
675
|
-
loadErrors.push(e);
|
|
676
|
-
}
|
|
677
|
-
} else {
|
|
678
|
-
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
679
|
-
}
|
|
680
|
-
} else {
|
|
681
|
-
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
nativeBinding = requireNative();
|
|
686
|
-
|
|
687
|
-
// NAPI_RS_FORCE_WASI is a tri-state flag:
|
|
688
|
-
// unset / any other value → native binding preferred, WASI is only a fallback
|
|
689
|
-
// 'true' → force WASI fallback even if native loaded
|
|
690
|
-
// 'error' → force WASI and throw if no WASI binding is found
|
|
691
|
-
// Treating any non-empty string as truthy (the historical behavior) meant
|
|
692
|
-
// NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
|
|
693
|
-
// the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
|
|
694
|
-
const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || process.env.NAPI_RS_FORCE_WASI === "error";
|
|
695
71
|
|
|
696
|
-
if (!nativeBinding || forceWasi) {
|
|
697
|
-
let wasiBinding = null;
|
|
698
|
-
let wasiBindingError = null;
|
|
699
|
-
try {
|
|
700
|
-
wasiBinding = require("./liter-llm-node.wasi.cjs");
|
|
701
|
-
nativeBinding = wasiBinding;
|
|
702
|
-
} catch (err) {
|
|
703
|
-
if (forceWasi) {
|
|
704
|
-
wasiBindingError = err;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (!nativeBinding || forceWasi) {
|
|
708
72
|
try {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
if (!wasiBindingError) {
|
|
714
|
-
wasiBindingError = err;
|
|
715
|
-
} else {
|
|
716
|
-
wasiBindingError.cause = err;
|
|
717
|
-
}
|
|
718
|
-
loadErrors.push(err);
|
|
73
|
+
const optBinding = requireOptionalDependency(optionalDep);
|
|
74
|
+
if (optBinding) {
|
|
75
|
+
nativeBinding = optBinding;
|
|
76
|
+
return;
|
|
719
77
|
}
|
|
78
|
+
} catch (e) {
|
|
79
|
+
loadErrors.push(e.message);
|
|
720
80
|
}
|
|
721
81
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
throw error;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
tryLoadBinding();
|
|
728
85
|
|
|
729
86
|
if (!nativeBinding) {
|
|
730
|
-
|
|
731
|
-
const error = new Error(
|
|
732
|
-
`Cannot find native binding. ` +
|
|
733
|
-
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
734
|
-
"Please try `npm i` again after removing both package-lock.json and node_modules directory.",
|
|
735
|
-
);
|
|
736
|
-
// assign instead of the `new Error(message, { cause })` options form,
|
|
737
|
-
// which Node < 16.9 silently ignores
|
|
738
|
-
error.cause = loadErrors.reduce((err, cur) => {
|
|
739
|
-
cur.cause = err;
|
|
740
|
-
return cur;
|
|
741
|
-
});
|
|
742
|
-
throw error;
|
|
743
|
-
}
|
|
744
|
-
throw new Error(`Failed to load native binding`);
|
|
87
|
+
throw new Error(`Failed to load native binding for ${platform}-${arch}. Errors: ${loadErrors.join(", ")}`);
|
|
745
88
|
}
|
|
746
89
|
|
|
747
90
|
module.exports = nativeBinding;
|
|
748
|
-
module.exports.ChatStreamIterator = nativeBinding.ChatStreamIterator;
|
|
749
|
-
module.exports.DefaultClient = nativeBinding.DefaultClient;
|
|
750
|
-
module.exports.JsDefaultClient = nativeBinding.JsDefaultClient;
|
|
751
|
-
module.exports.JsLiterLlmErrorInfo = nativeBinding.JsLiterLlmErrorInfo;
|
|
752
|
-
module.exports.SingleflightResult = nativeBinding.SingleflightResult;
|
|
753
|
-
module.exports.JsSingleflightResult = nativeBinding.JsSingleflightResult;
|
|
754
|
-
module.exports.allProviders = nativeBinding.allProviders;
|
|
755
|
-
module.exports.AuthHeaderFormat = nativeBinding.AuthHeaderFormat;
|
|
756
|
-
module.exports.JsAuthHeaderFormat = nativeBinding.JsAuthHeaderFormat;
|
|
757
|
-
module.exports.AuthType = nativeBinding.AuthType;
|
|
758
|
-
module.exports.JsAuthType = nativeBinding.JsAuthType;
|
|
759
|
-
module.exports.BatchStatus = nativeBinding.BatchStatus;
|
|
760
|
-
module.exports.JsBatchStatus = nativeBinding.JsBatchStatus;
|
|
761
|
-
module.exports.budgetConfigDefault = nativeBinding.budgetConfigDefault;
|
|
762
|
-
module.exports.cacheConfigDefault = nativeBinding.cacheConfigDefault;
|
|
763
|
-
module.exports.capabilities = nativeBinding.capabilities;
|
|
764
|
-
module.exports.catalogRefreshConfigDefault = nativeBinding.catalogRefreshConfigDefault;
|
|
765
|
-
module.exports.chatStream = nativeBinding.chatStream;
|
|
766
|
-
module.exports.checkBound = nativeBinding.checkBound;
|
|
767
|
-
module.exports.CircuitState = nativeBinding.CircuitState;
|
|
768
|
-
module.exports.JsCircuitState = nativeBinding.JsCircuitState;
|
|
769
|
-
module.exports.clear = nativeBinding.clear;
|
|
770
|
-
module.exports.clearCatalogOverlay = nativeBinding.clearCatalogOverlay;
|
|
771
|
-
module.exports.completionCost = nativeBinding.completionCost;
|
|
772
|
-
module.exports.completionCostWithCache = nativeBinding.completionCostWithCache;
|
|
773
|
-
module.exports.complexProviderNames = nativeBinding.complexProviderNames;
|
|
774
|
-
module.exports.countRequestTokens = nativeBinding.countRequestTokens;
|
|
775
|
-
module.exports.countTokens = nativeBinding.countTokens;
|
|
776
|
-
module.exports.createClient = nativeBinding.createClient;
|
|
777
|
-
module.exports.createClientFromJson = nativeBinding.createClientFromJson;
|
|
778
|
-
module.exports.decodeDataUrl = nativeBinding.decodeDataUrl;
|
|
779
|
-
module.exports.EmbeddingFormat = nativeBinding.EmbeddingFormat;
|
|
780
|
-
module.exports.JsEmbeddingFormat = nativeBinding.JsEmbeddingFormat;
|
|
781
|
-
module.exports.encodeDataUrl = nativeBinding.encodeDataUrl;
|
|
782
|
-
module.exports.Enforcement = nativeBinding.Enforcement;
|
|
783
|
-
module.exports.JsEnforcement = nativeBinding.JsEnforcement;
|
|
784
|
-
module.exports.ensureCryptoProvider = nativeBinding.ensureCryptoProvider;
|
|
785
|
-
module.exports.FilePurpose = nativeBinding.FilePurpose;
|
|
786
|
-
module.exports.JsFilePurpose = nativeBinding.JsFilePurpose;
|
|
787
|
-
module.exports.FinishReason = nativeBinding.FinishReason;
|
|
788
|
-
module.exports.JsFinishReason = nativeBinding.JsFinishReason;
|
|
789
|
-
module.exports.HealthStatus = nativeBinding.HealthStatus;
|
|
790
|
-
module.exports.JsHealthStatus = nativeBinding.JsHealthStatus;
|
|
791
|
-
module.exports.ImageDetail = nativeBinding.ImageDetail;
|
|
792
|
-
module.exports.JsImageDetail = nativeBinding.JsImageDetail;
|
|
793
|
-
module.exports.installCatalogOverlayFromStr = nativeBinding.installCatalogOverlayFromStr;
|
|
794
|
-
module.exports.Modality = nativeBinding.Modality;
|
|
795
|
-
module.exports.JsModality = nativeBinding.JsModality;
|
|
796
|
-
module.exports.modelInfo = nativeBinding.modelInfo;
|
|
797
|
-
module.exports.rateLimitConfigDefault = nativeBinding.rateLimitConfigDefault;
|
|
798
|
-
module.exports.ReasoningEffort = nativeBinding.ReasoningEffort;
|
|
799
|
-
module.exports.JsReasoningEffort = nativeBinding.JsReasoningEffort;
|
|
800
|
-
module.exports.recordCostUsd = nativeBinding.recordCostUsd;
|
|
801
|
-
module.exports.refreshCatalog = nativeBinding.refreshCatalog;
|
|
802
|
-
module.exports.RefreshOutcome = nativeBinding.RefreshOutcome;
|
|
803
|
-
module.exports.JsRefreshOutcome = nativeBinding.JsRefreshOutcome;
|
|
804
|
-
module.exports.registerCustomProvider = nativeBinding.registerCustomProvider;
|
|
805
|
-
module.exports.StreamFormat = nativeBinding.StreamFormat;
|
|
806
|
-
module.exports.JsStreamFormat = nativeBinding.JsStreamFormat;
|
|
807
|
-
module.exports.ToolChoiceMode = nativeBinding.ToolChoiceMode;
|
|
808
|
-
module.exports.JsToolChoiceMode = nativeBinding.JsToolChoiceMode;
|
|
809
|
-
module.exports.ToolType = nativeBinding.ToolType;
|
|
810
|
-
module.exports.JsToolType = nativeBinding.JsToolType;
|
|
811
|
-
module.exports.unregisterCustomProvider = nativeBinding.unregisterCustomProvider;
|
|
812
|
-
module.exports.waitForBatchConfigDefault = nativeBinding.waitForBatchConfigDefault;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xberg-io/liter-llm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Universal LLM API client with Rust-powered polyglot bindings.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": ["index.js", "index.d.ts", "*.node"],
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@xberg-io/liter-llm-linux-x64-gnu": "
|
|
28
|
-
"@xberg-io/liter-llm-linux-arm64-gnu": "
|
|
29
|
-
"@xberg-io/liter-llm-darwin-x64": "
|
|
30
|
-
"@xberg-io/liter-llm-darwin-arm64": "
|
|
31
|
-
"@xberg-io/liter-llm-win32-x64-msvc": "
|
|
32
|
-
"@xberg-io/liter-llm-win32-arm64-msvc": "
|
|
27
|
+
"@xberg-io/liter-llm-linux-x64-gnu": "2.0.0",
|
|
28
|
+
"@xberg-io/liter-llm-linux-arm64-gnu": "2.0.0",
|
|
29
|
+
"@xberg-io/liter-llm-darwin-x64": "2.0.0",
|
|
30
|
+
"@xberg-io/liter-llm-darwin-arm64": "2.0.0",
|
|
31
|
+
"@xberg-io/liter-llm-win32-x64-msvc": "2.0.0",
|
|
32
|
+
"@xberg-io/liter-llm-win32-arm64-msvc": "2.0.0"
|
|
33
33
|
},
|
|
34
34
|
"napi": {
|
|
35
35
|
"packageName": "@xberg-io/liter-llm",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
]
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
|
-
"build": "npx --yes -p @napi-rs/cli@^3.8.6 napi build --platform --release",
|
|
47
|
+
"build": "npx --yes -p @napi-rs/cli@^3.8.6 napi build --platform --no-js --dts index.native.d.ts --release",
|
|
48
48
|
"artifacts": "npx --yes -p @napi-rs/cli@^3.8.6 napi artifacts",
|
|
49
49
|
"prepublishOnly": "npx --yes -p @napi-rs/cli@^3.8.6 napi prepublish -t npm --skip-optional-publish"
|
|
50
50
|
},
|