@openclaw/gateway-protocol 2026.10.5 → 2026.10.10-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.
- package/README.md +2 -2
- package/dist/{catalog-WA519PXd.mjs → catalog-CSyi1a9u.mjs} +1049 -134
- package/dist/frame-guards.d.mts +1 -1
- package/dist/frame-guards.mjs +1 -2
- package/dist/{frames-DHlyMuKP.d.mts → frames-B2TMmFj0.d.mts} +31 -0
- package/dist/{gateway-error-details-CsyGNcmF.d.mts → gateway-error-details-BqRYhh5h.d.mts} +81 -7
- package/dist/gateway-error-details.d.mts +2 -2
- package/dist/gateway-error-details.mjs +21 -2
- package/dist/index.d.mts +847 -19
- package/dist/index.mjs +31 -6
- package/dist/{schema-modules-9B0QAFVD.d.mts → schema-modules-BqRxTyRP.d.mts} +8154 -6100
- package/dist/schema.d.mts +4 -4
- package/dist/schema.mjs +71 -4
- package/dist/{server-capabilities-FfgdQE-U.mjs → server-capabilities-DRQ3mUjT.mjs} +14 -2
- package/dist/{theme-CBR5kBV0.mjs → theme-BshtYPJX.mjs} +10 -27
- package/dist/theme.mjs +1 -1
- package/package.json +2 -2
- package/protocol.schema.json +11892 -548
- package/dist/protocol-value-normalization-Oati9UF1.mjs +0 -7
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
//#region packages/gateway-protocol/src/protocol-value-normalization.ts
|
|
2
|
+
/** Checks string presence without changing wire-significant whitespace. */
|
|
3
|
+
function isNonEmptyProtocolString(value) {
|
|
4
|
+
return typeof value === "string" && value.length > 0;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
1
7
|
//#region packages/gateway-protocol/src/server-capabilities.ts
|
|
2
8
|
/** Stable feature names advertised in Gateway hello responses. */
|
|
3
9
|
const GATEWAY_SERVER_CAPS = {
|
|
10
|
+
AGENT_SESSION_ID_CREATE: "agent-session-id-create-v1",
|
|
4
11
|
BOARD_WIDGET_PUT_CANVAS_DOC: "board-widget-put-canvas-doc",
|
|
5
12
|
CHAT_SEND_ROUTING_CONTRACT: "chat-send-routing-contract",
|
|
6
13
|
CONTROL_UI_BROWSER_FOCUS: "control-ui-browser-focus",
|
|
7
14
|
GATEWAY_RESTART_TARGET_SAFE: "gateway-restart-target-safe-v1",
|
|
8
15
|
LOCAL_STATE_OWNER_ROUTING: "local-state-owner-routing-v1",
|
|
16
|
+
MODELS_AUTH_SET_API_KEY_OWNER: "models-auth-set-api-key-owner-v1",
|
|
17
|
+
MODELS_AUTH_LOGIN_OWNER: "models-auth-login-owner-v1",
|
|
9
18
|
CHANNELS_PAIRING_LIST_OWNER: "channels-pairing-list-owner-v1",
|
|
10
19
|
CHANNELS_PAIRING_APPROVE_OWNER: "channels-pairing-approve-owner-v1",
|
|
11
20
|
EXEC_APPROVALS_GET_OWNER: "exec-approvals-get-owner-v1",
|
|
@@ -16,10 +25,12 @@ const GATEWAY_SERVER_CAPS = {
|
|
|
16
25
|
WORKTREES_RECOVER_REMOVAL_OWNER: "worktrees-recover-removal-owner-v1",
|
|
17
26
|
WORKTREES_RETIRE_SNAPSHOT_OWNER: "worktrees-retire-snapshot-owner-v1",
|
|
18
27
|
MODEL_CATALOG_SNAPSHOT: "model-catalog-snapshot",
|
|
28
|
+
NODE_PERMISSION_ERRORS: "node-permission-errors",
|
|
19
29
|
NODE_WORKER_BUNDLE_RETENTION: "node-worker-bundle-retention-v1",
|
|
20
30
|
NODE_WORKER_BUNDLE_STATUS: "node-worker-bundle-status-v1",
|
|
21
31
|
NODE_WORKER_CAPTURED_EXEC_POLICY: "node-worker-captured-exec-policy",
|
|
22
32
|
NODE_WORKER_WORKSPACE_QUIESCENCE: "node-worker-workspace-quiescence-v1",
|
|
33
|
+
NODE_WORKER_DEVICE_FOLDERS: "node-worker-device-folders-v1",
|
|
23
34
|
NODE_WORKER_ENVIRONMENT_SESSION: "node-worker-environment-session-v1",
|
|
24
35
|
NODE_WORKER_HOST_DIAGNOSTICS: "node-worker-host-diagnostics-v1",
|
|
25
36
|
NODE_WORKER_IDLE_RETENTION: "node-worker-idle-retention-v1",
|
|
@@ -40,7 +51,8 @@ const GATEWAY_SERVER_CAPS = {
|
|
|
40
51
|
SENDER_RESTRICTED_HIDDEN_HELPERS: "sender-restricted-hidden-helpers-v1",
|
|
41
52
|
SYSTEM_AGENT_WIZARD_CANCEL: "openclaw-chat-wizard-cancel",
|
|
42
53
|
SYSTEM_AGENT_SETUP_MODEL_REF: "openclaw-setup-model-ref",
|
|
43
|
-
TASK_SUGGESTIONS_ACCEPT_MODES: "taskSuggestions.acceptModes"
|
|
54
|
+
TASK_SUGGESTIONS_ACCEPT_MODES: "taskSuggestions.acceptModes",
|
|
55
|
+
TALK_SESSION_CLOSE_DISPOSITION: "talk-session-close-disposition"
|
|
44
56
|
};
|
|
45
57
|
//#endregion
|
|
46
|
-
export { GATEWAY_SERVER_CAPS as t };
|
|
58
|
+
export { isNonEmptyProtocolString as n, GATEWAY_SERVER_CAPS as t };
|
|
@@ -178,6 +178,11 @@ function requireText(value, label, maxLength) {
|
|
|
178
178
|
if (typeof value !== "string" || !value.trim() || value.trim().length > maxLength || Array.from(value).some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127)) throw new Error(`${label} must be nonempty text of at most ${maxLength} characters`);
|
|
179
179
|
return value.trim();
|
|
180
180
|
}
|
|
181
|
+
function requireChoice(value, allowed, label) {
|
|
182
|
+
const choice = allowed.find((candidate) => candidate === value);
|
|
183
|
+
if (!choice) throw new Error(`${label} must be one of ${allowed.join(", ")}`);
|
|
184
|
+
return choice;
|
|
185
|
+
}
|
|
181
186
|
const NUMBER = "[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?";
|
|
182
187
|
const COMPONENT = `${NUMBER}%?`;
|
|
183
188
|
const HUE = `${NUMBER}(?:deg|grad|rad|turn)?`;
|
|
@@ -259,27 +264,14 @@ function normalizeThemeDefinition(input, options) {
|
|
|
259
264
|
...record.light !== void 0 ? { light: normalizePalette(record.light, "light") } : {},
|
|
260
265
|
...record.dark !== void 0 ? { dark: normalizePalette(record.dark, "dark") } : {}
|
|
261
266
|
};
|
|
262
|
-
if (record.mascot !== void 0)
|
|
263
|
-
const mascot = THEME_MASCOT_VALUES.find((candidate) => candidate === record.mascot);
|
|
264
|
-
if (!mascot) throw new Error(`theme.mascot must be one of ${THEME_MASCOT_VALUES.join(", ")}`);
|
|
265
|
-
definition.mascot = mascot;
|
|
266
|
-
}
|
|
267
|
+
if (record.mascot !== void 0) definition.mascot = requireChoice(record.mascot, THEME_MASCOT_VALUES, "theme.mascot");
|
|
267
268
|
if (record.brandName !== void 0) {
|
|
268
269
|
const brandName = requireText(record.brandName, "theme.brandName", 80);
|
|
269
270
|
if (/[\p{Cc}\p{Cf}\p{Cs}\p{Zl}\p{Zp}]/u.test(brandName)) throw new Error("theme.brandName must contain only printable characters");
|
|
270
271
|
definition.brandName = brandName;
|
|
271
272
|
}
|
|
272
|
-
if (record.brandIcon !== void 0)
|
|
273
|
-
|
|
274
|
-
const brandIcon = allowedIds.find((id) => id === record.brandIcon);
|
|
275
|
-
if (!brandIcon) throw new Error(`theme.brandIcon must be one of ${allowedIds.join(", ")}`);
|
|
276
|
-
definition.brandIcon = brandIcon;
|
|
277
|
-
}
|
|
278
|
-
if (record.workingIndicator !== void 0) {
|
|
279
|
-
const workingIndicator = THEME_WORKING_INDICATOR_VALUES.find((value) => value === record.workingIndicator);
|
|
280
|
-
if (!workingIndicator) throw new Error(`theme.workingIndicator must be one of ${THEME_WORKING_INDICATOR_VALUES.join(", ")}`);
|
|
281
|
-
definition.workingIndicator = workingIndicator;
|
|
282
|
-
}
|
|
273
|
+
if (record.brandIcon !== void 0) definition.brandIcon = requireChoice(record.brandIcon, [...THEME_BRAND_ICON_IDS, ...options?.iconIds ?? []], "theme.brandIcon");
|
|
274
|
+
if (record.workingIndicator !== void 0) definition.workingIndicator = requireChoice(record.workingIndicator, THEME_WORKING_INDICATOR_VALUES, "theme.workingIndicator");
|
|
283
275
|
for (const key of ["lobsterdex", "communityLinks"]) if (record[key] !== void 0) {
|
|
284
276
|
if (typeof record[key] !== "boolean") throw new Error(`theme.${key} must be a boolean`);
|
|
285
277
|
definition[key] = record[key];
|
|
@@ -293,20 +285,11 @@ function normalizeThemeDefinition(input, options) {
|
|
|
293
285
|
if (record.critters !== void 0) {
|
|
294
286
|
if (!Array.isArray(record.critters) || record.critters.length > 8) throw new Error("theme.critters must be an array of at most 8 entries");
|
|
295
287
|
const allowedIds = [...THEME_CRITTER_IDS, ...options?.critterIds ?? []];
|
|
296
|
-
const critters = Array.from(record.critters, (entry, index) => {
|
|
297
|
-
const critter = allowedIds.find((id) => id === entry);
|
|
298
|
-
if (!critter) throw new Error(`theme.critters[${index}] must be one of ${allowedIds.join(", ")}`);
|
|
299
|
-
return critter;
|
|
300
|
-
});
|
|
288
|
+
const critters = Array.from(record.critters, (entry, index) => requireChoice(entry, allowedIds, `theme.critters[${index}]`));
|
|
301
289
|
if (new Set(critters).size !== critters.length) throw new Error("theme.critters must not contain duplicate entries");
|
|
302
290
|
definition.critters = critters;
|
|
303
291
|
}
|
|
304
|
-
if (record.avatarHat !== void 0)
|
|
305
|
-
const allowedIds = [...THEME_AVATAR_HAT_IDS, ...options?.hatIds ?? []];
|
|
306
|
-
const avatarHat = allowedIds.find((id) => id === record.avatarHat);
|
|
307
|
-
if (!avatarHat) throw new Error(`theme.avatarHat must be one of ${allowedIds.join(", ")}`);
|
|
308
|
-
definition.avatarHat = avatarHat;
|
|
309
|
-
}
|
|
292
|
+
if (record.avatarHat !== void 0) definition.avatarHat = requireChoice(record.avatarHat, [...THEME_AVATAR_HAT_IDS, ...options?.hatIds ?? []], "theme.avatarHat");
|
|
310
293
|
if (!definition.light && !definition.dark) throw new Error("theme must provide at least one light or dark palette");
|
|
311
294
|
if (new TextEncoder().encode(JSON.stringify(definition)).length > 4096) throw new Error(`theme definition exceeds ${MAX_THEME_DEFINITION_BYTES} bytes`);
|
|
312
295
|
return definition;
|
package/dist/theme.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as THEME_LOCAL_ID_MAX_LENGTH, D as normalizeThemeMode, E as isThemeId, S as BUILTIN_THEME_IDS, T as isBuiltinThemeId, _ as isThemeAvatarHatId, a as THEME_BRAND_ICON_IDS, b as parseThemeDefinition, c as THEME_CRITTER_IDS, d as THEME_MASCOT_VALUES, f as THEME_NAME_MAX_LENGTH, g as THEME_WORKING_PHRASE_MAX_LENGTH, h as THEME_WORKING_PHRASES_MAX, i as THEME_AVATAR_HAT_IDS, l as THEME_DESCRIPTION_MAX_LENGTH, m as THEME_WORKING_INDICATOR_VALUES, n as MAX_THEME_DEFINITION_BYTES, o as THEME_BRAND_NAME_MAX_LENGTH, p as THEME_TOKEN_MAX_LENGTH, r as THEME_ARTWORK_ID_PATTERN, s as THEME_COLOR_KEYS, t as BUILTIN_THEMES, u as THEME_FONT_KEYS, v as isThemeCritterId, w as THEME_LOCAL_ID_PATTERN, x as resolveThemeBranding, y as normalizeThemeDefinition } from "./theme-
|
|
1
|
+
import { C as THEME_LOCAL_ID_MAX_LENGTH, D as normalizeThemeMode, E as isThemeId, S as BUILTIN_THEME_IDS, T as isBuiltinThemeId, _ as isThemeAvatarHatId, a as THEME_BRAND_ICON_IDS, b as parseThemeDefinition, c as THEME_CRITTER_IDS, d as THEME_MASCOT_VALUES, f as THEME_NAME_MAX_LENGTH, g as THEME_WORKING_PHRASE_MAX_LENGTH, h as THEME_WORKING_PHRASES_MAX, i as THEME_AVATAR_HAT_IDS, l as THEME_DESCRIPTION_MAX_LENGTH, m as THEME_WORKING_INDICATOR_VALUES, n as MAX_THEME_DEFINITION_BYTES, o as THEME_BRAND_NAME_MAX_LENGTH, p as THEME_TOKEN_MAX_LENGTH, r as THEME_ARTWORK_ID_PATTERN, s as THEME_COLOR_KEYS, t as BUILTIN_THEMES, u as THEME_FONT_KEYS, v as isThemeCritterId, w as THEME_LOCAL_ID_PATTERN, x as resolveThemeBranding, y as normalizeThemeDefinition } from "./theme-BshtYPJX.mjs";
|
|
2
2
|
export { BUILTIN_THEMES, BUILTIN_THEME_IDS, MAX_THEME_DEFINITION_BYTES, THEME_ARTWORK_ID_PATTERN, THEME_AVATAR_HAT_IDS, THEME_BRAND_ICON_IDS, THEME_BRAND_NAME_MAX_LENGTH, THEME_COLOR_KEYS, THEME_CRITTER_IDS, THEME_DESCRIPTION_MAX_LENGTH, THEME_FONT_KEYS, THEME_LOCAL_ID_MAX_LENGTH, THEME_LOCAL_ID_PATTERN, THEME_MASCOT_VALUES, THEME_NAME_MAX_LENGTH, THEME_TOKEN_MAX_LENGTH, THEME_WORKING_INDICATOR_VALUES, THEME_WORKING_PHRASES_MAX, THEME_WORKING_PHRASE_MAX_LENGTH, isBuiltinThemeId, isThemeAvatarHatId, isThemeCritterId, isThemeId, normalizeThemeDefinition, normalizeThemeMode, parseThemeDefinition, resolveThemeBranding };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/gateway-protocol",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.10-beta.2",
|
|
4
4
|
"description": "Typed schemas and runtime validators for the OpenClaw Gateway WebSocket protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gateway",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"typebox": "1.3.
|
|
92
|
+
"typebox": "1.3.35"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@openclaw/normalization-core": "0.0.0-private",
|