@openclaw/onnx 2026.10.10-beta.5 → 2026.11.1
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/dist/.setup/{artifacts-CD0XZUIN.mjs → artifacts-BoNZbqnR.mjs} +2 -3
- package/dist/.setup/{catalog-Bgbx4LHv.mjs → catalog-0M53kmJq.mjs} +1 -2
- package/dist/.setup/{cli-Bs1V3EDP.mjs → cli-Dc9p3Cjs.mjs} +4 -5
- package/dist/.setup/{model-loader-C6GHyZWy.mjs → model-loader-Dkk1GRxt.mjs} +8 -13
- package/dist/.setup/{protocol-lN8zQ8J3.mjs → protocol-0QYyt_af.mjs} +2 -4
- package/dist/.setup/{worker-client-DUApeDD4.mjs → worker-client-cQ1VR-j4.mjs} +4 -6
- package/dist/.source-module-urls/c006b803da4ad0d774d12fd121a0790ab987a6423243e5bb28b74c5ce87a8b57.json +1 -1
- package/dist/index.js +5 -7
- package/dist/src/inference.worker.js +3 -4
- package/package.json +4 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as OnnxWorkerError } from "./protocol-
|
|
1
|
+
import { t as OnnxWorkerError } from "./protocol-0QYyt_af.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
4
|
import { Value } from "typebox/value";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { readFileWindowFully, root, sha256File } from "openclaw/plugin-sdk/file-access-runtime";
|
|
8
|
-
|
|
8
|
+
// extensions/onnx/src/artifacts.ts
|
|
9
9
|
const ExportSchema = Type.Object({
|
|
10
10
|
modelId: Type.String(),
|
|
11
11
|
sourceRevision: Type.String({ pattern: "^[a-f0-9]{40}$" }),
|
|
@@ -152,5 +152,4 @@ async function downloadModel(root$1, model, signal) {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
//#endregion
|
|
156
155
|
export { verifyModel as i, readModelArtifact as n, resolveModelFiles as r, downloadModel as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/onnx/src/catalog.ts
|
|
2
2
|
const MODELS = [
|
|
3
3
|
{
|
|
4
4
|
id: "gliclass-edge-v3.0",
|
|
@@ -169,5 +169,4 @@ const MODELS = [
|
|
|
169
169
|
function findModel(id) {
|
|
170
170
|
return MODELS.find((model) => model.id === id);
|
|
171
171
|
}
|
|
172
|
-
//#endregion
|
|
173
172
|
export { findModel as n, MODELS as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as findModel, t as MODELS } from "./catalog-
|
|
2
|
-
import { n as createOnnxProvider, t as InferenceWorkerClient } from "./worker-client-
|
|
3
|
-
import { i as verifyModel, t as downloadModel } from "./artifacts-
|
|
1
|
+
import { n as findModel, t as MODELS } from "./catalog-0M53kmJq.mjs";
|
|
2
|
+
import { n as createOnnxProvider, t as InferenceWorkerClient } from "./worker-client-cQ1VR-j4.mjs";
|
|
3
|
+
import { i as verifyModel, t as downloadModel } from "./artifacts-BoNZbqnR.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
|
|
5
|
+
// extensions/onnx/src/cli.ts
|
|
6
6
|
function registerOnnxCli({ program }, settings, workerUrl, resolvePath) {
|
|
7
7
|
const root = program.command("onnx").description("Download, verify, and check local ONNX decision models");
|
|
8
8
|
const config = (options) => ({
|
|
@@ -91,5 +91,4 @@ function registerOnnxCli({ program }, settings, workerUrl, resolvePath) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
//#endregion
|
|
95
94
|
export { registerOnnxCli };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as findModel } from "./catalog-
|
|
2
|
-
import { i as UnsupportedInputError, t as OnnxWorkerError } from "./protocol-
|
|
3
|
-
import { n as readModelArtifact, r as resolveModelFiles } from "./artifacts-
|
|
1
|
+
import { n as findModel } from "./catalog-0M53kmJq.mjs";
|
|
2
|
+
import { i as UnsupportedInputError, t as OnnxWorkerError } from "./protocol-0QYyt_af.mjs";
|
|
3
|
+
import { n as readModelArtifact, r as resolveModelFiles } from "./artifacts-BoNZbqnR.mjs";
|
|
4
4
|
import { Tokenizer } from "@huggingface/tokenizers";
|
|
5
5
|
import { InferenceSession, Tensor } from "onnxruntime-node";
|
|
6
|
-
|
|
6
|
+
// extensions/onnx/src/models/tokenize.ts
|
|
7
7
|
function tokenIds(value) {
|
|
8
8
|
return Array.isArray(value) && value.every((id) => typeof id === "number" && Number.isSafeInteger(id) && id >= 0);
|
|
9
9
|
}
|
|
@@ -15,8 +15,7 @@ function encodeModelText(tokenizer, text, options) {
|
|
|
15
15
|
attention_mask: encoded.attention_mask
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
//#region extensions/onnx/src/models/deberta.ts
|
|
18
|
+
// extensions/onnx/src/models/deberta.ts
|
|
20
19
|
function createDebertaAdapter({ session, tokenizer, maxTokens }) {
|
|
21
20
|
return { async classify({ text, labels, instructions, descriptions }) {
|
|
22
21
|
const premise = instructions ? `${instructions}\n${text}` : text;
|
|
@@ -59,8 +58,7 @@ function createDebertaAdapter({ session, tokenizer, maxTokens }) {
|
|
|
59
58
|
};
|
|
60
59
|
} };
|
|
61
60
|
}
|
|
62
|
-
|
|
63
|
-
//#region extensions/onnx/src/models/gliclass.ts
|
|
61
|
+
// extensions/onnx/src/models/gliclass.ts
|
|
64
62
|
function createGliclassAdapter(context) {
|
|
65
63
|
const labelToken = context.tokenizer.token_to_id("<<LABEL>>");
|
|
66
64
|
const separatorToken = context.tokenizer.token_to_id("<<SEP>>");
|
|
@@ -88,8 +86,7 @@ function createGliclassAdapter(context) {
|
|
|
88
86
|
};
|
|
89
87
|
} };
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
//#region extensions/onnx/src/models/gliner.ts
|
|
89
|
+
// extensions/onnx/src/models/gliner.ts
|
|
93
90
|
const WORDS = /(?:https?:\/\/[^\s]+|www\.[^\s]+)|[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}|@[a-z0-9_]+|[\p{L}\p{N}_]+(?:[-_][\p{L}\p{N}_]+)*|\S/giu;
|
|
94
91
|
const RESERVED = /\[(?:P|L|C|E|R|DESCRIPTION|EXAMPLE|OUTPUT|SEP_TEXT|SEP_STRUCT)\]|[()]/u;
|
|
95
92
|
function indices(values) {
|
|
@@ -159,8 +156,7 @@ function createGlinerAdapter({ session, tokenizer, maxTokens }) {
|
|
|
159
156
|
};
|
|
160
157
|
} };
|
|
161
158
|
}
|
|
162
|
-
|
|
163
|
-
//#region extensions/onnx/src/model-loader.ts
|
|
159
|
+
// extensions/onnx/src/model-loader.ts
|
|
164
160
|
function jsonObject(data) {
|
|
165
161
|
const parsed = JSON.parse(data.toString("utf8"));
|
|
166
162
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new OnnxWorkerError("model-integrity");
|
|
@@ -225,5 +221,4 @@ var ModelCache = class {
|
|
|
225
221
|
}
|
|
226
222
|
}
|
|
227
223
|
};
|
|
228
|
-
//#endregion
|
|
229
224
|
export { ModelCache };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { Value } from "typebox/value";
|
|
3
|
-
|
|
3
|
+
// extensions/onnx/src/models/types.ts
|
|
4
4
|
var UnsupportedInputError = class extends Error {};
|
|
5
|
-
|
|
6
|
-
//#region extensions/onnx/src/protocol.ts
|
|
5
|
+
// extensions/onnx/src/protocol.ts
|
|
7
6
|
const ModelInputSchema = Type.Object({
|
|
8
7
|
text: Type.String({ maxLength: 262144 }),
|
|
9
8
|
labels: Type.Array(Type.String({
|
|
@@ -111,5 +110,4 @@ var OnnxWorkerError = class extends Error {
|
|
|
111
110
|
this.code = code;
|
|
112
111
|
}
|
|
113
112
|
};
|
|
114
|
-
//#endregion
|
|
115
113
|
export { UnsupportedInputError as i, parseWorkerReply as n, parseWorkerRequest as r, OnnxWorkerError as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as findModel } from "./catalog-
|
|
2
|
-
import { i as UnsupportedInputError, n as parseWorkerReply, r as parseWorkerRequest, t as OnnxWorkerError } from "./protocol-
|
|
1
|
+
import { n as findModel } from "./catalog-0M53kmJq.mjs";
|
|
2
|
+
import { i as UnsupportedInputError, n as parseWorkerReply, r as parseWorkerRequest, t as OnnxWorkerError } from "./protocol-0QYyt_af.mjs";
|
|
3
3
|
import { createDeferred } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
4
4
|
import { resolveRuntimeWorkerArgv, spawnOomScoreAdjusted } from "openclaw/plugin-sdk/process-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/onnx/src/decisions.ts
|
|
6
6
|
function render(value) {
|
|
7
7
|
return typeof value === "string" ? value : JSON.stringify(value);
|
|
8
8
|
}
|
|
@@ -122,8 +122,7 @@ function createOnnxProvider(client, warn) {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
//#region extensions/onnx/src/worker-client.ts
|
|
125
|
+
// extensions/onnx/src/worker-client.ts
|
|
127
126
|
function workerEnv() {
|
|
128
127
|
const env = {};
|
|
129
128
|
for (const key of [
|
|
@@ -325,5 +324,4 @@ var InferenceWorkerClient = class {
|
|
|
325
324
|
worker.child.kill("SIGKILL");
|
|
326
325
|
}
|
|
327
326
|
};
|
|
328
|
-
//#endregion
|
|
329
327
|
export { createOnnxProvider as n, InferenceWorkerClient as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"index.js","source":"extensions/onnx/index.ts"},{"output":"src/inference.worker.js","source":"extensions/onnx/src/inference.worker.ts"}],"chunks":[{"output":".setup/artifacts-
|
|
1
|
+
{"version":3,"entries":[{"output":"index.js","source":"extensions/onnx/index.ts"},{"output":"src/inference.worker.js","source":"extensions/onnx/src/inference.worker.ts"}],"chunks":[{"output":".setup/artifacts-BoNZbqnR.mjs","sha256":"f9b8500c3bd96f75f706b9c1e1fe1e09a0bd02f7311f93604b6253d08638e065","facadeSource":null,"sources":["extensions/onnx/src/artifacts.ts"]},{"output":".setup/catalog-0M53kmJq.mjs","sha256":"25917d745fa90a2541e2a42f989b4355936e5531ac5b70df365297316ca6027f","facadeSource":null,"sources":["extensions/onnx/src/catalog.ts"]},{"output":".setup/cli-Dc9p3Cjs.mjs","sha256":"5d61e386b371cba9721002bea851ebe46f50a774c625985a47029049146f60fa","facadeSource":"extensions/onnx/src/cli.ts","sources":["extensions/onnx/src/cli.ts"]},{"output":".setup/model-loader-Dkk1GRxt.mjs","sha256":"53927e49867f12d6a4c144721c68106e4787c1a02454b277b1efd583d87e44e2","facadeSource":"extensions/onnx/src/model-loader.ts","sources":["extensions/onnx/src/model-loader.ts","extensions/onnx/src/models/deberta.ts","extensions/onnx/src/models/gliclass.ts","extensions/onnx/src/models/gliner.ts","extensions/onnx/src/models/tokenize.ts"]},{"output":".setup/protocol-0QYyt_af.mjs","sha256":"845f1eaf37b8243e54b1433a94a84afe6c9a9e73d4d4bd4dfe0cd6012bd5e897","facadeSource":null,"sources":["extensions/onnx/src/models/types.ts","extensions/onnx/src/protocol.ts"]},{"output":".setup/worker-client-cQ1VR-j4.mjs","sha256":"224d5a0653eadb4d55c498acbcbff87dabbcefa88026a57aece80eed31318749","facadeSource":null,"sources":["extensions/onnx/src/decisions.ts","extensions/onnx/src/worker-client.ts"]},{"output":"index.js","sha256":"ad177f1ba6aa0eee84b254e905ed4a2273e082391aadd53579435841c10659b2","facadeSource":"extensions/onnx/index.ts","sources":["extensions/onnx/index.ts","extensions/onnx/src/config.ts"]},{"output":"src/inference.worker.js","sha256":"efea4edae30e3dddfe13cd1150427046932a5fcd1cf1f733ca70c11438ea4d6f","facadeSource":"extensions/onnx/src/inference.worker.ts","sources":["extensions/onnx/src/inference.worker.ts"]}],"unrenderedSources":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as findModel } from "./.setup/catalog-
|
|
2
|
-
import { n as createOnnxProvider, t as InferenceWorkerClient } from "./.setup/worker-client-
|
|
1
|
+
import { n as findModel } from "./.setup/catalog-0M53kmJq.mjs";
|
|
2
|
+
import { n as createOnnxProvider, t as InferenceWorkerClient } from "./.setup/worker-client-cQ1VR-j4.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
6
6
|
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
7
7
|
import { Type } from "typebox";
|
|
8
|
-
|
|
8
|
+
// extensions/onnx/src/config.ts
|
|
9
9
|
const ConfigSchema = Type.Object({
|
|
10
10
|
modelDir: Type.Optional(Type.String({
|
|
11
11
|
minLength: 1,
|
|
@@ -33,8 +33,7 @@ function resolveOnnxConfig(config, resolvePath) {
|
|
|
33
33
|
maxLoadedModels
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
//#region extensions/onnx/index.ts
|
|
36
|
+
// extensions/onnx/index.ts
|
|
38
37
|
function selectedModels(config) {
|
|
39
38
|
const selectors = [config.agents?.defaults?.decisionModel, ...Object.values(config.agents?.entries ?? {}).map((agent) => agent.decisionModel)];
|
|
40
39
|
return [...new Set(selectors.flatMap((selector) => {
|
|
@@ -72,7 +71,7 @@ var onnx_default = definePluginEntry({
|
|
|
72
71
|
});
|
|
73
72
|
api.lifecycle?.onDispose?.(() => client.stop());
|
|
74
73
|
api.registerCli(async (context) => {
|
|
75
|
-
const { registerOnnxCli } = await import("./.setup/cli-
|
|
74
|
+
const { registerOnnxCli } = await import("./.setup/cli-Dc9p3Cjs.mjs");
|
|
76
75
|
registerOnnxCli(context, config, workerUrl, api.resolvePath);
|
|
77
76
|
}, { descriptors: [{
|
|
78
77
|
name: "onnx",
|
|
@@ -81,5 +80,4 @@ var onnx_default = definePluginEntry({
|
|
|
81
80
|
}] });
|
|
82
81
|
}
|
|
83
82
|
});
|
|
84
|
-
//#endregion
|
|
85
83
|
export { onnx_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as UnsupportedInputError, r as parseWorkerRequest, t as OnnxWorkerError } from "../.setup/protocol-
|
|
2
|
-
|
|
1
|
+
import { i as UnsupportedInputError, r as parseWorkerRequest, t as OnnxWorkerError } from "../.setup/protocol-0QYyt_af.mjs";
|
|
2
|
+
// extensions/onnx/src/inference.worker.ts
|
|
3
3
|
let config;
|
|
4
4
|
let cache;
|
|
5
5
|
let stopping = false;
|
|
@@ -53,7 +53,7 @@ async function handle(value) {
|
|
|
53
53
|
if (!cache) {
|
|
54
54
|
let implementation;
|
|
55
55
|
try {
|
|
56
|
-
implementation = await import("../.setup/model-loader-
|
|
56
|
+
implementation = await import("../.setup/model-loader-Dkk1GRxt.mjs");
|
|
57
57
|
} catch {
|
|
58
58
|
throw new OnnxWorkerError("dependency-unavailable");
|
|
59
59
|
}
|
|
@@ -89,5 +89,4 @@ async function handle(value) {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/onnx",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.1",
|
|
4
4
|
"description": "Local ONNX decision models for OpenClaw",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"minHostVersion": ">=2026.9.6"
|
|
29
29
|
},
|
|
30
30
|
"compat": {
|
|
31
|
-
"pluginApi": ">=2026.
|
|
31
|
+
"pluginApi": ">=2026.11.1"
|
|
32
32
|
},
|
|
33
33
|
"build": {
|
|
34
34
|
"bundledDist": false,
|
|
35
|
-
"openclawVersion": "2026.
|
|
35
|
+
"openclawVersion": "2026.11.1",
|
|
36
36
|
"workerEntries": [
|
|
37
37
|
"./src/inference.worker.ts"
|
|
38
38
|
],
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"assets/activity.svg"
|
|
61
61
|
],
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"openclaw": ">=2026.
|
|
63
|
+
"openclaw": ">=2026.11.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"openclaw": {
|