@openclaw/typesafe 2026.11.5-beta.1 → 2026.11.5-beta.3
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/{client-DI7wM7N-.mjs → client-28h1nLtb.mjs} +7 -4
- package/dist/.setup/{errors-BEKARoBh.mjs → errors-CAxlQL5v.mjs} +4 -2
- package/dist/.source-module-urls/cb128076f461604fb70d7e9adeed8a53c97339bf983a26e3f0598f525dcccb17.json +1 -1
- package/dist/index.js +10 -6
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as HOSTED_ORIGIN, c as providerBaseUrl, o as hasCredentials, r as evaluationError, s as localBaseUrl, t as EvaluationError, u as usesHostedEndpoint } from "./errors-
|
|
1
|
+
import { a as HOSTED_ORIGIN, c as providerBaseUrl, o as hasCredentials, r as evaluationError, s as localBaseUrl, t as EvaluationError, u as usesHostedEndpoint } from "./errors-CAxlQL5v.mjs";
|
|
2
2
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
3
3
|
import { createProviderCredentialMatcher, fetchWithProviderHttpGuard, resolveProviderHttpRequestConfigWithOriginTrust, resolveProviderTransportSsrFPolicy, sanitizeConfiguredModelProviderRequest } from "openclaw/plugin-sdk/provider-http";
|
|
4
4
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -6,7 +6,7 @@ import { responseWithRelease, shouldUseEnvHttpProxyForUrl, withTrustedEnvProxyGu
|
|
|
6
6
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
7
7
|
import { parseRetryAfterHeaderSeconds } from "openclaw/plugin-sdk/retry-runtime";
|
|
8
8
|
import { isDeepStrictEqual } from "node:util";
|
|
9
|
-
|
|
9
|
+
//#region extensions/typesafe/src/schema-validator.generated.js
|
|
10
10
|
/*!
|
|
11
11
|
TypeBox
|
|
12
12
|
|
|
@@ -89,7 +89,8 @@ var isEvaluationQuestion = (() => {
|
|
|
89
89
|
], check_0 = (value) => typeof value == "object" && value !== null && !Array.isArray(value) && "type" in value && Object.getOwnPropertyNames(value).every((unique_0, unique_1) => External[0].test(unique_0) || !1) && typeof value.type == "string" && value.type === "noul" && (value.instructions === void 0 || !("instructions" in value) || typeof value.instructions == "string" || typeof value.instructions == "object" && value.instructions !== null && !Array.isArray(value.instructions) && Object.getOwnPropertyNames(value.instructions).every((unique_2, unique_3) => External[1].test(unique_2) || !0) && !0 || Array.isArray(value.instructions) && value.instructions.every((unique_4, index) => !0) || value.instructions === null) && (value.criteria === void 0 || !("criteria" in value) || typeof value.criteria == "object" && value.criteria !== null && !Array.isArray(value.criteria) && Object.getOwnPropertyNames(value.criteria).every((unique_5, unique_6) => External[2].test(unique_5) || !1) && (value.criteria.true === void 0 || !("true" in value.criteria) || typeof value.criteria.true == "string" || typeof value.criteria.true == "object" && value.criteria.true !== null && !Array.isArray(value.criteria.true) && Object.getOwnPropertyNames(value.criteria.true).every((unique_7, unique_8) => External[3].test(unique_7) || !0) && !0 || Array.isArray(value.criteria.true) && value.criteria.true.every((unique_9, index) => !0) || value.criteria.true === null) && (value.criteria.false === void 0 || !("false" in value.criteria) || typeof value.criteria.false == "string" || typeof value.criteria.false == "object" && value.criteria.false !== null && !Array.isArray(value.criteria.false) && Object.getOwnPropertyNames(value.criteria.false).every((unique_10, unique_11) => External[4].test(unique_10) || !0) && !0 || Array.isArray(value.criteria.false) && value.criteria.false.every((unique_12, index) => !0) || value.criteria.false === null) || value.criteria === null) || typeof value == "object" && value !== null && !Array.isArray(value) && "type" in value && "criteria" in value && Object.getOwnPropertyNames(value).every((unique_13, unique_14) => External[5].test(unique_13) || !1) && typeof value.type == "string" && value.type === "choice" && (value.instructions === void 0 || !("instructions" in value) || typeof value.instructions == "string" || typeof value.instructions == "object" && value.instructions !== null && !Array.isArray(value.instructions) && Object.getOwnPropertyNames(value.instructions).every((unique_15, unique_16) => External[6].test(unique_15) || !0) && !0 || Array.isArray(value.instructions) && value.instructions.every((unique_17, index) => !0) || value.instructions === null) && typeof value.criteria == "object" && value.criteria !== null && !Array.isArray(value.criteria) && Object.getOwnPropertyNames(value.criteria).every((unique_18, unique_19) => External[7].test(unique_18) || typeof value.criteria[unique_18] == "string" || typeof value.criteria[unique_18] == "object" && value.criteria[unique_18] !== null && !Array.isArray(value.criteria[unique_18]) && Object.getOwnPropertyNames(value.criteria[unique_18]).every((unique_20, unique_21) => External[8].test(unique_20) || !0) && !0 || Array.isArray(value.criteria[unique_18]) && value.criteria[unique_18].every((unique_22, index) => !0) || value.criteria[unique_18] === null) && Object.getOwnPropertyNames(value.criteria).length >= 2 && Object.getOwnPropertyNames(value.criteria).length <= 255 || typeof value == "object" && value !== null && !Array.isArray(value) && "type" in value && "criteria" in value && Object.getOwnPropertyNames(value).every((unique_23, unique_24) => External[9].test(unique_23) || !1) && typeof value.type == "string" && value.type === "score" && (value.instructions === void 0 || !("instructions" in value) || typeof value.instructions == "string" || typeof value.instructions == "object" && value.instructions !== null && !Array.isArray(value.instructions) && Object.getOwnPropertyNames(value.instructions).every((unique_25, unique_26) => External[10].test(unique_25) || !0) && !0 || Array.isArray(value.instructions) && value.instructions.every((unique_27, index) => !0) || value.instructions === null) && Array.isArray(value.criteria) && value.criteria.every((unique_28, index) => typeof unique_28 == "string" || typeof unique_28 == "object" && unique_28 !== null && !Array.isArray(unique_28) && Object.getOwnPropertyNames(unique_28).every((unique_29, unique_30) => External[11].test(unique_29) || !0) && !0 || Array.isArray(unique_28) && unique_28.every((unique_31, index2) => !0) || unique_28 === null) && value.criteria.length >= 2 && value.criteria.length <= 10;
|
|
90
90
|
return (value) => check_0(value);
|
|
91
91
|
})();
|
|
92
|
-
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region extensions/typesafe/src/schema.ts
|
|
93
94
|
const MAX_JSON_BYTES = 4194304;
|
|
94
95
|
const MAX_JSON_NODES = 262144;
|
|
95
96
|
const MAX_JSON_DEPTH = 64;
|
|
@@ -166,7 +167,8 @@ function parseResult(value, input) {
|
|
|
166
167
|
throw new Error("TypeSafe returned an invalid evaluation response.");
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
|
-
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region extensions/typesafe/src/client.ts
|
|
170
172
|
const IMAGE_OPT_IN_HEADER = "TypeSafe-Danger-Zone-Images";
|
|
171
173
|
const API_BASE_URL = `${HOSTED_ORIGIN}/v1`;
|
|
172
174
|
function httpError(response) {
|
|
@@ -358,4 +360,5 @@ async function evaluate(input, config, abortSignal, deadlineMonotonicMs, isAdmis
|
|
|
358
360
|
throw evaluationError(error, abortSignal?.aborted ?? false);
|
|
359
361
|
}
|
|
360
362
|
}
|
|
363
|
+
//#endregion
|
|
361
364
|
export { evaluate };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
|
-
|
|
2
|
+
//#region extensions/typesafe/src/config.ts
|
|
3
3
|
const LOCAL_BASE_URL_PATTERN = "^https?://(?:localhost|127\\.0\\.0\\.1|\\[::1\\])(?::[0-9]{1,5})?/?$";
|
|
4
4
|
const localBaseUrlPattern = new RegExp(LOCAL_BASE_URL_PATTERN);
|
|
5
5
|
const ConfigSchema = Type.Object({
|
|
@@ -65,7 +65,8 @@ function runtimeConfig(config) {
|
|
|
65
65
|
timeoutMs
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region extensions/typesafe/src/errors.ts
|
|
69
70
|
var EvaluationError = class extends Error {
|
|
70
71
|
constructor(message, reason, retryAfterMs) {
|
|
71
72
|
super(message);
|
|
@@ -89,4 +90,5 @@ function decisionFailure(error) {
|
|
|
89
90
|
};
|
|
90
91
|
throw new Error("TypeSafe decision adapter contract failure.");
|
|
91
92
|
}
|
|
93
|
+
//#endregion
|
|
92
94
|
export { HOSTED_ORIGIN as a, providerBaseUrl as c, ConfigSchema as i, runtimeConfig as l, decisionFailure as n, hasCredentials as o, evaluationError as r, localBaseUrl as s, EvaluationError as t, usesHostedEndpoint as u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"index.js","source":"extensions/typesafe/index.ts"}],"chunks":[{"output":".setup/client-
|
|
1
|
+
{"version":3,"entries":[{"output":"index.js","source":"extensions/typesafe/index.ts"}],"chunks":[{"output":".setup/client-28h1nLtb.mjs","sha256":"c2e0db4d6cb47bcda8344d8e566cf0b9bb3359e58cbc41bc7d5678bdf9be945e","facadeSource":"extensions/typesafe/src/client.ts","sources":["extensions/typesafe/src/client.ts","extensions/typesafe/src/schema-validator.generated.js","extensions/typesafe/src/schema.ts"]},{"output":".setup/errors-CAxlQL5v.mjs","sha256":"f6305d81e1570cef8ef01ac9c437653ecd74e6fe010c8285cd617b406542d0d9","facadeSource":null,"sources":["extensions/typesafe/src/config.ts","extensions/typesafe/src/errors.ts"]},{"output":"index.js","sha256":"268977472d78374b80e56692520c30f62352b7f93678ffdf015cf34e156fb117","facadeSource":"extensions/typesafe/index.ts","sources":["extensions/typesafe/index.ts","extensions/typesafe/openclaw.plugin.json","extensions/typesafe/src/credentials.ts","extensions/typesafe/src/decisions.ts"]}],"unrenderedSources":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as providerBaseUrl, i as ConfigSchema, l as runtimeConfig, n as decisionFailure, o as hasCredentials } from "./.setup/errors-
|
|
1
|
+
import { c as providerBaseUrl, i as ConfigSchema, l as runtimeConfig, n as decisionFailure, o as hasCredentials } from "./.setup/errors-CAxlQL5v.mjs";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
import { findNormalizedProviderValue } from "openclaw/plugin-sdk/model-ref-parse";
|
|
4
4
|
import { resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
@@ -8,7 +8,7 @@ import { decisionBatchV2ToV1, decisionResultV1ToV2, validateDecisionBatchV2 } fr
|
|
|
8
8
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { resolveProviderRequestHeaders } from "openclaw/plugin-sdk/provider-http";
|
|
10
10
|
import { omitNullRequestHeaders } from "openclaw/plugin-sdk/provider-request-headers";
|
|
11
|
-
|
|
11
|
+
//#region extensions/typesafe/src/credentials.ts
|
|
12
12
|
/** Read the active host snapshot only; never resolve refs or discover fallback credentials. */
|
|
13
13
|
function resolveRuntimeConfig(snapshot) {
|
|
14
14
|
const configured = snapshot.plugins?.entries?.typesafe?.config;
|
|
@@ -37,7 +37,8 @@ function resolveRuntimeConfig(snapshot) {
|
|
|
37
37
|
apiKey: prepared.value
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region extensions/typesafe/openclaw.plugin.json
|
|
41
42
|
var modelCatalog = { "providers": { "typesafe": {
|
|
42
43
|
"models": [
|
|
43
44
|
{
|
|
@@ -198,8 +199,9 @@ var modelCatalog = { "providers": { "typesafe": {
|
|
|
198
199
|
],
|
|
199
200
|
"authScope": "plugin"
|
|
200
201
|
} } };
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region extensions/typesafe/src/decisions.ts
|
|
204
|
+
const loadClient = createLazyRuntimeModule(() => import("./.setup/client-28h1nLtb.mjs"));
|
|
203
205
|
const models = modelCatalog.providers.typesafe.models;
|
|
204
206
|
const hostedBaseUrl = providerBaseUrl(models[0].baseUrl);
|
|
205
207
|
function effectiveBaseUrl(config) {
|
|
@@ -460,7 +462,8 @@ function createPreparedDecisionProvider(getConfig) {
|
|
|
460
462
|
}
|
|
461
463
|
};
|
|
462
464
|
}
|
|
463
|
-
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region extensions/typesafe/index.ts
|
|
464
467
|
var typesafe_default = definePluginEntry({
|
|
465
468
|
id: "typesafe",
|
|
466
469
|
name: "TypeSafe AI",
|
|
@@ -470,4 +473,5 @@ var typesafe_default = definePluginEntry({
|
|
|
470
473
|
api.registerDecisionProvider(createPreparedDecisionProvider(() => resolveRuntimeConfig(api.runtime.config.current())));
|
|
471
474
|
}
|
|
472
475
|
});
|
|
476
|
+
//#endregion
|
|
473
477
|
export { typesafe_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/typesafe",
|
|
3
|
-
"version": "2026.11.5-beta.
|
|
3
|
+
"version": "2026.11.5-beta.3",
|
|
4
4
|
"description": "OpenClaw TypeSafe typed decision provider",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"minHostVersion": ">=2026.9.6"
|
|
22
22
|
},
|
|
23
23
|
"compat": {
|
|
24
|
-
"pluginApi": ">=2026.11.5-beta.
|
|
24
|
+
"pluginApi": ">=2026.11.5-beta.3"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
27
|
"bundledDist": false,
|
|
28
|
-
"openclawVersion": "2026.11.5-beta.
|
|
28
|
+
"openclawVersion": "2026.11.5-beta.3"
|
|
29
29
|
},
|
|
30
30
|
"release": {
|
|
31
31
|
"publishToClawHub": true,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"assets/activity.svg"
|
|
44
44
|
],
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"openclaw": ">=2026.11.5-beta.
|
|
46
|
+
"openclaw": ">=2026.11.5-beta.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"openclaw": {
|