refactor(plugin-sdk): expose zod subpath

This commit is contained in:
Ayaan Zaidi
2026-03-27 09:50:05 +05:30
parent 70184d0a5e
commit 8b13710c09
37 changed files with 44 additions and 120 deletions

View File

@@ -2,7 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { buildPluginConfigSchema } from "openclaw/plugin-sdk/core";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import type { OpenClawPluginConfigSchema } from "../runtime-api.js";
export const ACPX_PERMISSION_MODES = ["approve-all", "approve-reads", "deny-all"] as const;

View File

@@ -3,9 +3,6 @@
"version": "2026.3.26",
"description": "OpenClaw BlueBubbles channel plugin",
"type": "module",
"dependencies": {
"zod": "^4.3.6"
},
"devDependencies": {
"openclaw": "workspace:*"
},

View File

@@ -7,7 +7,7 @@ import {
MarkdownConfigSchema,
ToolPolicySchema,
} from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { bluebubblesChannelConfigUiHints } from "./config-ui-hints.js";
import { buildSecretInputSchema, hasConfiguredSecretInput } from "./secret-input.js";

View File

@@ -1,5 +1,5 @@
import { buildPluginConfigSchema } from "openclaw/plugin-sdk/core";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import type { OpenClawPluginConfigSchema } from "../api.js";
import {
DIFF_IMAGE_QUALITY_PRESETS,

View File

@@ -6,8 +6,7 @@
"dependencies": {
"@larksuiteoapi/node-sdk": "^1.60.0",
"@sinclair/typebox": "0.34.48",
"https-proxy-agent": "^8.0.0",
"zod": "^4.3.6"
"https-proxy-agent": "^8.0.0"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -1,5 +1,5 @@
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
export { z };
import { buildSecretInputSchema, hasConfiguredSecretInput } from "./secret-input.js";

View File

@@ -3,9 +3,6 @@
"version": "2026.3.26",
"description": "OpenClaw IRC channel plugin",
"type": "module",
"dependencies": {
"zod": "^4.3.6"
},
"openclaw": {
"extensions": [
"./index.ts"

View File

@@ -9,7 +9,7 @@ import {
ToolPolicySchema,
requireOpenAllowFrom,
} from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { ircChannelConfigUiHints } from "./config-ui-hints.js";
const IrcGroupSchema = z

View File

@@ -1,5 +1,5 @@
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
const DmPolicySchema = z.enum(["open", "allowlist", "pairing", "disabled"]);
const GroupPolicySchema = z.enum(["open", "allowlist", "disabled"]);

View File

@@ -8,8 +8,7 @@
"fake-indexeddb": "^6.2.5",
"markdown-it": "14.1.1",
"matrix-js-sdk": "41.2.0",
"music-metadata": "^11.12.3",
"zod": "^4.3.6"
"music-metadata": "^11.12.3"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -4,7 +4,7 @@ import {
DmPolicySchema,
GroupPolicySchema,
} from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { buildSecretInputSchema, MarkdownConfigSchema, ToolPolicySchema } from "./runtime-api.js";
const matrixActionSchema = z

View File

@@ -5,8 +5,7 @@
"type": "module",
"dependencies": {
"@sinclair/typebox": "0.34.48",
"ws": "^8.20.0",
"zod": "^4.3.6"
"ws": "^8.20.0"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -1,5 +1,5 @@
import { requireChannelOpenAllowFrom } from "openclaw/plugin-sdk/extension-shared";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import {
BlockStreamingCoalesceSchema,
DmPolicySchema,

View File

@@ -3,9 +3,6 @@
"version": "2026.3.26",
"description": "OpenClaw Nextcloud Talk channel plugin",
"type": "module",
"dependencies": {
"zod": "^4.3.6"
},
"devDependencies": {
"openclaw": "workspace:*"
},

View File

@@ -1,5 +1,5 @@
import { requireChannelOpenAllowFrom } from "openclaw/plugin-sdk/extension-shared";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import {
BlockStreamingCoalesceSchema,
DmConfigSchema,

View File

@@ -4,8 +4,7 @@
"description": "OpenClaw Nostr channel plugin for NIP-04 encrypted DMs",
"type": "module",
"dependencies": {
"nostr-tools": "^2.23.3",
"zod": "^4.3.6"
"nostr-tools": "^2.23.3"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -1,5 +1,5 @@
import { AllowFromListSchema, DmPolicySchema } from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { MarkdownConfigSchema, buildChannelConfigSchema } from "../api.js";
/**

View File

@@ -8,7 +8,7 @@
*/
import type { IncomingMessage, ServerResponse } from "node:http";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import {
createFixedWindowRateLimiter,
isBlockedHostnameOrIp,

View File

@@ -1,6 +1,6 @@
import path from "node:path";
import { buildPluginConfigSchema, type OpenClawPluginConfigSchema } from "openclaw/plugin-sdk/core";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
export type OpenShellPluginConfig = {
mode?: "mirror" | "remote";

View File

@@ -3,9 +3,6 @@
"version": "2026.3.26",
"description": "Synology Chat channel plugin for OpenClaw",
"type": "module",
"dependencies": {
"zod": "^4.3.6"
},
"openclaw": {
"extensions": [
"./index.ts"

View File

@@ -1,5 +1,5 @@
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
export const SynologyChatChannelConfigSchema = buildChannelConfigSchema(
z

View File

@@ -7,8 +7,7 @@
"@aws-sdk/client-s3": "3.1018.0",
"@aws-sdk/s3-request-presigner": "3.1018.0",
"@tloncorp/tlon-skill": "0.3.0",
"@urbit/aura": "^3.0.0",
"zod": "^4.3.6"
"@urbit/aura": "^3.0.0"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -1,5 +1,5 @@
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/core";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
const ShipSchema = z.string().min(1);
const ChannelNestSchema = z.string().min(1);

View File

@@ -6,8 +6,7 @@
"dependencies": {
"@twurple/api": "^8.0.3",
"@twurple/auth": "^8.0.3",
"@twurple/chat": "^8.0.3",
"zod": "^4.3.6"
"@twurple/chat": "^8.0.3"
},
"openclaw": {
"extensions": [

View File

@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { MarkdownConfigSchema } from "../runtime-api.js";
/**

View File

@@ -132,7 +132,7 @@ export type {
OutboundDeliveryResult,
};
import type { z } from "zod";
import type { z } from "openclaw/plugin-sdk/zod";
// Import and re-export the schema type
import type { TwitchConfigSchema } from "./config-schema.js";
export type TwitchConfig = z.infer<typeof TwitchConfigSchema>;

View File

@@ -6,8 +6,7 @@
"dependencies": {
"@sinclair/typebox": "0.34.48",
"commander": "^14.0.3",
"ws": "^8.20.0",
"zod": "^4.3.6"
"ws": "^8.20.0"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { TtsAutoSchema, TtsConfigSchema, TtsModeSchema, TtsProviderSchema } from "../api.js";
import { deepMergeDefined } from "./deep-merge.js";

View File

@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import type { CallMode } from "./config.js";
// -----------------------------------------------------------------------------

View File

@@ -4,8 +4,7 @@
"description": "OpenClaw Zalo channel plugin",
"type": "module",
"dependencies": {
"undici": "7.24.6",
"zod": "^4.3.6"
"undici": "7.24.6"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -4,7 +4,7 @@ import {
DmPolicySchema,
GroupPolicySchema,
} from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { MarkdownConfigSchema } from "./runtime-api.js";
import { buildSecretInputSchema } from "./secret-input.js";

View File

@@ -5,8 +5,7 @@
"type": "module",
"dependencies": {
"@sinclair/typebox": "0.34.48",
"zca-js": "2.1.2",
"zod": "^4.3.6"
"zca-js": "2.1.2"
},
"devDependencies": {
"openclaw": "workspace:*"

View File

@@ -4,7 +4,7 @@ import {
DmPolicySchema,
GroupPolicySchema,
} from "openclaw/plugin-sdk/channel-config-schema";
import { z } from "zod";
import { z } from "openclaw/plugin-sdk/zod";
import { MarkdownConfigSchema, ToolPolicySchema } from "../runtime-api.js";
const groupConfigSchema = z.object({

View File

@@ -652,6 +652,10 @@
"types": "./dist/plugin-sdk/zalouser.d.ts",
"default": "./dist/plugin-sdk/zalouser.js"
},
"./plugin-sdk/zod": {
"types": "./dist/plugin-sdk/zod.d.ts",
"default": "./dist/plugin-sdk/zod.js"
},
"./extension-api": "./dist/extensionAPI.js",
"./cli-entry": "./openclaw.mjs"
},

77
pnpm-lock.yaml generated
View File

@@ -130,7 +130,7 @@ importers:
version: 1.2.10
node-llama-cpp:
specifier: 3.18.1
version: 3.18.1(typescript@5.9.3)
version: 3.18.1(typescript@6.0.2)
osc-progress:
specifier: ^0.3.0
version: 0.3.0
@@ -250,10 +250,6 @@ importers:
extensions/anthropic: {}
extensions/bluebubbles:
dependencies:
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -364,9 +360,6 @@ importers:
https-proxy-agent:
specifier: ^8.0.0
version: 8.0.0
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -394,11 +387,7 @@ importers:
extensions/imessage: {}
extensions/irc:
dependencies:
zod:
specifier: ^4.3.6
version: 4.3.6
extensions/irc: {}
extensions/kilocode: {}
@@ -442,9 +431,6 @@ importers:
music-metadata:
specifier: ^11.12.3
version: 11.12.3
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -458,9 +444,6 @@ importers:
ws:
specifier: ^8.20.0
version: 8.20.0
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -517,10 +500,6 @@ importers:
version: link:../..
extensions/nextcloud-talk:
dependencies:
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -531,9 +510,6 @@ importers:
nostr-tools:
specifier: ^2.23.3
version: 2.23.3(typescript@6.0.2)
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -572,11 +548,7 @@ importers:
specifier: ^7.15.0
version: 7.15.0
extensions/synology-chat:
dependencies:
zod:
specifier: ^4.3.6
version: 4.3.6
extensions/synology-chat: {}
extensions/synthetic: {}
@@ -608,9 +580,6 @@ importers:
'@urbit/aura':
specifier: ^3.0.0
version: 3.0.0
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -629,9 +598,6 @@ importers:
'@twurple/chat':
specifier: ^8.0.3
version: 8.0.3(@twurple/auth@8.0.3)
zod:
specifier: ^4.3.6
version: 4.3.6
extensions/venice: {}
@@ -650,9 +616,6 @@ importers:
ws:
specifier: ^8.20.0
version: 8.20.0
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -684,9 +647,6 @@ importers:
undici:
specifier: 7.24.6
version: 7.24.6
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -700,9 +660,6 @@ importers:
zca-js:
specifier: 2.1.2
version: 2.1.2
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
@@ -714,6 +671,8 @@ importers:
specifier: workspace:*
version: link:../..
packages/memory-host-sdk: {}
packages/moltbot:
dependencies:
openclaw:
@@ -6276,10 +6235,6 @@ packages:
tar-stream@3.1.8:
resolution: {integrity: sha512-U6QpVRyCGHva435KoNWy9PRoi2IFYCgtEhq9nmrPPpbRacPs9IH4aJ3gbrFC8dPcXvdSZ4XXfXT5Fshbp2MtlQ==}
tar@7.5.12:
resolution: {integrity: sha512-9TsuLcdhOn4XztcQqhNyq1KOwOOED/3k58JAvtULiYqbO8B/0IBAAIE1hj0Svmm58k27TmcigyDI0deMlgG3uw==}
engines: {node: '>=18'}
tar@7.5.13:
resolution: {integrity: sha512-tOG/7GyXpFevhXVh8jOPJrmtRpOTsYqUIkVdVooZYJS/z8WhfQUX8RJILmeuJNinGAMSu1veBr4asSHFt5/hng==}
engines: {node: '>=18'}
@@ -6415,11 +6370,6 @@ packages:
resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==}
engines: {node: '>= 0.6'}
typescript@5.9.3:
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
engines: {node: '>=14.17'}
hasBin: true
typescript@6.0.2:
resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==}
engines: {node: '>=14.17'}
@@ -10549,7 +10499,7 @@ snapshots:
node-api-headers: 1.8.0
rc: 1.2.8
semver: 7.7.4
tar: 7.5.12
tar: 7.5.13
url-join: 4.0.1
which: 6.0.1
yargs: 17.7.2
@@ -11979,7 +11929,7 @@ snapshots:
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
node-llama-cpp@3.18.1(typescript@5.9.3):
node-llama-cpp@3.18.1(typescript@6.0.2):
dependencies:
'@huggingface/jinja': 0.5.6
async-retry: 1.3.3
@@ -12023,7 +11973,7 @@ snapshots:
'@node-llama-cpp/win-x64-cuda': 3.18.1
'@node-llama-cpp/win-x64-cuda-ext': 3.18.1
'@node-llama-cpp/win-x64-vulkan': 3.18.1
typescript: 5.9.3
typescript: 6.0.2
transitivePeerDependencies:
- supports-color
@@ -13081,14 +13031,6 @@ snapshots:
- bare-buffer
- react-native-b4a
tar@7.5.12:
dependencies:
'@isaacs/fs-minipass': 4.0.1
chownr: 3.0.0
minipass: 7.1.3
minizlib: 3.1.0
yallist: 5.0.0
tar@7.5.13:
dependencies:
'@isaacs/fs-minipass': 4.0.1
@@ -13233,9 +13175,6 @@ snapshots:
media-typer: 1.1.0
mime-types: 3.0.2
typescript@5.9.3:
optional: true
typescript@6.0.2: {}
typical@4.0.0: {}

View File

@@ -152,5 +152,6 @@
"whatsapp-core",
"whatsapp-shared",
"zalo",
"zalouser"
"zalouser",
"zod"
]

1
src/plugin-sdk/zod.ts Normal file
View File

@@ -0,0 +1 @@
export * from "zod";