@openclaw/typesafe 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/{client-6lXBoHzi.mjs → client-CjL-E0U1.mjs} +4 -8
- package/dist/.setup/{errors-BZeWj5nc.mjs → errors-BCfRF_ub.mjs} +2 -4
- package/dist/.source-module-urls/cb128076f461604fb70d7e9adeed8a53c97339bf983a26e3f0598f525dcccb17.json +1 -1
- package/dist/index.js +5 -8
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as localBaseUrl, r as evaluationError, t as EvaluationError } from "./errors-
|
|
1
|
+
import { a as localBaseUrl, r as evaluationError, t as EvaluationError } from "./errors-BCfRF_ub.mjs";
|
|
2
2
|
import { Type } from "typebox";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
import { Compile } from "typebox/compile";
|
|
@@ -203,8 +203,7 @@ function parseResult(value, input) {
|
|
|
203
203
|
throw new Error("TypeSafe returned an invalid evaluation response.");
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
//#region extensions/typesafe/src/local.ts
|
|
206
|
+
// extensions/typesafe/src/local.ts
|
|
208
207
|
function localInput(input) {
|
|
209
208
|
const questions = {};
|
|
210
209
|
for (const [id, question] of Object.entries(input.questions)) {
|
|
@@ -239,8 +238,7 @@ function parseLocalResult(value, wireInput, originalInput) {
|
|
|
239
238
|
}
|
|
240
239
|
return evaluation;
|
|
241
240
|
}
|
|
242
|
-
|
|
243
|
-
//#region extensions/typesafe/src/transport.ts
|
|
241
|
+
// extensions/typesafe/src/transport.ts
|
|
244
242
|
const ENDPOINT = "https://api.typesafe.ai/v1/systemone";
|
|
245
243
|
function httpError(response) {
|
|
246
244
|
if (response.status === 401 || response.status === 403) return new EvaluationError("TypeSafe authentication failed; check the configured credential and account access.", "authentication");
|
|
@@ -361,8 +359,7 @@ async function requestEvaluation(params) {
|
|
|
361
359
|
cleanup();
|
|
362
360
|
}
|
|
363
361
|
}
|
|
364
|
-
|
|
365
|
-
//#region extensions/typesafe/src/client.ts
|
|
362
|
+
// extensions/typesafe/src/client.ts
|
|
366
363
|
/** Evaluate explicit state without ambient credentials, retries, or vendor diagnostics. */
|
|
367
364
|
async function evaluate(input, config, signal, deadlineMonotonicMs, isAdmissible) {
|
|
368
365
|
if (signal?.aborted) throw evaluationError(void 0, true);
|
|
@@ -393,5 +390,4 @@ async function evaluate(input, config, signal, deadlineMonotonicMs, isAdmissible
|
|
|
393
390
|
throw evaluationError(error, signal?.aborted ?? false);
|
|
394
391
|
}
|
|
395
392
|
}
|
|
396
|
-
//#endregion
|
|
397
393
|
export { evaluate };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
|
-
|
|
2
|
+
// 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({
|
|
@@ -51,8 +51,7 @@ function runtimeConfig(config) {
|
|
|
51
51
|
timeoutMs
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
//#region extensions/typesafe/src/errors.ts
|
|
54
|
+
// extensions/typesafe/src/errors.ts
|
|
56
55
|
var EvaluationError = class extends Error {
|
|
57
56
|
constructor(message, reason, retryAfterMs) {
|
|
58
57
|
super(message);
|
|
@@ -76,5 +75,4 @@ function decisionFailure(error) {
|
|
|
76
75
|
};
|
|
77
76
|
throw new Error("TypeSafe decision adapter contract failure.");
|
|
78
77
|
}
|
|
79
|
-
//#endregion
|
|
80
78
|
export { localBaseUrl as a, ConfigSchema as i, decisionFailure as n, runtimeConfig as o, evaluationError as r, EvaluationError as t };
|
|
@@ -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-CjL-E0U1.mjs","sha256":"718fc6a2ab2e254185c7f856a98adce040ef398186bda69617005d55d2ff274b","facadeSource":"extensions/typesafe/src/client.ts","sources":["extensions/typesafe/src/client.ts","extensions/typesafe/src/local.ts","extensions/typesafe/src/schema.ts","extensions/typesafe/src/transport.ts"]},{"output":".setup/errors-BCfRF_ub.mjs","sha256":"fe9e6a92afc52555823245f42cffc93448c7e607eef4202ce99e4188bd0b98bd","facadeSource":null,"sources":["extensions/typesafe/src/config.ts","extensions/typesafe/src/errors.ts"]},{"output":"index.js","sha256":"631e8261e0c9b28de1fd86934b1a8b94d477c0a800e97e6aa964e55e68c29e37","facadeSource":"extensions/typesafe/index.ts","sources":["extensions/typesafe/index.ts","extensions/typesafe/src/credentials.ts","extensions/typesafe/src/decisions.ts"]}],"unrenderedSources":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as ConfigSchema, n as decisionFailure, o as runtimeConfig } from "./.setup/errors-
|
|
1
|
+
import { i as ConfigSchema, n as decisionFailure, o as runtimeConfig } from "./.setup/errors-BCfRF_ub.mjs";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
import { getPreparedPluginSecretInput } from "openclaw/plugin-sdk/secret-input-runtime";
|
|
4
4
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/typesafe/src/credentials.ts
|
|
6
6
|
/** Only host-prepared capability snapshots may supply a credential. Never resolve or cache refs. */
|
|
7
7
|
function resolveRuntimeConfig(snapshot) {
|
|
8
8
|
const configured = snapshot.plugins?.entries?.typesafe?.config;
|
|
@@ -14,9 +14,8 @@ function resolveRuntimeConfig(snapshot) {
|
|
|
14
14
|
apiKey: prepared.value
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const loadClient = createLazyRuntimeModule(() => import("./.setup/client-6lXBoHzi.mjs"));
|
|
17
|
+
// extensions/typesafe/src/decisions.ts
|
|
18
|
+
const loadClient = createLazyRuntimeModule(() => import("./.setup/client-CjL-E0U1.mjs"));
|
|
20
19
|
/** Translate the host-selected decision contract through the TypeSafe transport. */
|
|
21
20
|
function createDecisionProvider(getConfig) {
|
|
22
21
|
return {
|
|
@@ -91,8 +90,7 @@ function createDecisionProvider(getConfig) {
|
|
|
91
90
|
}
|
|
92
91
|
};
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
//#region extensions/typesafe/index.ts
|
|
93
|
+
// extensions/typesafe/index.ts
|
|
96
94
|
var typesafe_default = definePluginEntry({
|
|
97
95
|
id: "typesafe",
|
|
98
96
|
name: "TypeSafe AI",
|
|
@@ -102,5 +100,4 @@ var typesafe_default = definePluginEntry({
|
|
|
102
100
|
api.registerDecisionProvider(createDecisionProvider(() => resolveRuntimeConfig(api.runtime.config.current())));
|
|
103
101
|
}
|
|
104
102
|
});
|
|
105
|
-
//#endregion
|
|
106
103
|
export { typesafe_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/typesafe",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.1",
|
|
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.
|
|
24
|
+
"pluginApi": ">=2026.11.1"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
27
|
"bundledDist": false,
|
|
28
|
-
"openclawVersion": "2026.
|
|
28
|
+
"openclawVersion": "2026.11.1"
|
|
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.
|
|
46
|
+
"openclaw": ">=2026.11.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"openclaw": {
|