build: migrate schema deps to typebox

This commit is contained in:
Peter Steinberger
2026-04-23 04:59:26 +01:00
parent dd1ba0296c
commit b2472d6560
143 changed files with 344 additions and 347 deletions

View File

@@ -1,3 +1,3 @@
{
"specs": ["@sinclair/typebox@0.34.49"]
"specs": ["typebox@1.1.28"]
}

View File

@@ -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:*"

View File

@@ -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;

View File

@@ -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"
},

View File

@@ -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",

View File

@@ -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:*"

View File

@@ -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";

View File

@@ -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"
},

View File

@@ -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(),

View File

@@ -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:*",

View File

@@ -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<unknown>;
}) => {
api.registerTool(

View File

@@ -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;

View File

@@ -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" }),

View File

@@ -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";

View File

@@ -1,4 +1,4 @@
import { Type, type Static } from "@sinclair/typebox";
import { Type, type Static } from "typebox";
const FileType = Type.Union([
Type.Literal("doc"),

View File

@@ -1,4 +1,4 @@
import { Type, type Static } from "@sinclair/typebox";
import { Type, type Static } from "typebox";
const TokenType = Type.Union([
Type.Literal("doc"),

View File

@@ -1,4 +1,4 @@
import { Type, type Static } from "@sinclair/typebox";
import { Type, type Static } from "typebox";
export const FeishuWikiSchema = Type.Union([
Type.Object({

View File

@@ -1,3 +1,3 @@
{
"specs": ["@sinclair/typebox@0.34.49"]
"specs": ["typebox@1.1.28"]
}

View File

@@ -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:*"

View File

@@ -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<const T extends readonly string[]>(

View File

@@ -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(

View File

@@ -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:*"

View File

@@ -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,

View File

@@ -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,

View File

@@ -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:*"

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import type { OpenClawPluginApi } from "../runtime-api.js";
import {
createEmbeddedLobsterRunner,

View File

@@ -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:*",

View File

@@ -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";

View File

@@ -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:*",

View File

@@ -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<

View File

@@ -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"

View File

@@ -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,

View File

@@ -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:*"

View File

@@ -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": {

View File

@@ -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 {

View File

@@ -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:*",

View File

@@ -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";

View File

@@ -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,

View File

@@ -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:*"

View File

@@ -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<string, unknown>,
execute: async (args) =>
await runOllamaWebSearch({
config: ctx.config,

View File

@@ -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:*",

View File

@@ -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,

View File

@@ -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:*"

View File

@@ -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 {

View File

@@ -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:*"

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
export function createSlackMessageToolBlocksSchema() {
return Type.Array(

View File

@@ -1,3 +1,3 @@
{
"specs": ["@sinclair/typebox@0.34.49"]
"specs": ["typebox@1.1.28"]
}

View File

@@ -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:*"

View File

@@ -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";

View File

@@ -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";

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
export function optionalStringEnum<const T extends readonly string[]>(
values: T,

View File

@@ -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": {

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
export function createTelegramPollExtraToolSchemas() {
return {

View File

@@ -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<string, unknown> {
return params && typeof params === "object" && !Array.isArray(params)
? (params as Record<string, unknown>)
: {};
}
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");

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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,

View File

@@ -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": {

View File

@@ -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 {

View File

@@ -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": {

View File

@@ -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 {

View File

@@ -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",

161
pnpm-lock.yaml generated
View File

@@ -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

View File

@@ -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,

View File

@@ -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" }),

View File

@@ -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";

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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";

View File

@@ -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"> {

View File

@@ -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({

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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";

View File

@@ -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";

View File

@@ -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(() => ({

View File

@@ -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 {

View File

@@ -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";

View File

@@ -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(),
};
}

View File

@@ -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)),
});
}

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
type StringEnumOptions<T extends readonly string[]> = {
description?: string;

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import {
CHANNEL_TARGET_DESCRIPTION,
CHANNEL_TARGETS_DESCRIPTION,

View File

@@ -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 {

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import { loadConfig } from "../../config/config.js";
import {
DEFAULT_AGENT_ID,

View File

@@ -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";

View File

@@ -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<TParameters extends TSchema, TResult> = 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<AgentToolResult<unknown>>;
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<unknown>,
): Promise<AgentToolResult<unknown>>;
};
export type AnyAgentTool = Omit<AgentTool<TSchema, unknown>, "execute"> &
ErasedAgentToolExecute & {
ownerOnly?: boolean;
displaySummary?: string;
};
export function asToolParameterSchema(schema: unknown): TSchema {
return schema as TSchema;
}
export function asToolParamsRecord(params: unknown): Record<string, unknown> {
return params && typeof params === "object" && !Array.isArray(params)
? (params as Record<string, unknown>)
: {};
}
export type StringParamOptions = {
required?: boolean;
trim?: boolean;

View File

@@ -25,11 +25,13 @@ function propertyAt(
}
describe("CronToolSchema", () => {
const schemaRecord = CronToolSchema as unknown as Record<string, unknown>;
// 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<string, unknown>, "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<string, unknown>, "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<string, unknown>, "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<string, unknown>,
"job.schedule.staggerMs",
);
const patchStagger = propertyAt(
CronToolSchema as Record<string, unknown>,
"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<string, unknown>, "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<string, unknown>, "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<string, unknown>, "job.payload")).toContain("fallbacks");
expect(keysAt(schemaRecord, "job.payload")).toContain("fallbacks");
});
it("patch.payload exposes agentTurn fallback overrides", () => {
expect(keysAt(CronToolSchema as Record<string, unknown>, "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<string, unknown>, "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<string, unknown>).properties as
const root = schemaRecord.properties as
| Record<string, { properties?: Record<string, unknown>; 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<string, unknown>).properties as
const root = schemaRecord.properties as
| Record<string, { properties?: Record<string, unknown> }>
| undefined;
const jobProps = root?.job?.properties as Record<string, { type?: unknown }> | 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<string, unknown>).properties as
const root = schemaRecord.properties as
| Record<string, { properties?: Record<string, unknown> }>
| undefined;
const patchProps = root?.patch?.properties as

View File

@@ -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";

View File

@@ -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";

View File

@@ -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";

View File

@@ -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,

View File

@@ -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";

View File

@@ -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,

View File

@@ -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";

View File

@@ -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";

View File

@@ -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";

View File

@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import type {
ElevatedLevel,
ReasoningLevel,

Some files were not shown because too many files have changed in this diff Show More