@openclaw/gateway-protocol 2026.11.3 → 2026.11.5-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/CHANGELOG.md +17 -10
- package/README.md +10 -2
- package/dist/.source-module-urls/5712ecf2b505e1ffe07307c66aedeadc7e26051742412d27b27f0c2a96ba2443.json +1 -0
- package/dist/catalog-CjRscarz.mjs +23370 -0
- package/dist/client-info.d.mts +10 -0
- package/dist/client-info.mjs +14 -8
- package/dist/connect-error-details.d.mts +2 -1
- package/dist/connect-error-details.mjs +5 -7
- package/dist/frame-guards.d.mts +2 -1
- package/dist/frame-guards.mjs +4 -6
- package/dist/{frames-CP0Lw0m-.d.mts → frames-clYGKOGE.d.mts} +18 -61
- package/dist/gateway-error-details-1bwo8ogl.d.mts +236 -0
- package/dist/gateway-error-details.d.mts +2 -2
- package/dist/gateway-error-details.mjs +7 -5
- package/dist/index.d.mts +7333 -6554
- package/dist/index.mjs +715 -545
- package/dist/number-coercion-C3Y6DVez.mjs +9 -0
- package/dist/{schema-modules-BIMQGSeA.d.mts → schema-modules-mv6kLPga.d.mts} +3571 -762
- package/dist/schema.d.mts +7 -5
- package/dist/schema.mjs +105 -59
- package/dist/server-capabilities-CYIhEfgo.d.mts +55 -0
- package/dist/{server-capabilities-DRQ3mUjT.mjs → server-capabilities-DA3Gf1Rp.mjs} +3 -0
- package/dist/session-row-deltas.d.mts +21 -0
- package/dist/session-row-deltas.mjs +8 -0
- package/dist/startup-unavailable.d.mts +4 -1
- package/dist/startup-unavailable.mjs +3 -1
- package/dist/system-agent-context.d.mts +2 -1
- package/dist/{theme-BshtYPJX.mjs → theme-DRGRYAgn.mjs} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/theme.mjs +1 -2
- package/dist/themes-GZs9U79C.d.mts +293 -0
- package/package.json +7 -2
- package/protocol.schema.json +36150 -26351
- package/dist/catalog-SevQOEU4.mjs +0 -16823
- package/dist/gateway-error-details-BqRYhh5h.d.mts +0 -1489
- package/dist/theme-dtBTRSNj.d.mts +0 -109
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region packages/gateway-protocol/src/server-capabilities.d.ts
|
|
2
|
+
/** Stable feature names advertised in Gateway hello responses. */
|
|
3
|
+
declare const GATEWAY_SERVER_CAPS: {
|
|
4
|
+
readonly AGENT_SESSION_ID_CREATE: "agent-session-id-create-v1";
|
|
5
|
+
readonly BOARD_WIDGET_PUT_CANVAS_DOC: "board-widget-put-canvas-doc";
|
|
6
|
+
readonly CHAT_SEND_ROUTING_CONTRACT: "chat-send-routing-contract";
|
|
7
|
+
readonly CONTROL_UI_BROWSER_FOCUS: "control-ui-browser-focus";
|
|
8
|
+
readonly GATEWAY_RESTART_TARGET_SAFE: "gateway-restart-target-safe-v1";
|
|
9
|
+
readonly LOCAL_STATE_OWNER_ROUTING: "local-state-owner-routing-v1";
|
|
10
|
+
readonly MODELS_AUTH_SET_API_KEY_OWNER: "models-auth-set-api-key-owner-v1";
|
|
11
|
+
readonly MODELS_AUTH_LOGIN_OWNER: "models-auth-login-owner-v1";
|
|
12
|
+
readonly CHANNELS_PAIRING_LIST_OWNER: "channels-pairing-list-owner-v1";
|
|
13
|
+
readonly CHANNELS_PAIRING_APPROVE_OWNER: "channels-pairing-approve-owner-v1";
|
|
14
|
+
readonly EXEC_APPROVALS_GET_OWNER: "exec-approvals-get-owner-v1";
|
|
15
|
+
readonly EXEC_APPROVALS_SET_OWNER: "exec-approvals-set-owner-v1";
|
|
16
|
+
readonly EXEC_APPROVALS_NATIVE_COMMIT: "exec-approvals-native-commit-v1";
|
|
17
|
+
readonly WORKTREES_REMOVE_OWNER: "worktrees-remove-owner-v1";
|
|
18
|
+
readonly WORKTREES_RESTORE_OWNER: "worktrees-restore-owner-v1";
|
|
19
|
+
readonly WORKTREES_GC_OWNER: "worktrees-gc-owner-v1";
|
|
20
|
+
readonly WORKTREES_RECOVER_REMOVAL_OWNER: "worktrees-recover-removal-owner-v1";
|
|
21
|
+
readonly WORKTREES_RETIRE_SNAPSHOT_OWNER: "worktrees-retire-snapshot-owner-v1";
|
|
22
|
+
readonly MODEL_CATALOG_SNAPSHOT: "model-catalog-snapshot";
|
|
23
|
+
readonly NODE_PERMISSION_ERRORS: "node-permission-errors";
|
|
24
|
+
readonly NODE_WORKER_BUNDLE_PREFETCH: "node-worker-bundle-prefetch-v1";
|
|
25
|
+
readonly NODE_WORKER_BUNDLE_RETENTION: "node-worker-bundle-retention-v1";
|
|
26
|
+
readonly NODE_WORKER_BUNDLE_STATUS: "node-worker-bundle-status-v1";
|
|
27
|
+
readonly NODE_WORKER_CAPTURED_EXEC_POLICY: "node-worker-captured-exec-policy";
|
|
28
|
+
readonly NODE_WORKER_WORKSPACE_RESULT: "node-worker-workspace-result-v2";
|
|
29
|
+
readonly NODE_WORKER_WORKSPACE_QUIESCENCE: "node-worker-workspace-quiescence-v1";
|
|
30
|
+
readonly NODE_WORKER_DEVICE_FOLDERS: "node-worker-device-folders-v1";
|
|
31
|
+
readonly NODE_WORKER_ENVIRONMENT_SESSION: "node-worker-environment-session-v1";
|
|
32
|
+
readonly NODE_WORKER_HOST_DIAGNOSTICS: "node-worker-host-diagnostics-v1";
|
|
33
|
+
readonly NODE_WORKER_IDLE_RETENTION: "node-worker-idle-retention-v1";
|
|
34
|
+
readonly NODE_WORKER_LAUNCH_TOOL_NAMES: "node-worker-launch-tool-names-v1";
|
|
35
|
+
readonly NODE_WORKER_NATIVE_INFERENCE: "node-worker-native-inference-v1";
|
|
36
|
+
readonly NODE_WORKER_PORTAL_STREAM: "node-worker-portal-stream-v1";
|
|
37
|
+
readonly NODE_WORKER_PROMPT_CONTEXT: "node-worker-prompt-context-v1";
|
|
38
|
+
readonly NODE_WORKER_STATUS_WAIT: "node-worker-status-wait-v1";
|
|
39
|
+
readonly PUBLISHED_MODEL_CATALOG: "published-model-catalog";
|
|
40
|
+
readonly PROFILE_BINDING: "profile-binding-v1";
|
|
41
|
+
readonly PROGRESS_CARD_AGENT_SCOPE: "progress-card-agent-scope-v1";
|
|
42
|
+
readonly SESSION_SCOPED_CHAT_METADATA: "session-scoped-chat-metadata";
|
|
43
|
+
readonly SESSION_SCOPED_MODEL_CATALOG: "session-scoped-model-catalog";
|
|
44
|
+
readonly SESSION_UNREAD_ACK_CONTRACT: "session-unread-ack-contract";
|
|
45
|
+
readonly SESSION_GOAL_START: "session-goal-start-v1";
|
|
46
|
+
readonly SESSION_SETTINGS_CONTRACT: "session-settings-contract";
|
|
47
|
+
readonly SESSION_SETTINGS_CAS: "session-settings-cas-v1";
|
|
48
|
+
readonly SENDER_RESTRICTED_HIDDEN_HELPERS: "sender-restricted-hidden-helpers-v1";
|
|
49
|
+
readonly SYSTEM_AGENT_WIZARD_CANCEL: "openclaw-chat-wizard-cancel";
|
|
50
|
+
readonly SYSTEM_AGENT_SETUP_MODEL_REF: "openclaw-setup-model-ref";
|
|
51
|
+
readonly TASK_SUGGESTIONS_ACCEPT_MODES: "taskSuggestions.acceptModes";
|
|
52
|
+
readonly TALK_SESSION_CLOSE_DISPOSITION: "talk-session-close-disposition";
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { GATEWAY_SERVER_CAPS as t };
|
|
@@ -19,6 +19,7 @@ const GATEWAY_SERVER_CAPS = {
|
|
|
19
19
|
CHANNELS_PAIRING_APPROVE_OWNER: "channels-pairing-approve-owner-v1",
|
|
20
20
|
EXEC_APPROVALS_GET_OWNER: "exec-approvals-get-owner-v1",
|
|
21
21
|
EXEC_APPROVALS_SET_OWNER: "exec-approvals-set-owner-v1",
|
|
22
|
+
EXEC_APPROVALS_NATIVE_COMMIT: "exec-approvals-native-commit-v1",
|
|
22
23
|
WORKTREES_REMOVE_OWNER: "worktrees-remove-owner-v1",
|
|
23
24
|
WORKTREES_RESTORE_OWNER: "worktrees-restore-owner-v1",
|
|
24
25
|
WORKTREES_GC_OWNER: "worktrees-gc-owner-v1",
|
|
@@ -26,9 +27,11 @@ const GATEWAY_SERVER_CAPS = {
|
|
|
26
27
|
WORKTREES_RETIRE_SNAPSHOT_OWNER: "worktrees-retire-snapshot-owner-v1",
|
|
27
28
|
MODEL_CATALOG_SNAPSHOT: "model-catalog-snapshot",
|
|
28
29
|
NODE_PERMISSION_ERRORS: "node-permission-errors",
|
|
30
|
+
NODE_WORKER_BUNDLE_PREFETCH: "node-worker-bundle-prefetch-v1",
|
|
29
31
|
NODE_WORKER_BUNDLE_RETENTION: "node-worker-bundle-retention-v1",
|
|
30
32
|
NODE_WORKER_BUNDLE_STATUS: "node-worker-bundle-status-v1",
|
|
31
33
|
NODE_WORKER_CAPTURED_EXEC_POLICY: "node-worker-captured-exec-policy",
|
|
34
|
+
NODE_WORKER_WORKSPACE_RESULT: "node-worker-workspace-result-v2",
|
|
32
35
|
NODE_WORKER_WORKSPACE_QUIESCENCE: "node-worker-workspace-quiescence-v1",
|
|
33
36
|
NODE_WORKER_DEVICE_FOLDERS: "node-worker-device-folders-v1",
|
|
34
37
|
NODE_WORKER_ENVIRONMENT_SESSION: "node-worker-environment-session-v1",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region packages/gateway-protocol/src/session-row-deltas.d.ts
|
|
2
|
+
/** Shared count bound keeps the socket's server/client row LRU deterministic. */
|
|
3
|
+
export declare const SESSION_ROW_DELTA_MAX_ENTRIES = 1024;
|
|
4
|
+
export declare function sessionRowIdentity(key: string, agentId?: string): string;
|
|
5
|
+
type SessionRowWireIdentity = {
|
|
6
|
+
key: string;
|
|
7
|
+
agentId?: string;
|
|
8
|
+
version: number;
|
|
9
|
+
};
|
|
10
|
+
export type SessionRowFull = SessionRowWireIdentity & {
|
|
11
|
+
full: Record<string, unknown>;
|
|
12
|
+
retain?: false;
|
|
13
|
+
};
|
|
14
|
+
export type SessionRowPatch = SessionRowWireIdentity & {
|
|
15
|
+
base: number;
|
|
16
|
+
set: Record<string, unknown>;
|
|
17
|
+
remove: string[];
|
|
18
|
+
};
|
|
19
|
+
export type SessionRowWire = SessionRowFull | SessionRowPatch;
|
|
20
|
+
//#endregion
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region packages/gateway-protocol/src/session-row-deltas.ts
|
|
2
|
+
/** Shared count bound keeps the socket's server/client row LRU deterministic. */
|
|
3
|
+
const SESSION_ROW_DELTA_MAX_ENTRIES = 1024;
|
|
4
|
+
function sessionRowIdentity(key, agentId) {
|
|
5
|
+
return JSON.stringify([agentId, key]);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { SESSION_ROW_DELTA_MAX_ENTRIES, sessionRowIdentity };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
//#region packages/gateway-protocol/src/startup-unavailable.d.ts
|
|
2
2
|
/** Structured error reason used while gateway startup sidecars are still initializing. */
|
|
3
3
|
export declare const GATEWAY_STARTUP_UNAVAILABLE_REASON = "startup-sidecars";
|
|
4
|
+
/** Base startup-admission budget shared by the server and interactive clients. */
|
|
5
|
+
export declare const GATEWAY_STARTUP_ADMISSION_WAIT_MS = 300000;
|
|
4
6
|
/** Internal close cause that distinguishes startup retry closes from generic disconnects. */
|
|
5
7
|
export declare const GATEWAY_STARTUP_PENDING_CLOSE_CAUSE = "startup-sidecars-pending";
|
|
6
8
|
/** WebSocket close code for temporary gateway unavailability. */
|
|
@@ -19,4 +21,5 @@ export declare function gatewayStartupUnavailableDetails(): GatewayStartupUnavai
|
|
|
19
21
|
export declare function isRetryableGatewayStartupUnavailableError(error: unknown): boolean;
|
|
20
22
|
/** Resolves a bounded retry-after delay from a startup-unavailable error. */
|
|
21
23
|
export declare function resolveGatewayStartupRetryAfterMs(error: unknown): number | null;
|
|
22
|
-
//#endregion
|
|
24
|
+
//#endregion
|
|
25
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
//#region packages/gateway-protocol/src/startup-unavailable.ts
|
|
2
2
|
/** Structured error reason used while gateway startup sidecars are still initializing. */
|
|
3
3
|
const GATEWAY_STARTUP_UNAVAILABLE_REASON = "startup-sidecars";
|
|
4
|
+
/** Base startup-admission budget shared by the server and interactive clients. */
|
|
5
|
+
const GATEWAY_STARTUP_ADMISSION_WAIT_MS = 3e5;
|
|
4
6
|
/** Internal close cause that distinguishes startup retry closes from generic disconnects. */
|
|
5
7
|
const GATEWAY_STARTUP_PENDING_CLOSE_CAUSE = "startup-sidecars-pending";
|
|
6
8
|
/** WebSocket close code for temporary gateway unavailability. */
|
|
@@ -31,4 +33,4 @@ function resolveGatewayStartupRetryAfterMs(error) {
|
|
|
31
33
|
return Math.min(Math.max(Math.floor(typeof retryAfterMs === "number" && Number.isFinite(retryAfterMs) ? retryAfterMs : 500), GATEWAY_STARTUP_RETRY_MIN_MS), GATEWAY_STARTUP_RETRY_MAX_MS);
|
|
32
34
|
}
|
|
33
35
|
//#endregion
|
|
34
|
-
export { GATEWAY_STARTUP_CLOSE_CODE, GATEWAY_STARTUP_CLOSE_REASON, GATEWAY_STARTUP_PENDING_CLOSE_CAUSE, GATEWAY_STARTUP_RETRY_AFTER_MS, GATEWAY_STARTUP_UNAVAILABLE_REASON, gatewayStartupUnavailableDetails, isRetryableGatewayStartupUnavailableError, resolveGatewayStartupRetryAfterMs };
|
|
36
|
+
export { GATEWAY_STARTUP_ADMISSION_WAIT_MS, GATEWAY_STARTUP_CLOSE_CODE, GATEWAY_STARTUP_CLOSE_REASON, GATEWAY_STARTUP_PENDING_CLOSE_CAUSE, GATEWAY_STARTUP_RETRY_AFTER_MS, GATEWAY_STARTUP_UNAVAILABLE_REASON, gatewayStartupUnavailableDetails, isRetryableGatewayStartupUnavailableError, resolveGatewayStartupRetryAfterMs };
|
|
@@ -231,7 +231,7 @@ function normalizePalette(value, mode) {
|
|
|
231
231
|
const palette = requireRecord(value, `theme.${mode}`);
|
|
232
232
|
requireKeys(palette, [...THEME_COLOR_KEYS, ...THEME_FONT_KEYS], `theme.${mode}`);
|
|
233
233
|
const entries = THEME_COLOR_KEYS.map((key) => [key, requireColor(palette[key], `theme.${mode}.${key}`)]);
|
|
234
|
-
const result =
|
|
234
|
+
const result = Object.fromEntries(entries);
|
|
235
235
|
for (const key of THEME_FONT_KEYS) {
|
|
236
236
|
if (palette[key] === void 0) continue;
|
|
237
237
|
const font = requireText(palette[key], `theme.${mode}.${key}`, 120);
|
package/dist/theme.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { $ as ThemeMode, A as THEME_WORKING_PHRASES_MAX, B as ThemeMascot, C as THEME_CRITTER_IDS, D as THEME_NAME_MAX_LENGTH, E as THEME_MASCOT_VALUES, F as ThemeCatalogEntry, G as normalizeThemeDefinition, H as ThemeWorkingIndicator, I as ThemeColorMode, J as BUILTIN_THEME_IDS, K as parseThemeDefinition, L as ThemeCritterId, M as ThemeArtwork, N as ThemeAvatarHatId, O as THEME_TOKEN_MAX_LENGTH, P as ThemeBranding, Q as ThemeId, R as ThemeDefinition, S as THEME_COLOR_KEYS, T as THEME_FONT_KEYS, U as isThemeAvatarHatId, V as ThemePalette, W as isThemeCritterId, X as THEME_LOCAL_ID_MAX_LENGTH, Y as BuiltinThemeId, Z as THEME_LOCAL_ID_PATTERN, _ as MAX_THEME_DEFINITION_BYTES, b as THEME_BRAND_ICON_IDS, et as isBuiltinThemeId, g as BUILTIN_THEMES, j as THEME_WORKING_PHRASE_MAX_LENGTH, k as THEME_WORKING_INDICATOR_VALUES, nt as normalizeThemeMode, q as resolveThemeBranding, tt as isThemeId, v as THEME_ARTWORK_ID_PATTERN, w as THEME_DESCRIPTION_MAX_LENGTH, x as THEME_BRAND_NAME_MAX_LENGTH, y as THEME_AVATAR_HAT_IDS, z as ThemeDescriptor } from "./themes-GZs9U79C.mjs";
|
|
2
2
|
export { BUILTIN_THEMES, BUILTIN_THEME_IDS, type BuiltinThemeId, 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, ThemeArtwork, ThemeAvatarHatId, ThemeBranding, ThemeCatalogEntry, ThemeColorMode, ThemeCritterId, ThemeDefinition, ThemeDescriptor, type ThemeId, ThemeMascot, type ThemeMode, ThemePalette, ThemeWorkingIndicator, isBuiltinThemeId, isThemeAvatarHatId, isThemeCritterId, isThemeId, normalizeThemeDefinition, normalizeThemeMode, parseThemeDefinition, resolveThemeBranding };
|
package/dist/theme.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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 };
|
|
1
|
+
export { t as BUILTIN_THEMES, S as BUILTIN_THEME_IDS, n as MAX_THEME_DEFINITION_BYTES, r as THEME_ARTWORK_ID_PATTERN, i as THEME_AVATAR_HAT_IDS, a as THEME_BRAND_ICON_IDS, o as THEME_BRAND_NAME_MAX_LENGTH, s as THEME_COLOR_KEYS, c as THEME_CRITTER_IDS, l as THEME_DESCRIPTION_MAX_LENGTH, u as THEME_FONT_KEYS, C as THEME_LOCAL_ID_MAX_LENGTH, w as THEME_LOCAL_ID_PATTERN, d as THEME_MASCOT_VALUES, f as THEME_NAME_MAX_LENGTH, p as THEME_TOKEN_MAX_LENGTH, m as THEME_WORKING_INDICATOR_VALUES, h as THEME_WORKING_PHRASES_MAX, g as THEME_WORKING_PHRASE_MAX_LENGTH, T as isBuiltinThemeId, _ as isThemeAvatarHatId, v as isThemeCritterId, E as isThemeId, y as normalizeThemeDefinition, D as normalizeThemeMode, b as parseThemeDefinition, x as resolveThemeBranding } from "./theme-DRGRYAgn.mjs";
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { Static, Type } from "typebox";
|
|
2
|
+
//#region packages/gateway-protocol/src/schema-contract.d.ts
|
|
3
|
+
/** Keep handwritten optional-property contracts when deriving JSON shapes from schemas. */
|
|
4
|
+
type SchemaContract<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly unknown[] ? { [K in keyof T]: SchemaContract<T[K]>; } : T extends object ? { [K in keyof T]: SchemaContract<string extends K ? T[K] : number extends K ? T[K] : symbol extends K ? T[K] : Pick<T, K> extends Required<Pick<T, K>> ? T[K] : Exclude<T[K], undefined>>; } : T;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region packages/gateway-protocol/src/theme-ids.d.ts
|
|
7
|
+
/** Lightweight theme identifiers used while browser preferences boot. */
|
|
8
|
+
declare const BUILTIN_THEME_IDS: readonly ["claw", "knot", "dash", "absolutely", "tide", "beacon", "phosphor", "crt", "manuscript", "rose", "miami"];
|
|
9
|
+
type BuiltinThemeId = (typeof BUILTIN_THEME_IDS)[number];
|
|
10
|
+
type ThemeId = BuiltinThemeId | `${string}/${string}`;
|
|
11
|
+
type ThemeMode = "system" | "light" | "dark";
|
|
12
|
+
declare const THEME_LOCAL_ID_MAX_LENGTH = 64;
|
|
13
|
+
declare const THEME_LOCAL_ID_PATTERN: RegExp;
|
|
14
|
+
declare function isBuiltinThemeId(value: unknown): value is BuiltinThemeId;
|
|
15
|
+
declare function isThemeId(value: unknown): value is ThemeId;
|
|
16
|
+
declare function normalizeThemeMode(value: unknown): ThemeMode | undefined;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region packages/gateway-protocol/src/theme.d.ts
|
|
19
|
+
/** Portable theme data shared by profile preferences, plugins, and the Control UI. */
|
|
20
|
+
type ThemeColorMode = "light" | "dark";
|
|
21
|
+
declare const THEME_COLOR_KEYS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "destructive-foreground", "border", "input", "ring"];
|
|
22
|
+
declare const THEME_FONT_KEYS: readonly ["font-sans", "font-mono"];
|
|
23
|
+
declare const THEME_MASCOT_VALUES: readonly ["claw", "none"];
|
|
24
|
+
type ThemeMascot = (typeof THEME_MASCOT_VALUES)[number];
|
|
25
|
+
declare const THEME_BRAND_ICON_IDS: readonly ["claw", "mark"];
|
|
26
|
+
declare const THEME_WORKING_INDICATOR_VALUES: readonly ["claw", "dots", "brand", "none"];
|
|
27
|
+
type ThemeWorkingIndicator = (typeof THEME_WORKING_INDICATOR_VALUES)[number];
|
|
28
|
+
declare const THEME_BRAND_NAME_MAX_LENGTH = 80;
|
|
29
|
+
declare const THEME_CRITTER_IDS: readonly ["penguin", "fedora"];
|
|
30
|
+
type ThemeCritterId = (typeof THEME_CRITTER_IDS)[number];
|
|
31
|
+
declare function isThemeCritterId(value: unknown): value is ThemeCritterId;
|
|
32
|
+
declare const THEME_AVATAR_HAT_IDS: readonly ["fedora", "crown", "santa", "party", "pumpkin"];
|
|
33
|
+
type ThemeAvatarHatId = (typeof THEME_AVATAR_HAT_IDS)[number];
|
|
34
|
+
declare function isThemeAvatarHatId(value: unknown): value is ThemeAvatarHatId;
|
|
35
|
+
declare const THEME_ARTWORK_ID_PATTERN: RegExp;
|
|
36
|
+
declare const THEME_WORKING_PHRASES_MAX = 24;
|
|
37
|
+
declare const THEME_WORKING_PHRASE_MAX_LENGTH = 24;
|
|
38
|
+
declare const MAX_THEME_DEFINITION_BYTES = 4096;
|
|
39
|
+
declare const THEME_NAME_MAX_LENGTH = 80;
|
|
40
|
+
declare const THEME_DESCRIPTION_MAX_LENGTH = 320;
|
|
41
|
+
declare const THEME_TOKEN_MAX_LENGTH = 120;
|
|
42
|
+
type ThemePalette = Record<(typeof THEME_COLOR_KEYS)[number], string> & Partial<Record<(typeof THEME_FONT_KEYS)[number], string>>;
|
|
43
|
+
type ThemeDefinition = SchemaContract<Static<typeof ThemeDefinitionSchema>>;
|
|
44
|
+
type ThemeArtwork = {
|
|
45
|
+
icons?: Record<string, {
|
|
46
|
+
url: string;
|
|
47
|
+
}>;
|
|
48
|
+
hats?: Record<string, {
|
|
49
|
+
url: string;
|
|
50
|
+
}>;
|
|
51
|
+
critters?: Record<string, {
|
|
52
|
+
url: string;
|
|
53
|
+
title?: string;
|
|
54
|
+
crossMs?: number;
|
|
55
|
+
}>;
|
|
56
|
+
/** Plugin-only canvas artwork per color mode; a missing mode keeps neutral artwork. */
|
|
57
|
+
backgrounds?: Partial<Record<ThemeColorMode, {
|
|
58
|
+
url: string;
|
|
59
|
+
}>>;
|
|
60
|
+
};
|
|
61
|
+
type ThemeDescriptor = {
|
|
62
|
+
id: ThemeId;
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
source: "builtin" | "plugin" | "user";
|
|
66
|
+
modes: ThemeColorMode[];
|
|
67
|
+
pluginId?: string;
|
|
68
|
+
mascot?: ThemeMascot;
|
|
69
|
+
brandName?: string;
|
|
70
|
+
brandIcon?: string;
|
|
71
|
+
workingIndicator?: ThemeWorkingIndicator;
|
|
72
|
+
lobsterdex?: boolean;
|
|
73
|
+
communityLinks?: boolean;
|
|
74
|
+
workingPhrases?: readonly string[];
|
|
75
|
+
critters?: readonly string[];
|
|
76
|
+
avatarHat?: string;
|
|
77
|
+
artwork?: ThemeArtwork;
|
|
78
|
+
};
|
|
79
|
+
type ThemeCatalogEntry = ThemeDescriptor & {
|
|
80
|
+
definition?: ThemeDefinition;
|
|
81
|
+
};
|
|
82
|
+
type ThemeBranding = {
|
|
83
|
+
mascot: ThemeMascot;
|
|
84
|
+
brandName: string;
|
|
85
|
+
brandIcon: string;
|
|
86
|
+
workingIndicator: ThemeWorkingIndicator;
|
|
87
|
+
lobsterdex: boolean;
|
|
88
|
+
communityLinks: boolean;
|
|
89
|
+
workingPhrases?: readonly string[];
|
|
90
|
+
critters: readonly string[];
|
|
91
|
+
avatarHat?: string;
|
|
92
|
+
artwork?: ThemeArtwork;
|
|
93
|
+
};
|
|
94
|
+
declare function resolveThemeBranding(source: Pick<ThemeDescriptor, "mascot" | "brandName" | "brandIcon" | "workingIndicator" | "lobsterdex" | "communityLinks" | "workingPhrases" | "critters" | "avatarHat" | "artwork"> | undefined): ThemeBranding;
|
|
95
|
+
declare const BUILTIN_THEMES: readonly ThemeDescriptor[];
|
|
96
|
+
/** Rejects executable CSS and incomplete palettes before they reach storage or a stylesheet. */
|
|
97
|
+
declare function normalizeThemeDefinition(input: unknown, options?: {
|
|
98
|
+
iconIds?: readonly string[];
|
|
99
|
+
hatIds?: readonly string[];
|
|
100
|
+
critterIds?: readonly string[];
|
|
101
|
+
}): ThemeDefinition;
|
|
102
|
+
declare function parseThemeDefinition(value: unknown): ThemeDefinition | null;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region packages/gateway-protocol/src/schema/themes.d.ts
|
|
105
|
+
declare const ThemePaletteSchema: Type.TObject<{
|
|
106
|
+
background: Type.TString;
|
|
107
|
+
foreground: Type.TString;
|
|
108
|
+
card: Type.TString;
|
|
109
|
+
"card-foreground": Type.TString;
|
|
110
|
+
popover: Type.TString;
|
|
111
|
+
"popover-foreground": Type.TString;
|
|
112
|
+
primary: Type.TString;
|
|
113
|
+
"primary-foreground": Type.TString;
|
|
114
|
+
secondary: Type.TString;
|
|
115
|
+
"secondary-foreground": Type.TString;
|
|
116
|
+
muted: Type.TString;
|
|
117
|
+
"muted-foreground": Type.TString;
|
|
118
|
+
accent: Type.TString;
|
|
119
|
+
"accent-foreground": Type.TString;
|
|
120
|
+
destructive: Type.TString;
|
|
121
|
+
"destructive-foreground": Type.TString;
|
|
122
|
+
border: Type.TString;
|
|
123
|
+
input: Type.TString;
|
|
124
|
+
ring: Type.TString;
|
|
125
|
+
"font-sans": Type.TOptional<Type.TString>;
|
|
126
|
+
"font-mono": Type.TOptional<Type.TString>;
|
|
127
|
+
}>;
|
|
128
|
+
declare const ThemeDefinitionSchema: Type.TObject<{
|
|
129
|
+
name: Type.TString;
|
|
130
|
+
description: Type.TString;
|
|
131
|
+
mascot: Type.TOptional<Type.TUnion<[Type.TLiteral<"claw">, Type.TLiteral<"none">]>>;
|
|
132
|
+
brandName: Type.TOptional<Type.TString>;
|
|
133
|
+
brandIcon: Type.TOptional<Type.TString>;
|
|
134
|
+
workingIndicator: Type.TOptional<Type.TUnion<[Type.TLiteral<"claw">, Type.TLiteral<"dots">, Type.TLiteral<"brand">, Type.TLiteral<"none">]>>;
|
|
135
|
+
lobsterdex: Type.TOptional<Type.TBoolean>;
|
|
136
|
+
communityLinks: Type.TOptional<Type.TBoolean>;
|
|
137
|
+
workingPhrases: Type.TOptional<Type.TArray<Type.TString>>;
|
|
138
|
+
critters: Type.TOptional<Type.TArray<Type.TString>>;
|
|
139
|
+
avatarHat: Type.TOptional<Type.TString>;
|
|
140
|
+
light: Type.TOptional<Type.TObject<{
|
|
141
|
+
background: Type.TString;
|
|
142
|
+
foreground: Type.TString;
|
|
143
|
+
card: Type.TString;
|
|
144
|
+
"card-foreground": Type.TString;
|
|
145
|
+
popover: Type.TString;
|
|
146
|
+
"popover-foreground": Type.TString;
|
|
147
|
+
primary: Type.TString;
|
|
148
|
+
"primary-foreground": Type.TString;
|
|
149
|
+
secondary: Type.TString;
|
|
150
|
+
"secondary-foreground": Type.TString;
|
|
151
|
+
muted: Type.TString;
|
|
152
|
+
"muted-foreground": Type.TString;
|
|
153
|
+
accent: Type.TString;
|
|
154
|
+
"accent-foreground": Type.TString;
|
|
155
|
+
destructive: Type.TString;
|
|
156
|
+
"destructive-foreground": Type.TString;
|
|
157
|
+
border: Type.TString;
|
|
158
|
+
input: Type.TString;
|
|
159
|
+
ring: Type.TString;
|
|
160
|
+
"font-sans": Type.TOptional<Type.TString>;
|
|
161
|
+
"font-mono": Type.TOptional<Type.TString>;
|
|
162
|
+
}>>;
|
|
163
|
+
dark: Type.TOptional<Type.TObject<{
|
|
164
|
+
background: Type.TString;
|
|
165
|
+
foreground: Type.TString;
|
|
166
|
+
card: Type.TString;
|
|
167
|
+
"card-foreground": Type.TString;
|
|
168
|
+
popover: Type.TString;
|
|
169
|
+
"popover-foreground": Type.TString;
|
|
170
|
+
primary: Type.TString;
|
|
171
|
+
"primary-foreground": Type.TString;
|
|
172
|
+
secondary: Type.TString;
|
|
173
|
+
"secondary-foreground": Type.TString;
|
|
174
|
+
muted: Type.TString;
|
|
175
|
+
"muted-foreground": Type.TString;
|
|
176
|
+
accent: Type.TString;
|
|
177
|
+
"accent-foreground": Type.TString;
|
|
178
|
+
destructive: Type.TString;
|
|
179
|
+
"destructive-foreground": Type.TString;
|
|
180
|
+
border: Type.TString;
|
|
181
|
+
input: Type.TString;
|
|
182
|
+
ring: Type.TString;
|
|
183
|
+
"font-sans": Type.TOptional<Type.TString>;
|
|
184
|
+
"font-mono": Type.TOptional<Type.TString>;
|
|
185
|
+
}>>;
|
|
186
|
+
}>;
|
|
187
|
+
declare const ThemeModeSchema: Type.TUnion<[Type.TLiteral<"system">, Type.TLiteral<"light">, Type.TLiteral<"dark">]>;
|
|
188
|
+
declare const ThemesListParamsSchema: Type.TObject<{}>;
|
|
189
|
+
declare const ThemesGetParamsSchema: Type.TObject<{
|
|
190
|
+
id: Type.TOptional<Type.TString>;
|
|
191
|
+
}>;
|
|
192
|
+
declare const ThemesSetParamsSchema: Type.TObject<{
|
|
193
|
+
id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
194
|
+
mode: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TLiteral<"system">, Type.TLiteral<"light">, Type.TLiteral<"dark">]>, Type.TNull]>>;
|
|
195
|
+
appearance: Type.TOptional<Type.TObject<{
|
|
196
|
+
accent: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
197
|
+
fontUi: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
198
|
+
fontChat: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
199
|
+
}>>;
|
|
200
|
+
}>;
|
|
201
|
+
declare const ThemesImportParamsSchema: Type.TObject<{
|
|
202
|
+
id: Type.TString;
|
|
203
|
+
definition: Type.TObject<{
|
|
204
|
+
name: Type.TString;
|
|
205
|
+
description: Type.TString;
|
|
206
|
+
mascot: Type.TOptional<Type.TUnion<[Type.TLiteral<"claw">, Type.TLiteral<"none">]>>;
|
|
207
|
+
brandName: Type.TOptional<Type.TString>;
|
|
208
|
+
brandIcon: Type.TOptional<Type.TString>;
|
|
209
|
+
workingIndicator: Type.TOptional<Type.TUnion<[Type.TLiteral<"claw">, Type.TLiteral<"dots">, Type.TLiteral<"brand">, Type.TLiteral<"none">]>>;
|
|
210
|
+
lobsterdex: Type.TOptional<Type.TBoolean>;
|
|
211
|
+
communityLinks: Type.TOptional<Type.TBoolean>;
|
|
212
|
+
workingPhrases: Type.TOptional<Type.TArray<Type.TString>>;
|
|
213
|
+
critters: Type.TOptional<Type.TArray<Type.TString>>;
|
|
214
|
+
avatarHat: Type.TOptional<Type.TString>;
|
|
215
|
+
light: Type.TOptional<Type.TObject<{
|
|
216
|
+
background: Type.TString;
|
|
217
|
+
foreground: Type.TString;
|
|
218
|
+
card: Type.TString;
|
|
219
|
+
"card-foreground": Type.TString;
|
|
220
|
+
popover: Type.TString;
|
|
221
|
+
"popover-foreground": Type.TString;
|
|
222
|
+
primary: Type.TString;
|
|
223
|
+
"primary-foreground": Type.TString;
|
|
224
|
+
secondary: Type.TString;
|
|
225
|
+
"secondary-foreground": Type.TString;
|
|
226
|
+
muted: Type.TString;
|
|
227
|
+
"muted-foreground": Type.TString;
|
|
228
|
+
accent: Type.TString;
|
|
229
|
+
"accent-foreground": Type.TString;
|
|
230
|
+
destructive: Type.TString;
|
|
231
|
+
"destructive-foreground": Type.TString;
|
|
232
|
+
border: Type.TString;
|
|
233
|
+
input: Type.TString;
|
|
234
|
+
ring: Type.TString;
|
|
235
|
+
"font-sans": Type.TOptional<Type.TString>;
|
|
236
|
+
"font-mono": Type.TOptional<Type.TString>;
|
|
237
|
+
}>>;
|
|
238
|
+
dark: Type.TOptional<Type.TObject<{
|
|
239
|
+
background: Type.TString;
|
|
240
|
+
foreground: Type.TString;
|
|
241
|
+
card: Type.TString;
|
|
242
|
+
"card-foreground": Type.TString;
|
|
243
|
+
popover: Type.TString;
|
|
244
|
+
"popover-foreground": Type.TString;
|
|
245
|
+
primary: Type.TString;
|
|
246
|
+
"primary-foreground": Type.TString;
|
|
247
|
+
secondary: Type.TString;
|
|
248
|
+
"secondary-foreground": Type.TString;
|
|
249
|
+
muted: Type.TString;
|
|
250
|
+
"muted-foreground": Type.TString;
|
|
251
|
+
accent: Type.TString;
|
|
252
|
+
"accent-foreground": Type.TString;
|
|
253
|
+
destructive: Type.TString;
|
|
254
|
+
"destructive-foreground": Type.TString;
|
|
255
|
+
border: Type.TString;
|
|
256
|
+
input: Type.TString;
|
|
257
|
+
ring: Type.TString;
|
|
258
|
+
"font-sans": Type.TOptional<Type.TString>;
|
|
259
|
+
"font-mono": Type.TOptional<Type.TString>;
|
|
260
|
+
}>>;
|
|
261
|
+
}>;
|
|
262
|
+
apply: Type.TOptional<Type.TBoolean>;
|
|
263
|
+
mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"system">, Type.TLiteral<"light">, Type.TLiteral<"dark">]>>;
|
|
264
|
+
}>;
|
|
265
|
+
type ThemesListParams = Static<typeof ThemesListParamsSchema>;
|
|
266
|
+
type ThemesGetParams = Static<typeof ThemesGetParamsSchema>;
|
|
267
|
+
type ThemesSetParams = Static<typeof ThemesSetParamsSchema>;
|
|
268
|
+
type ThemesImportParams = Static<typeof ThemesImportParamsSchema>;
|
|
269
|
+
type ThemeSelection = {
|
|
270
|
+
id: string;
|
|
271
|
+
mode: ThemeMode;
|
|
272
|
+
effectiveMode?: "light" | "dark";
|
|
273
|
+
scope: "profile" | "gateway";
|
|
274
|
+
overrides: {
|
|
275
|
+
id?: string;
|
|
276
|
+
mode?: ThemeMode;
|
|
277
|
+
};
|
|
278
|
+
requestedId?: string;
|
|
279
|
+
};
|
|
280
|
+
type ThemesGetResult = {
|
|
281
|
+
current: ThemeSelection;
|
|
282
|
+
theme: ThemeDescriptor;
|
|
283
|
+
definition?: ThemeDefinition;
|
|
284
|
+
artwork?: ThemeArtwork;
|
|
285
|
+
};
|
|
286
|
+
type ThemesListResult = ThemesGetResult & {
|
|
287
|
+
themes: ThemeDescriptor[];
|
|
288
|
+
};
|
|
289
|
+
type ThemesMutationResult = ThemesGetResult & {
|
|
290
|
+
application: "saved";
|
|
291
|
+
};
|
|
292
|
+
//#endregion
|
|
293
|
+
export { ThemeMode as $, THEME_WORKING_PHRASES_MAX as A, ThemeMascot as B, THEME_CRITTER_IDS as C, THEME_NAME_MAX_LENGTH as D, THEME_MASCOT_VALUES as E, ThemeCatalogEntry as F, normalizeThemeDefinition as G, ThemeWorkingIndicator as H, ThemeColorMode as I, BUILTIN_THEME_IDS as J, parseThemeDefinition as K, ThemeCritterId as L, ThemeArtwork as M, ThemeAvatarHatId as N, THEME_TOKEN_MAX_LENGTH as O, ThemeBranding as P, ThemeId as Q, ThemeDefinition as R, THEME_COLOR_KEYS as S, THEME_FONT_KEYS as T, isThemeAvatarHatId as U, ThemePalette as V, isThemeCritterId as W, THEME_LOCAL_ID_MAX_LENGTH as X, BuiltinThemeId as Y, THEME_LOCAL_ID_PATTERN as Z, MAX_THEME_DEFINITION_BYTES as _, ThemesGetParams as a, THEME_BRAND_ICON_IDS as b, ThemesImportParams as c, ThemesListParamsSchema as d, isBuiltinThemeId as et, ThemesListResult as f, BUILTIN_THEMES as g, ThemesSetParamsSchema as h, ThemeSelection as i, THEME_WORKING_PHRASE_MAX_LENGTH as j, THEME_WORKING_INDICATOR_VALUES as k, ThemesImportParamsSchema as l, ThemesSetParams as m, ThemeModeSchema as n, normalizeThemeMode as nt, ThemesGetParamsSchema as o, ThemesMutationResult as p, resolveThemeBranding as q, ThemePaletteSchema as r, SchemaContract as rt, ThemesGetResult as s, ThemeDefinitionSchema as t, isThemeId as tt, ThemesListParams as u, THEME_ARTWORK_ID_PATTERN as v, THEME_DESCRIPTION_MAX_LENGTH as w, THEME_BRAND_NAME_MAX_LENGTH as x, THEME_AVATAR_HAT_IDS as y, ThemeDescriptor as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/gateway-protocol",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.5-beta.2",
|
|
4
4
|
"description": "Typed schemas and runtime validators for the OpenClaw Gateway WebSocket protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gateway",
|
|
@@ -67,6 +67,11 @@
|
|
|
67
67
|
"import": "./dist/schema.mjs",
|
|
68
68
|
"default": "./dist/schema.mjs"
|
|
69
69
|
},
|
|
70
|
+
"./session-row-deltas": {
|
|
71
|
+
"types": "./dist/session-row-deltas.d.mts",
|
|
72
|
+
"import": "./dist/session-row-deltas.mjs",
|
|
73
|
+
"default": "./dist/session-row-deltas.mjs"
|
|
74
|
+
},
|
|
70
75
|
"./startup-unavailable": {
|
|
71
76
|
"types": "./dist/startup-unavailable.d.mts",
|
|
72
77
|
"import": "./dist/startup-unavailable.mjs",
|
|
@@ -89,7 +94,7 @@
|
|
|
89
94
|
}
|
|
90
95
|
},
|
|
91
96
|
"dependencies": {
|
|
92
|
-
"typebox": "1.
|
|
97
|
+
"typebox": "1.4.2"
|
|
93
98
|
},
|
|
94
99
|
"devDependencies": {
|
|
95
100
|
"@openclaw/normalization-core": "0.0.0-private",
|