@openclaw/onnx 2026.11.7 → 2026.11.9
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-Ca0QH6_i.mjs → artifacts-DgGGpngs.mjs} +2 -3
- package/dist/.setup/{catalog-1BypY0zY.mjs → catalog-g9or975s.mjs} +1 -2
- package/dist/.setup/{cli-1ENeSnvV.mjs → cli-wozJmsLz.mjs} +4 -5
- package/dist/.setup/{model-loader-qxzJEnKc.mjs → model-loader-DDsav9p5.mjs} +5 -7
- package/dist/.setup/{protocol-YadX71Hf.mjs → protocol-CG1ILdRP.mjs} +2 -4
- package/dist/.setup/{worker-client-DkWtdqU9.mjs → worker-client-C6PMT6Zd.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-CG1ILdRP.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { readFileWindowFully, root, sha256File } from "openclaw/plugin-sdk/file-access-runtime";
|
|
7
7
|
import { Value } from "typebox/value";
|
|
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
|
function file(bytes, sha256, path = "model.onnx") {
|
|
3
3
|
return {
|
|
4
4
|
name: path.slice(path.lastIndexOf("/") + 1),
|
|
@@ -43,5 +43,4 @@ const MODELS = [
|
|
|
43
43
|
function findModel(id) {
|
|
44
44
|
return MODELS.find((model) => model.id === id);
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
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-g9or975s.mjs";
|
|
2
|
+
import { n as createOnnxProvider, t as InferenceWorkerClient } from "./worker-client-C6PMT6Zd.mjs";
|
|
3
|
+
import { i as verifyModel, t as downloadModel } from "./artifacts-DgGGpngs.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 { n as UnsupportedInputError, t as OnnxWorkerError } from "./protocol-
|
|
3
|
-
import { n as readModelArtifact, r as resolveModelFiles } from "./artifacts-
|
|
1
|
+
import { n as findModel } from "./catalog-g9or975s.mjs";
|
|
2
|
+
import { n as UnsupportedInputError, t as OnnxWorkerError } from "./protocol-CG1ILdRP.mjs";
|
|
3
|
+
import { n as readModelArtifact, r as resolveModelFiles } from "./artifacts-DgGGpngs.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/model-loader.ts
|
|
18
|
+
// extensions/onnx/src/model-loader.ts
|
|
20
19
|
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;
|
|
21
20
|
const RESERVED = /\[(?:P|L|C|E|R|DESCRIPTION|EXAMPLE|OUTPUT|SEP_TEXT|SEP_STRUCT)\]|[()]/u;
|
|
22
21
|
function indices(values) {
|
|
@@ -210,5 +209,4 @@ var ModelCache = class {
|
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
211
|
};
|
|
213
|
-
//#endregion
|
|
214
212
|
export { ModelCache };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/onnx/src/models/types.ts
|
|
2
2
|
var UnsupportedInputError = class extends Error {};
|
|
3
|
-
|
|
4
|
-
//#region extensions/onnx/src/protocol.ts
|
|
3
|
+
// extensions/onnx/src/protocol.ts
|
|
5
4
|
var OnnxWorkerError = class extends Error {
|
|
6
5
|
constructor(code) {
|
|
7
6
|
super(`ONNX worker: ${code}`);
|
|
8
7
|
this.code = code;
|
|
9
8
|
}
|
|
10
9
|
};
|
|
11
|
-
//#endregion
|
|
12
10
|
export { UnsupportedInputError as n, OnnxWorkerError as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as findModel } from "./catalog-
|
|
2
|
-
import { n as UnsupportedInputError, t as OnnxWorkerError } from "./protocol-
|
|
1
|
+
import { n as findModel } from "./catalog-g9or975s.mjs";
|
|
2
|
+
import { n as UnsupportedInputError, t as OnnxWorkerError } from "./protocol-CG1ILdRP.mjs";
|
|
3
3
|
import { resolveRuntimeWorkerArgv, spawnOomScoreAdjusted } from "openclaw/plugin-sdk/process-runtime";
|
|
4
4
|
import { decisionBatchV2ToV1, decisionResultV1ToV2 } from "openclaw/plugin-sdk/decisions";
|
|
5
5
|
import { createDeferred } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
6
6
|
import { Guard } from "typebox/guard";
|
|
7
|
-
|
|
7
|
+
// extensions/onnx/src/decisions.ts
|
|
8
8
|
function render(value) {
|
|
9
9
|
return typeof value === "string" ? value : JSON.stringify(value);
|
|
10
10
|
}
|
|
@@ -203,8 +203,7 @@ function createPreparedOnnxProvider(client, warn) {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
//#region extensions/onnx/src/worker-client.ts
|
|
206
|
+
// extensions/onnx/src/worker-client.ts
|
|
208
207
|
function workerEnv() {
|
|
209
208
|
const env = {};
|
|
210
209
|
for (const key of [
|
|
@@ -383,5 +382,4 @@ var InferenceWorkerClient = class {
|
|
|
383
382
|
worker.child.kill("SIGKILL");
|
|
384
383
|
}
|
|
385
384
|
};
|
|
386
|
-
//#endregion
|
|
387
385
|
export { createOnnxProvider as n, createPreparedOnnxProvider as r, 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-DgGGpngs.mjs","sha256":"f24046fd61b468a1eeca5745cb1d1492cd181ed8b29e392030b21f9e6ea92580","facadeSource":null,"sources":["extensions/onnx/src/artifacts.ts"]},{"output":".setup/catalog-g9or975s.mjs","sha256":"987b247b64a95183a5c6d128f2c81cfcc9b24cd504376bb02658f7fb2fa41522","facadeSource":null,"sources":["extensions/onnx/src/catalog.ts"]},{"output":".setup/cli-wozJmsLz.mjs","sha256":"614dcbb83f3c5e175bab1b4959537e4870f226745f379a7be05a03b7ea7d2402","facadeSource":"extensions/onnx/src/cli.ts","sources":["extensions/onnx/src/cli.ts"]},{"output":".setup/model-loader-DDsav9p5.mjs","sha256":"0293e51b336449ee19d792f3c2bee6837dae8d30fe2f12ad9c85d9f9cbece661","facadeSource":"extensions/onnx/src/model-loader.ts","sources":["extensions/onnx/src/model-loader.ts","extensions/onnx/src/models/tokenize.ts"]},{"output":".setup/protocol-CG1ILdRP.mjs","sha256":"bd0d6764cdfe342a66c946c7bace8ce50ec6ca4bc6bbf154f6b828b0fd892cbc","facadeSource":null,"sources":["extensions/onnx/src/models/types.ts","extensions/onnx/src/protocol.ts"]},{"output":".setup/worker-client-C6PMT6Zd.mjs","sha256":"7417b2f61134059ce710b1415635558f66809ec86d74f6bb96ba77c9d5933952","facadeSource":null,"sources":["extensions/onnx/src/decisions.ts","extensions/onnx/src/worker-client.ts"]},{"output":"index.js","sha256":"d2ea1fc4c93e1bde3f2ec3caa08632662d261f19a8dbe0b24796345dd36cec32","facadeSource":"extensions/onnx/index.ts","sources":["extensions/onnx/index.ts","extensions/onnx/src/config.ts"]},{"output":"src/inference.worker.js","sha256":"c098d4e340450e9e922ddd0c636d7dddb0e46df3e270ec77c1aa0ef043b936c1","facadeSource":"extensions/onnx/src/inference.worker.ts","sources":["extensions/onnx/src/inference.worker.ts"]}],"unrenderedSources":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as findModel } from "./.setup/catalog-
|
|
2
|
-
import { r as createPreparedOnnxProvider, t as InferenceWorkerClient } from "./.setup/worker-client-
|
|
1
|
+
import { n as findModel } from "./.setup/catalog-g9or975s.mjs";
|
|
2
|
+
import { r as createPreparedOnnxProvider, t as InferenceWorkerClient } from "./.setup/worker-client-C6PMT6Zd.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
5
5
|
import { createPluginRuntimeProcessEntrypoint, resolveRuntimeWorkerUrl } from "openclaw/plugin-sdk/process-runtime";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
8
8
|
import { Type } from "typebox";
|
|
9
|
-
|
|
9
|
+
// extensions/onnx/src/config.ts
|
|
10
10
|
const ConfigSchema = Type.Object({
|
|
11
11
|
modelDir: Type.Optional(Type.String({
|
|
12
12
|
minLength: 1,
|
|
@@ -34,8 +34,7 @@ function resolveOnnxConfig(config, resolvePath) {
|
|
|
34
34
|
maxLoadedModels
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
//#region extensions/onnx/index.ts
|
|
37
|
+
// extensions/onnx/index.ts
|
|
39
38
|
function selectedModels(config) {
|
|
40
39
|
const selectors = [config.agents?.defaults?.decisionModel, ...Object.values(config.agents?.entries ?? {}).map((agent) => agent.decisionModel)];
|
|
41
40
|
return [...new Set(selectors.flatMap((selector) => {
|
|
@@ -73,7 +72,7 @@ var onnx_default = definePluginEntry({
|
|
|
73
72
|
});
|
|
74
73
|
api.lifecycle.onDispose?.(() => client.stop());
|
|
75
74
|
api.registerCli(async (context) => {
|
|
76
|
-
const { registerOnnxCli } = await import("./.setup/cli-
|
|
75
|
+
const { registerOnnxCli } = await import("./.setup/cli-wozJmsLz.mjs");
|
|
77
76
|
registerOnnxCli(context, config, workerUrl, api.resolvePath);
|
|
78
77
|
}, { descriptors: [{
|
|
79
78
|
name: "onnx",
|
|
@@ -82,5 +81,4 @@ var onnx_default = definePluginEntry({
|
|
|
82
81
|
}] });
|
|
83
82
|
}
|
|
84
83
|
});
|
|
85
|
-
//#endregion
|
|
86
84
|
export { onnx_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as UnsupportedInputError, t as OnnxWorkerError } from "../.setup/protocol-
|
|
2
|
-
|
|
1
|
+
import { n as UnsupportedInputError, t as OnnxWorkerError } from "../.setup/protocol-CG1ILdRP.mjs";
|
|
2
|
+
// extensions/onnx/src/inference.worker.ts
|
|
3
3
|
let config;
|
|
4
4
|
let cache;
|
|
5
5
|
let stopping = false;
|
|
@@ -45,7 +45,7 @@ async function handle(request) {
|
|
|
45
45
|
if (!cache) {
|
|
46
46
|
let implementation;
|
|
47
47
|
try {
|
|
48
|
-
implementation = await import("../.setup/model-loader-
|
|
48
|
+
implementation = await import("../.setup/model-loader-DDsav9p5.mjs");
|
|
49
49
|
} catch {
|
|
50
50
|
throw new OnnxWorkerError("dependency-unavailable");
|
|
51
51
|
}
|
|
@@ -76,5 +76,4 @@ async function handle(request) {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
//#endregion
|
|
80
79
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/onnx",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.9",
|
|
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.11.
|
|
31
|
+
"pluginApi": ">=2026.11.9"
|
|
32
32
|
},
|
|
33
33
|
"build": {
|
|
34
34
|
"bundledDist": false,
|
|
35
|
-
"openclawVersion": "2026.11.
|
|
35
|
+
"openclawVersion": "2026.11.9",
|
|
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.11.
|
|
63
|
+
"openclaw": ">=2026.11.9"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"openclaw": {
|