惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
博客园 - 三生石上(FineUI控件)
V
V2EX
有赞技术团队
有赞技术团队
V
Visual Studio Blog
小众软件
小众软件
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
量子位
T
Tailwind CSS Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
P
Palo Alto Networks Blog
Cisco Talos Blog
Cisco Talos Blog
I
Intezer
Project Zero
Project Zero
A
Arctic Wolf
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
L
Lohrmann on Cybersecurity
S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tor Project blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Help Net Security
Help Net Security
N
News | PayPal Newsroom
W
WeLiveSecurity
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
perf: optimize plugin schema validation · openclaw/openclaw@a3564ae
steipete · 2026-05-02 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,2 +1,2 @@

1-

b0424fd44d888d28f7f4ab0f653e5ae37f6ae61aad298b759ea0531edccb4405 plugin-sdk-api-baseline.json

2-

82a080f2ec0455f1496391dc35534545b07181655ef5d3845e8c86eda7979501 plugin-sdk-api-baseline.jsonl

1+

dfdecb3918124ec7926ffe17220e498ffeef2fc7a7edfea528cc5a7f284cb8ef plugin-sdk-api-baseline.json

2+

079c31016f34256af290f80f3e16d6f8154eb13513d36547ba41d3241d60e0e4 plugin-sdk-api-baseline.jsonl

Original file line numberDiff line numberDiff line change

