@openclaw/typesafe 2026.9.8 → 2026.10.1-beta.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.
|
@@ -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";
|
|
@@ -302,6 +302,7 @@ async function requestEvaluation(params) {
|
|
|
302
302
|
const assertActive = () => {
|
|
303
303
|
signal?.throwIfAborted();
|
|
304
304
|
if (params.deadlineMonotonicMs !== void 0 && performance.now() >= params.deadlineMonotonicMs) throw new EvaluationError("TypeSafe evaluation timed out.", "transport");
|
|
305
|
+
if (params.isAdmissible && !params.isAdmissible()) throw new EvaluationError("TypeSafe evaluation is no longer admitted.", "transport");
|
|
305
306
|
};
|
|
306
307
|
try {
|
|
307
308
|
assertActive();
|
|
@@ -363,7 +364,7 @@ async function requestEvaluation(params) {
|
|
|
363
364
|
//#endregion
|
|
364
365
|
//#region extensions/typesafe/src/client.ts
|
|
365
366
|
/** Evaluate explicit state without ambient credentials, retries, or vendor diagnostics. */
|
|
366
|
-
async function evaluate(input, config, signal, deadlineMonotonicMs) {
|
|
367
|
+
async function evaluate(input, config, signal, deadlineMonotonicMs, isAdmissible) {
|
|
367
368
|
if (signal?.aborted) throw evaluationError(void 0, true);
|
|
368
369
|
const parsed = parseInput(input);
|
|
369
370
|
const model = parsed.model;
|
|
@@ -381,7 +382,8 @@ async function evaluate(input, config, signal, deadlineMonotonicMs) {
|
|
|
381
382
|
baseUrl: config.baseUrl,
|
|
382
383
|
timeoutMs: config.timeoutMs,
|
|
383
384
|
signal,
|
|
384
|
-
deadlineMonotonicMs
|
|
385
|
+
deadlineMonotonicMs,
|
|
386
|
+
isAdmissible
|
|
385
387
|
});
|
|
386
388
|
signal?.throwIfAborted();
|
|
387
389
|
const evaluation = config.baseUrl ? parseLocalResult(response, wireInput, parsed) : parseResult(response, parsed);
|
|
@@ -32,12 +32,9 @@ const ConfigSchema = Type.Object({
|
|
|
32
32
|
/** A configured endpoint grants access to one loopback origin, never arbitrary private hosts. */
|
|
33
33
|
function localBaseUrl(value) {
|
|
34
34
|
if (value === void 0) return;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} catch {
|
|
39
|
-
throw new Error("Invalid TypeSafe baseUrl; use an http(s) loopback origin without a path, credentials, query, or fragment.");
|
|
40
|
-
}
|
|
35
|
+
const parsed = typeof value === "string" && value === value.trim() && localBaseUrlPattern.test(value) ? URL.parse(value) : null;
|
|
36
|
+
if (!parsed) throw new Error("Invalid TypeSafe baseUrl; use an http(s) loopback origin without a path, credentials, query, or fragment.");
|
|
37
|
+
return parsed.origin;
|
|
41
38
|
}
|
|
42
39
|
/** Validate runtime settings and recognize materialized credentials without resolving inputs. */
|
|
43
40
|
function runtimeConfig(config) {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -16,7 +16,7 @@ function resolveRuntimeConfig(snapshot) {
|
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region extensions/typesafe/src/decisions.ts
|
|
19
|
-
const loadClient = createLazyRuntimeModule(() => import("./.setup/client-
|
|
19
|
+
const loadClient = createLazyRuntimeModule(() => import("./.setup/client-vvIolGjJ.mjs"));
|
|
20
20
|
/** Translate the host-selected decision contract through the TypeSafe transport. */
|
|
21
21
|
function createDecisionProvider(getConfig) {
|
|
22
22
|
return {
|
|
@@ -52,7 +52,7 @@ function createDecisionProvider(getConfig) {
|
|
|
52
52
|
}, {
|
|
53
53
|
...config,
|
|
54
54
|
timeoutMs: Math.min(config.timeoutMs, remaining)
|
|
55
|
-
}, context.signal, context.deadlineMonotonicMs);
|
|
55
|
+
}, context.signal, context.deadlineMonotonicMs, context.isAdmissible);
|
|
56
56
|
context.signal.throwIfAborted();
|
|
57
57
|
const answers = {};
|
|
58
58
|
for (const [id, answer] of Object.entries(evaluation.answers)) if (answer.type === "noul") answers[id] = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/typesafe",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.10.1-beta.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.
|
|
24
|
+
"pluginApi": ">=2026.10.1-beta.2"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
27
|
"bundledDist": false,
|
|
28
|
-
"openclawVersion": "2026.
|
|
28
|
+
"openclawVersion": "2026.10.1-beta.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.
|
|
46
|
+
"openclaw": ">=2026.10.1-beta.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"openclaw": {
|