From b2472d65607a05841e89df3c8dc26e7b956be48d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 23 Apr 2026 04:59:26 +0100 Subject: [PATCH] build: migrate schema deps to typebox --- extensions/brave/.openclaw-runtime-deps.json | 2 +- extensions/brave/package.json | 2 +- .../src/brave-web-search-provider.shared.ts | 2 +- extensions/browser/package.json | 2 +- extensions/browser/src/browser-tool.schema.ts | 2 +- extensions/diffs/package.json | 4 +- extensions/diffs/src/tool.ts | 2 +- extensions/discord/package.json | 2 +- extensions/discord/src/message-tool-schema.ts | 2 +- extensions/feishu/package.json | 6 +- extensions/feishu/src/bitable.ts | 4 +- extensions/feishu/src/chat-schema.ts | 2 +- extensions/feishu/src/doc-schema.ts | 2 +- extensions/feishu/src/docx.ts | 2 +- extensions/feishu/src/drive-schema.ts | 2 +- extensions/feishu/src/perm-schema.ts | 2 +- extensions/feishu/src/wiki-schema.ts | 2 +- .../firecrawl/.openclaw-runtime-deps.json | 2 +- extensions/firecrawl/package.json | 2 +- .../firecrawl/src/firecrawl-scrape-tool.ts | 2 +- .../firecrawl/src/firecrawl-search-tool.ts | 2 +- extensions/llm-task/package.json | 4 +- extensions/llm-task/src/llm-task-tool.test.ts | 2 +- extensions/llm-task/src/llm-task-tool.ts | 2 +- extensions/lobster/package.json | 2 +- extensions/lobster/src/lobster-tool.ts | 2 +- extensions/matrix/package.json | 4 +- extensions/matrix/src/actions.ts | 2 +- extensions/memory-core/package.json | 4 +- extensions/memory-core/src/tools.shared.ts | 2 +- extensions/memory-core/src/tools.ts | 19 ++- extensions/memory-lancedb/index.ts | 2 +- extensions/memory-lancedb/package.json | 4 +- extensions/memory-wiki/package.json | 2 +- extensions/memory-wiki/src/tool.ts | 2 +- extensions/msteams/package.json | 4 +- extensions/msteams/src/actions.ts | 2 +- extensions/msteams/src/channel.ts | 2 +- extensions/ollama/package.json | 2 +- extensions/ollama/src/web-search-provider.ts | 4 +- extensions/qa-channel/package.json | 2 +- extensions/qa-channel/src/channel-actions.ts | 2 +- extensions/skill-workshop/package.json | 2 +- extensions/skill-workshop/src/tool.ts | 2 +- extensions/slack/package.json | 4 +- extensions/slack/src/message-tool-schema.ts | 2 +- extensions/tavily/.openclaw-runtime-deps.json | 2 +- extensions/tavily/package.json | 2 +- extensions/tavily/src/tavily-extract-tool.ts | 2 +- extensions/tavily/src/tavily-search-tool.ts | 2 +- extensions/tavily/src/tavily-tool-schema.ts | 2 +- extensions/telegram/package.json | 2 +- .../telegram/src/message-tool-schema.ts | 2 +- extensions/voice-call/index.ts | 41 +++-- extensions/voice-call/package.json | 2 +- extensions/whatsapp/package.json | 2 +- extensions/whatsapp/src/agent-tools-login.ts | 2 +- extensions/xai/code-execution.ts | 2 +- extensions/xai/index.ts | 2 +- extensions/xai/package.json | 2 +- extensions/xai/x-search-tool-shared.ts | 2 +- extensions/zalouser/package.json | 2 +- extensions/zalouser/src/tool.ts | 2 +- package.json | 4 +- pnpm-lock.yaml | 161 +++++++++--------- src/agents/apply-patch.ts | 2 +- src/agents/bash-tools.schemas.ts | 2 +- src/agents/google-gemini-switch.live.test.ts | 2 +- src/agents/live-cache-regression-runner.ts | 2 +- src/agents/model-scan.ts | 2 +- src/agents/models.profiles.live.test.ts | 2 +- .../openai-responses.reasoning-replay.test.ts | 2 +- src/agents/pi-bundle-mcp-materialize.ts | 4 +- .../pi-embedded-runner.cache.live.test.ts | 2 +- .../pi-embedded-runner/tool-schema-runtime.ts | 2 +- src/agents/pi-mcp-style.cache.live.test.ts | 2 +- ...adapter.after-tool-call.fires-once.test.ts | 2 +- ...definition-adapter.after-tool-call.test.ts | 2 +- ...pi-tool-definition-adapter.logging.test.ts | 2 +- src/agents/pi-tool-definition-adapter.test.ts | 2 +- ...aliases-schemas-without-dropping-g.test.ts | 2 +- src/agents/pi-tools.schema.test.ts | 5 +- src/agents/pi-tools.schema.ts | 3 +- src/agents/schema/string-enum.ts | 2 +- src/agents/schema/typebox.ts | 2 +- src/agents/test-helpers/pi-tool-stubs.ts | 2 +- src/agents/tools/agents-list-tool.ts | 2 +- src/agents/tools/canvas-tool.ts | 2 +- src/agents/tools/common.ts | 49 +++--- src/agents/tools/cron-tool.schema.test.ts | 34 ++-- src/agents/tools/cron-tool.ts | 2 +- src/agents/tools/gateway-tool.ts | 2 +- src/agents/tools/image-generate-tool.ts | 2 +- src/agents/tools/image-tool.ts | 2 +- src/agents/tools/message-tool.test.ts | 2 +- src/agents/tools/message-tool.ts | 2 +- src/agents/tools/music-generate-tool.ts | 2 +- src/agents/tools/nodes-tool.ts | 2 +- src/agents/tools/pdf-tool.ts | 2 +- src/agents/tools/session-status-tool.ts | 2 +- src/agents/tools/sessions-history-tool.ts | 2 +- src/agents/tools/sessions-list-tool.ts | 2 +- src/agents/tools/sessions-send-tool.ts | 2 +- src/agents/tools/sessions-spawn-tool.ts | 2 +- src/agents/tools/sessions-yield-tool.ts | 2 +- src/agents/tools/subagents-tool.ts | 2 +- src/agents/tools/tts-tool.ts | 2 +- src/agents/tools/update-plan-tool.ts | 2 +- src/agents/tools/video-generate-tool.ts | 2 +- src/agents/tools/web-fetch.ts | 2 +- src/agents/tools/web-search.ts | 6 +- src/agents/xai.live.test.ts | 2 +- .../plugins/message-action-discovery.ts | 2 +- src/channels/plugins/message-actions.test.ts | 2 +- src/channels/plugins/types.adapters.ts | 40 ++--- src/channels/plugins/types.core.ts | 2 +- src/gateway/protocol/schema/agent.ts | 2 +- .../protocol/schema/agents-models-skills.ts | 2 +- src/gateway/protocol/schema/channels.ts | 2 +- src/gateway/protocol/schema/commands.ts | 2 +- src/gateway/protocol/schema/config.ts | 2 +- src/gateway/protocol/schema/cron.ts | 2 +- src/gateway/protocol/schema/devices.ts | 2 +- src/gateway/protocol/schema/exec-approvals.ts | 2 +- src/gateway/protocol/schema/frames.ts | 2 +- src/gateway/protocol/schema/logs-chat.ts | 2 +- src/gateway/protocol/schema/nodes.ts | 2 +- .../protocol/schema/plugin-approvals.ts | 2 +- src/gateway/protocol/schema/primitives.ts | 10 +- .../protocol/schema/protocol-schemas.ts | 2 +- src/gateway/protocol/schema/push.ts | 2 +- src/gateway/protocol/schema/secrets.ts | 2 +- src/gateway/protocol/schema/sessions.ts | 2 +- src/gateway/protocol/schema/snapshot.ts | 2 +- src/gateway/protocol/schema/types.ts | 2 +- src/gateway/protocol/schema/wizard.ts | 2 +- .../message-action-runner.media.test.ts | 2 +- src/memory-host-sdk/runtime-core.ts | 7 +- src/plugin-sdk/channel-actions.ts | 4 +- src/plugin-sdk/provider-tools.ts | 9 +- .../package-manifest.contract.test.ts | 8 +- src/plugins/types.ts | 6 +- test/scripts/lint-suppressions.test.ts | 9 - 143 files changed, 344 insertions(+), 347 deletions(-) diff --git a/extensions/brave/.openclaw-runtime-deps.json b/extensions/brave/.openclaw-runtime-deps.json index 78e587a3fef..d7dc02e19bf 100644 --- a/extensions/brave/.openclaw-runtime-deps.json +++ b/extensions/brave/.openclaw-runtime-deps.json @@ -1,3 +1,3 @@ { - "specs": ["@sinclair/typebox@0.34.49"] + "specs": ["typebox@1.1.28"] } diff --git a/extensions/brave/package.json b/extensions/brave/package.json index 97fa9a73bfd..a9311b17ca7 100644 --- a/extensions/brave/package.json +++ b/extensions/brave/package.json @@ -5,7 +5,7 @@ "description": "OpenClaw Brave plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/brave/src/brave-web-search-provider.shared.ts b/extensions/brave/src/brave-web-search-provider.shared.ts index 445c29f18cc..57f125103ee 100644 --- a/extensions/brave/src/brave-web-search-provider.shared.ts +++ b/extensions/brave/src/brave-web-search-provider.shared.ts @@ -1,8 +1,8 @@ -import { Type } from "@sinclair/typebox"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; export type BraveConfig = { mode?: string; diff --git a/extensions/browser/package.json b/extensions/browser/package.json index 492af1aa1fd..b233e4599b9 100644 --- a/extensions/browser/package.json +++ b/extensions/browser/package.json @@ -6,10 +6,10 @@ "type": "module", "dependencies": { "@modelcontextprotocol/sdk": "1.29.0", - "@sinclair/typebox": "0.34.49", "commander": "^14.0.3", "express": "^5.2.1", "playwright-core": "1.59.1", + "typebox": "1.1.28", "undici": "8.1.0", "ws": "^8.20.0" }, diff --git a/extensions/browser/src/browser-tool.schema.ts b/extensions/browser/src/browser-tool.schema.ts index 6e5dc7d8018..f652ebb96a8 100644 --- a/extensions/browser/src/browser-tool.schema.ts +++ b/extensions/browser/src/browser-tool.schema.ts @@ -1,5 +1,5 @@ -import { Type } from "@sinclair/typebox"; import { optionalStringEnum, stringEnum } from "openclaw/plugin-sdk/channel-actions"; +import { Type } from "typebox"; const BROWSER_ACT_KINDS = [ "click", diff --git a/extensions/diffs/package.json b/extensions/diffs/package.json index 438aa697abf..8676e69f672 100644 --- a/extensions/diffs/package.json +++ b/extensions/diffs/package.json @@ -10,8 +10,8 @@ "dependencies": { "@pierre/diffs": "1.1.16", "@pierre/theme": "0.0.29", - "@sinclair/typebox": "0.34.49", - "playwright-core": "1.59.1" + "playwright-core": "1.59.1", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/diffs/src/tool.ts b/extensions/diffs/src/tool.ts index c0fcb36b4fd..fad94e6b864 100644 --- a/extensions/diffs/src/tool.ts +++ b/extensions/diffs/src/tool.ts @@ -1,7 +1,7 @@ import fs from "node:fs/promises"; -import { Static, Type } from "@sinclair/typebox"; import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Static, Type } from "typebox"; import type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginToolContext } from "../api.js"; import { PlaywrightDiffScreenshotter, type DiffScreenshotter } from "./browser.js"; import { resolveDiffImageRenderOptions } from "./config.js"; diff --git a/extensions/discord/package.json b/extensions/discord/package.json index d75ad0db6a4..768cc89a8ac 100644 --- a/extensions/discord/package.json +++ b/extensions/discord/package.json @@ -6,10 +6,10 @@ "dependencies": { "@buape/carbon": "0.16.0", "@discordjs/voice": "^0.19.2", - "@sinclair/typebox": "0.34.49", "discord-api-types": "^0.38.47", "https-proxy-agent": "^9.0.0", "opusscript": "^0.0.8", + "typebox": "1.1.28", "undici": "8.1.0", "ws": "^8.20.0" }, diff --git a/extensions/discord/src/message-tool-schema.ts b/extensions/discord/src/message-tool-schema.ts index 591f367d69c..e12be4c4734 100644 --- a/extensions/discord/src/message-tool-schema.ts +++ b/extensions/discord/src/message-tool-schema.ts @@ -1,5 +1,5 @@ -import { Type } from "@sinclair/typebox"; import { stringEnum } from "openclaw/plugin-sdk/channel-actions"; +import { Type } from "typebox"; const discordComponentEmojiSchema = Type.Object({ name: Type.String(), diff --git a/extensions/feishu/package.json b/extensions/feishu/package.json index 0a97a0eda9a..3e2f397750a 100644 --- a/extensions/feishu/package.json +++ b/extensions/feishu/package.json @@ -4,9 +4,9 @@ "description": "OpenClaw Feishu/Lark channel plugin (community maintained by @m1heng)", "type": "module", "dependencies": { - "@larksuiteoapi/node-sdk": "^1.61.0", - "@sinclair/typebox": "0.34.49", - "qrcode-terminal": "^0.12.0" + "@larksuiteoapi/node-sdk": "^1.61.1", + "qrcode-terminal": "^0.12.0", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*", diff --git a/extensions/feishu/src/bitable.ts b/extensions/feishu/src/bitable.ts index 77a234d7cd1..933d2660cb8 100644 --- a/extensions/feishu/src/bitable.ts +++ b/extensions/feishu/src/bitable.ts @@ -1,6 +1,6 @@ import type * as Lark from "@larksuiteoapi/node-sdk"; -import { Type } from "@sinclair/typebox"; import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; +import { Type, type TSchema } from "typebox"; import type { OpenClawPluginApi } from "../runtime-api.js"; import { listEnabledFeishuAccounts } from "./accounts.js"; import { createFeishuToolClient } from "./tool-account.js"; @@ -565,7 +565,7 @@ export function registerFeishuBitableTools(api: OpenClawPluginApi) { name: string; label: string; description: string; - parameters: unknown; + parameters: TSchema; execute: (args: { params: TParams; defaultAccountId?: string }) => Promise; }) => { api.registerTool( diff --git a/extensions/feishu/src/chat-schema.ts b/extensions/feishu/src/chat-schema.ts index 5460f11dcc9..e684a529e0b 100644 --- a/extensions/feishu/src/chat-schema.ts +++ b/extensions/feishu/src/chat-schema.ts @@ -1,4 +1,4 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { Type, type Static } from "typebox"; const CHAT_ACTION_VALUES = ["members", "info", "member_info"] as const; const MEMBER_ID_TYPE_VALUES = ["open_id", "user_id", "union_id"] as const; diff --git a/extensions/feishu/src/doc-schema.ts b/extensions/feishu/src/doc-schema.ts index ab657065a69..837b281f369 100644 --- a/extensions/feishu/src/doc-schema.ts +++ b/extensions/feishu/src/doc-schema.ts @@ -1,4 +1,4 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { Type, type Static } from "typebox"; const tableCreationProperties = { doc_token: Type.String({ description: "Document token" }), diff --git a/extensions/feishu/src/docx.ts b/extensions/feishu/src/docx.ts index f12667a818b..820aa5ce3ad 100644 --- a/extensions/feishu/src/docx.ts +++ b/extensions/feishu/src/docx.ts @@ -3,9 +3,9 @@ import { homedir } from "node:os"; import { isAbsolute, resolve } from "node:path"; import { basename } from "node:path"; import type * as Lark from "@larksuiteoapi/node-sdk"; -import { Type } from "@sinclair/typebox"; import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import type { OpenClawPluginApi } from "../runtime-api.js"; import { listEnabledFeishuAccounts } from "./accounts.js"; import { FeishuDocSchema, type FeishuDocParams } from "./doc-schema.js"; diff --git a/extensions/feishu/src/drive-schema.ts b/extensions/feishu/src/drive-schema.ts index 044ee0f3d48..9a468cb04dc 100644 --- a/extensions/feishu/src/drive-schema.ts +++ b/extensions/feishu/src/drive-schema.ts @@ -1,4 +1,4 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { Type, type Static } from "typebox"; const FileType = Type.Union([ Type.Literal("doc"), diff --git a/extensions/feishu/src/perm-schema.ts b/extensions/feishu/src/perm-schema.ts index ac645389e7c..9724a7ac9af 100644 --- a/extensions/feishu/src/perm-schema.ts +++ b/extensions/feishu/src/perm-schema.ts @@ -1,4 +1,4 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { Type, type Static } from "typebox"; const TokenType = Type.Union([ Type.Literal("doc"), diff --git a/extensions/feishu/src/wiki-schema.ts b/extensions/feishu/src/wiki-schema.ts index 006cc2da39d..f339d614b05 100644 --- a/extensions/feishu/src/wiki-schema.ts +++ b/extensions/feishu/src/wiki-schema.ts @@ -1,4 +1,4 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { Type, type Static } from "typebox"; export const FeishuWikiSchema = Type.Union([ Type.Object({ diff --git a/extensions/firecrawl/.openclaw-runtime-deps.json b/extensions/firecrawl/.openclaw-runtime-deps.json index 78e587a3fef..d7dc02e19bf 100644 --- a/extensions/firecrawl/.openclaw-runtime-deps.json +++ b/extensions/firecrawl/.openclaw-runtime-deps.json @@ -1,3 +1,3 @@ { - "specs": ["@sinclair/typebox@0.34.49"] + "specs": ["typebox@1.1.28"] } diff --git a/extensions/firecrawl/package.json b/extensions/firecrawl/package.json index e61d2a6bced..c8e71f49942 100644 --- a/extensions/firecrawl/package.json +++ b/extensions/firecrawl/package.json @@ -5,7 +5,7 @@ "description": "OpenClaw Firecrawl plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/firecrawl/src/firecrawl-scrape-tool.ts b/extensions/firecrawl/src/firecrawl-scrape-tool.ts index ba77ce87f73..c741b82c3da 100644 --- a/extensions/firecrawl/src/firecrawl-scrape-tool.ts +++ b/extensions/firecrawl/src/firecrawl-scrape-tool.ts @@ -1,10 +1,10 @@ -import { Type } from "@sinclair/typebox"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime"; import { jsonResult, readNumberParam, readStringParam, } from "openclaw/plugin-sdk/provider-web-search"; +import { Type } from "typebox"; import { runFirecrawlScrape } from "./firecrawl-client.js"; function optionalStringEnum( diff --git a/extensions/firecrawl/src/firecrawl-search-tool.ts b/extensions/firecrawl/src/firecrawl-search-tool.ts index fd99bcf4704..a3935e7b197 100644 --- a/extensions/firecrawl/src/firecrawl-search-tool.ts +++ b/extensions/firecrawl/src/firecrawl-search-tool.ts @@ -1,4 +1,3 @@ -import { Type } from "@sinclair/typebox"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime"; import { jsonResult, @@ -6,6 +5,7 @@ import { readStringArrayParam, readStringParam, } from "openclaw/plugin-sdk/provider-web-search"; +import { Type } from "typebox"; import { runFirecrawlSearch } from "./firecrawl-client.js"; const FirecrawlSearchToolSchema = Type.Object( diff --git a/extensions/llm-task/package.json b/extensions/llm-task/package.json index 65321d341ab..7ad8e2a74af 100644 --- a/extensions/llm-task/package.json +++ b/extensions/llm-task/package.json @@ -5,8 +5,8 @@ "description": "OpenClaw JSON-only LLM task plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", - "ajv": "^8.18.0" + "ajv": "^8.18.0", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/llm-task/src/llm-task-tool.test.ts b/extensions/llm-task/src/llm-task-tool.test.ts index 57ce16538a4..9436367d490 100644 --- a/extensions/llm-task/src/llm-task-tool.test.ts +++ b/extensions/llm-task/src/llm-task-tool.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; -vi.mock("@sinclair/typebox", () => ({ +vi.mock("typebox", () => ({ Type: { Object: (schema: unknown) => schema, String: (schema?: unknown) => schema, diff --git a/extensions/llm-task/src/llm-task-tool.ts b/extensions/llm-task/src/llm-task-tool.ts index 339f74c5805..1611ca0f113 100644 --- a/extensions/llm-task/src/llm-task-tool.ts +++ b/extensions/llm-task/src/llm-task-tool.ts @@ -1,8 +1,8 @@ import fs from "node:fs/promises"; import path from "node:path"; -import { Type } from "@sinclair/typebox"; import Ajv from "ajv"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import { formatThinkingLevels, isThinkingLevelSupported, diff --git a/extensions/lobster/package.json b/extensions/lobster/package.json index 9470664e41c..739d330e6f1 100644 --- a/extensions/lobster/package.json +++ b/extensions/lobster/package.json @@ -5,7 +5,7 @@ "type": "module", "dependencies": { "@clawdbot/lobster": "2026.4.6", - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/lobster/src/lobster-tool.ts b/extensions/lobster/src/lobster-tool.ts index 6c2a6b99077..f2d1b06eabe 100644 --- a/extensions/lobster/src/lobster-tool.ts +++ b/extensions/lobster/src/lobster-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { OpenClawPluginApi } from "../runtime-api.js"; import { createEmbeddedLobsterRunner, diff --git a/extensions/matrix/package.json b/extensions/matrix/package.json index 03ea15dd363..f976632879b 100644 --- a/extensions/matrix/package.json +++ b/extensions/matrix/package.json @@ -6,12 +6,12 @@ "dependencies": { "@matrix-org/matrix-sdk-crypto-nodejs": "^0.4.0", "@matrix-org/matrix-sdk-crypto-wasm": "18.1.0", - "@sinclair/typebox": "0.34.49", "fake-indexeddb": "^6.2.5", "jiti": "^2.6.1", "markdown-it": "14.1.1", "matrix-js-sdk": "41.3.0", - "music-metadata": "^11.12.3" + "music-metadata": "^11.12.3", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*", diff --git a/extensions/matrix/src/actions.ts b/extensions/matrix/src/actions.ts index e1f956cb87a..a63d213dbf6 100644 --- a/extensions/matrix/src/actions.ts +++ b/extensions/matrix/src/actions.ts @@ -1,4 +1,3 @@ -import { Type } from "@sinclair/typebox"; import { createActionGate, readNumberParam, @@ -13,6 +12,7 @@ import type { } from "openclaw/plugin-sdk/channel-contract"; import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime"; import { extractToolSend } from "openclaw/plugin-sdk/tool-send"; +import { Type } from "typebox"; import { requiresExplicitMatrixDefaultAccount } from "./account-selection.js"; import { resolveDefaultMatrixAccountId, resolveMatrixAccount } from "./matrix/accounts.js"; import type { CoreConfig } from "./types.js"; diff --git a/extensions/memory-core/package.json b/extensions/memory-core/package.json index d4641b65b6c..9b5deb2afcf 100644 --- a/extensions/memory-core/package.json +++ b/extensions/memory-core/package.json @@ -5,8 +5,8 @@ "description": "OpenClaw core memory search plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", - "chokidar": "^5.0.0" + "chokidar": "^5.0.0", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*", diff --git a/extensions/memory-core/src/tools.shared.ts b/extensions/memory-core/src/tools.shared.ts index 26e1d2aee67..fd042bad528 100644 --- a/extensions/memory-core/src/tools.shared.ts +++ b/extensions/memory-core/src/tools.shared.ts @@ -1,4 +1,3 @@ -import { Type } from "@sinclair/typebox"; import { listMemoryCorpusSupplements, resolveMemorySearchConfig, @@ -9,6 +8,7 @@ import { type OpenClawConfig, } from "openclaw/plugin-sdk/memory-core-host-runtime-core"; import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; type MemoryToolRuntime = typeof import("./tools.runtime.js"); type MemorySearchManagerResult = Awaited< diff --git a/extensions/memory-core/src/tools.ts b/extensions/memory-core/src/tools.ts index bc682b64ab4..c6a929eafd6 100644 --- a/extensions/memory-core/src/tools.ts +++ b/extensions/memory-core/src/tools.ts @@ -1,5 +1,6 @@ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; import { + asToolParamsRecord, jsonResult, readNumberParam, readStringParam, @@ -191,10 +192,11 @@ export function createMemorySearchTool(options: { execute: ({ cfg, agentId }) => async (_toolCallId, params) => { - const query = readStringParam(params, "query", { required: true }); - const maxResults = readNumberParam(params, "maxResults"); - const minScore = readNumberParam(params, "minScore"); - const requestedCorpus = readStringParam(params, "corpus") as + const rawParams = asToolParamsRecord(params); + const query = readStringParam(rawParams, "query", { required: true }); + const maxResults = readNumberParam(rawParams, "maxResults"); + const minScore = readNumberParam(rawParams, "minScore"); + const requestedCorpus = readStringParam(rawParams, "corpus") as | "memory" | "wiki" | "all" @@ -332,10 +334,11 @@ export function createMemoryGetTool(options: { execute: ({ cfg, agentId }) => async (_toolCallId, params) => { - const relPath = readStringParam(params, "path", { required: true }); - const from = readNumberParam(params, "from", { integer: true }); - const lines = readNumberParam(params, "lines", { integer: true }); - const requestedCorpus = readStringParam(params, "corpus") as + const rawParams = asToolParamsRecord(params); + const relPath = readStringParam(rawParams, "path", { required: true }); + const from = readNumberParam(rawParams, "from", { integer: true }); + const lines = readNumberParam(rawParams, "lines", { integer: true }); + const requestedCorpus = readStringParam(rawParams, "corpus") as | "memory" | "wiki" | "all" diff --git a/extensions/memory-lancedb/index.ts b/extensions/memory-lancedb/index.ts index 29670e3072a..03c20d45864 100644 --- a/extensions/memory-lancedb/index.ts +++ b/extensions/memory-lancedb/index.ts @@ -8,11 +8,11 @@ import { randomUUID } from "node:crypto"; import type * as LanceDB from "@lancedb/lancedb"; -import { Type } from "@sinclair/typebox"; import OpenAI from "openai"; import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/config-runtime"; import { ensureGlobalUndiciEnvProxyDispatcher } from "openclaw/plugin-sdk/runtime-env"; import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import { definePluginEntry, type OpenClawPluginApi } from "./api.js"; import { DEFAULT_CAPTURE_MAX_CHARS, diff --git a/extensions/memory-lancedb/package.json b/extensions/memory-lancedb/package.json index da72ffc5d94..417a94d35ee 100644 --- a/extensions/memory-lancedb/package.json +++ b/extensions/memory-lancedb/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "@lancedb/lancedb": "^0.27.2", - "@sinclair/typebox": "0.34.49", - "openai": "^6.34.0" + "openai": "^6.34.0", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/memory-wiki/package.json b/extensions/memory-wiki/package.json index ecd88e73dbb..bb681822368 100644 --- a/extensions/memory-wiki/package.json +++ b/extensions/memory-wiki/package.json @@ -5,7 +5,7 @@ "description": "OpenClaw persistent wiki plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", + "typebox": "1.1.28", "yaml": "^2.8.3" }, "devDependencies": { diff --git a/extensions/memory-wiki/src/tool.ts b/extensions/memory-wiki/src/tool.ts index f49b6dad458..77621397a31 100644 --- a/extensions/memory-wiki/src/tool.ts +++ b/extensions/memory-wiki/src/tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { AnyAgentTool, OpenClawConfig } from "../api.js"; import { applyMemoryWikiMutation, normalizeMemoryWikiMutationInput } from "./apply.js"; import { diff --git a/extensions/msteams/package.json b/extensions/msteams/package.json index 2ce33eae7e8..657820c16f1 100644 --- a/extensions/msteams/package.json +++ b/extensions/msteams/package.json @@ -7,10 +7,10 @@ "@azure/identity": "^4.13.1", "@microsoft/teams.api": "2.0.8", "@microsoft/teams.apps": "2.0.8", - "@sinclair/typebox": "0.34.49", "express": "^5.2.1", "jsonwebtoken": "^9.0.3", - "jwks-rsa": "^4.0.1" + "jwks-rsa": "^4.0.1", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*", diff --git a/extensions/msteams/src/actions.ts b/extensions/msteams/src/actions.ts index 3c00031dea3..b10ceaae24e 100644 --- a/extensions/msteams/src/actions.ts +++ b/extensions/msteams/src/actions.ts @@ -1,4 +1,3 @@ -import { Type } from "@sinclair/typebox"; import type { ChannelMessageActionAdapter, ChannelMessageToolDiscovery, @@ -6,6 +5,7 @@ import type { import { normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime"; import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import type { ChannelMessageActionName, ChannelPlugin } from "./channel-api.js"; import { buildMSTeamsPresentationCard } from "./presentation.js"; import { resolveMSTeamsCredentials } from "./token.js"; diff --git a/extensions/msteams/src/channel.ts b/extensions/msteams/src/channel.ts index f70c4247610..09292974bdc 100644 --- a/extensions/msteams/src/channel.ts +++ b/extensions/msteams/src/channel.ts @@ -1,4 +1,3 @@ -import { Type } from "@sinclair/typebox"; import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers"; import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from"; import { createTopLevelChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers"; @@ -22,6 +21,7 @@ import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime"; import { createRuntimeOutboundDelegates } from "openclaw/plugin-sdk/outbound-runtime"; import { createComputedAccountStatusAdapter } from "openclaw/plugin-sdk/status-helpers"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import type { ChannelMessageActionName, ChannelPlugin, OpenClawConfig } from "../runtime-api.js"; import { buildProbeChannelStatusSummary, diff --git a/extensions/ollama/package.json b/extensions/ollama/package.json index 1f160f6bce0..2a4b25f7b75 100644 --- a/extensions/ollama/package.json +++ b/extensions/ollama/package.json @@ -6,7 +6,7 @@ "type": "module", "dependencies": { "@mariozechner/pi-ai": "0.69.0", - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/ollama/src/web-search-provider.ts b/extensions/ollama/src/web-search-provider.ts index a2872ae4889..5295bc74a1d 100644 --- a/extensions/ollama/src/web-search-provider.ts +++ b/extensions/ollama/src/web-search-provider.ts @@ -1,4 +1,3 @@ -import { Type } from "@sinclair/typebox"; import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import { isNonSecretApiKeyMarker, @@ -19,6 +18,7 @@ import { } from "openclaw/plugin-sdk/provider-web-search"; import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import { OLLAMA_CLOUD_BASE_URL, OLLAMA_DEFAULT_BASE_URL } from "./defaults.js"; import { buildOllamaBaseUrlSsrFPolicy, @@ -231,7 +231,7 @@ export function createOllamaWebSearchProvider(): WebSearchProviderPlugin { createTool: (ctx) => ({ description: "Search the web using Ollama's experimental web search API. Returns titles, URLs, and snippets from the configured Ollama host.", - parameters: OLLAMA_WEB_SEARCH_SCHEMA, + parameters: OLLAMA_WEB_SEARCH_SCHEMA as unknown as Record, execute: async (args) => await runOllamaWebSearch({ config: ctx.config, diff --git a/extensions/qa-channel/package.json b/extensions/qa-channel/package.json index f2344dc8bf1..369a2b9664c 100644 --- a/extensions/qa-channel/package.json +++ b/extensions/qa-channel/package.json @@ -5,7 +5,7 @@ "description": "OpenClaw QA synthetic channel plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*", diff --git a/extensions/qa-channel/src/channel-actions.ts b/extensions/qa-channel/src/channel-actions.ts index f518d1036b3..8d1cc01075a 100644 --- a/extensions/qa-channel/src/channel-actions.ts +++ b/extensions/qa-channel/src/channel-actions.ts @@ -1,6 +1,6 @@ -import { Type } from "@sinclair/typebox"; import { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions"; import { extractToolSend } from "openclaw/plugin-sdk/tool-send"; +import { Type } from "typebox"; import { resolveQaChannelAccount } from "./accounts.js"; import { buildQaTarget, diff --git a/extensions/skill-workshop/package.json b/extensions/skill-workshop/package.json index e77763771ed..68e2152d343 100644 --- a/extensions/skill-workshop/package.json +++ b/extensions/skill-workshop/package.json @@ -5,7 +5,7 @@ "description": "OpenClaw skill workshop plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/skill-workshop/src/tool.ts b/extensions/skill-workshop/src/tool.ts index 069b6184d12..fe0c191abf3 100644 --- a/extensions/skill-workshop/src/tool.ts +++ b/extensions/skill-workshop/src/tool.ts @@ -1,5 +1,5 @@ import { randomUUID } from "node:crypto"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { jsonResult, type OpenClawPluginApi } from "../api.js"; import type { SkillWorkshopConfig } from "./config.js"; import { diff --git a/extensions/slack/package.json b/extensions/slack/package.json index 1ed4df6a92b..277de2a8b2b 100644 --- a/extensions/slack/package.json +++ b/extensions/slack/package.json @@ -5,10 +5,10 @@ "description": "OpenClaw Slack channel plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", "@slack/bolt": "^4.7.0", "@slack/web-api": "^7.15.1", - "https-proxy-agent": "^9.0.0" + "https-proxy-agent": "^9.0.0", + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/slack/src/message-tool-schema.ts b/extensions/slack/src/message-tool-schema.ts index b9b6d8d3de9..0bc8578667f 100644 --- a/extensions/slack/src/message-tool-schema.ts +++ b/extensions/slack/src/message-tool-schema.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export function createSlackMessageToolBlocksSchema() { return Type.Array( diff --git a/extensions/tavily/.openclaw-runtime-deps.json b/extensions/tavily/.openclaw-runtime-deps.json index 78e587a3fef..d7dc02e19bf 100644 --- a/extensions/tavily/.openclaw-runtime-deps.json +++ b/extensions/tavily/.openclaw-runtime-deps.json @@ -1,3 +1,3 @@ { - "specs": ["@sinclair/typebox@0.34.49"] + "specs": ["typebox@1.1.28"] } diff --git a/extensions/tavily/package.json b/extensions/tavily/package.json index 754d85e7f52..bcc237a5033 100644 --- a/extensions/tavily/package.json +++ b/extensions/tavily/package.json @@ -5,7 +5,7 @@ "description": "OpenClaw Tavily plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49" + "typebox": "1.1.28" }, "devDependencies": { "@openclaw/plugin-sdk": "workspace:*" diff --git a/extensions/tavily/src/tavily-extract-tool.ts b/extensions/tavily/src/tavily-extract-tool.ts index 4ec47cff88a..98ce7f38f74 100644 --- a/extensions/tavily/src/tavily-extract-tool.ts +++ b/extensions/tavily/src/tavily-extract-tool.ts @@ -1,10 +1,10 @@ -import { Type } from "@sinclair/typebox"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime"; import { jsonResult, readNumberParam, readStringParam, } from "openclaw/plugin-sdk/provider-web-search"; +import { Type } from "typebox"; import { runTavilyExtract } from "./tavily-client.js"; import { optionalStringEnum } from "./tavily-tool-schema.js"; diff --git a/extensions/tavily/src/tavily-search-tool.ts b/extensions/tavily/src/tavily-search-tool.ts index aee0af0079b..b6b1dbbd8b1 100644 --- a/extensions/tavily/src/tavily-search-tool.ts +++ b/extensions/tavily/src/tavily-search-tool.ts @@ -1,10 +1,10 @@ -import { Type } from "@sinclair/typebox"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime"; import { jsonResult, readNumberParam, readStringParam, } from "openclaw/plugin-sdk/provider-web-search"; +import { Type } from "typebox"; import { runTavilySearch } from "./tavily-client.js"; import { optionalStringEnum } from "./tavily-tool-schema.js"; diff --git a/extensions/tavily/src/tavily-tool-schema.ts b/extensions/tavily/src/tavily-tool-schema.ts index 10f7fec46a7..14283b2e453 100644 --- a/extensions/tavily/src/tavily-tool-schema.ts +++ b/extensions/tavily/src/tavily-tool-schema.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export function optionalStringEnum( values: T, diff --git a/extensions/telegram/package.json b/extensions/telegram/package.json index 26644cdafe6..5b05e523a21 100644 --- a/extensions/telegram/package.json +++ b/extensions/telegram/package.json @@ -7,8 +7,8 @@ "dependencies": { "@grammyjs/runner": "^2.0.3", "@grammyjs/transformer-throttler": "^1.2.1", - "@sinclair/typebox": "0.34.49", "grammy": "^1.42.0", + "typebox": "1.1.28", "undici": "8.1.0" }, "devDependencies": { diff --git a/extensions/telegram/src/message-tool-schema.ts b/extensions/telegram/src/message-tool-schema.ts index bfc91fbfd67..1956d9cc9f9 100644 --- a/extensions/telegram/src/message-tool-schema.ts +++ b/extensions/telegram/src/message-tool-schema.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export function createTelegramPollExtraToolSchemas() { return { diff --git a/extensions/voice-call/index.ts b/extensions/voice-call/index.ts index 86590824d5d..478b133b0f0 100644 --- a/extensions/voice-call/index.ts +++ b/extensions/voice-call/index.ts @@ -1,6 +1,6 @@ -import { Type } from "@sinclair/typebox"; import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; +import { Type } from "typebox"; import { definePluginEntry, type GatewayRequestHandlerOptions, @@ -138,6 +138,12 @@ const VoiceCallToolSchema = Type.Union([ }), ]); +function asParamRecord(params: unknown): Record { + return params && typeof params === "object" && !Array.isArray(params) + ? (params as Record) + : {}; +} + export default definePluginEntry({ id: "voice-call", name: "Voice Call", @@ -391,6 +397,7 @@ export default definePluginEntry({ description: "Make phone calls and have voice conversations via the voice-call plugin.", parameters: VoiceCallToolSchema, async execute(_toolCallId, params) { + const rawParams = asParamRecord(params); const json = (payload: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(payload, null, 2) }], details: payload, @@ -399,22 +406,22 @@ export default definePluginEntry({ try { const rt = await ensureRuntime(); - if (typeof params?.action === "string") { - switch (params.action) { + if (typeof rawParams.action === "string") { + switch (rawParams.action) { case "initiate_call": { - const message = normalizeOptionalString(params.message) ?? ""; + const message = normalizeOptionalString(rawParams.message) ?? ""; if (!message) { throw new Error("message required"); } - const to = normalizeOptionalString(params.to) ?? rt.config.toNumber; + const to = normalizeOptionalString(rawParams.to) ?? rt.config.toNumber; if (!to) { throw new Error("to required"); } const result = await rt.manager.initiateCall(to, undefined, { message, mode: - params.mode === "notify" || params.mode === "conversation" - ? params.mode + rawParams.mode === "notify" || rawParams.mode === "conversation" + ? rawParams.mode : undefined, }); if (!result.success) { @@ -423,8 +430,8 @@ export default definePluginEntry({ return json({ callId: result.callId, initiated: true }); } case "continue_call": { - const callId = normalizeOptionalString(params.callId) ?? ""; - const message = normalizeOptionalString(params.message) ?? ""; + const callId = normalizeOptionalString(rawParams.callId) ?? ""; + const message = normalizeOptionalString(rawParams.message) ?? ""; if (!callId || !message) { throw new Error("callId and message required"); } @@ -435,8 +442,8 @@ export default definePluginEntry({ return json({ success: true, transcript: result.transcript }); } case "speak_to_user": { - const callId = normalizeOptionalString(params.callId) ?? ""; - const message = normalizeOptionalString(params.message) ?? ""; + const callId = normalizeOptionalString(rawParams.callId) ?? ""; + const message = normalizeOptionalString(rawParams.message) ?? ""; if (!callId || !message) { throw new Error("callId and message required"); } @@ -447,7 +454,7 @@ export default definePluginEntry({ return json({ success: true }); } case "end_call": { - const callId = normalizeOptionalString(params.callId) ?? ""; + const callId = normalizeOptionalString(rawParams.callId) ?? ""; if (!callId) { throw new Error("callId required"); } @@ -458,7 +465,7 @@ export default definePluginEntry({ return json({ success: true }); } case "get_status": { - const callId = normalizeOptionalString(params.callId) ?? ""; + const callId = normalizeOptionalString(rawParams.callId) ?? ""; if (!callId) { throw new Error("callId required"); } @@ -469,9 +476,9 @@ export default definePluginEntry({ } } - const mode = params?.mode ?? "call"; + const mode = rawParams.mode ?? "call"; if (mode === "status") { - const sid = normalizeOptionalString(params.sid) ?? ""; + const sid = normalizeOptionalString(rawParams.sid) ?? ""; if (!sid) { throw new Error("sid required for status"); } @@ -479,12 +486,12 @@ export default definePluginEntry({ return json(call ? { found: true, call } : { found: false }); } - const to = normalizeOptionalString(params.to) ?? rt.config.toNumber; + const to = normalizeOptionalString(rawParams.to) ?? rt.config.toNumber; if (!to) { throw new Error("to required for call"); } const result = await rt.manager.initiateCall(to, undefined, { - message: normalizeOptionalString(params.message), + message: normalizeOptionalString(rawParams.message), }); if (!result.success) { throw new Error(result.error || "initiate failed"); diff --git a/extensions/voice-call/package.json b/extensions/voice-call/package.json index 75434671084..a630cd28c39 100644 --- a/extensions/voice-call/package.json +++ b/extensions/voice-call/package.json @@ -4,8 +4,8 @@ "description": "OpenClaw voice-call plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", "commander": "^14.0.3", + "typebox": "1.1.28", "ws": "^8.20.0" }, "devDependencies": { diff --git a/extensions/whatsapp/package.json b/extensions/whatsapp/package.json index e63f340c700..fd895144296 100644 --- a/extensions/whatsapp/package.json +++ b/extensions/whatsapp/package.json @@ -4,10 +4,10 @@ "description": "OpenClaw WhatsApp channel plugin", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", "@whiskeysockets/baileys": "7.0.0-rc.9", "jimp": "^1.6.1", "qrcode-terminal": "^0.12.0", + "typebox": "1.1.28", "undici": "8.1.0" }, "devDependencies": { diff --git a/extensions/whatsapp/src/agent-tools-login.ts b/extensions/whatsapp/src/agent-tools-login.ts index 653f4c5ef6b..714502fdd7a 100644 --- a/extensions/whatsapp/src/agent-tools-login.ts +++ b/extensions/whatsapp/src/agent-tools-login.ts @@ -1,5 +1,5 @@ -import { Type } from "@sinclair/typebox"; import type { ChannelAgentTool } from "openclaw/plugin-sdk/channel-contract"; +import { Type } from "typebox"; import { startWebLoginWithQr, waitForWebLogin } from "../login-qr-api.js"; export function createWhatsAppLoginTool(): ChannelAgentTool { diff --git a/extensions/xai/code-execution.ts b/extensions/xai/code-execution.ts index ea7d8f89c36..7ad02e3af2c 100644 --- a/extensions/xai/code-execution.ts +++ b/extensions/xai/code-execution.ts @@ -1,6 +1,6 @@ -import { Type } from "@sinclair/typebox"; import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/config-runtime"; import { jsonResult, readStringParam } from "openclaw/plugin-sdk/provider-web-search"; +import { Type } from "typebox"; import { buildXaiCodeExecutionPayload, requestXaiCodeExecution, diff --git a/extensions/xai/index.ts b/extensions/xai/index.ts index ccf77ab907e..9c9edf9c8b0 100644 --- a/extensions/xai/index.ts +++ b/extensions/xai/index.ts @@ -1,8 +1,8 @@ -import { Type } from "@sinclair/typebox"; import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry"; import { OPENAI_COMPATIBLE_REPLAY_HOOKS } from "openclaw/plugin-sdk/provider-model-shared"; import { defaultToolStreamExtraParams } from "openclaw/plugin-sdk/provider-stream-shared"; import { jsonResult, readProviderEnvValue } from "openclaw/plugin-sdk/provider-web-search"; +import { Type } from "typebox"; import { applyXaiModelCompat, buildXaiImageGenerationProvider, diff --git a/extensions/xai/package.json b/extensions/xai/package.json index c4351f8ff7c..2d4843cd694 100644 --- a/extensions/xai/package.json +++ b/extensions/xai/package.json @@ -6,7 +6,7 @@ "type": "module", "dependencies": { "@mariozechner/pi-ai": "0.69.0", - "@sinclair/typebox": "0.34.49", + "typebox": "1.1.28", "ws": "^8.20.0" }, "devDependencies": { diff --git a/extensions/xai/x-search-tool-shared.ts b/extensions/xai/x-search-tool-shared.ts index f15815d0c4c..c4621226672 100644 --- a/extensions/xai/x-search-tool-shared.ts +++ b/extensions/xai/x-search-tool-shared.ts @@ -1,5 +1,5 @@ import type { AgentToolResult } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export function buildMissingXSearchApiKeyPayload() { return { diff --git a/extensions/zalouser/package.json b/extensions/zalouser/package.json index 954e9869270..e14a2a44d62 100644 --- a/extensions/zalouser/package.json +++ b/extensions/zalouser/package.json @@ -4,7 +4,7 @@ "description": "OpenClaw Zalo Personal Account plugin via native zca-js integration", "type": "module", "dependencies": { - "@sinclair/typebox": "0.34.49", + "typebox": "1.1.28", "zca-js": "2.1.2" }, "devDependencies": { diff --git a/extensions/zalouser/src/tool.ts b/extensions/zalouser/src/tool.ts index 53c30034cfa..922aa6bca21 100644 --- a/extensions/zalouser/src/tool.ts +++ b/extensions/zalouser/src/tool.ts @@ -1,6 +1,6 @@ -import { Type } from "@sinclair/typebox"; import type { AnyAgentTool, OpenClawPluginToolContext } from "openclaw/plugin-sdk/core"; import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; +import { Type } from "typebox"; import { sendImageZalouser, sendLinkZalouser, sendMessageZalouser } from "./send.js"; import { parseZalouserOutboundTarget } from "./session-route.js"; import { diff --git a/package.json b/package.json index f4f8b86988f..0a995964b12 100644 --- a/package.json +++ b/package.json @@ -1540,7 +1540,6 @@ "@mariozechner/pi-tui": "0.69.0", "@modelcontextprotocol/sdk": "1.29.0", "@mozilla/readability": "^0.6.0", - "@sinclair/typebox": "0.34.49", "ajv": "^8.18.0", "chalk": "^5.6.2", "chokidar": "^5.0.0", @@ -1567,6 +1566,7 @@ "sqlite-vec": "0.1.9", "tar": "7.5.13", "tslog": "^4.10.2", + "typebox": "1.1.28", "undici": "8.1.0", "ws": "^8.20.0", "yaml": "^2.8.3", @@ -1633,7 +1633,7 @@ "path-to-regexp": "8.4.0", "qs": "6.14.2", "node-domexception": "npm:@nolyfill/domexception@1.0.28", - "@sinclair/typebox": "0.34.49", + "typebox": "1.1.28", "tar": "7.5.13", "tough-cookie": "4.1.3", "yauzl": "3.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 245aa95dfc4..413fd25060d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,7 @@ overrides: path-to-regexp: 8.4.0 qs: 6.14.2 node-domexception: npm:@nolyfill/domexception@1.0.28 - '@sinclair/typebox': 0.34.49 + typebox: 1.1.28 tar: 7.5.13 tough-cookie: 4.1.3 yauzl: 3.2.1 @@ -75,9 +75,6 @@ importers: '@napi-rs/canvas': specifier: ^0.1.89 version: 0.1.92 - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 ajv: specifier: ^8.18.0 version: 8.18.0 @@ -159,6 +156,9 @@ importers: tslog: specifier: ^4.10.2 version: 4.10.2 + typebox: + specifier: 1.1.28 + version: 1.1.28 undici: specifier: 8.1.0 version: 8.1.0 @@ -320,9 +320,9 @@ importers: extensions/brave: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -333,9 +333,6 @@ importers: '@modelcontextprotocol/sdk': specifier: 1.29.0 version: 1.29.0(zod@4.3.6) - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 commander: specifier: ^14.0.3 version: 14.0.3 @@ -345,6 +342,9 @@ importers: playwright-core: specifier: 1.59.1 version: 1.59.1 + typebox: + specifier: 1.1.28 + version: 1.1.28 undici: specifier: 8.1.0 version: 8.1.0 @@ -466,12 +466,12 @@ importers: '@pierre/theme': specifier: 0.0.29 version: 0.0.29 - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 playwright-core: specifier: 1.59.1 version: 1.59.1 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -485,9 +485,6 @@ importers: '@discordjs/voice': specifier: ^0.19.2 version: 0.19.2(@discordjs/opus@0.10.0)(@emnapi/core@1.9.2)(@emnapi/runtime@1.10.0)(opusscript@0.0.8) - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 discord-api-types: specifier: ^0.38.47 version: 0.38.47 @@ -497,6 +494,9 @@ importers: opusscript: specifier: ^0.0.8 version: 0.0.8 + typebox: + specifier: 1.1.28 + version: 1.1.28 undici: specifier: 8.1.0 version: 8.1.0 @@ -542,14 +542,14 @@ importers: extensions/feishu: dependencies: '@larksuiteoapi/node-sdk': - specifier: ^1.61.0 - version: 1.61.0 - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + specifier: ^1.61.1 + version: 1.61.1 qrcode-terminal: specifier: ^0.12.0 version: 0.12.0 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -560,9 +560,9 @@ importers: extensions/firecrawl: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -690,12 +690,12 @@ importers: extensions/llm-task: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 ajv: specifier: ^8.18.0 version: 8.18.0 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -712,9 +712,9 @@ importers: '@clawdbot/lobster': specifier: 2026.4.6 version: 2026.4.6 - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -728,9 +728,6 @@ importers: '@matrix-org/matrix-sdk-crypto-wasm': specifier: 18.1.0 version: 18.1.0 - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 fake-indexeddb: specifier: ^6.2.5 version: 6.2.5 @@ -746,6 +743,9 @@ importers: music-metadata: specifier: ^11.12.3 version: 11.12.3 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -775,12 +775,12 @@ importers: extensions/memory-core: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 chokidar: specifier: ^5.0.0 version: 5.0.0 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -794,12 +794,12 @@ importers: '@lancedb/lancedb': specifier: ^0.27.2 version: 0.27.2(apache-arrow@18.1.0) - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 openai: specifier: ^6.34.0 version: 6.34.0(ws@8.20.0)(zod@4.3.6) + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -807,9 +807,9 @@ importers: extensions/memory-wiki: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 yaml: specifier: ^2.8.3 version: 2.8.3 @@ -870,9 +870,6 @@ importers: '@microsoft/teams.apps': specifier: 2.0.8 version: 2.0.8 - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 express: specifier: ^5.2.1 version: 5.2.1 @@ -882,6 +879,9 @@ importers: jwks-rsa: specifier: ^4.0.1 version: 4.0.1 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -933,9 +933,9 @@ importers: '@mariozechner/pi-ai': specifier: 0.69.0 version: 0.69.0(@modelcontextprotocol/sdk@1.29.0(zod@4.3.6))(ws@8.20.0)(zod@4.3.6) - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -996,9 +996,9 @@ importers: extensions/qa-channel: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -1114,9 +1114,9 @@ importers: extensions/skill-workshop: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -1124,9 +1124,6 @@ importers: extensions/slack: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 '@slack/bolt': specifier: ^4.7.0 version: 4.7.0(@types/express@5.0.6) @@ -1136,6 +1133,9 @@ importers: https-proxy-agent: specifier: ^9.0.0 version: 9.0.0 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -1171,9 +1171,9 @@ importers: extensions/tavily: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 devDependencies: '@openclaw/plugin-sdk': specifier: workspace:* @@ -1187,12 +1187,12 @@ importers: '@grammyjs/transformer-throttler': specifier: ^1.2.1 version: 1.2.1(grammy@1.42.0) - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 grammy: specifier: ^1.42.0 version: 1.42.0 + typebox: + specifier: 1.1.28 + version: 1.1.28 undici: specifier: 8.1.0 version: 8.1.0 @@ -1287,12 +1287,12 @@ importers: extensions/voice-call: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 commander: specifier: ^14.0.3 version: 14.0.3 + typebox: + specifier: 1.1.28 + version: 1.1.28 ws: specifier: ^8.20.0 version: 8.20.0 @@ -1334,9 +1334,6 @@ importers: extensions/whatsapp: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 '@whiskeysockets/baileys': specifier: 7.0.0-rc.9 version: 7.0.0-rc.9(patch_hash=23ec8efe1484afa57c51b96955ba331d1467521a8e676a18c2690da7e70a6201)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5) @@ -1346,6 +1343,9 @@ importers: qrcode-terminal: specifier: ^0.12.0 version: 0.12.0 + typebox: + specifier: 1.1.28 + version: 1.1.28 undici: specifier: 8.1.0 version: 8.1.0 @@ -1362,9 +1362,9 @@ importers: '@mariozechner/pi-ai': specifier: 0.69.0 version: 0.69.0(@modelcontextprotocol/sdk@1.29.0(zod@4.3.6))(ws@8.20.0)(zod@4.3.6) - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 ws: specifier: ^8.20.0 version: 8.20.0 @@ -1400,9 +1400,9 @@ importers: extensions/zalouser: dependencies: - '@sinclair/typebox': - specifier: 0.34.49 - version: 0.34.49 + typebox: + specifier: 1.1.28 + version: 1.1.28 zca-js: specifier: 2.1.2 version: 2.1.2 @@ -2544,8 +2544,8 @@ packages: peerDependencies: apache-arrow: '>=15.0.0 <=18.1.0' - '@larksuiteoapi/node-sdk@1.61.0': - resolution: {integrity: sha512-90hPo4+srmwdyqFN5xhDI1P0Zyu30TisIRH5AZILKJhgvELos/eyCWKuz4wZ6gg9ugHNjqDTj4VpnNmxmuwKgw==} + '@larksuiteoapi/node-sdk@1.61.1': + resolution: {integrity: sha512-BxLBCXk/652I0nWduQbiIrTH2TPe/i4ZD6UhW3VCTVFzrOq5Y9SKvAwanBE6z1ZyEPL6iLnXg/TfGvGSzG6MLw==} '@line/bot-sdk@11.0.0': resolution: {integrity: sha512-3NZJjeFm2BikwVRgA8osIVbgKhuL0CzphQOdrB8okXIC40qMRE4RRfHFN3G8/qTb/34RtB95mD4J/KW5MD+b8g==} @@ -3693,9 +3693,6 @@ packages: '@silvia-odwyer/photon-node@0.3.4': resolution: {integrity: sha512-bnly4BKB3KDTFxrUIcgCLbaeVVS8lrAkri1pEzskpmxu9MdfGQTy8b8EgcD83ywD3RPMsIulY8xJH5Awa+t9fA==} - '@sinclair/typebox@0.34.49': - resolution: {integrity: sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==} - '@slack/bolt@4.7.0': resolution: {integrity: sha512-Xpf+gKegNvkHpft1z4YiuqZdciJ3tUp1bIRQxylW30Ovf+hzjb0M1zTHVtJsRw9jsjPxHTPoyanEXVvG6qVE1g==} engines: {node: '>=18', npm: '>=8.6.0'} @@ -9150,7 +9147,7 @@ snapshots: '@lancedb/lancedb-win32-arm64-msvc': 0.27.2 '@lancedb/lancedb-win32-x64-msvc': 0.27.2 - '@larksuiteoapi/node-sdk@1.61.0': + '@larksuiteoapi/node-sdk@1.61.1': dependencies: axios: 1.15.0 lodash.identity: 3.0.0 @@ -10152,8 +10149,6 @@ snapshots: '@silvia-odwyer/photon-node@0.3.4': {} - '@sinclair/typebox@0.34.49': {} - '@slack/bolt@4.7.0(@types/express@5.0.6)': dependencies: '@slack/logger': 4.0.1 diff --git a/src/agents/apply-patch.ts b/src/agents/apply-patch.ts index d6119cc4e1e..c6a8db2ab75 100644 --- a/src/agents/apply-patch.ts +++ b/src/agents/apply-patch.ts @@ -2,7 +2,7 @@ import syncFs from "node:fs"; import fs from "node:fs/promises"; import path from "node:path"; import type { AgentTool } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { openBoundaryFile, type BoundaryFileOpenResult } from "../infra/boundary-file-read.js"; import { mkdirPathWithinRoot, diff --git a/src/agents/bash-tools.schemas.ts b/src/agents/bash-tools.schemas.ts index 785e3c02280..c376faeff29 100644 --- a/src/agents/bash-tools.schemas.ts +++ b/src/agents/bash-tools.schemas.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export const execSchema = Type.Object({ command: Type.String({ description: "Shell command to execute" }), diff --git a/src/agents/google-gemini-switch.live.test.ts b/src/agents/google-gemini-switch.live.test.ts index f9512be692e..24c74386cf7 100644 --- a/src/agents/google-gemini-switch.live.test.ts +++ b/src/agents/google-gemini-switch.live.test.ts @@ -1,5 +1,5 @@ import { completeSimple, getModel } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it } from "vitest"; import { isLiveTestEnabled } from "./live-test-helpers.js"; import { makeZeroUsageSnapshot } from "./usage.js"; diff --git a/src/agents/live-cache-regression-runner.ts b/src/agents/live-cache-regression-runner.ts index 7523e5fd438..3ec549941a7 100644 --- a/src/agents/live-cache-regression-runner.ts +++ b/src/agents/live-cache-regression-runner.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; import fs from "node:fs/promises"; import type { AssistantMessage, Message, Tool } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { LIVE_CACHE_REGRESSION_BASELINE, diff --git a/src/agents/model-scan.ts b/src/agents/model-scan.ts index d2731f62e42..484810b914d 100644 --- a/src/agents/model-scan.ts +++ b/src/agents/model-scan.ts @@ -7,7 +7,7 @@ import { type OpenAICompletionsOptions, type Tool, } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { formatErrorMessage } from "../infra/errors.js"; import { inferParamBFromIdOrName } from "../shared/model-param-b.js"; import { diff --git a/src/agents/models.profiles.live.test.ts b/src/agents/models.profiles.live.test.ts index c76b152addd..b2cc1bdf0e7 100644 --- a/src/agents/models.profiles.live.test.ts +++ b/src/agents/models.profiles.live.test.ts @@ -1,5 +1,5 @@ import { type Api, completeSimple, type Model } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it } from "vitest"; import { loadConfig } from "../config/config.js"; import { parseLiveCsvFilter } from "../media-generation/live-test-helpers.js"; diff --git a/src/agents/openai-responses.reasoning-replay.test.ts b/src/agents/openai-responses.reasoning-replay.test.ts index 84897d11575..2e6ae50d3e5 100644 --- a/src/agents/openai-responses.reasoning-replay.test.ts +++ b/src/agents/openai-responses.reasoning-replay.test.ts @@ -1,6 +1,6 @@ import type { AssistantMessage, Model, ToolResultMessage } from "@mariozechner/pi-ai"; import { streamOpenAIResponses } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it } from "vitest"; function buildModel(): Model<"openai-responses"> { diff --git a/src/agents/pi-bundle-mcp-materialize.ts b/src/agents/pi-bundle-mcp-materialize.ts index a222ea27663..67b03f45ece 100644 --- a/src/agents/pi-bundle-mcp-materialize.ts +++ b/src/agents/pi-bundle-mcp-materialize.ts @@ -11,7 +11,7 @@ import { TOOL_NAME_SEPARATOR, } from "./pi-bundle-mcp-names.js"; import type { BundleMcpToolRuntime, SessionMcpRuntime } from "./pi-bundle-mcp-types.js"; -import type { AnyAgentTool } from "./tools/common.js"; +import { asToolParameterSchema, type AnyAgentTool } from "./tools/common.js"; function toAgentToolResult(params: { serverName: string; @@ -102,7 +102,7 @@ export async function materializeBundleMcpToolsForRun(params: { name: safeToolName, label: tool.title ?? tool.toolName, description: tool.description || tool.fallbackDescription, - parameters: tool.inputSchema, + parameters: asToolParameterSchema(tool.inputSchema), execute: async (_toolCallId: string, input: unknown) => { const result = await params.runtime.callTool(tool.serverName, tool.toolName, input); return toAgentToolResult({ diff --git a/src/agents/pi-embedded-runner.cache.live.test.ts b/src/agents/pi-embedded-runner.cache.live.test.ts index 84145fe03e3..9557b8d3438 100644 --- a/src/agents/pi-embedded-runner.cache.live.test.ts +++ b/src/agents/pi-embedded-runner.cache.live.test.ts @@ -2,7 +2,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import type { AssistantMessage, Message, Tool } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; import { diff --git a/src/agents/pi-embedded-runner/tool-schema-runtime.ts b/src/agents/pi-embedded-runner/tool-schema-runtime.ts index 3377af688c4..3150473f6ab 100644 --- a/src/agents/pi-embedded-runner/tool-schema-runtime.ts +++ b/src/agents/pi-embedded-runner/tool-schema-runtime.ts @@ -1,5 +1,5 @@ import type { AgentTool } from "@mariozechner/pi-agent-core"; -import type { TSchema } from "@sinclair/typebox"; +import type { TSchema } from "typebox"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { ProviderRuntimeModel } from "../../plugins/provider-runtime-model.types.js"; import { diff --git a/src/agents/pi-mcp-style.cache.live.test.ts b/src/agents/pi-mcp-style.cache.live.test.ts index ffda611c814..51ae45e71de 100644 --- a/src/agents/pi-mcp-style.cache.live.test.ts +++ b/src/agents/pi-mcp-style.cache.live.test.ts @@ -1,5 +1,5 @@ import type { AssistantMessage, Tool } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it } from "vitest"; import { buildAssistantHistoryTurn, diff --git a/src/agents/pi-tool-definition-adapter.after-tool-call.fires-once.test.ts b/src/agents/pi-tool-definition-adapter.after-tool-call.fires-once.test.ts index 466e57ecc11..d095610668a 100644 --- a/src/agents/pi-tool-definition-adapter.after-tool-call.fires-once.test.ts +++ b/src/agents/pi-tool-definition-adapter.after-tool-call.fires-once.test.ts @@ -7,7 +7,7 @@ * after_tool_call invocation (see PR #27283 → dedup in this fix). */ import type { AgentTool } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { createBaseToolHandlerState } from "./pi-tool-handler-state.test-helpers.js"; diff --git a/src/agents/pi-tool-definition-adapter.after-tool-call.test.ts b/src/agents/pi-tool-definition-adapter.after-tool-call.test.ts index 5e30734129d..2e8cc45ea52 100644 --- a/src/agents/pi-tool-definition-adapter.after-tool-call.test.ts +++ b/src/agents/pi-tool-definition-adapter.after-tool-call.test.ts @@ -1,5 +1,5 @@ import type { AgentTool } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { toToolDefinitions } from "./pi-tool-definition-adapter.js"; diff --git a/src/agents/pi-tool-definition-adapter.logging.test.ts b/src/agents/pi-tool-definition-adapter.logging.test.ts index 8869772977a..78ceb4c9fb2 100644 --- a/src/agents/pi-tool-definition-adapter.logging.test.ts +++ b/src/agents/pi-tool-definition-adapter.logging.test.ts @@ -1,5 +1,5 @@ import type { AgentTool } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const mocks = vi.hoisted(() => ({ diff --git a/src/agents/pi-tool-definition-adapter.test.ts b/src/agents/pi-tool-definition-adapter.test.ts index b3c4c8a9c52..92305cf42c0 100644 --- a/src/agents/pi-tool-definition-adapter.test.ts +++ b/src/agents/pi-tool-definition-adapter.test.ts @@ -1,5 +1,5 @@ import type { AgentTool } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it } from "vitest"; import type { ClientToolDefinition } from "./pi-embedded-runner/run/params.js"; import { diff --git a/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-g.test.ts b/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-g.test.ts index f059655c2b6..3a3fdd8d2b5 100644 --- a/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-g.test.ts +++ b/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-g.test.ts @@ -2,7 +2,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import type { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it, vi } from "vitest"; import { createOpenClawReadTool, createSandboxedReadTool } from "./pi-tools.read.js"; import { createHostSandboxFsBridge } from "./test-helpers/host-sandbox-fs-bridge.js"; diff --git a/src/agents/pi-tools.schema.test.ts b/src/agents/pi-tools.schema.test.ts index eeb84acb692..36d6a676615 100644 --- a/src/agents/pi-tools.schema.test.ts +++ b/src/agents/pi-tools.schema.test.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it, vi } from "vitest"; import { cleanToolSchemaForGemini, @@ -6,6 +6,7 @@ import { normalizeToolParameters, } from "./pi-tools.schema.js"; import type { AnyAgentTool } from "./pi-tools.types.js"; +import { asToolParameterSchema } from "./tools/common.js"; describe("normalizeToolParameterSchema", () => { it("normalizes truly empty schemas to type:object with properties:{}", () => { @@ -112,7 +113,7 @@ function makeTool(parameters: unknown): AnyAgentTool { name: "test_tool", label: "Test Tool", description: "test", - parameters, + parameters: asToolParameterSchema(parameters), execute: vi.fn(), }; } diff --git a/src/agents/pi-tools.schema.ts b/src/agents/pi-tools.schema.ts index bfac93f39f7..3d3c9118ddd 100644 --- a/src/agents/pi-tools.schema.ts +++ b/src/agents/pi-tools.schema.ts @@ -5,6 +5,7 @@ import { type ToolParameterSchemaOptions, } from "./pi-tools-parameter-schema.js"; import type { AnyAgentTool } from "./pi-tools.types.js"; +import { asToolParameterSchema } from "./tools/common.js"; export { normalizeToolParameterSchema }; @@ -26,7 +27,7 @@ export function normalizeToolParameters( } return preserveToolMeta({ ...tool, - parameters: normalizeToolParameterSchema(schema, options), + parameters: asToolParameterSchema(normalizeToolParameterSchema(schema, options)), }); } diff --git a/src/agents/schema/string-enum.ts b/src/agents/schema/string-enum.ts index 9678de1a646..56fee72de66 100644 --- a/src/agents/schema/string-enum.ts +++ b/src/agents/schema/string-enum.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; type StringEnumOptions = { description?: string; diff --git a/src/agents/schema/typebox.ts b/src/agents/schema/typebox.ts index 5fdecf1c6ff..302c9f12aae 100644 --- a/src/agents/schema/typebox.ts +++ b/src/agents/schema/typebox.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { CHANNEL_TARGET_DESCRIPTION, CHANNEL_TARGETS_DESCRIPTION, diff --git a/src/agents/test-helpers/pi-tool-stubs.ts b/src/agents/test-helpers/pi-tool-stubs.ts index 71fe740234f..4a42aed13ee 100644 --- a/src/agents/test-helpers/pi-tool-stubs.ts +++ b/src/agents/test-helpers/pi-tool-stubs.ts @@ -1,5 +1,5 @@ import type { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export function createStubTool(name: string): AgentTool { return { diff --git a/src/agents/tools/agents-list-tool.ts b/src/agents/tools/agents-list-tool.ts index d01a241c0de..63e17338d11 100644 --- a/src/agents/tools/agents-list-tool.ts +++ b/src/agents/tools/agents-list-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import { DEFAULT_AGENT_ID, diff --git a/src/agents/tools/canvas-tool.ts b/src/agents/tools/canvas-tool.ts index 2a503b76a6a..7ec8d521681 100644 --- a/src/agents/tools/canvas-tool.ts +++ b/src/agents/tools/canvas-tool.ts @@ -1,7 +1,7 @@ import crypto from "node:crypto"; import fs from "node:fs/promises"; import path from "node:path"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { writeBase64ToFile } from "../../cli/nodes-camera.js"; import { canvasSnapshotTempPath, parseCanvasSnapshotPayload } from "../../cli/nodes-canvas.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; diff --git a/src/agents/tools/common.ts b/src/agents/tools/common.ts index 7f280556d52..43f3b99c8c7 100644 --- a/src/agents/tools/common.ts +++ b/src/agents/tools/common.ts @@ -4,7 +4,7 @@ import type { AgentToolResult, AgentToolUpdateCallback, } from "@mariozechner/pi-agent-core"; -import type { TSchema } from "@sinclair/typebox"; +import type { TSchema } from "typebox"; import { detectMime } from "../../media/mime.js"; import { readSnakeCaseParamRaw } from "../../param-key.js"; import type { ImageSanitizationLimits } from "../image-sanitization.js"; @@ -18,31 +18,32 @@ export type AgentToolWithMeta = AgentTool< displaySummary?: string; }; -// Cross-package tool registration still mixes concrete schema-typed tools with -// plugin/runtime factories that are effectively existential over params/details. -// Tightening this alias without a dedicated adapter seam blows up plugin tool -// factories and embedded-runner tool plumbing. -type AnyAgentToolExecute = ( - toolCallId: string, - // oxlint-disable-next-line typescript/no-explicit-any - params: any, - signal?: AbortSignal, - onUpdate?: AgentToolUpdateCallback, -) => Promise>; - -export type AnyAgentTool = { - name: string; - label: string; - description: string; - // oxlint-disable-next-line typescript/no-explicit-any - parameters: any; - prepareArguments?: (args: unknown) => unknown; - executionMode?: AgentTool["executionMode"]; - ownerOnly?: boolean; - displaySummary?: string; - execute: AnyAgentToolExecute; +type ErasedAgentToolExecute = { + execute( + this: void, + toolCallId: string, + params: unknown, + signal?: AbortSignal, + onUpdate?: AgentToolUpdateCallback, + ): Promise>; }; +export type AnyAgentTool = Omit, "execute"> & + ErasedAgentToolExecute & { + ownerOnly?: boolean; + displaySummary?: string; + }; + +export function asToolParameterSchema(schema: unknown): TSchema { + return schema as TSchema; +} + +export function asToolParamsRecord(params: unknown): Record { + return params && typeof params === "object" && !Array.isArray(params) + ? (params as Record) + : {}; +} + export type StringParamOptions = { required?: boolean; trim?: boolean; diff --git a/src/agents/tools/cron-tool.schema.test.ts b/src/agents/tools/cron-tool.schema.test.ts index 1312318f79f..f5ab847a404 100644 --- a/src/agents/tools/cron-tool.schema.test.ts +++ b/src/agents/tools/cron-tool.schema.test.ts @@ -25,11 +25,13 @@ function propertyAt( } describe("CronToolSchema", () => { + const schemaRecord = CronToolSchema as unknown as Record; + // Regression: models like GPT-5.4 rely on these fields to populate job/patch. // If a field is removed from this list the test must be updated intentionally. it("job exposes the expected top-level fields", () => { - expect(keysAt(CronToolSchema as Record, "job")).toEqual( + expect(keysAt(schemaRecord, "job")).toEqual( [ "agentId", "deleteAfterRun", @@ -48,7 +50,7 @@ describe("CronToolSchema", () => { }); it("patch exposes the expected top-level fields", () => { - expect(keysAt(CronToolSchema as Record, "patch")).toEqual( + expect(keysAt(schemaRecord, "patch")).toEqual( [ "agentId", "deleteAfterRun", @@ -67,33 +69,27 @@ describe("CronToolSchema", () => { }); it("job.schedule exposes kind, at, everyMs, anchorMs, expr, tz, staggerMs", () => { - expect(keysAt(CronToolSchema as Record, "job.schedule")).toEqual( + expect(keysAt(schemaRecord, "job.schedule")).toEqual( ["anchorMs", "at", "everyMs", "expr", "kind", "staggerMs", "tz"].toSorted(), ); }); it("marks staggerMs as cron-only in both job and patch schedule schemas", () => { - const jobStagger = propertyAt( - CronToolSchema as Record, - "job.schedule.staggerMs", - ); - const patchStagger = propertyAt( - CronToolSchema as Record, - "patch.schedule.staggerMs", - ); + const jobStagger = propertyAt(schemaRecord, "job.schedule.staggerMs"); + const patchStagger = propertyAt(schemaRecord, "patch.schedule.staggerMs"); expect(jobStagger?.description).toBe("Random jitter in ms (kind=cron)"); expect(patchStagger?.description).toBe("Random jitter in ms (kind=cron)"); }); it("job.delivery exposes mode, channel, to, bestEffort, accountId, failureDestination", () => { - expect(keysAt(CronToolSchema as Record, "job.delivery")).toEqual( + expect(keysAt(schemaRecord, "job.delivery")).toEqual( ["accountId", "bestEffort", "channel", "failureDestination", "mode", "to"].toSorted(), ); }); it("job.payload exposes kind, text, message, model, thinking and extras", () => { - expect(keysAt(CronToolSchema as Record, "job.payload")).toEqual( + expect(keysAt(schemaRecord, "job.payload")).toEqual( [ "allowUnsafeExternalContent", "fallbacks", @@ -110,11 +106,11 @@ describe("CronToolSchema", () => { }); it("job.payload includes fallbacks", () => { - expect(keysAt(CronToolSchema as Record, "job.payload")).toContain("fallbacks"); + expect(keysAt(schemaRecord, "job.payload")).toContain("fallbacks"); }); it("patch.payload exposes agentTurn fallback overrides", () => { - expect(keysAt(CronToolSchema as Record, "patch.payload")).toEqual( + expect(keysAt(schemaRecord, "patch.payload")).toEqual( [ "allowUnsafeExternalContent", "fallbacks", @@ -131,13 +127,13 @@ describe("CronToolSchema", () => { }); it("job.failureAlert exposes after, channel, to, cooldownMs, mode, accountId", () => { - expect(keysAt(CronToolSchema as Record, "job.failureAlert")).toEqual( + expect(keysAt(schemaRecord, "job.failureAlert")).toEqual( ["accountId", "after", "channel", "cooldownMs", "mode", "to"].toSorted(), ); }); it("job.failureAlert uses plain object type for OpenAPI 3.0 compat", () => { - const root = (CronToolSchema as Record).properties as + const root = schemaRecord.properties as | Record; type?: unknown }> | undefined; const jobProps = root?.job?.properties as @@ -152,7 +148,7 @@ describe("CronToolSchema", () => { }); it("job.agentId and job.sessionKey use plain string type for OpenAPI 3.0 compat", () => { - const root = (CronToolSchema as Record).properties as + const root = schemaRecord.properties as | Record }> | undefined; const jobProps = root?.job?.properties as Record | undefined; @@ -164,7 +160,7 @@ describe("CronToolSchema", () => { }); it("patch.payload.toolsAllow uses plain array type for OpenAPI 3.0 compat", () => { - const root = (CronToolSchema as Record).properties as + const root = schemaRecord.properties as | Record }> | undefined; const patchProps = root?.patch?.properties as diff --git a/src/agents/tools/cron-tool.ts b/src/agents/tools/cron-tool.ts index 0f2cff09b93..c8d3a6288ce 100644 --- a/src/agents/tools/cron-tool.ts +++ b/src/agents/tools/cron-tool.ts @@ -1,4 +1,4 @@ -import { Type, type TSchema } from "@sinclair/typebox"; +import { Type, type TSchema } from "typebox"; import { loadConfig } from "../../config/config.js"; import { normalizeCronJobCreate, normalizeCronJobPatch } from "../../cron/normalize.js"; import type { CronDelivery, CronMessageChannel } from "../../cron/types.js"; diff --git a/src/agents/tools/gateway-tool.ts b/src/agents/tools/gateway-tool.ts index 8e5ff594c81..9f3ec3db6c1 100644 --- a/src/agents/tools/gateway-tool.ts +++ b/src/agents/tools/gateway-tool.ts @@ -1,5 +1,5 @@ import { isDeepStrictEqual } from "node:util"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { isRestartEnabled } from "../../config/commands.flags.js"; import { parseConfigJson5, resolveConfigSnapshotHash } from "../../config/io.js"; import { applyMergePatch } from "../../config/merge-patch.js"; diff --git a/src/agents/tools/image-generate-tool.ts b/src/agents/tools/image-generate-tool.ts index 3457c0a1cb7..94560e6983e 100644 --- a/src/agents/tools/image-generate-tool.ts +++ b/src/agents/tools/image-generate-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { parseImageGenerationModelRef } from "../../image-generation/model-ref.js"; diff --git a/src/agents/tools/image-tool.ts b/src/agents/tools/image-tool.ts index c34a5590bbc..574f2400b6f 100644 --- a/src/agents/tools/image-tool.ts +++ b/src/agents/tools/image-tool.ts @@ -1,5 +1,5 @@ import { resolve, isAbsolute } from "node:path"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveAutoMediaKeyProviders, diff --git a/src/agents/tools/message-tool.test.ts b/src/agents/tools/message-tool.test.ts index f26bb654753..993f1af3bfe 100644 --- a/src/agents/tools/message-tool.test.ts +++ b/src/agents/tools/message-tool.test.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import type { ChannelMessageCapability } from "../../channels/plugins/message-capabilities.js"; import type { ChannelMessageActionName, ChannelPlugin } from "../../channels/plugins/types.js"; diff --git a/src/agents/tools/message-tool.ts b/src/agents/tools/message-tool.ts index acabf2e3849..d296ff1f54c 100644 --- a/src/agents/tools/message-tool.ts +++ b/src/agents/tools/message-tool.ts @@ -1,4 +1,4 @@ -import { Type, type TSchema } from "@sinclair/typebox"; +import { Type, type TSchema } from "typebox"; import { listChannelPlugins } from "../../channels/plugins/index.js"; import { channelSupportsMessageCapability, diff --git a/src/agents/tools/music-generate-tool.ts b/src/agents/tools/music-generate-tool.ts index 07baa26c6e4..53786300e5f 100644 --- a/src/agents/tools/music-generate-tool.ts +++ b/src/agents/tools/music-generate-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; diff --git a/src/agents/tools/nodes-tool.ts b/src/agents/tools/nodes-tool.ts index 154ae6bd006..9035b82b3a6 100644 --- a/src/agents/tools/nodes-tool.ts +++ b/src/agents/tools/nodes-tool.ts @@ -1,5 +1,5 @@ import crypto from "node:crypto"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { OperatorScope } from "../../gateway/method-scopes.js"; import { readConnectPairingRequiredMessage } from "../../gateway/protocol/connect-error-details.js"; diff --git a/src/agents/tools/pdf-tool.ts b/src/agents/tools/pdf-tool.ts index 3b45bcc4610..dbe08ee7483 100644 --- a/src/agents/tools/pdf-tool.ts +++ b/src/agents/tools/pdf-tool.ts @@ -1,5 +1,5 @@ import { type Context, complete } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { extractPdfContent, type PdfExtractedContent } from "../../media/pdf-extract.js"; import { loadWebMediaRaw } from "../../media/web-media.js"; diff --git a/src/agents/tools/session-status-tool.ts b/src/agents/tools/session-status-tool.ts index 1c5f55c1e5a..a8c5058741f 100644 --- a/src/agents/tools/session-status-tool.ts +++ b/src/agents/tools/session-status-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { ElevatedLevel, ReasoningLevel, diff --git a/src/agents/tools/sessions-history-tool.ts b/src/agents/tools/sessions-history-tool.ts index 393421b9057..9cf7dacca46 100644 --- a/src/agents/tools/sessions-history-tool.ts +++ b/src/agents/tools/sessions-history-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; diff --git a/src/agents/tools/sessions-list-tool.ts b/src/agents/tools/sessions-list-tool.ts index 4d6cd130e52..2b6bb7e4082 100644 --- a/src/agents/tools/sessions-list-tool.ts +++ b/src/agents/tools/sessions-list-tool.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import { resolveSessionFilePath, diff --git a/src/agents/tools/sessions-send-tool.ts b/src/agents/tools/sessions-send-tool.ts index 32bcae4f467..68c7fcde62a 100644 --- a/src/agents/tools/sessions-send-tool.ts +++ b/src/agents/tools/sessions-send-tool.ts @@ -1,5 +1,5 @@ import crypto from "node:crypto"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { isRequesterParentOfBackgroundAcpSession } from "../../acp/session-interaction-mode.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; diff --git a/src/agents/tools/sessions-spawn-tool.ts b/src/agents/tools/sessions-spawn-tool.ts index ccfa198b9ab..66d846674ad 100644 --- a/src/agents/tools/sessions-spawn-tool.ts +++ b/src/agents/tools/sessions-spawn-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import { callGateway } from "../../gateway/call.js"; import { normalizeDeliveryContext } from "../../utils/delivery-context.shared.js"; diff --git a/src/agents/tools/sessions-yield-tool.ts b/src/agents/tools/sessions-yield-tool.ts index 8b4c3e7ad90..63a4191df80 100644 --- a/src/agents/tools/sessions-yield-tool.ts +++ b/src/agents/tools/sessions-yield-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { AnyAgentTool } from "./common.js"; import { jsonResult, readStringParam } from "./common.js"; diff --git a/src/agents/tools/subagents-tool.ts b/src/agents/tools/subagents-tool.ts index d5b213a50a3..cb50cfdeb95 100644 --- a/src/agents/tools/subagents-tool.ts +++ b/src/agents/tools/subagents-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import { optionalStringEnum } from "../schema/typebox.js"; import { diff --git a/src/agents/tools/tts-tool.ts b/src/agents/tools/tts-tool.ts index 1effdb065f9..b50bef3a67d 100644 --- a/src/agents/tools/tts-tool.ts +++ b/src/agents/tools/tts-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { SILENT_REPLY_TOKEN } from "../../auto-reply/tokens.js"; import { loadConfig } from "../../config/config.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; diff --git a/src/agents/tools/update-plan-tool.ts b/src/agents/tools/update-plan-tool.ts index 961b9a9e334..3b484eb35e2 100644 --- a/src/agents/tools/update-plan-tool.ts +++ b/src/agents/tools/update-plan-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { stringEnum } from "../schema/typebox.js"; import { describeUpdatePlanTool, diff --git a/src/agents/tools/video-generate-tool.ts b/src/agents/tools/video-generate-tool.ts index 4798eafba5a..041f21f395e 100644 --- a/src/agents/tools/video-generate-tool.ts +++ b/src/agents/tools/video-generate-tool.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { loadConfig } from "../../config/config.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; diff --git a/src/agents/tools/web-fetch.ts b/src/agents/tools/web-fetch.ts index 6404c79d025..d2bccca27cc 100644 --- a/src/agents/tools/web-fetch.ts +++ b/src/agents/tools/web-fetch.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { SsrFBlockedError, type LookupFn } from "../../infra/net/ssrf.js"; import { logDebug } from "../../logger.js"; diff --git a/src/agents/tools/web-search.ts b/src/agents/tools/web-search.ts index 5f49da37ffa..e80d16eb4c0 100644 --- a/src/agents/tools/web-search.ts +++ b/src/agents/tools/web-search.ts @@ -7,7 +7,7 @@ import { runWebSearch, } from "../../web-search/runtime.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult } from "./common.js"; +import { asToolParameterSchema, asToolParamsRecord, jsonResult } from "./common.js"; import { SEARCH_CACHE } from "./web-search-provider-common.js"; export function createWebSearchTool(options?: { @@ -37,14 +37,14 @@ export function createWebSearchTool(options?: { label: "Web Search", name: "web_search", description: resolved.definition.description, - parameters: resolved.definition.parameters, + parameters: asToolParameterSchema(resolved.definition.parameters), execute: async (_toolCallId, args) => { const result = await runWebSearch({ config: options?.config, sandboxed: options?.sandboxed, runtimeWebSearch: options?.runtimeWebSearch, preferRuntimeProviders, - args, + args: asToolParamsRecord(args), }); return jsonResult({ ...result.result, diff --git a/src/agents/xai.live.test.ts b/src/agents/xai.live.test.ts index 36b470febab..cd2e7dd99c2 100644 --- a/src/agents/xai.live.test.ts +++ b/src/agents/xai.live.test.ts @@ -1,5 +1,5 @@ import { completeSimple, getModel, streamSimple } from "@mariozechner/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { describe, expect, it } from "vitest"; import { createSingleUserPromptMessage, diff --git a/src/channels/plugins/message-action-discovery.ts b/src/channels/plugins/message-action-discovery.ts index 46745ec83d6..d250b06c3e0 100644 --- a/src/channels/plugins/message-action-discovery.ts +++ b/src/channels/plugins/message-action-discovery.ts @@ -1,4 +1,4 @@ -import type { TSchema } from "@sinclair/typebox"; +import type { TSchema } from "typebox"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { defaultRuntime } from "../../runtime.js"; diff --git a/src/channels/plugins/message-actions.test.ts b/src/channels/plugins/message-actions.test.ts index 0e619c696cb..177c2572333 100644 --- a/src/channels/plugins/message-actions.test.ts +++ b/src/channels/plugins/message-actions.test.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { afterEach, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; import { setActivePluginRegistry } from "../../plugins/runtime.js"; diff --git a/src/channels/plugins/types.adapters.ts b/src/channels/plugins/types.adapters.ts index 27e9986f270..0004b065f7d 100644 --- a/src/channels/plugins/types.adapters.ts +++ b/src/channels/plugins/types.adapters.ts @@ -69,9 +69,7 @@ export type ChannelCapabilitiesDiagnostics = { details?: Record; }; -type BivariantCallback unknown> = { - bivarianceHack: T; -}["bivarianceHack"]; +type ChannelAdapterCallback unknown> = T; export type ChannelSetupAdapter = { resolveAccountId?: (params: { @@ -124,13 +122,17 @@ export type ChannelConfigAdapter = { enabled: boolean; }) => OpenClawConfig; deleteAccount?: (params: { cfg: OpenClawConfig; accountId: string }) => OpenClawConfig; - isEnabled?: BivariantCallback<(account: ResolvedAccount, cfg: OpenClawConfig) => boolean>; - disabledReason?: BivariantCallback<(account: ResolvedAccount, cfg: OpenClawConfig) => string>; - isConfigured?: BivariantCallback< + isEnabled?: ChannelAdapterCallback<(account: ResolvedAccount, cfg: OpenClawConfig) => boolean>; + disabledReason?: ChannelAdapterCallback< + (account: ResolvedAccount, cfg: OpenClawConfig) => string + >; + isConfigured?: ChannelAdapterCallback< (account: ResolvedAccount, cfg: OpenClawConfig) => boolean | Promise >; - unconfiguredReason?: BivariantCallback<(account: ResolvedAccount, cfg: OpenClawConfig) => string>; - describeAccount?: BivariantCallback< + unconfiguredReason?: ChannelAdapterCallback< + (account: ResolvedAccount, cfg: OpenClawConfig) => string + >; + describeAccount?: ChannelAdapterCallback< (account: ResolvedAccount, cfg: OpenClawConfig) => ChannelAccountSnapshot >; resolveAllowFrom?: (params: { @@ -172,7 +174,7 @@ export type ChannelGroupAdapter = { export type ChannelStatusAdapter = { defaultRuntime?: ChannelAccountSnapshot; - buildChannelSummary?: BivariantCallback< + buildChannelSummary?: ChannelAdapterCallback< (params: { account: ResolvedAccount; cfg: OpenClawConfig; @@ -180,13 +182,13 @@ export type ChannelStatusAdapter Record | Promise> >; - probeAccount?: BivariantCallback< + probeAccount?: ChannelAdapterCallback< (params: { account: ResolvedAccount; timeoutMs: number; cfg: OpenClawConfig }) => Promise >; - formatCapabilitiesProbe?: BivariantCallback< + formatCapabilitiesProbe?: ChannelAdapterCallback< (params: { probe: Probe }) => ChannelCapabilitiesDisplayLine[] >; - auditAccount?: BivariantCallback< + auditAccount?: ChannelAdapterCallback< (params: { account: ResolvedAccount; timeoutMs: number; @@ -194,7 +196,7 @@ export type ChannelStatusAdapter Promise >; - buildCapabilitiesDiagnostics?: BivariantCallback< + buildCapabilitiesDiagnostics?: ChannelAdapterCallback< (params: { account: ResolvedAccount; timeoutMs: number; @@ -204,7 +206,7 @@ export type ChannelStatusAdapter Promise >; - buildAccountSnapshot?: BivariantCallback< + buildAccountSnapshot?: ChannelAdapterCallback< (params: { account: ResolvedAccount; cfg: OpenClawConfig; @@ -213,7 +215,7 @@ export type ChannelStatusAdapter ChannelAccountSnapshot | Promise >; - logSelfId?: BivariantCallback< + logSelfId?: ChannelAdapterCallback< (params: { account: ResolvedAccount; cfg: OpenClawConfig; @@ -221,7 +223,7 @@ export type ChannelStatusAdapter void >; - resolveAccountState?: BivariantCallback< + resolveAccountState?: ChannelAdapterCallback< (params: { account: ResolvedAccount; cfg: OpenClawConfig; @@ -843,13 +845,13 @@ export type ChannelSecurityAdapter = { cfg: OpenClawConfig; env: NodeJS.ProcessEnv; }) => ChannelDoctorConfigMutation | Promise; - resolveDmPolicy?: BivariantCallback< + resolveDmPolicy?: ChannelAdapterCallback< (ctx: ChannelSecurityContext) => ChannelSecurityDmPolicy | null >; - collectWarnings?: BivariantCallback< + collectWarnings?: ChannelAdapterCallback< (ctx: ChannelSecurityContext) => Promise | string[] >; - collectAuditFindings?: BivariantCallback< + collectAuditFindings?: ChannelAdapterCallback< ( ctx: ChannelSecurityContext & { sourceConfig: OpenClawConfig; diff --git a/src/channels/plugins/types.core.ts b/src/channels/plugins/types.core.ts index 667c07ed9a0..75ad434d8f7 100644 --- a/src/channels/plugins/types.core.ts +++ b/src/channels/plugins/types.core.ts @@ -1,5 +1,5 @@ import type { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core"; -import type { TSchema } from "@sinclair/typebox"; +import type { TSchema } from "typebox"; import type { ReplyPayload } from "../../auto-reply/reply-payload.js"; import type { MsgContext } from "../../auto-reply/templating.js"; import type { MarkdownTableMode } from "../../config/types.base.js"; diff --git a/src/gateway/protocol/schema/agent.ts b/src/gateway/protocol/schema/agent.ts index 7970e1e7a6a..6913e86cc19 100644 --- a/src/gateway/protocol/schema/agent.ts +++ b/src/gateway/protocol/schema/agent.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { AGENT_INTERNAL_EVENT_SOURCES, AGENT_INTERNAL_EVENT_STATUSES, diff --git a/src/gateway/protocol/schema/agents-models-skills.ts b/src/gateway/protocol/schema/agents-models-skills.ts index 16260fffe89..e9c8472aca2 100644 --- a/src/gateway/protocol/schema/agents-models-skills.ts +++ b/src/gateway/protocol/schema/agents-models-skills.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; export const ModelChoiceSchema = Type.Object( diff --git a/src/gateway/protocol/schema/channels.ts b/src/gateway/protocol/schema/channels.ts index 42015321801..5e134af1a27 100644 --- a/src/gateway/protocol/schema/channels.ts +++ b/src/gateway/protocol/schema/channels.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString, SecretInputSchema } from "./primitives.js"; export const TalkModeParamsSchema = Type.Object( diff --git a/src/gateway/protocol/schema/commands.ts b/src/gateway/protocol/schema/commands.ts index 88aafb5f3d3..2c0be369d6b 100644 --- a/src/gateway/protocol/schema/commands.ts +++ b/src/gateway/protocol/schema/commands.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; export const COMMAND_NAME_MAX_LENGTH = 200; diff --git a/src/gateway/protocol/schema/config.ts b/src/gateway/protocol/schema/config.ts index 4854abed666..8c61c1097c7 100644 --- a/src/gateway/protocol/schema/config.ts +++ b/src/gateway/protocol/schema/config.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; const ConfigSchemaLookupPathString = Type.String({ diff --git a/src/gateway/protocol/schema/cron.ts b/src/gateway/protocol/schema/cron.ts index 1e4918b2e2b..eb9a9fb1a0f 100644 --- a/src/gateway/protocol/schema/cron.ts +++ b/src/gateway/protocol/schema/cron.ts @@ -1,4 +1,4 @@ -import { Type, type TSchema } from "@sinclair/typebox"; +import { Type, type TSchema } from "typebox"; import { NonEmptyString } from "./primitives.js"; function cronAgentTurnPayloadSchema(params: { message: TSchema; toolsAllow: TSchema }) { diff --git a/src/gateway/protocol/schema/devices.ts b/src/gateway/protocol/schema/devices.ts index 813390775c7..0fd35ab07b6 100644 --- a/src/gateway/protocol/schema/devices.ts +++ b/src/gateway/protocol/schema/devices.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; export const DevicePairListParamsSchema = Type.Object({}, { additionalProperties: false }); diff --git a/src/gateway/protocol/schema/exec-approvals.ts b/src/gateway/protocol/schema/exec-approvals.ts index cc1e14cf89d..7806c0e92ca 100644 --- a/src/gateway/protocol/schema/exec-approvals.ts +++ b/src/gateway/protocol/schema/exec-approvals.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; export const ExecApprovalsAllowlistEntrySchema = Type.Object( diff --git a/src/gateway/protocol/schema/frames.ts b/src/gateway/protocol/schema/frames.ts index ff041fe7024..220f6bdaf98 100644 --- a/src/gateway/protocol/schema/frames.ts +++ b/src/gateway/protocol/schema/frames.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { GatewayClientIdSchema, GatewayClientModeSchema, NonEmptyString } from "./primitives.js"; import { SnapshotSchema, StateVersionSchema } from "./snapshot.js"; diff --git a/src/gateway/protocol/schema/logs-chat.ts b/src/gateway/protocol/schema/logs-chat.ts index ff0ec481c5c..642517baeca 100644 --- a/src/gateway/protocol/schema/logs-chat.ts +++ b/src/gateway/protocol/schema/logs-chat.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { ChatSendSessionKeyString, InputProvenanceSchema, NonEmptyString } from "./primitives.js"; export const LogsTailParamsSchema = Type.Object( diff --git a/src/gateway/protocol/schema/nodes.ts b/src/gateway/protocol/schema/nodes.ts index 413bd42fa42..28fb6a80770 100644 --- a/src/gateway/protocol/schema/nodes.ts +++ b/src/gateway/protocol/schema/nodes.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; const NodePendingWorkTypeSchema = Type.String({ diff --git a/src/gateway/protocol/schema/plugin-approvals.ts b/src/gateway/protocol/schema/plugin-approvals.ts index 09215c5640c..4aaa8e12a04 100644 --- a/src/gateway/protocol/schema/plugin-approvals.ts +++ b/src/gateway/protocol/schema/plugin-approvals.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { MAX_PLUGIN_APPROVAL_TIMEOUT_MS, PLUGIN_APPROVAL_DESCRIPTION_MAX_LENGTH, diff --git a/src/gateway/protocol/schema/primitives.ts b/src/gateway/protocol/schema/primitives.ts index 2983c834f35..47e5a0dabd7 100644 --- a/src/gateway/protocol/schema/primitives.ts +++ b/src/gateway/protocol/schema/primitives.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { ENV_SECRET_REF_ID_RE } from "../../../config/types.secrets.js"; import { EXEC_SECRET_REF_ID_JSON_SCHEMA_PATTERN, @@ -30,13 +30,9 @@ export const InputProvenanceSchema = Type.Object( { additionalProperties: false }, ); -export const GatewayClientIdSchema = Type.Union( - Object.values(GATEWAY_CLIENT_IDS).map((value) => Type.Literal(value)), -); +export const GatewayClientIdSchema = Type.Enum(GATEWAY_CLIENT_IDS); -export const GatewayClientModeSchema = Type.Union( - Object.values(GATEWAY_CLIENT_MODES).map((value) => Type.Literal(value)), -); +export const GatewayClientModeSchema = Type.Enum(GATEWAY_CLIENT_MODES); export const SecretRefSourceSchema = Type.Union([ Type.Literal("env"), diff --git a/src/gateway/protocol/schema/protocol-schemas.ts b/src/gateway/protocol/schema/protocol-schemas.ts index b215d1e9b2b..0f9c443740e 100644 --- a/src/gateway/protocol/schema/protocol-schemas.ts +++ b/src/gateway/protocol/schema/protocol-schemas.ts @@ -1,4 +1,4 @@ -import type { TSchema } from "@sinclair/typebox"; +import type { TSchema } from "typebox"; import { AgentEventSchema, AgentIdentityParamsSchema, diff --git a/src/gateway/protocol/schema/push.ts b/src/gateway/protocol/schema/push.ts index eb8b6212959..21b87876ae3 100644 --- a/src/gateway/protocol/schema/push.ts +++ b/src/gateway/protocol/schema/push.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; const ApnsEnvironmentSchema = Type.String({ enum: ["sandbox", "production"] }); diff --git a/src/gateway/protocol/schema/secrets.ts b/src/gateway/protocol/schema/secrets.ts index 8f77d952d41..9adfef7a585 100644 --- a/src/gateway/protocol/schema/secrets.ts +++ b/src/gateway/protocol/schema/secrets.ts @@ -1,4 +1,4 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { Type, type Static } from "typebox"; import { NonEmptyString } from "./primitives.js"; export const SecretsReloadParamsSchema = Type.Object({}, { additionalProperties: false }); diff --git a/src/gateway/protocol/schema/sessions.ts b/src/gateway/protocol/schema/sessions.ts index e11194d8d74..d8fb83f1e2c 100644 --- a/src/gateway/protocol/schema/sessions.ts +++ b/src/gateway/protocol/schema/sessions.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString, SessionLabelString } from "./primitives.js"; export const SessionCompactionCheckpointReasonSchema = Type.Union([ diff --git a/src/gateway/protocol/schema/snapshot.ts b/src/gateway/protocol/schema/snapshot.ts index 98e31826045..824246df6f1 100644 --- a/src/gateway/protocol/schema/snapshot.ts +++ b/src/gateway/protocol/schema/snapshot.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; export const PresenceEntrySchema = Type.Object( diff --git a/src/gateway/protocol/schema/types.ts b/src/gateway/protocol/schema/types.ts index ffb1c93b064..9a1ef1ddfd1 100644 --- a/src/gateway/protocol/schema/types.ts +++ b/src/gateway/protocol/schema/types.ts @@ -1,4 +1,4 @@ -import type { Static } from "@sinclair/typebox"; +import type { Static } from "typebox"; import { ProtocolSchemas } from "./protocol-schemas.js"; type ProtocolSchemaName = keyof typeof ProtocolSchemas; diff --git a/src/gateway/protocol/schema/wizard.ts b/src/gateway/protocol/schema/wizard.ts index d088f10f4fc..7d4d8669840 100644 --- a/src/gateway/protocol/schema/wizard.ts +++ b/src/gateway/protocol/schema/wizard.ts @@ -1,4 +1,4 @@ -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { NonEmptyString } from "./primitives.js"; const WizardRunStatusSchema = Type.Union([ diff --git a/src/infra/outbound/message-action-runner.media.test.ts b/src/infra/outbound/message-action-runner.media.test.ts index fd27ab3421c..2fdd2c3411d 100644 --- a/src/infra/outbound/message-action-runner.media.test.ts +++ b/src/infra/outbound/message-action-runner.media.test.ts @@ -1,7 +1,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { jsonResult } from "../../agents/tools/common.js"; import type { ChannelPlugin } from "../../channels/plugins/types.js"; diff --git a/src/memory-host-sdk/runtime-core.ts b/src/memory-host-sdk/runtime-core.ts index d57fe65c17d..6a25fb11b80 100644 --- a/src/memory-host-sdk/runtime-core.ts +++ b/src/memory-host-sdk/runtime-core.ts @@ -5,7 +5,12 @@ export { resolveCronStyleNow } from "../agents/current-time.js"; export { DEFAULT_PI_COMPACTION_RESERVE_TOKENS_FLOOR } from "../agents/pi-settings.js"; export { resolveDefaultAgentId, resolveSessionAgentId } from "../agents/agent-scope.js"; export { resolveMemorySearchConfig } from "../agents/memory-search.js"; -export { jsonResult, readNumberParam, readStringParam } from "../agents/tools/common.js"; +export { + asToolParamsRecord, + jsonResult, + readNumberParam, + readStringParam, +} from "../agents/tools/common.js"; export { SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js"; export { parseNonNegativeByteSize } from "../config/byte-size.js"; export { loadConfig } from "../config/config.js"; diff --git a/src/plugin-sdk/channel-actions.ts b/src/plugin-sdk/channel-actions.ts index 74e8f8a564a..c58a78c4cc5 100644 --- a/src/plugin-sdk/channel-actions.ts +++ b/src/plugin-sdk/channel-actions.ts @@ -1,5 +1,5 @@ -import { Type } from "@sinclair/typebox"; -import type { TSchema } from "@sinclair/typebox"; +import { Type } from "typebox"; +import type { TSchema } from "typebox"; import { stringEnum as createStringEnum } from "../agents/schema/typebox.js"; export { diff --git a/src/plugin-sdk/provider-tools.ts b/src/plugin-sdk/provider-tools.ts index 05b38ef758a..e66436e78a2 100644 --- a/src/plugin-sdk/provider-tools.ts +++ b/src/plugin-sdk/provider-tools.ts @@ -2,6 +2,7 @@ import { cleanSchemaForGemini, GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, } from "../agents/schema/clean-for-gemini.js"; +import { asToolParameterSchema } from "../agents/tools/common.js"; import type { ModelCompatConfig } from "../config/types.models.js"; import { applyModelCompatPatch } from "../plugins/provider-model-compat.js"; import type { @@ -138,7 +139,9 @@ export function normalizeGeminiToolSchemas( } return { ...tool, - parameters: cleanSchemaForGemini(tool.parameters as Record), + parameters: asToolParameterSchema( + cleanSchemaForGemini(tool.parameters as Record), + ), }; }); } @@ -169,7 +172,7 @@ export function normalizeOpenAIToolSchemas( if (tool.parameters == null) { return { ...tool, - parameters: normalizeOpenAIStrictCompatSchema({}), + parameters: asToolParameterSchema(normalizeOpenAIStrictCompatSchema({})), }; } if (typeof tool.parameters !== "object") { @@ -177,7 +180,7 @@ export function normalizeOpenAIToolSchemas( } return { ...tool, - parameters: normalizeOpenAIStrictCompatSchema(tool.parameters), + parameters: asToolParameterSchema(normalizeOpenAIStrictCompatSchema(tool.parameters)), }; }); } diff --git a/src/plugins/contracts/package-manifest.contract.test.ts b/src/plugins/contracts/package-manifest.contract.test.ts index 459d6b2be97..406095b8982 100644 --- a/src/plugins/contracts/package-manifest.contract.test.ts +++ b/src/plugins/contracts/package-manifest.contract.test.ts @@ -18,7 +18,7 @@ const packageManifestContractTests: PackageManifestContractParams[] = [ { pluginId: "feishu", pluginLocalRuntimeDeps: ["@larksuiteoapi/node-sdk"], - mirroredRootRuntimeDeps: ["@sinclair/typebox", "qrcode-terminal"], + mirroredRootRuntimeDeps: ["typebox", "qrcode-terminal"], minHostVersionBaseline: "2026.3.22", }, { pluginId: "google", pluginLocalRuntimeDeps: ["@google/genai"] }, @@ -44,7 +44,7 @@ const packageManifestContractTests: PackageManifestContractParams[] = [ { pluginId: "diffs", pluginLocalRuntimeDeps: ["@pierre/diffs", "@pierre/theme", "playwright-core"], - mirroredRootRuntimeDeps: ["@sinclair/typebox"], + mirroredRootRuntimeDeps: ["typebox"], }, { pluginId: "matrix", @@ -62,7 +62,7 @@ const packageManifestContractTests: PackageManifestContractParams[] = [ { pluginId: "memory-lancedb", pluginLocalRuntimeDeps: ["@lancedb/lancedb"], - mirroredRootRuntimeDeps: ["@sinclair/typebox", "openai"], + mirroredRootRuntimeDeps: ["typebox", "openai"], minHostVersionBaseline: "2026.3.22", }, { @@ -74,7 +74,7 @@ const packageManifestContractTests: PackageManifestContractParams[] = [ "jsonwebtoken", "jwks-rsa", ], - mirroredRootRuntimeDeps: ["@sinclair/typebox", "express"], + mirroredRootRuntimeDeps: ["typebox", "express"], minHostVersionBaseline: "2026.3.22", }, { pluginId: "nextcloud-talk", minHostVersionBaseline: "2026.3.22" }, diff --git a/src/plugins/types.ts b/src/plugins/types.ts index b53802c42e3..30611b4bf55 100644 --- a/src/plugins/types.ts +++ b/src/plugins/types.ts @@ -1761,10 +1761,6 @@ export type PluginInteractiveHandlerResult = { handled?: boolean; } | void; -type BivariantInteractiveHandler = { - bivarianceHack: (ctx: TContext) => Promise | TResult; -}["bivarianceHack"]; - export type PluginInteractiveRegistration< TContext = unknown, TChannel extends string = string, @@ -1772,7 +1768,7 @@ export type PluginInteractiveRegistration< > = { channel: TChannel; namespace: string; - handler: BivariantInteractiveHandler; + handler: (ctx: TContext) => Promise | TResult; }; export type PluginInteractiveHandlerRegistration = PluginInteractiveRegistration; diff --git a/test/scripts/lint-suppressions.test.ts b/test/scripts/lint-suppressions.test.ts index ee3be00e314..ef4575313f3 100644 --- a/test/scripts/lint-suppressions.test.ts +++ b/test/scripts/lint-suppressions.test.ts @@ -94,7 +94,6 @@ describe("production lint suppressions", () => { "src/agents/skills-clawhub.ts|no-control-regex|1", "src/agents/subagent-attachments.ts|no-control-regex|1", "src/agents/subagent-spawn.ts|no-control-regex|1", - "src/agents/tools/common.ts|typescript/no-explicit-any|2", "src/channels/plugins/channel-runtime-surface.types.ts|typescript/no-unnecessary-type-parameters|1", "src/channels/plugins/contracts/test-helpers.ts|typescript/no-unnecessary-type-parameters|1", "src/channels/plugins/types.plugin.ts|typescript/no-explicit-any|1", @@ -136,14 +135,6 @@ describe("production lint suppressions", () => { ); expect(anySuppressions).toEqual([ - { - file: "src/agents/tools/common.ts", - rule: "typescript/no-explicit-any", - }, - { - file: "src/agents/tools/common.ts", - rule: "typescript/no-explicit-any", - }, { file: "src/channels/plugins/types.plugin.ts", rule: "typescript/no-explicit-any",