@@ -399,6 +399,20 @@ const accountSchema = z.object({

399399

const configSchema = buildChannelConfigSchema(accountSchema);

400400

```

401401
402+

If you already author the contract as JSON Schema or TypeBox, use the direct helper so OpenClaw can skip Zod-to-JSON-Schema conversion on metadata paths:

403+
404+

```typescript

405+

import { Type } from "typebox";

406+

import { buildJsonChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";

407+
408+

const configSchema = buildJsonChannelConfigSchema(

409+

Type.Object({

410+

token: Type.Optional(Type.String()),

411+

allowFrom: Type.Optional(Type.Array(Type.String())),

412+

}),

413+

);

414+

```

415+
402416

For third-party plugins, the cold-path contract is still the plugin manifest: mirror the generated JSON Schema into `openclaw.plugin.json#channelConfigs` so config schema, setup, and UI surfaces can inspect `channels.<id>` without loading runtime code.

403417
404418

## Setup wizards

Original file line numberDiff line numberDiff line change

@@ -22,7 +22,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)

2222

| Subpath | Key exports |

2323

| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

2424

| `plugin-sdk/plugin-entry` | `definePluginEntry` |

25-

| `plugin-sdk/core` | `defineChannelPluginEntry`, `createChatChannelPlugin`, `createChannelPluginBase`, `defineSetupPluginEntry`, `buildChannelConfigSchema` |

25+

| `plugin-sdk/core` | `defineChannelPluginEntry`, `createChatChannelPlugin`, `createChannelPluginBase`, `defineSetupPluginEntry`, `buildChannelConfigSchema`, `buildJsonChannelConfigSchema` |

2626

| `plugin-sdk/config-schema` | `OpenClawSchema` |

2727

| `plugin-sdk/provider-entry` | `defineSingleProviderPluginEntry` |

2828

| `plugin-sdk/testing` | Broad compatibility barrel for legacy plugin tests; prefer focused test subpaths for new extension tests |

@@ -58,7 +58,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)

5858

| `plugin-sdk/channel-pairing` | `createChannelPairingController` |

5959

| `plugin-sdk/channel-reply-pipeline` | `createChannelReplyPipeline`, `resolveChannelSourceReplyDeliveryMode` |

6060

| `plugin-sdk/channel-config-helpers` | `createHybridChannelConfigAdapter`, `resolveChannelDmAccess`, `resolveChannelDmAllowFrom`, `resolveChannelDmPolicy`, `normalizeChannelDmPolicy`, `normalizeLegacyDmAliases` |

61-

| `plugin-sdk/channel-config-schema` | Shared channel config schema primitives and generic builder |

61+

| `plugin-sdk/channel-config-schema` | Shared channel config schema primitives plus Zod and direct JSON/TypeBox builders |

6262

| `plugin-sdk/bundled-channel-config-schema` | Bundled OpenClaw channel config schemas for maintained bundled plugins only |

6363

| `plugin-sdk/channel-config-schema-legacy` | Deprecated compatibility alias for bundled-channel config schemas |

6464

| `plugin-sdk/telegram-command-config` | Telegram custom-command normalization/validation helpers with bundled-contract fallback |

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,10 @@

11

import { describe, expect, it, vi } from "vitest";

22

import { z } from "zod";

3-

import { buildChannelConfigSchema, emptyChannelConfigSchema } from "./config-schema.js";

3+

import {

4+

buildChannelConfigSchema,

5+

buildJsonChannelConfigSchema,

6+

emptyChannelConfigSchema,

7+

} from "./config-schema.js";

48
59

describe("buildChannelConfigSchema", () => {

610

it("builds json schema when toJSONSchema is available", () => {

@@ -47,6 +51,37 @@ describe("buildChannelConfigSchema", () => {

4751

});

4852

});

4953
54+

describe("buildJsonChannelConfigSchema", () => {

55+

it("validates direct JSON schemas without zod conversion", () => {

56+

const result = buildJsonChannelConfigSchema(

57+

{

58+

type: "object",

59+

additionalProperties: false,

60+

properties: {

61+

enabled: { type: "boolean", default: true },

62+

},

63+

},

64+

{ cacheKey: "config-schema.test.json-channel" },

65+

);

66+
67+

expect(result.schema).toEqual({

68+

type: "object",

69+

additionalProperties: false,

70+

properties: {

71+

enabled: { type: "boolean", default: true },

72+

},

73+

});

74+

expect(result.runtime?.safeParse({})).toEqual({

75+

success: true,

76+

data: { enabled: true },

77+

});

78+

expect(result.runtime?.safeParse({ enabled: "yes" })).toEqual({

79+

success: false,

80+

issues: [{ path: ["enabled"], message: "must be boolean" }],

81+

});

82+

});

83+

});

84+
5085

describe("emptyChannelConfigSchema", () => {

5186

it("accepts undefined and empty objects only", () => {

5287

const result = emptyChannelConfigSchema();

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,6 @@

11

import { z, type ZodRawShape, type ZodTypeAny } from "zod";

22

import { DmPolicySchema } from "../../config/zod-schema.core.js";

3+

import { validateJsonSchemaValue } from "../../plugins/schema-validator.js";

34

import type { JsonSchemaObject } from "../../shared/json-schema.types.js";

45

import type {

56

ChannelConfigRuntimeIssue,

@@ -41,6 +42,12 @@ type BuildChannelConfigSchemaOptions = {

4142

uiHints?: Record<string, ChannelConfigUiHint>;

4243

};

4344
45+

type BuildJsonChannelConfigSchemaOptions = {

46+

cacheKey?: string;

47+

uiHints?: Record<string, ChannelConfigUiHint>;

48+

runtime?: ChannelConfigSchema["runtime"];

49+

};

50+
4451

function cloneRuntimeIssue(issue: unknown): ChannelConfigRuntimeIssue {

4552

const record = issue && typeof issue === "object" ? (issue as Record<string, unknown>) : {};

4653

const path = Array.isArray(record.path)

@@ -72,6 +79,53 @@ function safeParseRuntimeSchema(

7279

};

7380

}

7481
82+

function toIssuePath(path: string): Array<string | number> {

83+

if (!path || path === "<root>") {

84+

return [];

85+

}

86+

return path.split(".").map((segment) => {

87+

const index = Number(segment);

88+

return Number.isInteger(index) && String(index) === segment ? index : segment;

89+

});

90+

}

91+
92+

function safeParseJsonSchema(

93+

schema: JsonSchemaObject,

94+

cacheKey: string,

95+

value: unknown,

96+

): ChannelConfigRuntimeParseResult {

97+

const result = validateJsonSchemaValue({

98+

schema,

99+

cacheKey,

100+

value,

101+

applyDefaults: true,

102+

});

103+

if (result.ok) {

104+

return { success: true, data: result.value };

105+

}

106+

return {

107+

success: false,

108+

issues: result.errors.map((issue) => ({

109+

path: toIssuePath(issue.path),

110+

message: issue.message,

111+

})),

112+

};

113+

}

114+
115+

export function buildJsonChannelConfigSchema(

116+

schema: JsonSchemaObject,

117+

options?: BuildJsonChannelConfigSchemaOptions,

118+

): ChannelConfigSchema {

119+

return {

120+

schema,

121+

...(options?.uiHints ? { uiHints: options.uiHints } : {}),

122+

runtime: options?.runtime ?? {

123+

safeParse: (value) =>

124+

safeParseJsonSchema(schema, options?.cacheKey ?? "channel-config-schema:json", value),

125+

},

126+

};

127+

}

128+
75129

export function buildChannelConfigSchema(

76130

schema: ZodTypeAny,

77131

options?: BuildChannelConfigSchemaOptions,

Original file line numberDiff line numberDiff line change

@@ -3,6 +3,7 @@ export {

33

AllowFromListSchema,

44

buildChannelConfigSchema,

55

buildCatchallMultiAccountChannelSchema,

6+

buildJsonChannelConfigSchema,

67

buildNestedDmConfigSchema,

78

} from "../channels/plugins/config-schema.js";

89

export {

Original file line numberDiff line numberDiff line change

@@ -181,7 +181,11 @@ export type { PluginRuntime, RuntimeLogger } from "../plugins/runtime/types.js";

181181

export type { WizardPrompter } from "../wizard/prompts.js";

182182
183183

export { definePluginEntry } from "./plugin-entry.js";

184-

export { buildPluginConfigSchema, emptyPluginConfigSchema } from "../plugins/config-schema.js";

184+

export {

185+

buildJsonPluginConfigSchema,

186+

buildPluginConfigSchema,

187+

emptyPluginConfigSchema,

188+

} from "../plugins/config-schema.js";

185189

export { KeyedAsyncQueue, enqueueKeyedTask } from "./keyed-async-queue.js";

186190

export { createDedupeCache, resolveGlobalDedupeCache } from "../infra/dedupe.js";

187191

export { generateSecureToken, generateSecureUuid } from "../infra/secure-random.js";

@@ -192,6 +196,7 @@ export {

192196

export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";

193197

export {

194198

buildChannelConfigSchema,

199+

buildJsonChannelConfigSchema,

195200

emptyChannelConfigSchema,

196201

} from "../channels/plugins/config-schema.js";

197202

export {

Original file line numberDiff line numberDiff line change

@@ -223,7 +223,11 @@ export type {

223223

export type { ProviderRuntimeModel } from "../plugins/provider-runtime-model.types.js";

224224

export type { OpenClawConfig };

225225
226-

export { buildPluginConfigSchema, emptyPluginConfigSchema } from "../plugins/config-schema.js";

226+

export {

227+

buildJsonPluginConfigSchema,

228+

buildPluginConfigSchema,

229+

emptyPluginConfigSchema,

230+

} from "../plugins/config-schema.js";

227231
228232

/** Options for a plugin entry that registers providers, tools, commands, or services. */

229233

type DefinePluginEntryOptions = {

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,9 @@

11

import fs from "node:fs";

22

import path from "node:path";

3-

import { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";

3+

import {

4+

buildChannelConfigSchema,

5+

buildJsonChannelConfigSchema,

6+

} from "../channels/plugins/config-schema.js";

47

import type { ChannelConfigRuntimeSchema } from "../channels/plugins/types.config.js";

58

import type { JsonSchemaObject } from "../shared/json-schema.types.js";

69

import {

@@ -46,6 +49,24 @@ function isBuiltChannelConfigSchema(value: unknown): value is ChannelConfigSurfa

4649

return Boolean(candidate.schema && typeof candidate.schema === "object");

4750

}

4851
52+

function isJsonSchemaConfigSurface(value: unknown): value is JsonSchemaObject {

53+

if (!value || typeof value !== "object") {

54+

return false;

55+

}

56+

const candidate = value as Record<string, unknown>;

57+

if (typeof candidate.safeParse === "function" || typeof candidate.toJSONSchema === "function") {

58+

return false;

59+

}

60+

return (

61+

typeof candidate.type === "string" ||

62+

Array.isArray(candidate.anyOf) ||

63+

Array.isArray(candidate.oneOf) ||

64+

Array.isArray(candidate.allOf) ||

65+

Array.isArray(candidate.enum) ||

66+

Object.prototype.hasOwnProperty.call(candidate, "const")

67+

);

68+

}

69+
4970

function resolveConfigSchemaExport(imported: Record<string, unknown>): ChannelConfigSurface | null {

5071

for (const [name, value] of Object.entries(imported)) {

5172

if (name.endsWith("ChannelConfigSchema") && isBuiltChannelConfigSchema(value)) {

@@ -60,6 +81,9 @@ function resolveConfigSchemaExport(imported: Record<string, unknown>): ChannelCo

6081

if (isBuiltChannelConfigSchema(value)) {

6182

return value;

6283

}

84+

if (isJsonSchemaConfigSurface(value)) {

85+

return buildJsonChannelConfigSchema(value);

86+

}

6387

if (value && typeof value === "object") {

6488

return buildChannelConfigSchema(value as never);

6589

}

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,10 @@

11

import { describe, expect, it, vi } from "vitest";

22

import { z } from "zod";

3-

import { buildPluginConfigSchema, emptyPluginConfigSchema } from "./config-schema.js";

3+

import {

4+

buildJsonPluginConfigSchema,

5+

buildPluginConfigSchema,

6+

emptyPluginConfigSchema,

7+

} from "./config-schema.js";

48
59

function expectSafeParseCases(

610

safeParse: ((value: unknown) => unknown) | undefined,

@@ -83,6 +87,37 @@ describe("buildPluginConfigSchema", () => {

8387

});

8488

});

8589
90+

describe("buildJsonPluginConfigSchema", () => {

91+

it("validates direct JSON schemas without zod conversion", () => {

92+

const result = buildJsonPluginConfigSchema(

93+

{

94+

type: "object",

95+

additionalProperties: false,

96+

properties: {

97+

enabled: { type: "boolean", default: true },

98+

},

99+

},

100+

{ cacheKey: "config-schema.test.json-plugin" },

101+

);

102+
103+

expect(result.jsonSchema).toEqual({

104+

type: "object",

105+

additionalProperties: false,

106+

properties: {

107+

enabled: { type: "boolean", default: true },

108+

},

109+

});

110+

expect(result.safeParse?.({})).toEqual({

111+

success: true,

112+

data: { enabled: true },

113+

});

114+

expect(result.safeParse?.({ enabled: "yes" })).toEqual({

115+

success: false,

116+

error: { issues: [{ path: ["enabled"], message: "must be boolean" }] },

117+

});

118+

});

119+

});

120+
86121

describe("emptyPluginConfigSchema", () => {

87122

it("accepts undefined and empty objects only", () => {

88123

const schema = emptyPluginConfigSchema();