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