From 9a8c750a104eb1eb35d8caa053004dbf0368c520 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 09:05:36 +0100 Subject: [PATCH 01/80] setup sync with openclaw --- .agent/workflows/update_clawdbot.md | 41 ++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/.agent/workflows/update_clawdbot.md b/.agent/workflows/update_clawdbot.md index 04a079aab4..b6526583b8 100644 --- a/.agent/workflows/update_clawdbot.md +++ b/.agent/workflows/update_clawdbot.md @@ -1,19 +1,25 @@ --- -description: Update Clawdbot from upstream when branch has diverged (ahead/behind) +description: Mirror upstream into upstream-main, then optionally rebase/merge main and rebuild --- # Clawdbot Upstream Sync Workflow Use this workflow when your fork has diverged from upstream (e.g., "18 commits ahead, 29 commits behind"). +This flow mirrors upstream to `upstream-main` first, then (optionally) updates your `main` branch. ## Quick Reference ```bash -# Check divergence status -git fetch upstream && git rev-list --left-right --count main...upstream/main +# Mirror upstream/main to upstream-main (no working tree changes) +git fetch upstream main +git update-ref refs/heads/upstream-main upstream/main +git push origin +upstream-main:upstream-main + +# Check divergence status (after mirror) +git rev-list --left-right --count main...upstream-main # Full sync (rebase preferred) -git fetch upstream && git rebase upstream/main && pnpm install && pnpm build && ./scripts/restart-mac.sh +git rebase upstream-main && pnpm install && pnpm build && ./scripts/restart-mac.sh # Check for Swift 6.2 issues after sync grep -r "FileManager\.default\|Thread\.isMainThread" src/ apps/ --include="*.swift" @@ -21,11 +27,28 @@ grep -r "FileManager\.default\|Thread\.isMainThread" src/ apps/ --include="*.swi --- +## Step 0: Mirror Upstream to `upstream-main` + +This keeps `upstream-main` as a clean mirror of `upstream/main` without touching `main`. + +```bash +git fetch upstream main + +# If the branch exists, update it directly: +git update-ref refs/heads/upstream-main upstream/main + +# If the branch does not exist yet, create it: +git branch --track upstream-main upstream/main + +git push origin +upstream-main:upstream-main +``` + +--- + ## Step 1: Assess Divergence ```bash -git fetch upstream -git log --oneline --left-right main...upstream/main | head -20 +git log --oneline --left-right main...upstream-main | head -20 ``` This shows: @@ -48,8 +71,8 @@ Replays your commits on top of upstream. Results in linear history. # Ensure working tree is clean git status -# Rebase onto upstream -git rebase upstream/main +# Rebase onto mirrored upstream +git rebase upstream-main ``` ### Handling Rebase Conflicts @@ -86,7 +109,7 @@ git rebase --abort Preserves all history with a merge commit. ```bash -git merge upstream/main --no-edit +git merge upstream-main --no-edit ``` Resolve conflicts same as rebase, then: From c626b92bcd5f9a454c7fc5e8ee44105aa67eaa6f Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 12:11:28 +0100 Subject: [PATCH 02/80] Implement OpenClaw text chat proxy --- src/gateway/pazi-context-http.ts | 77 +++++++++++++++++++++ src/gateway/pazi-proxy.ts | 113 +++++++++++++++++++++++++++++++ src/gateway/server-http.ts | 4 ++ src/gateway/server.impl.ts | 6 ++ 4 files changed, 200 insertions(+) create mode 100644 src/gateway/pazi-context-http.ts create mode 100644 src/gateway/pazi-proxy.ts diff --git a/src/gateway/pazi-context-http.ts b/src/gateway/pazi-context-http.ts new file mode 100644 index 0000000000..2a079fc814 --- /dev/null +++ b/src/gateway/pazi-context-http.ts @@ -0,0 +1,77 @@ +import type { IncomingMessage, ServerResponse } from "node:http"; +import { createSubsystemLogger } from "../logging/subsystem.js"; +import { setProxyContext } from "./pazi-proxy.js"; + +type PaziContextRequest = { + userId?: string; + proxyToken?: string; +}; + +type PaziContextOpts = { + gatewayToken?: string; +}; + +const log = createSubsystemLogger("gateway/pazi-context"); + +function writeJson(res: ServerResponse, status: number, body: unknown) { + res.writeHead(status, { "Content-Type": "application/json; charset=utf-8" }); + res.end(JSON.stringify(body)); +} + +async function readJson(req: IncomingMessage): Promise { + const chunks: Buffer[] = []; + for await (const chunk of req) { + if (typeof chunk === "string") { + chunks.push(Buffer.from(chunk)); + } else { + chunks.push(chunk); + } + } + try { + const body = JSON.parse(Buffer.concat(chunks).toString()); + if (body && typeof body === "object") { + return body as PaziContextRequest; + } + } catch { + return null; + } + return null; +} + +export async function handlePaziContextRequest( + req: IncomingMessage, + res: ServerResponse, + opts: PaziContextOpts, +): Promise { + if (req.method !== "POST" || req.url !== "/pazi/context") { + return false; + } + + if (!opts.gatewayToken) { + log.warn("pazi context request rejected: gateway token missing"); + writeJson(res, 500, { error: "gateway_token_missing" }); + return true; + } + + const authHeader = req.headers.authorization; + if (authHeader !== `Bearer ${opts.gatewayToken}`) { + writeJson(res, 401, { error: "unauthorized" }); + return true; + } + + const body = await readJson(req); + if (!body) { + writeJson(res, 400, { error: "invalid JSON" }); + return true; + } + + const { userId, proxyToken } = body; + if (!userId || !proxyToken) { + writeJson(res, 400, { error: "missing userId or proxyToken" }); + return true; + } + + setProxyContext({ userId, proxyToken }); + writeJson(res, 200, { ok: true }); + return true; +} diff --git a/src/gateway/pazi-proxy.ts b/src/gateway/pazi-proxy.ts new file mode 100644 index 0000000000..80eac93210 --- /dev/null +++ b/src/gateway/pazi-proxy.ts @@ -0,0 +1,113 @@ +import http from "node:http"; +import https from "node:https"; +import type { IncomingHttpHeaders } from "node:http"; +import { createSubsystemLogger } from "../logging/subsystem.js"; + +type ProxyContext = { userId: string; proxyToken: string }; + +type HttpRequest = typeof http.request; + +type ProxyError = { error: string; message?: string }; + +const log = createSubsystemLogger("gateway/pazi-proxy"); + +let currentContext: ProxyContext | null = null; + +export function setProxyContext(ctx: ProxyContext): void { + currentContext = ctx; +} + +export function clearProxyContext(): void { + currentContext = null; +} + +function requestForUrl(url: URL): HttpRequest { + return url.protocol === "https:" ? https.request : http.request; +} + +function pickAnthropicHeaders(incoming: IncomingHttpHeaders): Record { + const forward: Record = {}; + const passthrough = ["anthropic-version", "anthropic-beta", "accept", "content-type"] as const; + for (const key of passthrough) { + const value = incoming[key]; + if (typeof value === "string") { + forward[key] = value; + } + } + return forward; +} + +function writeJson(res: http.ServerResponse, status: number, body: ProxyError) { + res.writeHead(status, { "Content-Type": "application/json; charset=utf-8" }); + res.end(JSON.stringify(body)); +} + +export async function startPaziProxy(port: number): Promise { + const paziApiUrl = process.env.PAZI_API_URL; + if (!paziApiUrl) { + log.info("pazi proxy disabled (PAZI_API_URL not set)"); + return; + } + + const server = http.createServer(async (req, res) => { + if (req.method !== "POST" || !req.url?.startsWith("/v1/messages")) { + res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" }); + res.end("Not Found"); + return; + } + + const context = currentContext; + if (!context) { + writeJson(res, 503, { error: "no billing context set" }); + return; + } + + const chunks: Buffer[] = []; + for await (const chunk of req) { + if (typeof chunk === "string") { + chunks.push(Buffer.from(chunk)); + } else { + chunks.push(chunk); + } + } + const body = Buffer.concat(chunks); + + const target = new URL("/anthropic/v1/messages", paziApiUrl); + const doRequest = requestForUrl(target); + + const proxyReq = doRequest( + target, + { + method: "POST", + headers: { + ...pickAnthropicHeaders(req.headers), + "X-Proxy-Token": context.proxyToken, + "X-User-Id": context.userId, + }, + }, + (proxyRes) => { + res.writeHead(proxyRes.statusCode || 500, proxyRes.headers); + proxyRes.pipe(res); + }, + ); + + proxyReq.on("error", (err: Error) => { + log.warn(`pazi proxy error: ${String(err)}`); + if (!res.headersSent) { + writeJson(res, 502, { error: "proxy_error", message: err.message }); + } + }); + + proxyReq.write(body); + proxyReq.end(); + }); + + server.on("clientError", (err, socket) => { + log.warn(`pazi proxy client error: ${String(err)}`); + socket.end("HTTP/1.1 400 Bad Request\r\n\r\n"); + }); + + server.listen(port, "127.0.0.1", () => { + log.info(`pazi proxy listening on 127.0.0.1:${port}`); + }); +} diff --git a/src/gateway/server-http.ts b/src/gateway/server-http.ts index 41d04d5d3a..199cec804a 100644 --- a/src/gateway/server-http.ts +++ b/src/gateway/server-http.ts @@ -58,6 +58,7 @@ import { sendGatewayAuthFailure, setDefaultSecurityHeaders } from "./http-common import { getBearerToken } from "./http-utils.js"; import { handleOpenAiHttpRequest } from "./openai-http.js"; import { handleOpenResponsesHttpRequest } from "./openresponses-http.js"; +import { handlePaziContextRequest } from "./pazi-context-http.js"; import { GATEWAY_CLIENT_MODES, normalizeGatewayClientMode } from "./protocol/client-info.js"; import type { GatewayWsClient } from "./server/ws-types.js"; import { handleToolsInvokeHttpRequest } from "./tools-invoke-http.js"; @@ -476,6 +477,9 @@ export function createGatewayHttpServer(opts: { if (await handleHooksRequest(req, res)) { return; } + if (await handlePaziContextRequest(req, res, { gatewayToken: resolvedAuth.token })) { + return; + } if ( await handleToolsInvokeHttpRequest(req, res, { auth: resolvedAuth, diff --git a/src/gateway/server.impl.ts b/src/gateway/server.impl.ts index 3dbd86e1e5..829e8ab3d1 100644 --- a/src/gateway/server.impl.ts +++ b/src/gateway/server.impl.ts @@ -78,6 +78,7 @@ import { createGatewayRuntimeState } from "./server-runtime-state.js"; import { resolveSessionKeyForRun } from "./server-session-key.js"; import { logGatewayStartup } from "./server-startup-log.js"; import { startGatewaySidecars } from "./server-startup.js"; +import { startPaziProxy } from "./pazi-proxy.js"; import { startGatewayTailscaleExposure } from "./server-tailscale.js"; import { createWizardSessionTracker } from "./server-wizard-sessions.js"; import { attachGatewayWsHandlers } from "./server-ws-runtime.js"; @@ -268,6 +269,11 @@ export async function startGatewayServer( ); } } + if (!minimalTestGateway) { + const proxyPortRaw = process.env.PAZI_PROXY_PORT; + const proxyPort = proxyPortRaw ? Number.parseInt(proxyPortRaw, 10) : 8765; + await startPaziProxy(Number.isFinite(proxyPort) ? proxyPort : 8765); + } const diagnosticsEnabled = isDiagnosticsEnabled(cfgAtStart); if (diagnosticsEnabled) { startDiagnosticHeartbeat(); From 9dfbea85852f15a7d41eb91216b11e10b280ee69 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 15:06:21 +0100 Subject: [PATCH 03/80] Plugins: add pazi proxy extension --- .github/labeler.yml | 4 + extensions/pazi/index.ts | 76 ++++++++++++++++++ extensions/pazi/openclaw.plugin.json | 11 +++ extensions/pazi/package.json | 15 ++++ extensions/pazi/src/config.ts | 61 +++++++++++++++ extensions/pazi/src/context.ts | 18 +++++ extensions/pazi/src/pazi-context.ts | 75 ++++++++++++++++++ .../pazi/src}/pazi-proxy.ts | 62 +++++++++------ src/gateway/pazi-context-http.ts | 77 ------------------- src/gateway/server-http.ts | 4 - src/gateway/server.impl.ts | 6 -- 11 files changed, 298 insertions(+), 111 deletions(-) create mode 100644 extensions/pazi/index.ts create mode 100644 extensions/pazi/openclaw.plugin.json create mode 100644 extensions/pazi/package.json create mode 100644 extensions/pazi/src/config.ts create mode 100644 extensions/pazi/src/context.ts create mode 100644 extensions/pazi/src/pazi-context.ts rename {src/gateway => extensions/pazi/src}/pazi-proxy.ts (65%) delete mode 100644 src/gateway/pazi-context-http.ts diff --git a/.github/labeler.yml b/.github/labeler.yml index 78366fb209..1d27136642 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -232,6 +232,10 @@ - changed-files: - any-glob-to-any-file: - "extensions/open-prose/**" +"extensions: pazi": + - changed-files: + - any-glob-to-any-file: + - "extensions/pazi/**" "extensions: qwen-portal-auth": - changed-files: - any-glob-to-any-file: diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts new file mode 100644 index 0000000000..a46202d116 --- /dev/null +++ b/extensions/pazi/index.ts @@ -0,0 +1,76 @@ +import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import type { Server as HttpServer } from "node:http"; +import { resolvePaziBillingConfig } from "./src/config.js"; +import { createPaziContextHandler } from "./src/pazi-context.js"; +import { startPaziProxy } from "./src/pazi-proxy.js"; + +function normalizePluginConfig( + value: OpenClawPluginApi["pluginConfig"], +): Record | null { + if (!value || typeof value !== "object" || Array.isArray(value)) { + return null; + } + return value as Record; +} + +async function stopServer(server: HttpServer, logger: OpenClawPluginApi["logger"]) { + await new Promise((resolve) => { + server.close((err) => { + if (err) { + logger.warn(`pazi proxy shutdown failed: ${String(err)}`); + } + resolve(); + }); + }); +} + +export default { + id: "pazi", + name: "Pazi Proxy", + description: "Routes Anthropic calls through the Pazi API.", + register(api: OpenClawPluginApi) { + const pluginConfig = normalizePluginConfig(api.pluginConfig); + const contextHandler = createPaziContextHandler({ + configToken: api.config.gateway?.auth?.token, + env: process.env, + logger: api.logger, + }); + + api.registerHttpRoute({ + path: "/pazi/context", + handler: async (req, res) => { + if (req.method !== "POST") { + res.statusCode = 404; + res.setHeader("Content-Type", "text/plain; charset=utf-8"); + res.end("Not Found"); + return; + } + await contextHandler(req, res); + }, + }); + + let proxyServer: HttpServer | null = null; + + api.registerService({ + id: "pazi-proxy", + start: async () => { + const resolved = resolvePaziBillingConfig({ + pluginConfig, + env: process.env, + }); + proxyServer = await startPaziProxy({ + apiUrl: resolved.apiUrl, + port: resolved.proxyPort, + logger: api.logger, + }); + }, + stop: async () => { + if (!proxyServer) { + return; + } + await stopServer(proxyServer, api.logger); + proxyServer = null; + }, + }); + }, +}; diff --git a/extensions/pazi/openclaw.plugin.json b/extensions/pazi/openclaw.plugin.json new file mode 100644 index 0000000000..32a927b1b3 --- /dev/null +++ b/extensions/pazi/openclaw.plugin.json @@ -0,0 +1,11 @@ +{ + "id": "pazi", + "configSchema": { + "type": "object", + "additionalProperties": false, + "properties": { + "apiUrl": { "type": "string" }, + "proxyPort": { "type": "number" } + } + } +} diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json new file mode 100644 index 0000000000..e8937d4aa7 --- /dev/null +++ b/extensions/pazi/package.json @@ -0,0 +1,15 @@ +{ + "name": "@openclaw/pazi", + "version": "2026.2.25", + "private": true, + "description": "OpenClaw Pazi proxy", + "type": "module", + "peerDependencies": { + "openclaw": ">=2026.1.26" + }, + "openclaw": { + "extensions": [ + "./index.ts" + ] + } +} diff --git a/extensions/pazi/src/config.ts b/extensions/pazi/src/config.ts new file mode 100644 index 0000000000..5d4ce46127 --- /dev/null +++ b/extensions/pazi/src/config.ts @@ -0,0 +1,61 @@ +export type PaziBillingConfig = { + apiUrl?: string; + proxyPort: number; +}; + +const DEFAULT_PROXY_PORT = 8765; + +function normalizeString(value: unknown): string | undefined { + if (typeof value !== "string") { + return undefined; + } + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : undefined; +} + +function normalizePort(value: unknown): number | undefined { + if (typeof value === "number" && Number.isFinite(value) && value > 0) { + return Math.floor(value); + } + if (typeof value === "string" && value.trim().length > 0) { + const parsed = Number.parseInt(value, 10); + if (Number.isFinite(parsed) && parsed > 0) { + return parsed; + } + } + return undefined; +} + +export function resolvePaziBillingConfig(params: { + pluginConfig?: Record | null; + env?: NodeJS.ProcessEnv; +}): PaziBillingConfig { + const env = params.env ?? process.env; + const raw = params.pluginConfig ?? {}; + + const apiUrl = + normalizeString(raw.apiUrl) ?? + normalizeString(env.PAZI_API_URL); + + const proxyPort = + normalizePort(raw.proxyPort) ?? + normalizePort(env.PAZI_PROXY_PORT) ?? + DEFAULT_PROXY_PORT; + + return { + apiUrl, + proxyPort, + }; +} + +export function resolveGatewayToken(params: { + configToken?: string; + env?: NodeJS.ProcessEnv; +}): string | undefined { + const configToken = normalizeString(params.configToken); + if (configToken) { + return configToken; + } + const env = params.env ?? process.env; + return normalizeString(env.OPENCLAW_GATEWAY_TOKEN); +} diff --git a/extensions/pazi/src/context.ts b/extensions/pazi/src/context.ts new file mode 100644 index 0000000000..b46b4c6f65 --- /dev/null +++ b/extensions/pazi/src/context.ts @@ -0,0 +1,18 @@ +type ProxyContext = { + userId: string; + proxyToken: string; +}; + +let currentContext: ProxyContext | null = null; + +export function getProxyContext(): ProxyContext | null { + return currentContext; +} + +export function setProxyContext(ctx: ProxyContext): void { + currentContext = ctx; +} + +export function clearProxyContext(): void { + currentContext = null; +} diff --git a/extensions/pazi/src/pazi-context.ts b/extensions/pazi/src/pazi-context.ts new file mode 100644 index 0000000000..2bcaef0943 --- /dev/null +++ b/extensions/pazi/src/pazi-context.ts @@ -0,0 +1,75 @@ +import type { IncomingMessage, ServerResponse } from "node:http"; +import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import { setProxyContext } from "./context.js"; +import { resolveGatewayToken } from "./config.js"; + +type JsonBody = { + userId?: string; + proxyToken?: string; +}; + +type ContextHandlerDeps = { + configToken?: string; + env?: NodeJS.ProcessEnv; + logger: OpenClawPluginApi["logger"]; +}; + +function writeJson(res: ServerResponse, status: number, body: unknown) { + res.writeHead(status, { "Content-Type": "application/json; charset=utf-8" }); + res.end(JSON.stringify(body)); +} + +async function readJsonBody(req: IncomingMessage): Promise { + const chunks: Buffer[] = []; + for await (const chunk of req) { + if (typeof chunk === "string") { + chunks.push(Buffer.from(chunk)); + } else { + chunks.push(chunk); + } + } + try { + const parsed = JSON.parse(Buffer.concat(chunks).toString()); + if (parsed && typeof parsed === "object") { + return parsed as JsonBody; + } + } catch { + return null; + } + return null; +} + +export function createPaziContextHandler(deps: ContextHandlerDeps) { + return async (req: IncomingMessage, res: ServerResponse): Promise => { + const gatewayToken = resolveGatewayToken({ + configToken: deps.configToken, + env: deps.env, + }); + if (!gatewayToken) { + deps.logger.warn("pazi context request rejected: gateway token missing"); + writeJson(res, 500, { error: "gateway_token_missing" }); + return; + } + + const authHeader = req.headers.authorization; + if (authHeader !== `Bearer ${gatewayToken}`) { + writeJson(res, 401, { error: "unauthorized" }); + return; + } + + const body = await readJsonBody(req); + if (!body) { + writeJson(res, 400, { error: "invalid JSON" }); + return; + } + + const { userId, proxyToken } = body; + if (!userId || !proxyToken) { + writeJson(res, 400, { error: "missing userId or proxyToken" }); + return; + } + + setProxyContext({ userId, proxyToken }); + writeJson(res, 200, { ok: true }); + }; +} diff --git a/src/gateway/pazi-proxy.ts b/extensions/pazi/src/pazi-proxy.ts similarity index 65% rename from src/gateway/pazi-proxy.ts rename to extensions/pazi/src/pazi-proxy.ts index 80eac93210..d052e0cf69 100644 --- a/src/gateway/pazi-proxy.ts +++ b/extensions/pazi/src/pazi-proxy.ts @@ -1,25 +1,24 @@ import http from "node:http"; import https from "node:https"; import type { IncomingHttpHeaders } from "node:http"; -import { createSubsystemLogger } from "../logging/subsystem.js"; +import { getProxyContext } from "./context.js"; -type ProxyContext = { userId: string; proxyToken: string }; +type ProxyLogger = { + info: (message: string) => void; + warn: (message: string) => void; +}; + +type ProxyServer = http.Server; type HttpRequest = typeof http.request; type ProxyError = { error: string; message?: string }; -const log = createSubsystemLogger("gateway/pazi-proxy"); - -let currentContext: ProxyContext | null = null; - -export function setProxyContext(ctx: ProxyContext): void { - currentContext = ctx; -} - -export function clearProxyContext(): void { - currentContext = null; -} +type StartProxyParams = { + apiUrl?: string; + port: number; + logger: ProxyLogger; +}; function requestForUrl(url: URL): HttpRequest { return url.protocol === "https:" ? https.request : http.request; @@ -42,11 +41,19 @@ function writeJson(res: http.ServerResponse, status: number, body: ProxyError) { res.end(JSON.stringify(body)); } -export async function startPaziProxy(port: number): Promise { - const paziApiUrl = process.env.PAZI_API_URL; - if (!paziApiUrl) { - log.info("pazi proxy disabled (PAZI_API_URL not set)"); - return; +export async function startPaziProxy(params: StartProxyParams): Promise { + const apiUrl = params.apiUrl?.trim(); + if (!apiUrl) { + params.logger.info("pazi proxy disabled (PAZI_API_URL not set)"); + return null; + } + + let baseUrl: URL; + try { + baseUrl = new URL(apiUrl); + } catch { + params.logger.warn(`pazi proxy disabled (invalid PAZI_API_URL: ${apiUrl})`); + return null; } const server = http.createServer(async (req, res) => { @@ -56,7 +63,7 @@ export async function startPaziProxy(port: number): Promise { return; } - const context = currentContext; + const context = getProxyContext(); if (!context) { writeJson(res, 503, { error: "no billing context set" }); return; @@ -72,7 +79,7 @@ export async function startPaziProxy(port: number): Promise { } const body = Buffer.concat(chunks); - const target = new URL("/anthropic/v1/messages", paziApiUrl); + const target = new URL("/anthropic/v1/messages", baseUrl); const doRequest = requestForUrl(target); const proxyReq = doRequest( @@ -92,7 +99,7 @@ export async function startPaziProxy(port: number): Promise { ); proxyReq.on("error", (err: Error) => { - log.warn(`pazi proxy error: ${String(err)}`); + params.logger.warn(`pazi proxy error: ${String(err)}`); if (!res.headersSent) { writeJson(res, 502, { error: "proxy_error", message: err.message }); } @@ -103,11 +110,18 @@ export async function startPaziProxy(port: number): Promise { }); server.on("clientError", (err, socket) => { - log.warn(`pazi proxy client error: ${String(err)}`); + params.logger.warn(`pazi proxy client error: ${String(err)}`); socket.end("HTTP/1.1 400 Bad Request\r\n\r\n"); }); - server.listen(port, "127.0.0.1", () => { - log.info(`pazi proxy listening on 127.0.0.1:${port}`); + await new Promise((resolve, reject) => { + server.once("error", reject); + server.listen(params.port, "127.0.0.1", () => { + server.off("error", reject); + resolve(); + }); }); + + params.logger.info(`pazi proxy listening on 127.0.0.1:${params.port}`); + return server; } diff --git a/src/gateway/pazi-context-http.ts b/src/gateway/pazi-context-http.ts deleted file mode 100644 index 2a079fc814..0000000000 --- a/src/gateway/pazi-context-http.ts +++ /dev/null @@ -1,77 +0,0 @@ -import type { IncomingMessage, ServerResponse } from "node:http"; -import { createSubsystemLogger } from "../logging/subsystem.js"; -import { setProxyContext } from "./pazi-proxy.js"; - -type PaziContextRequest = { - userId?: string; - proxyToken?: string; -}; - -type PaziContextOpts = { - gatewayToken?: string; -}; - -const log = createSubsystemLogger("gateway/pazi-context"); - -function writeJson(res: ServerResponse, status: number, body: unknown) { - res.writeHead(status, { "Content-Type": "application/json; charset=utf-8" }); - res.end(JSON.stringify(body)); -} - -async function readJson(req: IncomingMessage): Promise { - const chunks: Buffer[] = []; - for await (const chunk of req) { - if (typeof chunk === "string") { - chunks.push(Buffer.from(chunk)); - } else { - chunks.push(chunk); - } - } - try { - const body = JSON.parse(Buffer.concat(chunks).toString()); - if (body && typeof body === "object") { - return body as PaziContextRequest; - } - } catch { - return null; - } - return null; -} - -export async function handlePaziContextRequest( - req: IncomingMessage, - res: ServerResponse, - opts: PaziContextOpts, -): Promise { - if (req.method !== "POST" || req.url !== "/pazi/context") { - return false; - } - - if (!opts.gatewayToken) { - log.warn("pazi context request rejected: gateway token missing"); - writeJson(res, 500, { error: "gateway_token_missing" }); - return true; - } - - const authHeader = req.headers.authorization; - if (authHeader !== `Bearer ${opts.gatewayToken}`) { - writeJson(res, 401, { error: "unauthorized" }); - return true; - } - - const body = await readJson(req); - if (!body) { - writeJson(res, 400, { error: "invalid JSON" }); - return true; - } - - const { userId, proxyToken } = body; - if (!userId || !proxyToken) { - writeJson(res, 400, { error: "missing userId or proxyToken" }); - return true; - } - - setProxyContext({ userId, proxyToken }); - writeJson(res, 200, { ok: true }); - return true; -} diff --git a/src/gateway/server-http.ts b/src/gateway/server-http.ts index 199cec804a..41d04d5d3a 100644 --- a/src/gateway/server-http.ts +++ b/src/gateway/server-http.ts @@ -58,7 +58,6 @@ import { sendGatewayAuthFailure, setDefaultSecurityHeaders } from "./http-common import { getBearerToken } from "./http-utils.js"; import { handleOpenAiHttpRequest } from "./openai-http.js"; import { handleOpenResponsesHttpRequest } from "./openresponses-http.js"; -import { handlePaziContextRequest } from "./pazi-context-http.js"; import { GATEWAY_CLIENT_MODES, normalizeGatewayClientMode } from "./protocol/client-info.js"; import type { GatewayWsClient } from "./server/ws-types.js"; import { handleToolsInvokeHttpRequest } from "./tools-invoke-http.js"; @@ -477,9 +476,6 @@ export function createGatewayHttpServer(opts: { if (await handleHooksRequest(req, res)) { return; } - if (await handlePaziContextRequest(req, res, { gatewayToken: resolvedAuth.token })) { - return; - } if ( await handleToolsInvokeHttpRequest(req, res, { auth: resolvedAuth, diff --git a/src/gateway/server.impl.ts b/src/gateway/server.impl.ts index 829e8ab3d1..3dbd86e1e5 100644 --- a/src/gateway/server.impl.ts +++ b/src/gateway/server.impl.ts @@ -78,7 +78,6 @@ import { createGatewayRuntimeState } from "./server-runtime-state.js"; import { resolveSessionKeyForRun } from "./server-session-key.js"; import { logGatewayStartup } from "./server-startup-log.js"; import { startGatewaySidecars } from "./server-startup.js"; -import { startPaziProxy } from "./pazi-proxy.js"; import { startGatewayTailscaleExposure } from "./server-tailscale.js"; import { createWizardSessionTracker } from "./server-wizard-sessions.js"; import { attachGatewayWsHandlers } from "./server-ws-runtime.js"; @@ -269,11 +268,6 @@ export async function startGatewayServer( ); } } - if (!minimalTestGateway) { - const proxyPortRaw = process.env.PAZI_PROXY_PORT; - const proxyPort = proxyPortRaw ? Number.parseInt(proxyPortRaw, 10) : 8765; - await startPaziProxy(Number.isFinite(proxyPort) ? proxyPort : 8765); - } const diagnosticsEnabled = isDiagnosticsEnabled(cfgAtStart); if (diagnosticsEnabled) { startDiagnosticHeartbeat(); From 474890becb2e743be3e6cdf977a8a210076bb39c Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 15:18:01 +0100 Subject: [PATCH 04/80] Plugins: enable pazi by default --- src/plugins/config-state.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/config-state.ts b/src/plugins/config-state.ts index f2626e705f..07abbdcc31 100644 --- a/src/plugins/config-state.ts +++ b/src/plugins/config-state.ts @@ -17,6 +17,7 @@ export type NormalizedPluginsConfig = { export const BUNDLED_ENABLED_BY_DEFAULT = new Set([ "device-pair", "phone-control", + "pazi", "talk-voice", ]); From dc5714df1f3f27400efad24f02066672fd91f678 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 15:50:20 +0100 Subject: [PATCH 05/80] CI: switch to GitHub-hosted runners --- .github/workflows/auto-response.yml | 2 +- .github/workflows/ci.yml | 24 +++++++++++----------- .github/workflows/docker-release.yml | 6 +++--- .github/workflows/install-smoke.yml | 4 ++-- .github/workflows/labeler.yml | 6 +++--- .github/workflows/sandbox-common-smoke.yml | 2 +- .github/workflows/stale.yml | 2 +- .github/workflows/workflow-sanity.yml | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/auto-response.yml b/.github/workflows/auto-response.yml index 1502456a25..00d70f8344 100644 --- a/.github/workflows/auto-response.yml +++ b/.github/workflows/auto-response.yml @@ -13,7 +13,7 @@ jobs: permissions: issues: write pull-requests: write - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 id: app-token diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7bef285a7..b7dacfc348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: # Detect docs-only changes to skip heavy jobs (test, build, Windows, macOS, Android). # Lint and format always run. Fail-safe: if detection fails, run everything. docs-scope: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest outputs: docs_only: ${{ steps.check.outputs.docs_only }} docs_changed: ${{ steps.check.outputs.docs_changed }} @@ -33,7 +33,7 @@ jobs: changed-scope: needs: [docs-scope] if: needs.docs-scope.outputs.docs_only != 'true' - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest outputs: run_node: ${{ steps.scope.outputs.run_node }} run_macos: ${{ steps.scope.outputs.run_macos }} @@ -127,7 +127,7 @@ jobs: build-artifacts: needs: [docs-scope, changed-scope, check] if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true') - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -153,7 +153,7 @@ jobs: release-check: needs: [docs-scope, build-artifacts] if: github.event_name == 'push' && needs.docs-scope.outputs.docs_only != 'true' - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -177,7 +177,7 @@ jobs: checks: needs: [docs-scope, changed-scope, check] if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true') - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -244,7 +244,7 @@ jobs: name: "check" needs: [docs-scope] if: needs.docs-scope.outputs.docs_only != 'true' - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -270,7 +270,7 @@ jobs: needs: [docs-scope, changed-scope] # if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true') if: false - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -305,7 +305,7 @@ jobs: check-docs: needs: [docs-scope] if: needs.docs-scope.outputs.docs_changed == 'true' - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -323,7 +323,7 @@ jobs: skills-python: needs: [docs-scope, changed-scope] if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true') - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -347,7 +347,7 @@ jobs: run: python -m pytest -q skills secrets: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -403,7 +403,7 @@ jobs: checks-windows: needs: [docs-scope, changed-scope, build-artifacts, check] if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true') - runs-on: blacksmith-16vcpu-windows-2025 + runs-on: windows-latest env: NODE_OPTIONS: --max-old-space-size=4096 # Keep total concurrency predictable on the 16 vCPU runner: @@ -774,7 +774,7 @@ jobs: android: needs: [docs-scope, changed-scope, check] if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_android == 'true') - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index eff0993b46..0530eaf03a 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -24,7 +24,7 @@ env: jobs: # Build amd64 image build-amd64: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest permissions: packages: write contents: read @@ -83,7 +83,7 @@ jobs: # Build arm64 image build-arm64: - runs-on: blacksmith-16vcpu-ubuntu-2404-arm + runs-on: ubuntu-latest permissions: packages: write contents: read @@ -142,7 +142,7 @@ jobs: # Create multi-platform manifest create-manifest: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest permissions: packages: write contents: read diff --git a/.github/workflows/install-smoke.yml b/.github/workflows/install-smoke.yml index 03e87db82b..6a59074b25 100644 --- a/.github/workflows/install-smoke.yml +++ b/.github/workflows/install-smoke.yml @@ -12,7 +12,7 @@ concurrency: jobs: docs-scope: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest outputs: docs_only: ${{ steps.check.outputs.docs_only }} steps: @@ -28,7 +28,7 @@ jobs: install-smoke: needs: [docs-scope] if: needs.docs-scope.outputs.docs_only != 'true' - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout CLI uses: actions/checkout@v4 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 9ac44dfa6b..2bae5a6116 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -23,7 +23,7 @@ jobs: permissions: contents: read pull-requests: write - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 id: app-token @@ -200,7 +200,7 @@ jobs: permissions: contents: read pull-requests: write - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 id: app-token @@ -440,7 +440,7 @@ jobs: label-issues: permissions: issues: write - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 id: app-token diff --git a/.github/workflows/sandbox-common-smoke.yml b/.github/workflows/sandbox-common-smoke.yml index 26c0dcc106..c92a05c3ae 100644 --- a/.github/workflows/sandbox-common-smoke.yml +++ b/.github/workflows/sandbox-common-smoke.yml @@ -19,7 +19,7 @@ concurrency: jobs: sandbox-common-smoke: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 6248a93dce..4c81828316 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -12,7 +12,7 @@ jobs: permissions: issues: write pull-requests: write - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 id: app-token diff --git a/.github/workflows/workflow-sanity.yml b/.github/workflows/workflow-sanity.yml index 19668e697a..50602ece1a 100644 --- a/.github/workflows/workflow-sanity.yml +++ b/.github/workflows/workflow-sanity.yml @@ -11,7 +11,7 @@ concurrency: jobs: no-tabs: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -42,7 +42,7 @@ jobs: PY actionlint: - runs-on: blacksmith-16vcpu-ubuntu-2404 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 From 649bc05e8389a5addc88201624157a36284c5597 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 16:31:29 +0100 Subject: [PATCH 06/80] Deps: update pnpm lockfile for pazi plugin --- pnpm-lock.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0ddc70d9f9..318dd748a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -388,6 +388,12 @@ importers: extensions/open-prose: {} + extensions/pazi: + dependencies: + openclaw: + specifier: '>=2026.1.26' + version: 2026.2.24(@napi-rs/canvas@0.1.95)(@types/express@5.0.6)(audio-decode@2.2.3)(hono@4.11.10)(node-llama-cpp@3.15.1(typescript@5.9.3)) + extensions/signal: {} extensions/slack: {} @@ -6841,7 +6847,7 @@ snapshots: '@mariozechner/pi-agent-core@0.55.0(ws@8.19.0)(zod@4.3.6)': dependencies: - '@mariozechner/pi-ai': 0.55.0(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-ai': 0.55.1(ws@8.19.0)(zod@4.3.6) transitivePeerDependencies: - '@modelcontextprotocol/sdk' - aws-crt @@ -6914,9 +6920,9 @@ snapshots: '@mariozechner/pi-coding-agent@0.55.0(ws@8.19.0)(zod@4.3.6)': dependencies: '@mariozechner/jiti': 2.6.5 - '@mariozechner/pi-agent-core': 0.55.0(ws@8.19.0)(zod@4.3.6) - '@mariozechner/pi-ai': 0.55.0(ws@8.19.0)(zod@4.3.6) - '@mariozechner/pi-tui': 0.55.0 + '@mariozechner/pi-agent-core': 0.55.1(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-ai': 0.55.1(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-tui': 0.55.1 '@silvia-odwyer/photon-node': 0.3.4 chalk: 5.6.2 cli-highlight: 2.1.11 From 02b544d5f81dcda589790aaf2268b34c51d335ef Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 26 Feb 2026 17:30:05 +0100 Subject: [PATCH 07/80] Style: format pazi plugin files --- extensions/pazi/index.ts | 2 +- extensions/pazi/src/config.ts | 8 ++------ extensions/pazi/src/pazi-context.ts | 2 +- extensions/pazi/src/pazi-proxy.ts | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index a46202d116..571ccfd043 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -1,5 +1,5 @@ -import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import type { Server as HttpServer } from "node:http"; +import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import { resolvePaziBillingConfig } from "./src/config.js"; import { createPaziContextHandler } from "./src/pazi-context.js"; import { startPaziProxy } from "./src/pazi-proxy.js"; diff --git a/extensions/pazi/src/config.ts b/extensions/pazi/src/config.ts index 5d4ce46127..e83361ceee 100644 --- a/extensions/pazi/src/config.ts +++ b/extensions/pazi/src/config.ts @@ -33,14 +33,10 @@ export function resolvePaziBillingConfig(params: { const env = params.env ?? process.env; const raw = params.pluginConfig ?? {}; - const apiUrl = - normalizeString(raw.apiUrl) ?? - normalizeString(env.PAZI_API_URL); + const apiUrl = normalizeString(raw.apiUrl) ?? normalizeString(env.PAZI_API_URL); const proxyPort = - normalizePort(raw.proxyPort) ?? - normalizePort(env.PAZI_PROXY_PORT) ?? - DEFAULT_PROXY_PORT; + normalizePort(raw.proxyPort) ?? normalizePort(env.PAZI_PROXY_PORT) ?? DEFAULT_PROXY_PORT; return { apiUrl, diff --git a/extensions/pazi/src/pazi-context.ts b/extensions/pazi/src/pazi-context.ts index 2bcaef0943..66e8272983 100644 --- a/extensions/pazi/src/pazi-context.ts +++ b/extensions/pazi/src/pazi-context.ts @@ -1,7 +1,7 @@ import type { IncomingMessage, ServerResponse } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; -import { setProxyContext } from "./context.js"; import { resolveGatewayToken } from "./config.js"; +import { setProxyContext } from "./context.js"; type JsonBody = { userId?: string; diff --git a/extensions/pazi/src/pazi-proxy.ts b/extensions/pazi/src/pazi-proxy.ts index d052e0cf69..bda260c414 100644 --- a/extensions/pazi/src/pazi-proxy.ts +++ b/extensions/pazi/src/pazi-proxy.ts @@ -1,6 +1,6 @@ import http from "node:http"; -import https from "node:https"; import type { IncomingHttpHeaders } from "node:http"; +import https from "node:https"; import { getProxyContext } from "./context.js"; type ProxyLogger = { From ddfa64f3f5e33de7a0ef97a4c8094d69d731a59a Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Tue, 3 Mar 2026 09:53:16 +0100 Subject: [PATCH 08/80] update dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 2229a299a5..6b270f3e5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,9 @@ RUN if [ -n "$OPENCLAW_INSTALL_BROWSER" ]; then \ USER node COPY --chown=node:node . . +# Gateway config: disable Control UI dashboard, allow operator mode without device auth +RUN mkdir -p /home/node/.openclaw && \ + echo '{"gateway":{"controlUi":{"enabled":false,"dangerouslyDisableDeviceAuth":true}}}' > /home/node/.openclaw/openclaw.json RUN pnpm build # Force pnpm for UI build (Bun may fail on ARM/Synology architectures) ENV OPENCLAW_PREFER_PNPM=1 From d53206d1c929f24774e304c7bc8da3786d32f13b Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Tue, 3 Mar 2026 11:24:41 +0100 Subject: [PATCH 09/80] WIP #1 --- .github/workflows/deploy-pazi-agent.yml | 106 ++++++++++++++++++++++++ Dockerfile.pazi | 94 +++++++++++++++++++++ extensions/pazi/index.ts | 24 ++++++ supervisord.pazi.conf | 45 ++++++++++ 4 files changed, 269 insertions(+) create mode 100644 .github/workflows/deploy-pazi-agent.yml create mode 100644 Dockerfile.pazi create mode 100644 supervisord.pazi.conf diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml new file mode 100644 index 0000000000..962fe04309 --- /dev/null +++ b/.github/workflows/deploy-pazi-agent.yml @@ -0,0 +1,106 @@ +name: Deploy Pazi Agent + +on: + push: + branches: [main] + + workflow_dispatch: + +permissions: + contents: write + packages: write + +env: + AWS_REGION: us-east-1 + GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/pazi-agent + +jobs: + build-and-push: + runs-on: ubuntu-latest + + outputs: + image_tag: ${{ steps.build-image.outputs.image_tag }} + version: ${{ steps.get_version.outputs.VERSION }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Read version from package.json + id: get_version + run: | + VERSION=$(node -p "require('./package.json').version") + echo "Version: v${VERSION}" + echo "VERSION=v${VERSION}" >> $GITHUB_OUTPUT + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build, tag, and push image to GHCR + id: build-image + env: + IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }} + run: | + docker build -f Dockerfile.pazi -t $GHCR_IMAGE:$IMAGE_TAG . + docker tag $GHCR_IMAGE:$IMAGE_TAG $GHCR_IMAGE:latest + + docker push $GHCR_IMAGE:$IMAGE_TAG + docker push $GHCR_IMAGE:latest + + echo "image=$GHCR_IMAGE:$IMAGE_TAG" >> $GITHUB_OUTPUT + echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Upload latest version to S3 + run: | + echo "${{ steps.get_version.outputs.VERSION }}" > latest.txt + aws s3 cp latest.txt s3://assets.pazi.ai/cloud/latest.txt + + - name: Deployment Summary + if: success() + run: | + echo "### Build and Push Successful! :rocket:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Image:** ${{ steps.build-image.outputs.image }}" >> $GITHUB_STEP_SUMMARY + echo "**Registry:** GHCR (${{ env.GHCR_IMAGE }})" >> $GITHUB_STEP_SUMMARY + echo "**Version:** ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY + + push-version-tag: + runs-on: ubuntu-latest + needs: build-and-push + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Tag and bump version + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + git tag ${{ needs.build-and-push.outputs.version }} + git push origin ${{ needs.build-and-push.outputs.version }} + + CURRENT=$(node -p "require('./package.json').version") + IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" + NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" + node -e "const pkg=require('./package.json'); pkg.version='${NEXT}'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n')" + + git add package.json + git commit -m "chore: release ${NEXT} [skip ci]" + git push origin HEAD:${{ github.ref_name }} diff --git a/Dockerfile.pazi b/Dockerfile.pazi new file mode 100644 index 0000000000..d015922f93 --- /dev/null +++ b/Dockerfile.pazi @@ -0,0 +1,94 @@ +# Dockerfile.pazi — Pazi production wrapper +# Builds the OpenClaw agent, then layers desktop services on top. + +# --------------------------------------------------------------------------- +# Stage 1: Build OpenClaw (reuses the standard build steps from Dockerfile) +# --------------------------------------------------------------------------- +FROM node:22-bookworm@sha256:cd7bcd2e7a1e6f72052feb023c7f6b722205d3fcab7bbcbd2d1bfdab10b1e935 AS builder + +RUN curl -fsSL https://bun.sh/install | bash +ENV PATH="/root/.bun/bin:${PATH}" + +RUN corepack enable + +WORKDIR /app +RUN chown node:node /app + +COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./ +COPY --chown=node:node ui/package.json ./ui/package.json +COPY --chown=node:node patches ./patches +COPY --chown=node:node scripts ./scripts + +USER node +RUN NODE_OPTIONS=--max-old-space-size=2048 pnpm install --frozen-lockfile + +USER node +COPY --chown=node:node . . +RUN pnpm build +ENV OPENCLAW_PREFER_PNPM=1 +RUN pnpm ui:build + +# --------------------------------------------------------------------------- +# Stage 2: Production image with desktop environment +# --------------------------------------------------------------------------- +FROM node:22-bookworm-slim + +# Playwright: use system Chromium +ENV CHROME_PATH=/usr/bin/chromium \ + PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium \ + PLAYWRIGHT_MCP_EXECUTABLE_PATH=/usr/bin/chromium \ + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + # Chromium browser + chromium \ + # Playwright / Chromium runtime deps + libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ + libdbus-1-3 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 \ + libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0 \ + # Fonts + fonts-liberation fonts-noto-color-emoji \ + # Desktop environment + xvfb x11vnc novnc websockify \ + xfce4 xfce4-terminal dbus-x11 \ + # Utilities + git curl ca-certificates procps \ + # Process manager + supervisor \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Create pazi user (UID 1001 — matches host /home/pazi volume mounts) +RUN groupadd -g 1001 pazi && useradd -u 1001 -g 1001 -m -d /home/pazi pazi + +WORKDIR /app + +# Copy built app from builder stage +COPY --from=builder --chown=pazi:pazi /app /app + +# Gateway config: disable Control UI, skip device auth (gateway token handles auth) +RUN mkdir -p /home/pazi/.openclaw && \ + echo '{"gateway":{"controlUi":{"enabled":false,"dangerouslyDisableDeviceAuth":true}}}' > /home/pazi/.openclaw/openclaw.json && \ + chown -R pazi:pazi /home/pazi/.openclaw + +# Runtime directories +RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share && \ + chown -R pazi:pazi /home/pazi + +# Supervisord config +COPY supervisord.pazi.conf /etc/supervisor/conf.d/supervisord.conf + +ENV NODE_ENV=production \ + OPENCLAW_GATEWAY_PORT=3000 \ + GENERATIONS_DIR=/home/pazi/generations + +# 3000 — OpenClaw gateway (HTTP + WS) +# 6080 — noVNC desktop +EXPOSE 3000 6080 + +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD curl -f http://127.0.0.1:3000/health || exit 1 + +# supervisord runs as root to manage child processes with different users +USER root + +CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index 571ccfd043..4b4f3b03d4 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -1,6 +1,7 @@ import type { Server as HttpServer } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import { resolvePaziBillingConfig } from "./src/config.js"; +import { getProxyContext } from "./src/context.js"; import { createPaziContextHandler } from "./src/pazi-context.js"; import { startPaziProxy } from "./src/pazi-proxy.js"; @@ -49,6 +50,29 @@ export default { }, }); + api.registerHttpRoute({ + path: "/health", + handler: (_req, res) => { + res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); + res.end(JSON.stringify({ status: "ok", timestamp: new Date().toISOString() })); + }, + }); + + api.registerHttpRoute({ + path: "/status", + handler: (_req, res) => { + res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); + res.end( + JSON.stringify({ + status: "running", + busy: getProxyContext() !== null, + version: process.env.AGENT_VERSION ?? "unknown", + environment: process.env.NODE_ENV ?? "development", + }), + ); + }, + }); + let proxyServer: HttpServer | null = null; api.registerService({ diff --git a/supervisord.pazi.conf b/supervisord.pazi.conf new file mode 100644 index 0000000000..c5ec6ac74b --- /dev/null +++ b/supervisord.pazi.conf @@ -0,0 +1,45 @@ +[supervisord] +nodaemon=true +user=root +logfile=/var/log/supervisord.log +pidfile=/var/run/supervisord.pid + +[program:xvfb] +command=Xvfb :1 -screen 0 1920x1080x24 +autorestart=true +priority=10 + +[program:xfce4] +command=bash -c "sleep 2 && DISPLAY=:1 dbus-launch --exit-with-session startxfce4" +user=pazi +environment=HOME="/home/pazi",DISPLAY=":1" +autorestart=true +priority=20 + +[program:chromium] +command=bash -c "sleep 5 && chromium --no-sandbox --no-first-run --no-default-browser-check --disable-infobars --display=:1" +user=pazi +environment=HOME="/home/pazi",DISPLAY=":1" +autorestart=false +priority=25 + +[program:x11vnc] +command=bash -c "sleep 3 && x11vnc -display :1 -nopw -forever -shared -rfbport 5901 -localhost" +autorestart=true +priority=30 + +[program:websockify] +command=bash -c "sleep 4 && websockify --web /usr/share/novnc 6080 localhost:5901" +autorestart=true +priority=40 + +[program:agent] +command=bash -c "sleep 8 && exec node /app/openclaw.mjs gateway --allow-unconfigured --bind lan" +user=pazi +environment=HOME="/home/pazi",DISPLAY=":1",NODE_ENV="production" +autorestart=true +priority=50 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 From 48ccae52796bf154d475b973521730541e756650 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Tue, 3 Mar 2026 11:32:54 +0100 Subject: [PATCH 10/80] Staging support --- .github/workflows/deploy-pazi-agent.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 962fe04309..28c48de437 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -2,7 +2,7 @@ name: Deploy Pazi Agent on: push: - branches: [main] + branches: [main, staging] workflow_dispatch: @@ -65,8 +65,13 @@ jobs: - name: Upload latest version to S3 run: | - echo "${{ steps.get_version.outputs.VERSION }}" > latest.txt - aws s3 cp latest.txt s3://assets.pazi.ai/cloud/latest.txt + if [[ "${{ github.ref_name }}" == "main" ]]; then + S3_KEY="latest.txt" + else + S3_KEY="latest-staging.txt" + fi + echo "${{ steps.get_version.outputs.VERSION }}" > "$S3_KEY" + aws s3 cp "$S3_KEY" "s3://assets.pazi.ai/cloud/$S3_KEY" - name: Deployment Summary if: success() @@ -78,6 +83,7 @@ jobs: echo "**Version:** ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY push-version-tag: + if: github.ref_name == 'main' runs-on: ubuntu-latest needs: build-and-push From 175860dfc023ad2a0ea575224544bbaffa6f0eef Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Tue, 3 Mar 2026 12:38:23 +0100 Subject: [PATCH 11/80] Fix image --- .github/workflows/deploy-pazi-agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 28c48de437..4bfe0c7af4 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -12,7 +12,7 @@ permissions: env: AWS_REGION: us-east-1 - GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/pazi-agent + GHCR_IMAGE: ghcr.io/pythagora-io/pazi-agent jobs: build-and-push: From abee953aacf49c9f0490e363e583958da89637ae Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Tue, 3 Mar 2026 12:44:04 +0100 Subject: [PATCH 12/80] Fix env name --- .github/workflows/deploy-pazi-agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 4bfe0c7af4..c560b03eb5 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -40,7 +40,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GH_PAT }} - name: Build, tag, and push image to GHCR id: build-image From d5f478a2540a5bc21efc03f5d5dafb6489c8d2fa Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Tue, 3 Mar 2026 14:29:32 +0100 Subject: [PATCH 13/80] Fix dockerfile --- Dockerfile.pazi | 2 +- extensions/pazi/src/context.ts | 1 + extensions/pazi/src/pazi-context.ts | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index d015922f93..d236499156 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -67,7 +67,7 @@ COPY --from=builder --chown=pazi:pazi /app /app # Gateway config: disable Control UI, skip device auth (gateway token handles auth) RUN mkdir -p /home/pazi/.openclaw && \ - echo '{"gateway":{"controlUi":{"enabled":false,"dangerouslyDisableDeviceAuth":true}}}' > /home/pazi/.openclaw/openclaw.json && \ + echo '{"gateway":{"controlUi":{"enabled":false,"dangerouslyDisableDeviceAuth":true,"allowedOrigins":["http://127.0.0.1:3000"]}}}' > /home/pazi/.openclaw/openclaw.json && \ chown -R pazi:pazi /home/pazi/.openclaw # Runtime directories diff --git a/extensions/pazi/src/context.ts b/extensions/pazi/src/context.ts index b46b4c6f65..8897fcb055 100644 --- a/extensions/pazi/src/context.ts +++ b/extensions/pazi/src/context.ts @@ -1,5 +1,6 @@ type ProxyContext = { userId: string; + agentId: string; proxyToken: string; }; diff --git a/extensions/pazi/src/pazi-context.ts b/extensions/pazi/src/pazi-context.ts index 66e8272983..c72573d226 100644 --- a/extensions/pazi/src/pazi-context.ts +++ b/extensions/pazi/src/pazi-context.ts @@ -5,6 +5,7 @@ import { setProxyContext } from "./context.js"; type JsonBody = { userId?: string; + agentId?: string; proxyToken?: string; }; @@ -63,13 +64,13 @@ export function createPaziContextHandler(deps: ContextHandlerDeps) { return; } - const { userId, proxyToken } = body; - if (!userId || !proxyToken) { - writeJson(res, 400, { error: "missing userId or proxyToken" }); + const { userId, agentId, proxyToken } = body; + if (!userId || !agentId || !proxyToken) { + writeJson(res, 400, { error: "missing userId, agentId, or proxyToken" }); return; } - setProxyContext({ userId, proxyToken }); + setProxyContext({ userId, agentId, proxyToken }); writeJson(res, 200, { ok: true }); }; } From 584b2827193a4e0d09229d5927b2a5e0a6e62218 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Tue, 3 Mar 2026 15:05:42 +0100 Subject: [PATCH 14/80] Moved to boot script --- Dockerfile.pazi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index d236499156..59d5e5047e 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -65,11 +65,6 @@ WORKDIR /app # Copy built app from builder stage COPY --from=builder --chown=pazi:pazi /app /app -# Gateway config: disable Control UI, skip device auth (gateway token handles auth) -RUN mkdir -p /home/pazi/.openclaw && \ - echo '{"gateway":{"controlUi":{"enabled":false,"dangerouslyDisableDeviceAuth":true,"allowedOrigins":["http://127.0.0.1:3000"]}}}' > /home/pazi/.openclaw/openclaw.json && \ - chown -R pazi:pazi /home/pazi/.openclaw - # Runtime directories RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share && \ chown -R pazi:pazi /home/pazi From d3095cd5c3bb1cda096013ad8c5ea5188eafdbf7 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Tue, 3 Mar 2026 17:54:12 +0100 Subject: [PATCH 15/80] Pazi: add Pipedream integration tools --- extensions/pazi/index.ts | 18 +- extensions/pazi/package.json | 3 + extensions/pazi/src/pipedream/api.ts | 171 +++++++++++ extensions/pazi/src/pipedream/tools.ts | 286 ++++++++++++++++++ .../pazi/src/{ => proxy}/pazi-context.ts | 4 +- extensions/pazi/src/{ => proxy}/pazi-proxy.ts | 2 +- 6 files changed, 479 insertions(+), 5 deletions(-) create mode 100644 extensions/pazi/src/pipedream/api.ts create mode 100644 extensions/pazi/src/pipedream/tools.ts rename extensions/pazi/src/{ => proxy}/pazi-context.ts (95%) rename extensions/pazi/src/{ => proxy}/pazi-proxy.ts (98%) diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index 571ccfd043..c87b887b68 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -1,8 +1,9 @@ import type { Server as HttpServer } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import { resolvePaziBillingConfig } from "./src/config.js"; -import { createPaziContextHandler } from "./src/pazi-context.js"; -import { startPaziProxy } from "./src/pazi-proxy.js"; +import { createPipedreamTools } from "./src/pipedream/tools.js"; +import { createPaziContextHandler } from "./src/proxy/pazi-context.js"; +import { startPaziProxy } from "./src/proxy/pazi-proxy.js"; function normalizePluginConfig( value: OpenClawPluginApi["pluginConfig"], @@ -36,6 +37,19 @@ export default { logger: api.logger, }); + api.registerGatewayMethod("pazi.integration.emit", ({ params, respond, context }) => { + context.broadcast("integration", params); + respond(true, { emitted: true }); + }); + + const tools = createPipedreamTools({ + pluginConfig, + config: api.config, + }); + for (const tool of tools) { + api.registerTool(tool); + } + api.registerHttpRoute({ path: "/pazi/context", handler: async (req, res) => { diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json index e8937d4aa7..6eff493c19 100644 --- a/extensions/pazi/package.json +++ b/extensions/pazi/package.json @@ -4,6 +4,9 @@ "private": true, "description": "OpenClaw Pazi proxy", "type": "module", + "dependencies": { + "@sinclair/typebox": "0.34.48" + }, "peerDependencies": { "openclaw": ">=2026.1.26" }, diff --git a/extensions/pazi/src/pipedream/api.ts b/extensions/pazi/src/pipedream/api.ts new file mode 100644 index 0000000000..067f013feb --- /dev/null +++ b/extensions/pazi/src/pipedream/api.ts @@ -0,0 +1,171 @@ +import { resolvePaziBillingConfig } from "../config.js"; +import { getProxyContext } from "../context.js"; + +type ApiParams = { + apiUrl: string; + proxyToken: string; +}; + +export type PipedreamApiResult = { ok: true; data: T } | { ok: false; error: string }; + +function resolveApiParams(pluginConfig: Record | null): ApiParams { + const context = getProxyContext(); + if (!context) { + throw new Error("No billing context set — workspace may not be initialized yet"); + } + + const resolved = resolvePaziBillingConfig({ pluginConfig, env: process.env }); + const apiUrl = resolved.apiUrl?.trim(); + if (!apiUrl) { + throw new Error("PAZI_API_URL not configured"); + } + + let baseUrl: URL; + try { + baseUrl = new URL(apiUrl); + } catch { + throw new Error(`Invalid PAZI_API_URL: ${apiUrl}`); + } + + return { apiUrl: baseUrl.toString(), proxyToken: context.proxyToken }; +} + +function readErrorMessage(payload: unknown): string | undefined { + if (!payload) { + return undefined; + } + if (typeof payload === "string") { + return payload; + } + if (typeof payload === "object") { + const record = payload as { error?: unknown; message?: unknown }; + if (typeof record.error === "string") { + return record.error; + } + if (typeof record.message === "string") { + return record.message; + } + } + return undefined; +} + +async function readJsonBody(res: Response): Promise { + const text = await res.text(); + if (!text.trim()) { + return null; + } + try { + return JSON.parse(text) as unknown; + } catch { + return text; + } +} + +async function parseResponse(res: Response): Promise> { + const payload = await readJsonBody(res); + if (res.ok) { + return { ok: true, data: payload as T }; + } + const message = readErrorMessage(payload) ?? res.statusText ?? "Request failed"; + const status = res.status ? ` (${res.status})` : ""; + return { ok: false, error: `Pazi API error${status}: ${message}` }; +} + +async function fetchWithToken(params: ApiParams, url: URL, init?: RequestInit): Promise { + const headers = new Headers(init?.headers); + headers.set("x-proxy-token", params.proxyToken); + return await fetch(url, { ...init, headers }); +} + +async function requestJson( + params: ApiParams, + url: URL, + init?: RequestInit, +): Promise> { + const res = await fetchWithToken(params, url, init); + return await parseResponse(res); +} + +function coerceLimit(limit?: number): number | undefined { + if (typeof limit !== "number" || !Number.isFinite(limit) || limit <= 0) { + return undefined; + } + return Math.floor(limit); +} + +export async function searchApps( + params: { pluginConfig: Record | null }, + query: string, + limit?: number, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL("/integrations/apps", apiParams.apiUrl); + url.searchParams.set("q", query); + const resolvedLimit = coerceLimit(limit); + if (resolvedLimit) { + url.searchParams.set("limit", String(resolvedLimit)); + } + return await requestJson(apiParams, url); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function listActions( + params: { pluginConfig: Record | null }, + app: string, + limit?: number, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL(`/integrations/${encodeURIComponent(app)}/actions`, apiParams.apiUrl); + const resolvedLimit = coerceLimit(limit); + if (resolvedLimit) { + url.searchParams.set("limit", String(resolvedLimit)); + } + return await requestJson(apiParams, url); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function checkIntegration( + params: { pluginConfig: Record | null }, + app: string, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL(`/integrations/accounts/${encodeURIComponent(app)}`, apiParams.apiUrl); + const res = await fetchWithToken(apiParams, url, { method: "GET" }); + if (res.status === 404) { + return { ok: true, data: { connected: false } }; + } + return await parseResponse(res); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function runAction( + params: { pluginConfig: Record | null }, + app: string, + actionId: string, + configuredProps?: Record, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL(`/integrations/${encodeURIComponent(app)}/action`, apiParams.apiUrl); + const body: { actionId: string; configuredProps?: Record } = { actionId }; + if (configuredProps) { + body.configuredProps = configuredProps; + } + return await requestJson(apiParams, url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body), + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} diff --git a/extensions/pazi/src/pipedream/tools.ts b/extensions/pazi/src/pipedream/tools.ts new file mode 100644 index 0000000000..57c98c555f --- /dev/null +++ b/extensions/pazi/src/pipedream/tools.ts @@ -0,0 +1,286 @@ +import { Type } from "@sinclair/typebox"; +import type { AnyAgentTool, OpenClawConfig } from "openclaw/plugin-sdk"; +import { callGateway } from "../../../../src/gateway/call.js"; +import { + checkIntegration, + listActions, + runAction, + searchApps, + type PipedreamApiResult, +} from "./api.js"; + +export type PipedreamToolsDeps = { + pluginConfig: Record | null; + config: OpenClawConfig; +}; + +type AgentToolResult = { + content: Array<{ type: "text"; text: string }>; + details?: unknown; +}; + +function json(payload: unknown): AgentToolResult { + return { + content: [{ type: "text", text: JSON.stringify(payload, null, 2) }], + details: payload, + }; +} + +function readRequiredString(params: Record, key: string): string { + const value = params[key]; + if (typeof value !== "string") { + throw new Error(`${key} required`); + } + const trimmed = value.trim(); + if (!trimmed) { + throw new Error(`${key} required`); + } + return trimmed; +} + +function readOptionalString(params: Record, key: string): string | undefined { + const value = params[key]; + if (typeof value !== "string") { + return undefined; + } + const trimmed = value.trim(); + return trimmed ? trimmed : undefined; +} + +function readOptionalNumber(params: Record, key: string): number | undefined { + const value = params[key]; + if (typeof value !== "number" || !Number.isFinite(value)) { + return undefined; + } + return value; +} + +function coerceLimit(value: number | undefined): number | undefined { + if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) { + return undefined; + } + return Math.floor(value); +} + +function unwrapResult(result: PipedreamApiResult): AgentToolResult { + if (result.ok) { + return json(result.data); + } + return json({ error: result.error }); +} + +async function sleep(ms: number, signal?: AbortSignal): Promise<"ok" | "aborted"> { + if (signal?.aborted) { + return "aborted"; + } + return await new Promise<"ok" | "aborted">((resolve) => { + const timer = setTimeout(() => { + resolve("ok"); + }, ms); + if (!signal) { + return; + } + const onAbort = () => { + clearTimeout(timer); + resolve("aborted"); + }; + signal.addEventListener("abort", onAbort, { once: true }); + }); +} + +export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { + return [ + { + name: "mcp__pipedream__find_integrations", + label: "Pipedream: Find Integrations", + description: "Search Pipedream integrations/apps by name.", + parameters: Type.Object( + { + query: Type.String({ description: "Search query." }), + limit: Type.Optional(Type.Number({ description: "Maximum results to return." })), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const query = readRequiredString(params, "query"); + const limit = coerceLimit(readOptionalNumber(params, "limit")); + const result = await searchApps({ pluginConfig: deps.pluginConfig }, query, limit); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "mcp__pipedream__list_actions", + label: "Pipedream: List Actions", + description: "List available actions for a Pipedream app.", + parameters: Type.Object( + { + app: Type.String({ description: "Pipedream app slug." }), + limit: Type.Optional(Type.Number({ description: "Maximum results to return." })), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const app = readRequiredString(params, "app"); + const limit = coerceLimit(readOptionalNumber(params, "limit")); + const result = await listActions({ pluginConfig: deps.pluginConfig }, app, limit); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "mcp__pipedream__check_integration", + label: "Pipedream: Check Integration", + description: "Check whether a Pipedream integration is connected.", + parameters: Type.Object( + { + app: Type.String({ description: "Pipedream app slug." }), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const app = readRequiredString(params, "app"); + const result = await checkIntegration({ pluginConfig: deps.pluginConfig }, app); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "mcp__pipedream__use_integration", + label: "Pipedream: Use Integration", + description: "Run a Pipedream action for a connected integration.", + parameters: Type.Object( + { + app: Type.String({ description: "Pipedream app slug." }), + actionId: Type.String({ description: "Action id to invoke." }), + configuredProps: Type.Optional( + Type.Record(Type.String(), Type.Unknown(), { + description: "Configured properties for the action.", + }), + ), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const app = readRequiredString(params, "app"); + const actionId = readRequiredString(params, "actionId"); + const configuredProps = params.configuredProps; + if ( + configuredProps !== undefined && + (typeof configuredProps !== "object" || + configuredProps === null || + Array.isArray(configuredProps)) + ) { + throw new Error("configuredProps must be an object"); + } + const result = await runAction( + { pluginConfig: deps.pluginConfig }, + app, + actionId, + configuredProps as Record | undefined, + ); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "mcp__pipedream__request_integration", + label: "Pipedream: Request Integration", + description: "Prompt the UI to connect a Pipedream integration.", + parameters: Type.Object( + { + app: Type.String({ description: "Pipedream app slug." }), + message: Type.Optional(Type.String({ description: "Optional message to display." })), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const app = readRequiredString(params, "app"); + const message = readOptionalString(params, "message"); + const result = await callGateway({ + method: "pazi.integration.emit", + params: { action: "required", app, message }, + config: deps.config, + }); + return json(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "mcp__pipedream__wait_for_connection", + label: "Pipedream: Wait For Connection", + description: "Poll until a Pipedream integration is connected.", + parameters: Type.Object( + { + app: Type.String({ description: "Pipedream app slug." }), + timeoutMs: Type.Optional( + Type.Number({ description: "Total time to wait before timing out." }), + ), + pollIntervalMs: Type.Optional(Type.Number({ description: "Delay between polls." })), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record, signal?: AbortSignal) { + try { + const app = readRequiredString(params, "app"); + const timeoutMs = readOptionalNumber(params, "timeoutMs"); + const pollIntervalMs = readOptionalNumber(params, "pollIntervalMs"); + const resolvedTimeoutMs = + typeof timeoutMs === "number" && timeoutMs > 0 ? timeoutMs : 120_000; + const resolvedPollMs = + typeof pollIntervalMs === "number" && pollIntervalMs > 0 ? pollIntervalMs : 3_000; + const deadline = Date.now() + resolvedTimeoutMs; + + while (true) { + if (signal?.aborted) { + return json({ status: "aborted" }); + } + + const result = await checkIntegration({ pluginConfig: deps.pluginConfig }, app); + if (!result.ok) { + return json({ error: result.error }); + } + + const payload = + result.data && typeof result.data === "object" + ? (result.data as { connected?: unknown; accountId?: unknown }) + : undefined; + if (payload?.connected === true) { + const accountId = + typeof payload.accountId === "string" ? payload.accountId : undefined; + return json({ status: "connected", accountId }); + } + + const now = Date.now(); + if (now >= deadline) { + return json({ status: "timeout" }); + } + + const waitMs = Math.min(resolvedPollMs, deadline - now); + const slept = await sleep(waitMs, signal); + if (slept === "aborted") { + return json({ status: "aborted" }); + } + } + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + ]; +} diff --git a/extensions/pazi/src/pazi-context.ts b/extensions/pazi/src/proxy/pazi-context.ts similarity index 95% rename from extensions/pazi/src/pazi-context.ts rename to extensions/pazi/src/proxy/pazi-context.ts index 66e8272983..8167808cf9 100644 --- a/extensions/pazi/src/pazi-context.ts +++ b/extensions/pazi/src/proxy/pazi-context.ts @@ -1,7 +1,7 @@ import type { IncomingMessage, ServerResponse } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; -import { resolveGatewayToken } from "./config.js"; -import { setProxyContext } from "./context.js"; +import { resolveGatewayToken } from "../config.js"; +import { setProxyContext } from "../context.js"; type JsonBody = { userId?: string; diff --git a/extensions/pazi/src/pazi-proxy.ts b/extensions/pazi/src/proxy/pazi-proxy.ts similarity index 98% rename from extensions/pazi/src/pazi-proxy.ts rename to extensions/pazi/src/proxy/pazi-proxy.ts index bda260c414..ff3ab2625c 100644 --- a/extensions/pazi/src/pazi-proxy.ts +++ b/extensions/pazi/src/proxy/pazi-proxy.ts @@ -1,7 +1,7 @@ import http from "node:http"; import type { IncomingHttpHeaders } from "node:http"; import https from "node:https"; -import { getProxyContext } from "./context.js"; +import { getProxyContext } from "../context.js"; type ProxyLogger = { info: (message: string) => void; From 2036581952868c5060c052e7550f3d44a8185b53 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Wed, 4 Mar 2026 11:06:10 +0100 Subject: [PATCH 16/80] feat(pipedream): add schema + request scope --- extensions/pazi/src/pipedream/api.ts | 62 +++ extensions/pazi/src/pipedream/tools.ts | 554 ++++++++++++++++++++++++- pnpm-lock.yaml | 3 + src/gateway/method-scopes.ts | 1 + 4 files changed, 603 insertions(+), 17 deletions(-) diff --git a/extensions/pazi/src/pipedream/api.ts b/extensions/pazi/src/pipedream/api.ts index 067f013feb..288b3fdf9f 100644 --- a/extensions/pazi/src/pipedream/api.ts +++ b/extensions/pazi/src/pipedream/api.ts @@ -130,6 +130,68 @@ export async function listActions( } } +export async function getAction( + params: { pluginConfig: Record | null }, + actionId: string, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL(`/integrations/actions/${encodeURIComponent(actionId)}`, apiParams.apiUrl); + return await requestJson(apiParams, url); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function configureActionProp( + params: { pluginConfig: Record | null }, + actionId: string, + body: { + propName: string; + configuredProps?: Record; + query?: string; + page?: number; + prevContext?: Record; + dynamicPropsId?: string; + }, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL( + `/integrations/actions/${encodeURIComponent(actionId)}/configure-prop`, + apiParams.apiUrl, + ); + return await requestJson(apiParams, url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body), + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function reloadActionProps( + params: { pluginConfig: Record | null }, + actionId: string, + body: { configuredProps?: Record; dynamicPropsId?: string }, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + const url = new URL( + `/integrations/actions/${encodeURIComponent(actionId)}/reload-props`, + apiParams.apiUrl, + ); + return await requestJson(apiParams, url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body), + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + export async function checkIntegration( params: { pluginConfig: Record | null }, app: string, diff --git a/extensions/pazi/src/pipedream/tools.ts b/extensions/pazi/src/pipedream/tools.ts index 57c98c555f..225d47d29e 100644 --- a/extensions/pazi/src/pipedream/tools.ts +++ b/extensions/pazi/src/pipedream/tools.ts @@ -4,6 +4,9 @@ import { callGateway } from "../../../../src/gateway/call.js"; import { checkIntegration, listActions, + getAction, + configureActionProp, + reloadActionProps, runAction, searchApps, type PipedreamApiResult, @@ -69,6 +72,104 @@ function unwrapResult(result: PipedreamApiResult): AgentToolResult { return json({ error: result.error }); } +type ConfigurableProp = { + name?: string; + type?: string; + label?: string; + description?: string; + optional?: boolean; + hidden?: boolean; + disabled?: boolean; + withLabel?: boolean; + remoteOptions?: boolean; + useQuery?: boolean; + reloadProps?: boolean; +}; + +type ActionSchemaPayload = { + action?: { + configurableProps?: ConfigurableProp[]; + }; +}; + +type LabelValueOption = { label: string; value: unknown }; + +function extractActionProps(payload: unknown): ConfigurableProp[] { + if (!payload || typeof payload !== "object") { + return []; + } + const data = payload as ActionSchemaPayload; + const props = data.action?.configurableProps; + return Array.isArray(props) ? props : []; +} + +function isLabelValue(value: unknown): value is { label: string; value: unknown } { + if (!value || typeof value !== "object") { + return false; + } + const record = value as { label?: unknown; value?: unknown }; + return typeof record.label === "string" && "value" in record; +} + +function normalizeOptions(payload: unknown): LabelValueOption[] { + if (!payload || typeof payload !== "object") { + return []; + } + const record = payload as { + options?: Array< + { label?: string; value?: unknown } | { lv?: { label?: string; value?: unknown } } + >; + stringOptions?: string[]; + }; + const options: LabelValueOption[] = []; + if (Array.isArray(record.options)) { + for (const raw of record.options) { + if (!raw || typeof raw !== "object") { + continue; + } + if ("lv" in raw && raw.lv && typeof raw.lv === "object") { + const lv = raw.lv as { label?: string; value?: unknown }; + if (typeof lv.label === "string") { + options.push({ label: lv.label, value: lv.value }); + } + continue; + } + const direct = raw as { label?: string; value?: unknown }; + if (typeof direct.label === "string") { + options.push({ label: direct.label, value: direct.value }); + } + } + } + if (Array.isArray(record.stringOptions)) { + for (const value of record.stringOptions) { + options.push({ label: value, value }); + } + } + return options; +} + +function matchesType(value: unknown, propType: string): boolean { + if (propType === "any" || propType === "object" || propType === "sql") { + return true; + } + if (propType === "string") { + return typeof value === "string"; + } + if (propType === "integer") { + return typeof value === "number" && Number.isInteger(value); + } + if (propType === "boolean") { + return typeof value === "boolean"; + } + if (propType === "string[]") { + return Array.isArray(value) && value.every((item) => typeof item === "string"); + } + if (propType === "integer[]") { + return Array.isArray(value) && value.every((item) => typeof item === "number"); + } + return true; +} + async function sleep(ms: number, signal?: AbortSignal): Promise<"ok" | "aborted"> { if (signal?.aborted) { return "aborted"; @@ -91,9 +192,10 @@ async function sleep(ms: number, signal?: AbortSignal): Promise<"ok" | "aborted" export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { return [ { - name: "mcp__pipedream__find_integrations", + name: "pipedream_find_integrations", label: "Pipedream: Find Integrations", - description: "Search Pipedream integrations/apps by name.", + description: + "ALWAYS call this FIRST to discover the correct Pipedream app slug. App slugs are often different from expected (e.g. Slack is 'slack_v2', Gmail is 'gmail', etc.). Returns matching apps with their exact slug to use in subsequent calls.", parameters: Type.Object( { query: Type.String({ description: "Search query." }), @@ -113,9 +215,10 @@ export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { }, }, { - name: "mcp__pipedream__list_actions", + name: "pipedream_list_actions", label: "Pipedream: List Actions", - description: "List available actions for a Pipedream app.", + description: + "List available actions for a Pipedream app. Returns each action's key (use as actionId), name, description, and a basic configuredProps schema (exact property names and types). For full configurableProps metadata (remote options, withLabel, etc.), call pipedream_get_action.", parameters: Type.Object( { app: Type.String({ description: "Pipedream app slug." }), @@ -135,12 +238,156 @@ export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { }, }, { - name: "mcp__pipedream__check_integration", + name: "pipedream_get_action", + label: "Pipedream: Get Action Schema", + description: + "Fetch the full configurableProps schema for a specific action. Use this to see required props, remoteOptions, withLabel, and other metadata before calling pipedream_use_integration.", + parameters: Type.Object( + { + actionId: Type.String({ + description: "Action key from pipedream_list_actions (e.g. 'slack_v2-send-message').", + }), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const actionId = readRequiredString(params, "actionId"); + const result = await getAction({ pluginConfig: deps.pluginConfig }, actionId); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "pipedream_configure_prop", + label: "Pipedream: Configure Prop", + description: + "Fetch remote options (label/value) for a configurable prop, or validate dynamic props. Use this for props marked remoteOptions/withLabel or when you need to map a human name to an ID.", + parameters: Type.Object( + { + actionId: Type.String({ + description: "Action key from pipedream_list_actions.", + }), + propName: Type.String({ + description: "Configurable prop name from pipedream_get_action.", + }), + configuredProps: Type.Optional( + Type.Record(Type.String(), Type.Unknown(), { + description: + "Current configuredProps values (excluding auth). Used to resolve dependent props.", + }), + ), + query: Type.Optional( + Type.String({ + description: "Optional search query for filtering options (if supported).", + }), + ), + page: Type.Optional(Type.Number({ description: "Optional page for pagination." })), + prevContext: Type.Optional( + Type.Record(Type.String(), Type.Unknown(), { + description: "Optional context from a previous configureProp call.", + }), + ), + dynamicPropsId: Type.Optional( + Type.String({ + description: "Optional dynamicPropsId when props are generated dynamically.", + }), + ), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const actionId = readRequiredString(params, "actionId"); + const propName = readRequiredString(params, "propName"); + const configuredProps = params.configuredProps; + if ( + configuredProps !== undefined && + (typeof configuredProps !== "object" || + configuredProps === null || + Array.isArray(configuredProps)) + ) { + throw new Error("configuredProps must be an object"); + } + const query = readOptionalString(params, "query"); + const page = readOptionalNumber(params, "page"); + const prevContext = params.prevContext; + if ( + prevContext !== undefined && + (typeof prevContext !== "object" || prevContext === null || Array.isArray(prevContext)) + ) { + throw new Error("prevContext must be an object"); + } + const dynamicPropsId = readOptionalString(params, "dynamicPropsId"); + + const result = await configureActionProp({ pluginConfig: deps.pluginConfig }, actionId, { + propName, + configuredProps: configuredProps as Record | undefined, + query: query ?? undefined, + page: page ?? undefined, + prevContext: prevContext as Record | undefined, + dynamicPropsId, + }); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "pipedream_reload_props", + label: "Pipedream: Reload Props", + description: + "Reload dynamic props after setting dependent values (when a prop has reloadProps=true).", + parameters: Type.Object( + { + actionId: Type.String({ description: "Action key from pipedream_list_actions." }), + configuredProps: Type.Optional( + Type.Record(Type.String(), Type.Unknown(), { + description: "Current configuredProps values (excluding auth).", + }), + ), + dynamicPropsId: Type.Optional(Type.String({ description: "Dynamic props ID." })), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record) { + try { + const actionId = readRequiredString(params, "actionId"); + const configuredProps = params.configuredProps; + if ( + configuredProps !== undefined && + (typeof configuredProps !== "object" || + configuredProps === null || + Array.isArray(configuredProps)) + ) { + throw new Error("configuredProps must be an object"); + } + const dynamicPropsId = readOptionalString(params, "dynamicPropsId"); + + const result = await reloadActionProps({ pluginConfig: deps.pluginConfig }, actionId, { + configuredProps: configuredProps as Record | undefined, + dynamicPropsId: dynamicPropsId ?? undefined, + }); + return unwrapResult(result); + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + { + name: "pipedream_check_integration", label: "Pipedream: Check Integration", - description: "Check whether a Pipedream integration is connected.", + description: + "Check whether a Pipedream app is connected. Use the exact app slug from pipedream_find_integrations. Returns {connected: true, accountId} if connected.", parameters: Type.Object( { - app: Type.String({ description: "Pipedream app slug." }), + app: Type.String({ + description: + "Pipedream app slug from pipedream_find_integrations (e.g. 'slack_v2', not 'slack').", + }), }, { additionalProperties: false }, ), @@ -148,6 +395,18 @@ export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { try { const app = readRequiredString(params, "app"); const result = await checkIntegration({ pluginConfig: deps.pluginConfig }, app); + if (result.ok) { + const data = + result.data && typeof result.data === "object" + ? (result.data as { connected?: unknown }) + : undefined; + if (data?.connected !== true) { + return json({ + ...data, + hint: `App "${app}" is not connected. Did you use the correct slug? Call pipedream_find_integrations to discover the exact Pipedream slug (e.g. Slack is "slack_v2", not "slack").`, + }); + } + } return unwrapResult(result); } catch (err) { return json({ error: err instanceof Error ? err.message : String(err) }); @@ -155,16 +414,20 @@ export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { }, }, { - name: "mcp__pipedream__use_integration", + name: "pipedream_use_integration", label: "Pipedream: Use Integration", - description: "Run a Pipedream action for a connected integration.", + description: + "Run a Pipedream action. IMPORTANT: Use pipedream_list_actions to discover actionId and pipedream_get_action to fetch the full configurableProps schema. This tool validates your configuredProps and will reject calls with missing/unknown props. Do NOT guess property names — use the schema. Do NOT include auth/app props — authentication is automatic. For props with remoteOptions/withLabel, use pipedream_configure_prop to fetch options.", parameters: Type.Object( { app: Type.String({ description: "Pipedream app slug." }), - actionId: Type.String({ description: "Action id to invoke." }), + actionId: Type.String({ + description: "Action key from pipedream_list_actions (e.g. 'slack_v2-send-message').", + }), configuredProps: Type.Optional( Type.Record(Type.String(), Type.Unknown(), { - description: "Configured properties for the action.", + description: + "Action properties. Keys and types MUST match the configurableProps schema returned by pipedream_get_action.", }), ), }, @@ -183,22 +446,278 @@ export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { ) { throw new Error("configuredProps must be an object"); } + const props = (configuredProps as Record | undefined) ?? {}; + const resolvedProps: Record = { ...props }; + + // Validate configuredProps against full action schema + const actionResult = await getAction({ pluginConfig: deps.pluginConfig }, actionId); + if (!actionResult.ok) { + return json({ + error: actionResult.error, + hint: "Failed to fetch action schema. Try pipedream_get_action again before calling pipedream_use_integration.", + }); + } + + const actionProps = extractActionProps(actionResult.data); + const authPropNames = actionProps + .filter((p) => p.type === "app" && typeof p.name === "string") + .map((p) => p.name as string); + + const expectedProps = actionProps.filter((p) => { + if (!p.name || typeof p.name !== "string") { + return false; + } + if (p.type === "app") { + return false; + } + if (p.hidden === true || p.disabled === true) { + return false; + } + return true; + }); + + const tryResolveValue = async ( + prop: ConfigurableProp, + value: unknown, + ): Promise< + { ok: true; value: unknown } | { ok: false; error: string; options?: string[] } + > => { + if (!prop.name || typeof prop.name !== "string") { + return { ok: true, value }; + } + if (isLabelValue(value)) { + return { ok: true, value }; + } + if (Array.isArray(value)) { + const resolvedValues: unknown[] = []; + for (const item of value) { + if (isLabelValue(item)) { + resolvedValues.push(item); + continue; + } + if (typeof item !== "string") { + return { + ok: false, + error: `Prop "${prop.name}" expects label/value objects; got non-string array item.`, + }; + } + const lookup = await configureActionProp( + { pluginConfig: deps.pluginConfig }, + actionId, + { + propName: prop.name, + configuredProps: resolvedProps, + query: prop.useQuery ? item : undefined, + }, + ); + if (!lookup.ok) { + return { ok: false, error: lookup.error }; + } + const options = normalizeOptions(lookup.data); + const match = options.filter( + (opt) => + opt.label.toLowerCase() === item.toLowerCase() || + String(opt.value ?? "").toLowerCase() === item.toLowerCase(), + ); + if (match.length !== 1) { + return { + ok: false, + error: + match.length === 0 + ? `No option found for "${item}" in prop "${prop.name}".` + : `Multiple options found for "${item}" in prop "${prop.name}".`, + options: options.slice(0, 5).map((opt) => opt.label), + }; + } + const selected = match[0]; + const selectedValue = selected.value ?? selected.label; + const resolved = prop.withLabel + ? { label: selected.label, value: selectedValue } + : selectedValue; + resolvedValues.push(resolved); + } + return { ok: true, value: resolvedValues }; + } + if (typeof value !== "string") { + return { ok: true, value }; + } + + const lookup = await configureActionProp( + { pluginConfig: deps.pluginConfig }, + actionId, + { + propName: prop.name, + configuredProps: resolvedProps, + query: prop.useQuery ? value : undefined, + }, + ); + if (!lookup.ok) { + return { ok: false, error: lookup.error }; + } + const options = normalizeOptions(lookup.data); + const match = options.filter( + (opt) => + opt.label.toLowerCase() === value.toLowerCase() || + String(opt.value ?? "").toLowerCase() === value.toLowerCase(), + ); + if (match.length !== 1) { + return { + ok: false, + error: + match.length === 0 + ? `No option found for "${value}" in prop "${prop.name}".` + : `Multiple options found for "${value}" in prop "${prop.name}".`, + options: options.slice(0, 5).map((opt) => opt.label), + }; + } + const selected = match[0]; + const selectedValue = selected.value ?? selected.label; + const resolved = prop.withLabel + ? { label: selected.label, value: selectedValue } + : selectedValue; + return { ok: true, value: resolved }; + }; + + // Auto-resolve remote options when needed + const resolutionErrors: Array<{ prop: string; error: string; options?: string[] }> = []; + for (const prop of expectedProps) { + if (!prop.name || typeof prop.name !== "string") { + continue; + } + if (!(prop.name in resolvedProps)) { + continue; + } + const value = resolvedProps[prop.name]; + if (value === undefined || value === null) { + continue; + } + + const needsRemote = + prop.remoteOptions === true || prop.useQuery === true || prop.withLabel === true; + const needsLabel = + prop.withLabel === true && + !(isLabelValue(value) || (Array.isArray(value) && value.every(isLabelValue))); + + if (needsRemote || needsLabel) { + const resolved = await tryResolveValue(prop, value); + if (!resolved.ok) { + resolutionErrors.push({ + prop: prop.name, + error: resolved.error, + options: resolved.options, + }); + } else { + resolvedProps[prop.name] = resolved.value; + } + } + } + + if (resolutionErrors.length > 0) { + return json({ + error: "Unable to resolve remote options for one or more props.", + details: resolutionErrors, + hint: "Call pipedream_configure_prop to fetch options and pass { label, value } for withLabel props.", + }); + } + + const expectedNames = new Set( + expectedProps.map((p) => (typeof p.name === "string" ? p.name : "")).filter(Boolean), + ); + const requiredProps = expectedProps.filter((p) => p.optional !== true); + const providedNames = new Set( + Object.entries(resolvedProps) + .filter(([_, value]) => value !== undefined && value !== null) + .map(([name]) => name), + ); + for (const authName of authPropNames) { + providedNames.delete(authName); + } + + const missingRequired = requiredProps + .filter((p) => p.name && !providedNames.has(p.name)) + .map((p) => p.name); + const unrecognized = [...providedNames].filter((n) => !expectedNames.has(n)); + + const typeErrors = expectedProps + .filter((p) => p.name && providedNames.has(p.name)) + .map((p) => { + const value = resolvedProps[p.name as string]; + if ( + p.withLabel && + (isLabelValue(value) || (Array.isArray(value) && value.every(isLabelValue))) + ) { + return null; + } + if (!p.type) { + return null; + } + if (!matchesType(value, p.type)) { + return { name: p.name, expectedType: p.type }; + } + return null; + }) + .filter(Boolean); + + if (missingRequired.length > 0 || unrecognized.length > 0 || typeErrors.length > 0) { + return json({ + error: "Invalid configuredProps.", + missingRequired: missingRequired.length > 0 ? missingRequired : undefined, + unrecognized: unrecognized.length > 0 ? unrecognized : undefined, + typeErrors: typeErrors.length > 0 ? typeErrors : undefined, + expectedProps: expectedProps.map((p) => ({ + name: p.name, + type: p.type, + description: p.description ?? p.label, + required: p.optional !== true, + remoteOptions: p.remoteOptions === true ? true : undefined, + withLabel: p.withLabel === true ? true : undefined, + useQuery: p.useQuery === true ? true : undefined, + })), + hint: "Use the exact property names and types from the expectedProps list above. For remote options, call pipedream_configure_prop to get label/value entries.", + }); + } + + const authPropProvided = authPropNames.filter((name) => + Object.prototype.hasOwnProperty.call(resolvedProps, name), + ); + if (authPropProvided.length > 0) { + return json({ + error: "Do not include auth/app props in configuredProps.", + authProps: authPropProvided, + hint: "Remove auth props; authentication is added automatically.", + }); + } + const result = await runAction( { pluginConfig: deps.pluginConfig }, app, actionId, - configuredProps as Record | undefined, + Object.keys(resolvedProps).length > 0 ? resolvedProps : undefined, ); - return unwrapResult(result); + if (result.ok) { + return json({ + ...(result.data as Record), + _request: { app, actionId, configuredProps: resolvedProps }, + note: + (result.data as { result?: unknown })?.result === null + ? "Action returned null result. This can be normal, but verify the message was delivered." + : undefined, + }); + } + return json({ + error: result.error, + _request: { app, actionId, configuredProps: resolvedProps }, + }); } catch (err) { return json({ error: err instanceof Error ? err.message : String(err) }); } }, }, { - name: "mcp__pipedream__request_integration", + name: "pipedream_request_integration", label: "Pipedream: Request Integration", - description: "Prompt the UI to connect a Pipedream integration.", + description: + "Prompt the user's UI to connect a Pipedream integration. Only use this AFTER check_integration returns connected=false. This opens an OAuth dialog in the frontend.", parameters: Type.Object( { app: Type.String({ description: "Pipedream app slug." }), @@ -222,9 +741,10 @@ export function createPipedreamTools(deps: PipedreamToolsDeps): AnyAgentTool[] { }, }, { - name: "mcp__pipedream__wait_for_connection", + name: "pipedream_wait_for_connection", label: "Pipedream: Wait For Connection", - description: "Poll until a Pipedream integration is connected.", + description: + "Poll until a Pipedream integration is connected. Use after request_integration to wait for the user to complete the OAuth flow.", parameters: Type.Object( { app: Type.String({ description: "Pipedream app slug." }), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 318dd748a3..8c0612e614 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -390,6 +390,9 @@ importers: extensions/pazi: dependencies: + '@sinclair/typebox': + specifier: 0.34.48 + version: 0.34.48 openclaw: specifier: '>=2026.1.26' version: 2026.2.24(@napi-rs/canvas@0.1.95)(@types/express@5.0.6)(audio-decode@2.2.3)(hono@4.11.10)(node-llama-cpp@3.15.1(typescript@5.9.3)) diff --git a/src/gateway/method-scopes.ts b/src/gateway/method-scopes.ts index f52b24de75..62d5ac5adb 100644 --- a/src/gateway/method-scopes.ts +++ b/src/gateway/method-scopes.ts @@ -82,6 +82,7 @@ const METHOD_SCOPE_GROUPS: Record = { "agent", "agent.wait", "wake", + "pazi.integration.emit", "talk.mode", "tts.enable", "tts.disable", From b95aeaaf895fb29b8b26d73a38265184e80e33c7 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Wed, 4 Mar 2026 11:30:24 +0100 Subject: [PATCH 17/80] Add dockerfile desktop icon --- Dockerfile.pazi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 59d5e5047e..ed3a4dd15e 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -65,8 +65,11 @@ WORKDIR /app # Copy built app from builder stage COPY --from=builder --chown=pazi:pazi /app /app -# Runtime directories -RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share && \ +# Runtime directories + Desktop shortcut to OpenClaw config +RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share /home/pazi/Desktop && \ + printf '[Desktop Entry]\nType=Application\nName=OpenClaw Config\nIcon=folder\nExec=thunar /home/pazi/.openclaw\nTerminal=false\n' \ + > /home/pazi/Desktop/openclaw.desktop && \ + chmod +x /home/pazi/Desktop/openclaw.desktop && \ chown -R pazi:pazi /home/pazi # Supervisord config From 2612f02339fe5044831afbef4444fbf6b78e9c57 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Wed, 4 Mar 2026 12:27:14 +0100 Subject: [PATCH 18/80] Add dockerfile desktop icon 2 --- Dockerfile.pazi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index ed3a4dd15e..59d5e5047e 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -65,11 +65,8 @@ WORKDIR /app # Copy built app from builder stage COPY --from=builder --chown=pazi:pazi /app /app -# Runtime directories + Desktop shortcut to OpenClaw config -RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share /home/pazi/Desktop && \ - printf '[Desktop Entry]\nType=Application\nName=OpenClaw Config\nIcon=folder\nExec=thunar /home/pazi/.openclaw\nTerminal=false\n' \ - > /home/pazi/Desktop/openclaw.desktop && \ - chmod +x /home/pazi/Desktop/openclaw.desktop && \ +# Runtime directories +RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share && \ chown -R pazi:pazi /home/pazi # Supervisord config From ea3168e1bc596d2d9f4af6df70415d908e265144 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Wed, 4 Mar 2026 13:06:05 +0100 Subject: [PATCH 19/80] Update dockerfile --- Dockerfile.pazi | 26 +++++++++++++++++++++----- supervisord.pazi.conf | 10 +++------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 59d5e5047e..ce204a82e2 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -48,15 +48,31 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0 \ # Fonts fonts-liberation fonts-noto-color-emoji \ - # Desktop environment - xvfb x11vnc novnc websockify \ - xfce4 xfce4-terminal dbus-x11 \ + # Desktop environment (Xvfb + XFCE4) + xvfb xfce4 xfce4-terminal dbus-x11 \ + # Selkies-GStreamer dependencies + python3 python3-gi python3-setuptools python3-pip python3-dev \ + libpulse0 libwayland-dev libwayland-egl1 \ + x11-utils x11-xkb-utils x11-xserver-utils \ + libx11-xcb1 libxcb-dri3-0 libxkbcommon0 libxdamage1 libxfixes3 \ + libxv1 libxtst6 libxext6 libgcrypt20 glib-networking \ + jq \ # Utilities git curl ca-certificates procps \ # Process manager supervisor \ && apt-get clean && rm -rf /var/lib/apt/lists/* +# Install Selkies-GStreamer (WebRTC remote desktop, replaces noVNC) +RUN SELKIES_VERSION="$(curl -fsSL \ + "https://api.github.com/repos/selkies-project/selkies/releases/latest" | \ + jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')" && \ + mkdir -p /opt/selkies && cd /opt/selkies && \ + curl -fsSL \ + "https://github.com/selkies-project/selkies/releases/download/v${SELKIES_VERSION}/selkies-gstreamer-portable-v${SELKIES_VERSION}_amd64.tar.gz" | \ + tar -xzf - && \ + echo "Selkies-GStreamer v${SELKIES_VERSION} installed" + # Create pazi user (UID 1001 — matches host /home/pazi volume mounts) RUN groupadd -g 1001 pazi && useradd -u 1001 -g 1001 -m -d /home/pazi pazi @@ -77,8 +93,8 @@ ENV NODE_ENV=production \ GENERATIONS_DIR=/home/pazi/generations # 3000 — OpenClaw gateway (HTTP + WS) -# 6080 — noVNC desktop -EXPOSE 3000 6080 +# 8080 — Selkies-GStreamer WebRTC desktop +EXPOSE 3000 8080 HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ CMD curl -f http://127.0.0.1:3000/health || exit 1 diff --git a/supervisord.pazi.conf b/supervisord.pazi.conf index c5ec6ac74b..21a00d7492 100644 --- a/supervisord.pazi.conf +++ b/supervisord.pazi.conf @@ -23,16 +23,12 @@ environment=HOME="/home/pazi",DISPLAY=":1" autorestart=false priority=25 -[program:x11vnc] -command=bash -c "sleep 3 && x11vnc -display :1 -nopw -forever -shared -rfbport 5901 -localhost" +[program:selkies] +command=bash -c "sleep 3 && /opt/selkies/selkies-gstreamer/selkies-gstreamer-run --addr=0.0.0.0 --port=8080 --enable_https=false --encoder=x264enc --enable_resize=false --enable_basic_auth=false" +environment=DISPLAY=":1",XDG_RUNTIME_DIR="/tmp",PIPEWIRE_LATENCY="128/48000",PULSE_RUNTIME_PATH="/tmp/pulse",PULSE_SERVER="unix:/tmp/pulse/native" autorestart=true priority=30 -[program:websockify] -command=bash -c "sleep 4 && websockify --web /usr/share/novnc 6080 localhost:5901" -autorestart=true -priority=40 - [program:agent] command=bash -c "sleep 8 && exec node /app/openclaw.mjs gateway --allow-unconfigured --bind lan" user=pazi From a452fae1d089ebd0bde1de69f0de62108988554a Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Wed, 4 Mar 2026 13:28:34 +0100 Subject: [PATCH 20/80] Fix pazi conf --- supervisord.pazi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisord.pazi.conf b/supervisord.pazi.conf index 21a00d7492..5554e4fed0 100644 --- a/supervisord.pazi.conf +++ b/supervisord.pazi.conf @@ -24,7 +24,7 @@ autorestart=false priority=25 [program:selkies] -command=bash -c "sleep 3 && /opt/selkies/selkies-gstreamer/selkies-gstreamer-run --addr=0.0.0.0 --port=8080 --enable_https=false --encoder=x264enc --enable_resize=false --enable_basic_auth=false" +command=bash -c "sleep 3 && /opt/selkies/selkies-gstreamer/selkies-gstreamer-run --addr=0.0.0.0 --port=8080 --web_root=/opt/selkies/selkies-gstreamer/share/selkies-web --enable_https=false --encoder=x264enc --enable_resize=false --enable_basic_auth=false" environment=DISPLAY=":1",XDG_RUNTIME_DIR="/tmp",PIPEWIRE_LATENCY="128/48000",PULSE_RUNTIME_PATH="/tmp/pulse",PULSE_SERVER="unix:/tmp/pulse/native" autorestart=true priority=30 From 91b9e7e8b2e90a7cff67c576fadb185d2847b3d2 Mon Sep 17 00:00:00 2001 From: mijauexe Date: Wed, 4 Mar 2026 14:34:17 +0100 Subject: [PATCH 21/80] Add file upload in chat --- extensions/pazi/index.ts | 22 +++++ extensions/pazi/src/proxy/pazi-upload.ts | 109 +++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 extensions/pazi/src/proxy/pazi-upload.ts diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index c87b887b68..92a717fce6 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -4,6 +4,7 @@ import { resolvePaziBillingConfig } from "./src/config.js"; import { createPipedreamTools } from "./src/pipedream/tools.js"; import { createPaziContextHandler } from "./src/proxy/pazi-context.js"; import { startPaziProxy } from "./src/proxy/pazi-proxy.js"; +import { createPaziUploadHandler } from "./src/proxy/pazi-upload.js"; function normalizePluginConfig( value: OpenClawPluginApi["pluginConfig"], @@ -37,6 +38,12 @@ export default { logger: api.logger, }); + const uploadHandler = createPaziUploadHandler({ + configToken: api.config.gateway?.auth?.token, + env: process.env, + logger: api.logger, + }); + api.registerGatewayMethod("pazi.integration.emit", ({ params, respond, context }) => { context.broadcast("integration", params); respond(true, { emitted: true }); @@ -52,6 +59,7 @@ export default { api.registerHttpRoute({ path: "/pazi/context", + auth: "gateway", handler: async (req, res) => { if (req.method !== "POST") { res.statusCode = 404; @@ -63,6 +71,20 @@ export default { }, }); + api.registerHttpRoute({ + path: "/pazi/upload", + auth: "gateway", + handler: async (req, res) => { + if (req.method !== "POST") { + res.statusCode = 404; + res.setHeader("Content-Type", "text/plain; charset=utf-8"); + res.end("Not Found"); + return; + } + await uploadHandler(req, res); + }, + }); + let proxyServer: HttpServer | null = null; api.registerService({ diff --git a/extensions/pazi/src/proxy/pazi-upload.ts b/extensions/pazi/src/proxy/pazi-upload.ts new file mode 100644 index 0000000000..5bb58efab4 --- /dev/null +++ b/extensions/pazi/src/proxy/pazi-upload.ts @@ -0,0 +1,109 @@ +import { existsSync } from "node:fs"; +import { mkdir, writeFile } from "node:fs/promises"; +import type { IncomingMessage, ServerResponse } from "node:http"; +import { homedir } from "node:os"; +import { join, extname, basename } from "node:path"; +import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import { resolveGatewayToken } from "../config.js"; + +type UploadFile = { + name: string; + content: string; // base64 + mimeType: string; +}; + +type UploadBody = { + files?: UploadFile[]; +}; + +type UploadHandlerDeps = { + configToken?: string; + env?: NodeJS.ProcessEnv; + logger: OpenClawPluginApi["logger"]; +}; + +function writeJson(res: ServerResponse, status: number, body: unknown) { + res.writeHead(status, { "Content-Type": "application/json; charset=utf-8" }); + res.end(JSON.stringify(body)); +} + +async function readJsonBody(req: IncomingMessage): Promise { + const chunks: Buffer[] = []; + for await (const chunk of req) { + if (typeof chunk === "string") { + chunks.push(Buffer.from(chunk)); + } else { + chunks.push(chunk); + } + } + try { + const parsed = JSON.parse(Buffer.concat(chunks).toString()); + if (parsed && typeof parsed === "object") { + return parsed as UploadBody; + } + } catch { + return null; + } + return null; +} + +/** Resolve a unique path, appending -1, -2, etc. on collision. */ +function uniquePath(dir: string, name: string): string { + const ext = extname(name); + const base = basename(name, ext); + let candidate = join(dir, name); + let counter = 0; + while (existsSync(candidate)) { + counter++; + candidate = join(dir, `${base}-${String(counter)}${ext}`); + } + return candidate; +} + +export function createPaziUploadHandler(deps: UploadHandlerDeps) { + return async (req: IncomingMessage, res: ServerResponse): Promise => { + const gatewayToken = resolveGatewayToken({ + configToken: deps.configToken, + env: deps.env, + }); + if (!gatewayToken) { + deps.logger.warn("pazi upload request rejected: gateway token missing"); + writeJson(res, 500, { error: "gateway_token_missing" }); + return; + } + + const authHeader = req.headers.authorization; + if (authHeader !== `Bearer ${gatewayToken}`) { + writeJson(res, 401, { error: "unauthorized" }); + return; + } + + const body = await readJsonBody(req); + if (!body) { + writeJson(res, 400, { error: "invalid JSON" }); + return; + } + + const { files } = body; + if (!Array.isArray(files) || files.length === 0) { + writeJson(res, 400, { error: "no files provided" }); + return; + } + + const uploadDir = join(homedir(), "Desktop", "agent"); + await mkdir(uploadDir, { recursive: true }); + + const paths: string[] = []; + for (const file of files) { + if (!file.name || !file.content) { + continue; + } + const filePath = uniquePath(uploadDir, file.name); + await writeFile(filePath, Buffer.from(file.content, "base64")); + paths.push(filePath); + } + + deps.logger.info(`pazi upload: wrote ${String(paths.length)} file(s) to ${uploadDir}`); + writeJson(res, 200, { paths }); + }; +} From 8f9fd94e78d9d853778ab18612b44629779d00a7 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Wed, 4 Mar 2026 14:37:09 +0100 Subject: [PATCH 22/80] Update screenshot --- Dockerfile.pazi | 2 ++ supervisord.pazi.conf | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index ce204a82e2..0c032d4144 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -57,6 +57,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins libx11-xcb1 libxcb-dri3-0 libxkbcommon0 libxdamage1 libxfixes3 \ libxv1 libxtst6 libxext6 libgcrypt20 glib-networking \ jq \ + # Screenshot capture for desktop preview + scrot \ # Utilities git curl ca-certificates procps \ # Process manager diff --git a/supervisord.pazi.conf b/supervisord.pazi.conf index 5554e4fed0..62facc827e 100644 --- a/supervisord.pazi.conf +++ b/supervisord.pazi.conf @@ -29,6 +29,12 @@ environment=DISPLAY=":1",XDG_RUNTIME_DIR="/tmp",PIPEWIRE_LATENCY="128/48000",PUL autorestart=true priority=30 +[program:desktop-preview] +command=bash -c "sleep 10 && while true; do scrot -q 40 /tmp/preview-new.jpg && mv -f /tmp/preview-new.jpg /opt/selkies/selkies-gstreamer/share/selkies-web/preview.jpg; sleep 60; done" +environment=DISPLAY=":1" +autorestart=true +priority=35 + [program:agent] command=bash -c "sleep 8 && exec node /app/openclaw.mjs gateway --allow-unconfigured --bind lan" user=pazi From 9454874c5fb74f98156e33045238d2cffbd77879 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Wed, 4 Mar 2026 15:02:30 +0100 Subject: [PATCH 23/80] Use s3 background image --- Dockerfile.pazi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 0c032d4144..9a4cb4c96a 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -83,6 +83,11 @@ WORKDIR /app # Copy built app from builder stage COPY --from=builder --chown=pazi:pazi /app /app +# Download desktop wallpaper from S3 +RUN mkdir -p /usr/share/backgrounds && \ + curl -fsSL "https://s3.us-east-1.amazonaws.com/assets.pazi.ai/cloud/pazi-desktop-bg.jpg" \ + -o /usr/share/backgrounds/pazi-desktop.jpg + # Runtime directories RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share && \ chown -R pazi:pazi /home/pazi From 2ae32a7aa1aa3268d048335dc289fac2fba7d280 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Thu, 5 Mar 2026 13:53:00 +0100 Subject: [PATCH 24/80] Fix versioning for staging to not overwrite --- .github/workflows/deploy-pazi-agent.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index c560b03eb5..93ede92633 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -42,16 +42,28 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GH_PAT }} + - name: Determine environment + id: env + run: | + if [[ "${{ github.ref_name }}" == "main" ]]; then + echo "environment=production" >> $GITHUB_OUTPUT + echo "suffix=" >> $GITHUB_OUTPUT + else + echo "environment=staging" >> $GITHUB_OUTPUT + echo "suffix=-staging" >> $GITHUB_OUTPUT + fi + - name: Build, tag, and push image to GHCR id: build-image env: - IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }} + IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }}${{ steps.env.outputs.suffix }} + LATEST_TAG: latest${{ steps.env.outputs.suffix }} run: | docker build -f Dockerfile.pazi -t $GHCR_IMAGE:$IMAGE_TAG . - docker tag $GHCR_IMAGE:$IMAGE_TAG $GHCR_IMAGE:latest + docker tag $GHCR_IMAGE:$IMAGE_TAG $GHCR_IMAGE:$LATEST_TAG docker push $GHCR_IMAGE:$IMAGE_TAG - docker push $GHCR_IMAGE:latest + docker push $GHCR_IMAGE:$LATEST_TAG echo "image=$GHCR_IMAGE:$IMAGE_TAG" >> $GITHUB_OUTPUT echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT @@ -64,13 +76,15 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Upload latest version to S3 + env: + IMAGE_TAG: ${{ steps.build-image.outputs.image_tag }} run: | if [[ "${{ github.ref_name }}" == "main" ]]; then S3_KEY="latest.txt" else S3_KEY="latest-staging.txt" fi - echo "${{ steps.get_version.outputs.VERSION }}" > "$S3_KEY" + echo "$IMAGE_TAG" > "$S3_KEY" aws s3 cp "$S3_KEY" "s3://assets.pazi.ai/cloud/$S3_KEY" - name: Deployment Summary From 2b366a8609becfd5f40d5fe4a12af6188d2a1708 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Thu, 5 Mar 2026 14:19:28 +0100 Subject: [PATCH 25/80] Fix version manually for now --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c85410074..902dadfb6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.3", + "version": "2026.3.4", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 402258b73d08d91867145b4aa3c075fd8502472d Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Thu, 5 Mar 2026 14:25:27 +0100 Subject: [PATCH 26/80] Fix token --- .github/workflows/deploy-pazi-agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 93ede92633..927c10a51f 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -40,7 +40,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GH_PAT }} + password: ${{ secrets.GHCR_TOKEN }} - name: Determine environment id: env From 07e2b9313c08b3ee67fb1d0bea6fe989490787a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Mar 2026 13:38:32 +0000 Subject: [PATCH 27/80] chore: release 2026.3.5 [skip ci] --- package.json | 890 +++++++++++++++++++++++++-------------------------- 1 file changed, 445 insertions(+), 445 deletions(-) diff --git a/package.json b/package.json index 902dadfb6b..3b99583a06 100644 --- a/package.json +++ b/package.json @@ -1,447 +1,447 @@ { - "name": "openclaw", - "version": "2026.3.4", - "description": "Multi-channel AI gateway with extensible messaging integrations", - "keywords": [], - "homepage": "https://github.com/openclaw/openclaw#readme", - "bugs": { - "url": "https://github.com/openclaw/openclaw/issues" - }, - "license": "MIT", - "author": "", - "repository": { - "type": "git", - "url": "git+https://github.com/openclaw/openclaw.git" - }, - "bin": { - "openclaw": "openclaw.mjs" - }, - "directories": { - "doc": "docs", - "test": "test" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "openclaw.mjs", - "README-header.png", - "README.md", - "assets/", - "dist/", - "docs/", - "extensions/", - "skills/" - ], - "type": "module", - "main": "dist/index.js", - "exports": { - ".": "./dist/index.js", - "./plugin-sdk": { - "types": "./dist/plugin-sdk/index.d.ts", - "default": "./dist/plugin-sdk/index.js" - }, - "./plugin-sdk/core": { - "types": "./dist/plugin-sdk/core.d.ts", - "default": "./dist/plugin-sdk/core.js" - }, - "./plugin-sdk/compat": { - "types": "./dist/plugin-sdk/compat.d.ts", - "default": "./dist/plugin-sdk/compat.js" - }, - "./plugin-sdk/telegram": { - "types": "./dist/plugin-sdk/telegram.d.ts", - "default": "./dist/plugin-sdk/telegram.js" - }, - "./plugin-sdk/discord": { - "types": "./dist/plugin-sdk/discord.d.ts", - "default": "./dist/plugin-sdk/discord.js" - }, - "./plugin-sdk/slack": { - "types": "./dist/plugin-sdk/slack.d.ts", - "default": "./dist/plugin-sdk/slack.js" - }, - "./plugin-sdk/signal": { - "types": "./dist/plugin-sdk/signal.d.ts", - "default": "./dist/plugin-sdk/signal.js" - }, - "./plugin-sdk/imessage": { - "types": "./dist/plugin-sdk/imessage.d.ts", - "default": "./dist/plugin-sdk/imessage.js" - }, - "./plugin-sdk/whatsapp": { - "types": "./dist/plugin-sdk/whatsapp.d.ts", - "default": "./dist/plugin-sdk/whatsapp.js" - }, - "./plugin-sdk/line": { - "types": "./dist/plugin-sdk/line.d.ts", - "default": "./dist/plugin-sdk/line.js" - }, - "./plugin-sdk/msteams": { - "types": "./dist/plugin-sdk/msteams.d.ts", - "default": "./dist/plugin-sdk/msteams.js" - }, - "./plugin-sdk/acpx": { - "types": "./dist/plugin-sdk/acpx.d.ts", - "default": "./dist/plugin-sdk/acpx.js" - }, - "./plugin-sdk/bluebubbles": { - "types": "./dist/plugin-sdk/bluebubbles.d.ts", - "default": "./dist/plugin-sdk/bluebubbles.js" - }, - "./plugin-sdk/copilot-proxy": { - "types": "./dist/plugin-sdk/copilot-proxy.d.ts", - "default": "./dist/plugin-sdk/copilot-proxy.js" - }, - "./plugin-sdk/device-pair": { - "types": "./dist/plugin-sdk/device-pair.d.ts", - "default": "./dist/plugin-sdk/device-pair.js" - }, - "./plugin-sdk/diagnostics-otel": { - "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", - "default": "./dist/plugin-sdk/diagnostics-otel.js" - }, - "./plugin-sdk/diffs": { - "types": "./dist/plugin-sdk/diffs.d.ts", - "default": "./dist/plugin-sdk/diffs.js" - }, - "./plugin-sdk/feishu": { - "types": "./dist/plugin-sdk/feishu.d.ts", - "default": "./dist/plugin-sdk/feishu.js" - }, - "./plugin-sdk/google-gemini-cli-auth": { - "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", - "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" - }, - "./plugin-sdk/googlechat": { - "types": "./dist/plugin-sdk/googlechat.d.ts", - "default": "./dist/plugin-sdk/googlechat.js" - }, - "./plugin-sdk/irc": { - "types": "./dist/plugin-sdk/irc.d.ts", - "default": "./dist/plugin-sdk/irc.js" - }, - "./plugin-sdk/llm-task": { - "types": "./dist/plugin-sdk/llm-task.d.ts", - "default": "./dist/plugin-sdk/llm-task.js" - }, - "./plugin-sdk/lobster": { - "types": "./dist/plugin-sdk/lobster.d.ts", - "default": "./dist/plugin-sdk/lobster.js" - }, - "./plugin-sdk/matrix": { - "types": "./dist/plugin-sdk/matrix.d.ts", - "default": "./dist/plugin-sdk/matrix.js" - }, - "./plugin-sdk/mattermost": { - "types": "./dist/plugin-sdk/mattermost.d.ts", - "default": "./dist/plugin-sdk/mattermost.js" - }, - "./plugin-sdk/memory-core": { - "types": "./dist/plugin-sdk/memory-core.d.ts", - "default": "./dist/plugin-sdk/memory-core.js" - }, - "./plugin-sdk/memory-lancedb": { - "types": "./dist/plugin-sdk/memory-lancedb.d.ts", - "default": "./dist/plugin-sdk/memory-lancedb.js" - }, - "./plugin-sdk/minimax-portal-auth": { - "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", - "default": "./dist/plugin-sdk/minimax-portal-auth.js" - }, - "./plugin-sdk/nextcloud-talk": { - "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", - "default": "./dist/plugin-sdk/nextcloud-talk.js" - }, - "./plugin-sdk/nostr": { - "types": "./dist/plugin-sdk/nostr.d.ts", - "default": "./dist/plugin-sdk/nostr.js" - }, - "./plugin-sdk/open-prose": { - "types": "./dist/plugin-sdk/open-prose.d.ts", - "default": "./dist/plugin-sdk/open-prose.js" - }, - "./plugin-sdk/phone-control": { - "types": "./dist/plugin-sdk/phone-control.d.ts", - "default": "./dist/plugin-sdk/phone-control.js" - }, - "./plugin-sdk/qwen-portal-auth": { - "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", - "default": "./dist/plugin-sdk/qwen-portal-auth.js" - }, - "./plugin-sdk/synology-chat": { - "types": "./dist/plugin-sdk/synology-chat.d.ts", - "default": "./dist/plugin-sdk/synology-chat.js" - }, - "./plugin-sdk/talk-voice": { - "types": "./dist/plugin-sdk/talk-voice.d.ts", - "default": "./dist/plugin-sdk/talk-voice.js" - }, - "./plugin-sdk/test-utils": { - "types": "./dist/plugin-sdk/test-utils.d.ts", - "default": "./dist/plugin-sdk/test-utils.js" - }, - "./plugin-sdk/thread-ownership": { - "types": "./dist/plugin-sdk/thread-ownership.d.ts", - "default": "./dist/plugin-sdk/thread-ownership.js" - }, - "./plugin-sdk/tlon": { - "types": "./dist/plugin-sdk/tlon.d.ts", - "default": "./dist/plugin-sdk/tlon.js" - }, - "./plugin-sdk/twitch": { - "types": "./dist/plugin-sdk/twitch.d.ts", - "default": "./dist/plugin-sdk/twitch.js" - }, - "./plugin-sdk/voice-call": { - "types": "./dist/plugin-sdk/voice-call.d.ts", - "default": "./dist/plugin-sdk/voice-call.js" - }, - "./plugin-sdk/zalo": { - "types": "./dist/plugin-sdk/zalo.d.ts", - "default": "./dist/plugin-sdk/zalo.js" - }, - "./plugin-sdk/zalouser": { - "types": "./dist/plugin-sdk/zalouser.d.ts", - "default": "./dist/plugin-sdk/zalouser.js" - }, - "./plugin-sdk/account-id": { - "types": "./dist/plugin-sdk/account-id.d.ts", - "default": "./dist/plugin-sdk/account-id.js" - }, - "./plugin-sdk/keyed-async-queue": { - "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", - "default": "./dist/plugin-sdk/keyed-async-queue.js" - }, - "./cli-entry": "./openclaw.mjs" - }, - "scripts": { - "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", - "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", - "android:install": "cd apps/android && ./gradlew :app:installDebug", - "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", - "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", - "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.android/.MainActivity", - "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", - "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", - "build": "pnpm canvas:a2ui:bundle && tsdown && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", - "build:strict-smoke": "pnpm canvas:a2ui:bundle && tsdown && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", - "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", - "check": "pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope && pnpm check:host-env-policy:swift", - "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", - "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", - "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", - "deadcode:ci": "pnpm deadcode:report:ci:knip && pnpm deadcode:report:ci:ts-prune && pnpm deadcode:report:ci:ts-unused", - "deadcode:knip": "pnpm dlx knip --no-progress", - "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", - "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", - "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", - "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", - "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", - "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", - "dev": "node scripts/run-node.mjs", - "docs:bin": "node scripts/build-docs-list.mjs", - "docs:check-links": "node scripts/docs-link-audit.mjs", - "docs:dev": "cd docs && mint dev", - "docs:list": "node scripts/docs-list.js", - "docs:spellcheck": "bash scripts/docs-spellcheck.sh", - "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", - "format": "oxfmt --write", - "format:all": "pnpm format && pnpm format:swift", - "format:check": "oxfmt --check", - "format:diff": "oxfmt --write && git --no-pager diff", - "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", - "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", - "format:fix": "oxfmt --write", - "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", - "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", - "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", - "gateway:watch": "node scripts/watch-node.mjs gateway --force", - "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", - "ghsa:patch": "node scripts/ghsa-patch.mjs", - "ios:build": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", - "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate'", - "ios:open": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", - "ios:run": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware", - "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", - "lint:all": "pnpm lint && pnpm lint:swift", - "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", - "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", - "lint:docs": "pnpm dlx markdownlint-cli2", - "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", - "lint:fix": "oxlint --type-aware --fix && pnpm format", - "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", - "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", - "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", - "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", - "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", - "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", - "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", - "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", - "mac:open": "open dist/OpenClaw.app", - "mac:package": "bash scripts/package-mac-app.sh", - "mac:restart": "bash scripts/restart-mac.sh", - "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "openclaw": "node scripts/run-node.mjs", - "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", - "prepack": "pnpm build && pnpm ui:build", - "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", - "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift", - "protocol:gen": "node --import tsx scripts/protocol-gen.ts", - "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", - "release:check": "node --import tsx scripts/release-check.ts", - "start": "node scripts/run-node.mjs", - "test": "node scripts/test-parallel.mjs", - "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", - "test:channels": "vitest run --config vitest.channels.config.ts", - "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", - "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", - "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", - "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", - "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", - "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", - "test:docker:live-models": "bash scripts/test-live-models-docker.sh", - "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", - "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", - "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", - "test:e2e": "vitest run --config vitest.e2e.config.ts", - "test:extensions": "vitest run --config vitest.extensions.config.ts", - "test:fast": "vitest run --config vitest.unit.config.ts", - "test:force": "node --import tsx scripts/test-force.ts", - "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", - "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", - "test:install:smoke": "bash scripts/test-install-sh-docker.sh", - "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", - "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", - "test:perf:budget": "node scripts/test-perf-budget.mjs", - "test:perf:hotspots": "node scripts/test-hotspots.mjs", - "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", - "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", - "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", - "test:watch": "vitest", - "tui": "node scripts/run-node.mjs tui", - "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", - "ui:build": "node scripts/ui.js build", - "ui:dev": "node scripts/ui.js dev", - "ui:install": "node scripts/ui.js install" - }, - "dependencies": { - "@agentclientprotocol/sdk": "0.14.1", - "@aws-sdk/client-bedrock": "^3.1000.0", - "@buape/carbon": "0.0.0-beta-20260216184201", - "@clack/prompts": "^1.0.1", - "@discordjs/voice": "^0.19.0", - "@grammyjs/runner": "^2.0.3", - "@grammyjs/transformer-throttler": "^1.2.1", - "@homebridge/ciao": "^1.3.5", - "@line/bot-sdk": "^10.6.0", - "@lydell/node-pty": "1.2.0-beta.3", - "@mariozechner/pi-agent-core": "0.55.3", - "@mariozechner/pi-ai": "0.55.3", - "@mariozechner/pi-coding-agent": "0.55.3", - "@mariozechner/pi-tui": "0.55.3", - "@mozilla/readability": "^0.6.0", - "@sinclair/typebox": "0.34.48", - "@slack/bolt": "^4.6.0", - "@slack/web-api": "^7.14.1", - "@snazzah/davey": "^0.1.9", - "@whiskeysockets/baileys": "7.0.0-rc.9", - "ajv": "^8.18.0", - "chalk": "^5.6.2", - "chokidar": "^5.0.0", - "cli-highlight": "^2.1.11", - "commander": "^14.0.3", - "croner": "^10.0.1", - "discord-api-types": "^0.38.40", - "dotenv": "^17.3.1", - "express": "^5.2.1", - "file-type": "^21.3.0", - "gaxios": "7.1.3", - "grammy": "^1.41.0", - "https-proxy-agent": "^7.0.6", - "ipaddr.js": "^2.3.0", - "jiti": "^2.6.1", - "json5": "^2.2.3", - "jszip": "^3.10.1", - "linkedom": "^0.18.12", - "long": "^5.3.2", - "markdown-it": "^14.1.1", - "node-domexception": "npm:@nolyfill/domexception@^1.0.28", - "node-edge-tts": "^1.2.10", - "opusscript": "^0.1.1", - "osc-progress": "^0.3.0", - "pdfjs-dist": "^5.5.207", - "playwright-core": "1.58.2", - "qrcode-terminal": "^0.12.0", - "sharp": "^0.34.5", - "sqlite-vec": "0.1.7-alpha.2", - "strip-ansi": "^7.2.0", - "tar": "7.5.9", - "tslog": "^4.10.2", - "undici": "^7.22.0", - "ws": "^8.19.0", - "yaml": "^2.8.2", - "zod": "^4.3.6" - }, - "devDependencies": { - "@grammyjs/types": "^3.25.0", - "@lit-labs/signals": "^0.2.0", - "@lit/context": "^1.1.6", - "@types/express": "^5.0.6", - "@types/markdown-it": "^14.1.2", - "@types/node": "^25.3.3", - "@types/qrcode-terminal": "^0.12.2", - "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260301.1", - "@vitest/coverage-v8": "^4.0.18", - "lit": "^3.3.2", - "oxfmt": "0.35.0", - "oxlint": "^1.50.0", - "oxlint-tsgolint": "^0.15.0", - "signal-utils": "0.21.1", - "tsdown": "0.21.0-beta.2", - "tsx": "^4.21.0", - "typescript": "^5.9.3", - "vitest": "^4.0.18" - }, - "peerDependencies": { - "@napi-rs/canvas": "^0.1.89", - "node-llama-cpp": "3.16.2" - }, - "engines": { - "node": ">=22.12.0" - }, - "packageManager": "pnpm@10.23.0", - "pnpm": { - "minimumReleaseAge": 2880, - "overrides": { - "hono": "4.11.10", - "fast-xml-parser": "5.3.8", - "request": "npm:@cypress/request@3.0.10", - "request-promise": "npm:@cypress/request-promise@5.0.0", - "form-data": "2.5.4", - "minimatch": "10.2.4", - "qs": "6.14.2", - "node-domexception": "npm:@nolyfill/domexception@^1.0.28", - "@sinclair/typebox": "0.34.48", - "tar": "7.5.9", - "tough-cookie": "4.1.3" - }, - "onlyBuiltDependencies": [ - "@lydell/node-pty", - "@matrix-org/matrix-sdk-crypto-nodejs", - "@napi-rs/canvas", - "@whiskeysockets/baileys", - "authenticate-pam", - "esbuild", - "koffi", - "node-llama-cpp", - "protobufjs", - "sharp" - ] - } + "name": "openclaw", + "version": "2026.3.5", + "description": "Multi-channel AI gateway with extensible messaging integrations", + "keywords": [], + "homepage": "https://github.com/openclaw/openclaw#readme", + "bugs": { + "url": "https://github.com/openclaw/openclaw/issues" + }, + "license": "MIT", + "author": "", + "repository": { + "type": "git", + "url": "git+https://github.com/openclaw/openclaw.git" + }, + "bin": { + "openclaw": "openclaw.mjs" + }, + "directories": { + "doc": "docs", + "test": "test" + }, + "files": [ + "CHANGELOG.md", + "LICENSE", + "openclaw.mjs", + "README-header.png", + "README.md", + "assets/", + "dist/", + "docs/", + "extensions/", + "skills/" + ], + "type": "module", + "main": "dist/index.js", + "exports": { + ".": "./dist/index.js", + "./plugin-sdk": { + "types": "./dist/plugin-sdk/index.d.ts", + "default": "./dist/plugin-sdk/index.js" + }, + "./plugin-sdk/core": { + "types": "./dist/plugin-sdk/core.d.ts", + "default": "./dist/plugin-sdk/core.js" + }, + "./plugin-sdk/compat": { + "types": "./dist/plugin-sdk/compat.d.ts", + "default": "./dist/plugin-sdk/compat.js" + }, + "./plugin-sdk/telegram": { + "types": "./dist/plugin-sdk/telegram.d.ts", + "default": "./dist/plugin-sdk/telegram.js" + }, + "./plugin-sdk/discord": { + "types": "./dist/plugin-sdk/discord.d.ts", + "default": "./dist/plugin-sdk/discord.js" + }, + "./plugin-sdk/slack": { + "types": "./dist/plugin-sdk/slack.d.ts", + "default": "./dist/plugin-sdk/slack.js" + }, + "./plugin-sdk/signal": { + "types": "./dist/plugin-sdk/signal.d.ts", + "default": "./dist/plugin-sdk/signal.js" + }, + "./plugin-sdk/imessage": { + "types": "./dist/plugin-sdk/imessage.d.ts", + "default": "./dist/plugin-sdk/imessage.js" + }, + "./plugin-sdk/whatsapp": { + "types": "./dist/plugin-sdk/whatsapp.d.ts", + "default": "./dist/plugin-sdk/whatsapp.js" + }, + "./plugin-sdk/line": { + "types": "./dist/plugin-sdk/line.d.ts", + "default": "./dist/plugin-sdk/line.js" + }, + "./plugin-sdk/msteams": { + "types": "./dist/plugin-sdk/msteams.d.ts", + "default": "./dist/plugin-sdk/msteams.js" + }, + "./plugin-sdk/acpx": { + "types": "./dist/plugin-sdk/acpx.d.ts", + "default": "./dist/plugin-sdk/acpx.js" + }, + "./plugin-sdk/bluebubbles": { + "types": "./dist/plugin-sdk/bluebubbles.d.ts", + "default": "./dist/plugin-sdk/bluebubbles.js" + }, + "./plugin-sdk/copilot-proxy": { + "types": "./dist/plugin-sdk/copilot-proxy.d.ts", + "default": "./dist/plugin-sdk/copilot-proxy.js" + }, + "./plugin-sdk/device-pair": { + "types": "./dist/plugin-sdk/device-pair.d.ts", + "default": "./dist/plugin-sdk/device-pair.js" + }, + "./plugin-sdk/diagnostics-otel": { + "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", + "default": "./dist/plugin-sdk/diagnostics-otel.js" + }, + "./plugin-sdk/diffs": { + "types": "./dist/plugin-sdk/diffs.d.ts", + "default": "./dist/plugin-sdk/diffs.js" + }, + "./plugin-sdk/feishu": { + "types": "./dist/plugin-sdk/feishu.d.ts", + "default": "./dist/plugin-sdk/feishu.js" + }, + "./plugin-sdk/google-gemini-cli-auth": { + "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", + "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" + }, + "./plugin-sdk/googlechat": { + "types": "./dist/plugin-sdk/googlechat.d.ts", + "default": "./dist/plugin-sdk/googlechat.js" + }, + "./plugin-sdk/irc": { + "types": "./dist/plugin-sdk/irc.d.ts", + "default": "./dist/plugin-sdk/irc.js" + }, + "./plugin-sdk/llm-task": { + "types": "./dist/plugin-sdk/llm-task.d.ts", + "default": "./dist/plugin-sdk/llm-task.js" + }, + "./plugin-sdk/lobster": { + "types": "./dist/plugin-sdk/lobster.d.ts", + "default": "./dist/plugin-sdk/lobster.js" + }, + "./plugin-sdk/matrix": { + "types": "./dist/plugin-sdk/matrix.d.ts", + "default": "./dist/plugin-sdk/matrix.js" + }, + "./plugin-sdk/mattermost": { + "types": "./dist/plugin-sdk/mattermost.d.ts", + "default": "./dist/plugin-sdk/mattermost.js" + }, + "./plugin-sdk/memory-core": { + "types": "./dist/plugin-sdk/memory-core.d.ts", + "default": "./dist/plugin-sdk/memory-core.js" + }, + "./plugin-sdk/memory-lancedb": { + "types": "./dist/plugin-sdk/memory-lancedb.d.ts", + "default": "./dist/plugin-sdk/memory-lancedb.js" + }, + "./plugin-sdk/minimax-portal-auth": { + "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", + "default": "./dist/plugin-sdk/minimax-portal-auth.js" + }, + "./plugin-sdk/nextcloud-talk": { + "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", + "default": "./dist/plugin-sdk/nextcloud-talk.js" + }, + "./plugin-sdk/nostr": { + "types": "./dist/plugin-sdk/nostr.d.ts", + "default": "./dist/plugin-sdk/nostr.js" + }, + "./plugin-sdk/open-prose": { + "types": "./dist/plugin-sdk/open-prose.d.ts", + "default": "./dist/plugin-sdk/open-prose.js" + }, + "./plugin-sdk/phone-control": { + "types": "./dist/plugin-sdk/phone-control.d.ts", + "default": "./dist/plugin-sdk/phone-control.js" + }, + "./plugin-sdk/qwen-portal-auth": { + "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", + "default": "./dist/plugin-sdk/qwen-portal-auth.js" + }, + "./plugin-sdk/synology-chat": { + "types": "./dist/plugin-sdk/synology-chat.d.ts", + "default": "./dist/plugin-sdk/synology-chat.js" + }, + "./plugin-sdk/talk-voice": { + "types": "./dist/plugin-sdk/talk-voice.d.ts", + "default": "./dist/plugin-sdk/talk-voice.js" + }, + "./plugin-sdk/test-utils": { + "types": "./dist/plugin-sdk/test-utils.d.ts", + "default": "./dist/plugin-sdk/test-utils.js" + }, + "./plugin-sdk/thread-ownership": { + "types": "./dist/plugin-sdk/thread-ownership.d.ts", + "default": "./dist/plugin-sdk/thread-ownership.js" + }, + "./plugin-sdk/tlon": { + "types": "./dist/plugin-sdk/tlon.d.ts", + "default": "./dist/plugin-sdk/tlon.js" + }, + "./plugin-sdk/twitch": { + "types": "./dist/plugin-sdk/twitch.d.ts", + "default": "./dist/plugin-sdk/twitch.js" + }, + "./plugin-sdk/voice-call": { + "types": "./dist/plugin-sdk/voice-call.d.ts", + "default": "./dist/plugin-sdk/voice-call.js" + }, + "./plugin-sdk/zalo": { + "types": "./dist/plugin-sdk/zalo.d.ts", + "default": "./dist/plugin-sdk/zalo.js" + }, + "./plugin-sdk/zalouser": { + "types": "./dist/plugin-sdk/zalouser.d.ts", + "default": "./dist/plugin-sdk/zalouser.js" + }, + "./plugin-sdk/account-id": { + "types": "./dist/plugin-sdk/account-id.d.ts", + "default": "./dist/plugin-sdk/account-id.js" + }, + "./plugin-sdk/keyed-async-queue": { + "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", + "default": "./dist/plugin-sdk/keyed-async-queue.js" + }, + "./cli-entry": "./openclaw.mjs" + }, + "scripts": { + "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", + "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", + "android:install": "cd apps/android && ./gradlew :app:installDebug", + "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", + "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", + "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.android/.MainActivity", + "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", + "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", + "build": "pnpm canvas:a2ui:bundle && tsdown && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", + "build:strict-smoke": "pnpm canvas:a2ui:bundle && tsdown && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", + "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", + "check": "pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope && pnpm check:host-env-policy:swift", + "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", + "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", + "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", + "deadcode:ci": "pnpm deadcode:report:ci:knip && pnpm deadcode:report:ci:ts-prune && pnpm deadcode:report:ci:ts-unused", + "deadcode:knip": "pnpm dlx knip --no-progress", + "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", + "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", + "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", + "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", + "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", + "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", + "dev": "node scripts/run-node.mjs", + "docs:bin": "node scripts/build-docs-list.mjs", + "docs:check-links": "node scripts/docs-link-audit.mjs", + "docs:dev": "cd docs && mint dev", + "docs:list": "node scripts/docs-list.js", + "docs:spellcheck": "bash scripts/docs-spellcheck.sh", + "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", + "format": "oxfmt --write", + "format:all": "pnpm format && pnpm format:swift", + "format:check": "oxfmt --check", + "format:diff": "oxfmt --write && git --no-pager diff", + "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", + "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", + "format:fix": "oxfmt --write", + "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", + "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", + "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", + "gateway:watch": "node scripts/watch-node.mjs gateway --force", + "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", + "ghsa:patch": "node scripts/ghsa-patch.mjs", + "ios:build": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", + "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate'", + "ios:open": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", + "ios:run": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", + "lint": "oxlint --type-aware", + "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", + "lint:all": "pnpm lint && pnpm lint:swift", + "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", + "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", + "lint:docs": "pnpm dlx markdownlint-cli2", + "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", + "lint:fix": "oxlint --type-aware --fix && pnpm format", + "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", + "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", + "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", + "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", + "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", + "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", + "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", + "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", + "mac:open": "open dist/OpenClaw.app", + "mac:package": "bash scripts/package-mac-app.sh", + "mac:restart": "bash scripts/restart-mac.sh", + "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "openclaw": "node scripts/run-node.mjs", + "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", + "prepack": "pnpm build && pnpm ui:build", + "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", + "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift", + "protocol:gen": "node --import tsx scripts/protocol-gen.ts", + "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", + "release:check": "node --import tsx scripts/release-check.ts", + "start": "node scripts/run-node.mjs", + "test": "node scripts/test-parallel.mjs", + "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", + "test:channels": "vitest run --config vitest.channels.config.ts", + "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", + "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", + "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", + "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", + "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", + "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", + "test:docker:live-models": "bash scripts/test-live-models-docker.sh", + "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", + "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", + "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", + "test:e2e": "vitest run --config vitest.e2e.config.ts", + "test:extensions": "vitest run --config vitest.extensions.config.ts", + "test:fast": "vitest run --config vitest.unit.config.ts", + "test:force": "node --import tsx scripts/test-force.ts", + "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", + "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", + "test:install:smoke": "bash scripts/test-install-sh-docker.sh", + "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", + "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", + "test:perf:budget": "node scripts/test-perf-budget.mjs", + "test:perf:hotspots": "node scripts/test-hotspots.mjs", + "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", + "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", + "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", + "test:watch": "vitest", + "tui": "node scripts/run-node.mjs tui", + "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", + "ui:build": "node scripts/ui.js build", + "ui:dev": "node scripts/ui.js dev", + "ui:install": "node scripts/ui.js install" + }, + "dependencies": { + "@agentclientprotocol/sdk": "0.14.1", + "@aws-sdk/client-bedrock": "^3.1000.0", + "@buape/carbon": "0.0.0-beta-20260216184201", + "@clack/prompts": "^1.0.1", + "@discordjs/voice": "^0.19.0", + "@grammyjs/runner": "^2.0.3", + "@grammyjs/transformer-throttler": "^1.2.1", + "@homebridge/ciao": "^1.3.5", + "@line/bot-sdk": "^10.6.0", + "@lydell/node-pty": "1.2.0-beta.3", + "@mariozechner/pi-agent-core": "0.55.3", + "@mariozechner/pi-ai": "0.55.3", + "@mariozechner/pi-coding-agent": "0.55.3", + "@mariozechner/pi-tui": "0.55.3", + "@mozilla/readability": "^0.6.0", + "@sinclair/typebox": "0.34.48", + "@slack/bolt": "^4.6.0", + "@slack/web-api": "^7.14.1", + "@snazzah/davey": "^0.1.9", + "@whiskeysockets/baileys": "7.0.0-rc.9", + "ajv": "^8.18.0", + "chalk": "^5.6.2", + "chokidar": "^5.0.0", + "cli-highlight": "^2.1.11", + "commander": "^14.0.3", + "croner": "^10.0.1", + "discord-api-types": "^0.38.40", + "dotenv": "^17.3.1", + "express": "^5.2.1", + "file-type": "^21.3.0", + "gaxios": "7.1.3", + "grammy": "^1.41.0", + "https-proxy-agent": "^7.0.6", + "ipaddr.js": "^2.3.0", + "jiti": "^2.6.1", + "json5": "^2.2.3", + "jszip": "^3.10.1", + "linkedom": "^0.18.12", + "long": "^5.3.2", + "markdown-it": "^14.1.1", + "node-domexception": "npm:@nolyfill/domexception@^1.0.28", + "node-edge-tts": "^1.2.10", + "opusscript": "^0.1.1", + "osc-progress": "^0.3.0", + "pdfjs-dist": "^5.5.207", + "playwright-core": "1.58.2", + "qrcode-terminal": "^0.12.0", + "sharp": "^0.34.5", + "sqlite-vec": "0.1.7-alpha.2", + "strip-ansi": "^7.2.0", + "tar": "7.5.9", + "tslog": "^4.10.2", + "undici": "^7.22.0", + "ws": "^8.19.0", + "yaml": "^2.8.2", + "zod": "^4.3.6" + }, + "devDependencies": { + "@grammyjs/types": "^3.25.0", + "@lit-labs/signals": "^0.2.0", + "@lit/context": "^1.1.6", + "@types/express": "^5.0.6", + "@types/markdown-it": "^14.1.2", + "@types/node": "^25.3.3", + "@types/qrcode-terminal": "^0.12.2", + "@types/ws": "^8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260301.1", + "@vitest/coverage-v8": "^4.0.18", + "lit": "^3.3.2", + "oxfmt": "0.35.0", + "oxlint": "^1.50.0", + "oxlint-tsgolint": "^0.15.0", + "signal-utils": "0.21.1", + "tsdown": "0.21.0-beta.2", + "tsx": "^4.21.0", + "typescript": "^5.9.3", + "vitest": "^4.0.18" + }, + "peerDependencies": { + "@napi-rs/canvas": "^0.1.89", + "node-llama-cpp": "3.16.2" + }, + "engines": { + "node": ">=22.12.0" + }, + "packageManager": "pnpm@10.23.0", + "pnpm": { + "minimumReleaseAge": 2880, + "overrides": { + "hono": "4.11.10", + "fast-xml-parser": "5.3.8", + "request": "npm:@cypress/request@3.0.10", + "request-promise": "npm:@cypress/request-promise@5.0.0", + "form-data": "2.5.4", + "minimatch": "10.2.4", + "qs": "6.14.2", + "node-domexception": "npm:@nolyfill/domexception@^1.0.28", + "@sinclair/typebox": "0.34.48", + "tar": "7.5.9", + "tough-cookie": "4.1.3" + }, + "onlyBuiltDependencies": [ + "@lydell/node-pty", + "@matrix-org/matrix-sdk-crypto-nodejs", + "@napi-rs/canvas", + "@whiskeysockets/baileys", + "authenticate-pam", + "esbuild", + "koffi", + "node-llama-cpp", + "protobufjs", + "sharp" + ] + } } From edde7ede04df174c822e0c3d2911c57f3023570f Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Thu, 5 Mar 2026 17:05:31 +0100 Subject: [PATCH 28/80] Trigger upgrade --- Dockerfile.pazi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 9a4cb4c96a..7bdad17358 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -1,4 +1,5 @@ -# Dockerfile.pazi — Pazi production wrapper +# Dockerfile.pazi +# Pazi production wrapper # Builds the OpenClaw agent, then layers desktop services on top. # --------------------------------------------------------------------------- From b35bdaead3e7958171ab7e01403137311aad1645 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Mar 2026 16:15:29 +0000 Subject: [PATCH 29/80] chore: release 2026.3.6 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b99583a06..abddf781af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.5", + "version": "2026.3.6", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 01a176406639e14a5e94192334b8cf963ea19d33 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Thu, 5 Mar 2026 17:24:42 +0100 Subject: [PATCH 30/80] Dummy commit to trigger flow --- Dockerfile.pazi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 7bdad17358..4a854901fd 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -1,5 +1,4 @@ -# Dockerfile.pazi -# Pazi production wrapper +# Dockerfile.pazi - Pazi production wrapper # Builds the OpenClaw agent, then layers desktop services on top. # --------------------------------------------------------------------------- From cba3e553073077aa428929e13d8502f0e1177b46 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Thu, 5 Mar 2026 17:40:56 +0100 Subject: [PATCH 31/80] Trigger new build --- Dockerfile.pazi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 4a854901fd..7bdad17358 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -1,4 +1,5 @@ -# Dockerfile.pazi - Pazi production wrapper +# Dockerfile.pazi +# Pazi production wrapper # Builds the OpenClaw agent, then layers desktop services on top. # --------------------------------------------------------------------------- From eba0eb3a9660040c956a5af43dabec7d4dc5b1df Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 6 Mar 2026 08:10:34 +0100 Subject: [PATCH 32/80] Trigger new build --- Dockerfile.pazi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 7bdad17358..4a854901fd 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -1,5 +1,4 @@ -# Dockerfile.pazi -# Pazi production wrapper +# Dockerfile.pazi - Pazi production wrapper # Builds the OpenClaw agent, then layers desktop services on top. # --------------------------------------------------------------------------- From e895dc66b8e5404570609c0183bf7e6db6385507 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 07:16:54 +0000 Subject: [PATCH 33/80] chore: release 2026.3.7 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index abddf781af..54c2c8e56a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.6", + "version": "2026.3.7", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From f92c728b4b1580bd9a5b2a77ab6e00fecf9a2ec0 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 6 Mar 2026 08:19:41 +0100 Subject: [PATCH 34/80] Trigger new build 2 --- Dockerfile.pazi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 4a854901fd..029740785c 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -1,4 +1,5 @@ -# Dockerfile.pazi - Pazi production wrapper +# Dockerfile.pazi +#Pazi production wrapper # Builds the OpenClaw agent, then layers desktop services on top. # --------------------------------------------------------------------------- From 4752883d56b2403f5a878b145268a2b6c7ec2a17 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 07:26:15 +0000 Subject: [PATCH 35/80] chore: release 2026.3.8 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54c2c8e56a..ed5e9651db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.7", + "version": "2026.3.8", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From a73c1c5113d1f4678b5e213f83aefdcafe5387d4 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 6 Mar 2026 08:58:04 +0100 Subject: [PATCH 36/80] Fix gateway --- Dockerfile.pazi | 2 +- extensions/pazi/index.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 029740785c..e99ae9118d 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -8,7 +8,7 @@ FROM node:22-bookworm@sha256:cd7bcd2e7a1e6f72052feb023c7f6b722205d3fcab7bbcbd2d1bfdab10b1e935 AS builder RUN curl -fsSL https://bun.sh/install | bash -ENV PATH="/root/.bun/bin:${PATH}" +ENV PATH="/root/.bun/bin:${PATH}" RUN corepack enable diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index b74f176b9b..1417c55a64 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -60,7 +60,6 @@ export default { api.registerHttpRoute({ path: "/pazi/context", - auth: "gateway", handler: async (req, res) => { if (req.method !== "POST") { res.statusCode = 404; @@ -97,7 +96,6 @@ export default { api.registerHttpRoute({ path: "/pazi/upload", - auth: "gateway", handler: async (req, res) => { if (req.method !== "POST") { res.statusCode = 404; From 93274b0f0454fc2e948437f6e9cbe64090cece59 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Fri, 6 Mar 2026 09:04:00 +0100 Subject: [PATCH 37/80] Pazi: add browser_use tool and browser-mode entrypoint toggle --- Dockerfile.pazi | 4 +- entrypoint.pazi.sh | 110 ++++++ extensions/pazi/index.ts | 15 + extensions/pazi/openclaw.plugin.json | 4 +- extensions/pazi/src/browser-use/api.ts | 347 ++++++++++++++++++ extensions/pazi/src/browser-use/config.ts | 93 +++++ extensions/pazi/src/browser-use/tools.ts | 411 ++++++++++++++++++++++ 7 files changed, 982 insertions(+), 2 deletions(-) create mode 100755 entrypoint.pazi.sh create mode 100644 extensions/pazi/src/browser-use/api.ts create mode 100644 extensions/pazi/src/browser-use/config.ts create mode 100644 extensions/pazi/src/browser-use/tools.ts diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 9a4cb4c96a..3c7de460ec 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -94,6 +94,8 @@ RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share & # Supervisord config COPY supervisord.pazi.conf /etc/supervisor/conf.d/supervisord.conf +COPY entrypoint.pazi.sh /usr/local/bin/entrypoint.pazi.sh +RUN chmod +x /usr/local/bin/entrypoint.pazi.sh ENV NODE_ENV=production \ OPENCLAW_GATEWAY_PORT=3000 \ @@ -109,4 +111,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ # supervisord runs as root to manage child processes with different users USER root -CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] +CMD ["/usr/local/bin/entrypoint.pazi.sh"] diff --git a/entrypoint.pazi.sh b/entrypoint.pazi.sh new file mode 100755 index 0000000000..9ab0be5178 --- /dev/null +++ b/entrypoint.pazi.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash +set -euo pipefail + +is_truthy() { + local raw="${1:-}" + raw="$(printf '%s' "$raw" | tr '[:upper:]' '[:lower:]')" + case "$raw" in + 1|true|yes|on) return 0 ;; + *) return 1 ;; + esac +} + +PAZI_HOME="${PAZI_HOME:-/home/pazi}" +DEFAULT_CONFIG_PATH="$PAZI_HOME/.openclaw/openclaw.json" +CONFIG_PATH="${OPENCLAW_CONFIG_PATH:-$DEFAULT_CONFIG_PATH}" +mkdir -p "$(dirname "$CONFIG_PATH")" + +BROWSER_USE_FLAG="${BROWSER_USE_ENABLED:-}" + +node - "$CONFIG_PATH" "$BROWSER_USE_FLAG" <<'NODE' +const fs = require("node:fs"); +const path = require("node:path"); + +let JSON5; +try { + JSON5 = require("json5"); +} catch { + JSON5 = { parse: JSON.parse }; +} + +const configPath = process.argv[2]; +const rawEnabled = String(process.argv[3] ?? "").trim(); +const browserUseEnabled = /^(1|true|yes|on)$/i.test(rawEnabled); + +const readConfig = () => { + if (!fs.existsSync(configPath)) { + return {}; + } + const raw = fs.readFileSync(configPath, "utf8"); + if (!raw.trim()) { + return {}; + } + try { + const parsed = JSON5.parse(raw); + if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) { + return parsed; + } + return {}; + } catch { + return {}; + } +}; + +const cfg = readConfig(); + +if (browserUseEnabled) { + if (!cfg.browser || typeof cfg.browser !== "object" || Array.isArray(cfg.browser)) { + cfg.browser = {}; + } + cfg.browser.enabled = false; + + if (!cfg.tools || typeof cfg.tools !== "object" || Array.isArray(cfg.tools)) { + cfg.tools = {}; + } + + const existingDeny = Array.isArray(cfg.tools.deny) + ? cfg.tools.deny.filter((entry) => typeof entry === "string") + : []; + if (!existingDeny.includes("browser")) { + existingDeny.push("browser"); + } + cfg.tools.deny = existingDeny; +} else { + if (cfg.browser && typeof cfg.browser === "object" && !Array.isArray(cfg.browser)) { + delete cfg.browser.enabled; + if (Object.keys(cfg.browser).length === 0) { + delete cfg.browser; + } + } + + if (cfg.tools && typeof cfg.tools === "object" && !Array.isArray(cfg.tools)) { + if (Array.isArray(cfg.tools.deny)) { + const nextDeny = cfg.tools.deny.filter((entry) => entry !== "browser"); + if (nextDeny.length > 0) { + cfg.tools.deny = nextDeny; + } else { + delete cfg.tools.deny; + } + } + if (Object.keys(cfg.tools).length === 0) { + delete cfg.tools; + } + } +} + +fs.mkdirSync(path.dirname(configPath), { recursive: true }); +fs.writeFileSync(configPath, `${JSON.stringify(cfg, null, 2)}\n`, "utf8"); +NODE + +if is_truthy "$BROWSER_USE_FLAG"; then + echo "BROWSER_USE_ENABLED=true: disabled built-in browser and denied browser tool in $CONFIG_PATH" +else + echo "BROWSER_USE_ENABLED is false/unset: removed Browser Use override keys in $CONFIG_PATH" +fi + +if id -u pazi >/dev/null 2>&1; then + chown pazi:pazi "$CONFIG_PATH" || true +fi + +exec supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index b74f176b9b..cee5b1a718 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -1,5 +1,7 @@ import type { Server as HttpServer } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import { resolveBrowserUseConfig } from "./src/browser-use/config.js"; +import { createBrowserUseTools } from "./src/browser-use/tools.js"; import { resolvePaziBillingConfig } from "./src/config.js"; import { getProxyContext } from "./src/context.js"; import { createPipedreamTools } from "./src/pipedream/tools.js"; @@ -58,6 +60,17 @@ export default { api.registerTool(tool); } + const browserUseConfig = resolveBrowserUseConfig({ + pluginConfig, + env: process.env, + }); + if (browserUseConfig.browserUseEnabled) { + const browserUseTools = createBrowserUseTools({ pluginConfig }); + for (const tool of browserUseTools) { + api.registerTool(tool); + } + } + api.registerHttpRoute({ path: "/pazi/context", auth: "gateway", @@ -74,6 +87,7 @@ export default { api.registerHttpRoute({ path: "/health", + auth: "gateway", handler: (_req, res) => { res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); res.end(JSON.stringify({ status: "ok", timestamp: new Date().toISOString() })); @@ -82,6 +96,7 @@ export default { api.registerHttpRoute({ path: "/status", + auth: "gateway", handler: (_req, res) => { res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); res.end( diff --git a/extensions/pazi/openclaw.plugin.json b/extensions/pazi/openclaw.plugin.json index 32a927b1b3..783096191b 100644 --- a/extensions/pazi/openclaw.plugin.json +++ b/extensions/pazi/openclaw.plugin.json @@ -5,7 +5,9 @@ "additionalProperties": false, "properties": { "apiUrl": { "type": "string" }, - "proxyPort": { "type": "number" } + "proxyPort": { "type": "number" }, + "browserUseEnabled": { "type": "boolean" }, + "browserUseTimeoutMs": { "type": "number" } } } } diff --git a/extensions/pazi/src/browser-use/api.ts b/extensions/pazi/src/browser-use/api.ts new file mode 100644 index 0000000000..50aff06302 --- /dev/null +++ b/extensions/pazi/src/browser-use/api.ts @@ -0,0 +1,347 @@ +import { getProxyContext } from "../context.js"; +import { resolveBrowserUseConfig } from "./config.js"; + +type ApiParams = { + apiUrl: string; + proxyToken: string; + timeoutMs: number; +}; + +export type BrowserUseApiResult = { ok: true; data: T } | { ok: false; error: string }; + +export type BrowserUseCreateSessionResponse = { + sessionId: string; + liveUrl?: string; + status?: string; + [key: string]: unknown; +}; + +export type BrowserUseSessionStatusResponse = { + sessionId: string; + liveUrl?: string; + status?: string; + [key: string]: unknown; +}; + +export type BrowserUseSnapshotResponse = { + text: string; + [key: string]: unknown; +}; + +export type BrowserUseScreenshotResponse = { + url: string; + [key: string]: unknown; +}; + +export type BrowserUseRunTaskResponse = { + taskId: string; + liveUrl?: string; + status?: string; + [key: string]: unknown; +}; + +export type BrowserUseTaskStatusResponse = { + taskId: string; + status: string; + liveUrl?: string; + result?: unknown; + [key: string]: unknown; +}; + +export type BrowserUseStopSessionResponse = { + ok?: boolean; + status?: string; + [key: string]: unknown; +}; + +function resolveApiParams(pluginConfig: Record | null): ApiParams { + const context = getProxyContext(); + if (!context) { + throw new Error("No billing context set — workspace may not be initialized yet"); + } + + const resolved = resolveBrowserUseConfig({ + pluginConfig, + env: process.env, + }); + const apiUrl = resolved.browserUseApiUrl?.trim(); + if (!apiUrl) { + throw new Error("Browser Use API URL not configured"); + } + + let baseUrl: URL; + try { + baseUrl = new URL(apiUrl); + } catch { + throw new Error(`Invalid Browser Use API URL: ${apiUrl}`); + } + + return { + apiUrl: baseUrl.toString(), + proxyToken: context.proxyToken, + timeoutMs: resolved.browserUseTimeoutMs, + }; +} + +function buildEndpointUrl(baseApiUrl: string, endpointPath: string): URL { + const url = new URL(baseApiUrl); + const prefix = url.pathname.endsWith("/") ? url.pathname : `${url.pathname}/`; + url.pathname = `${prefix}${endpointPath.replace(/^\/+/, "")}`; + url.search = ""; + url.hash = ""; + return url; +} + +function readErrorMessage(payload: unknown): string | undefined { + if (!payload) { + return undefined; + } + if (typeof payload === "string") { + return payload; + } + if (typeof payload === "object") { + const record = payload as { error?: unknown; message?: unknown }; + if (typeof record.error === "string") { + return record.error; + } + if (typeof record.message === "string") { + return record.message; + } + } + return undefined; +} + +async function readJsonBody(res: Response): Promise { + const text = await res.text(); + if (!text.trim()) { + return null; + } + try { + return JSON.parse(text) as unknown; + } catch { + return text; + } +} + +async function parseResponse(res: Response): Promise> { + const payload = await readJsonBody(res); + if (res.ok) { + return { ok: true, data: payload as T }; + } + const message = readErrorMessage(payload) ?? res.statusText ?? "Request failed"; + const status = res.status ? ` (${res.status})` : ""; + return { ok: false, error: `Pazi Browser Use API error${status}: ${message}` }; +} + +function withTimeoutSignal( + timeoutMs: number, + signal?: AbortSignal, +): { + signal: AbortSignal; + cleanup: () => void; +} { + const controller = new AbortController(); + const timer = setTimeout(() => { + controller.abort(); + }, timeoutMs); + + const onAbort = () => { + controller.abort(); + }; + + if (signal) { + if (signal.aborted) { + controller.abort(); + } else { + signal.addEventListener("abort", onAbort, { once: true }); + } + } + + return { + signal: controller.signal, + cleanup: () => { + clearTimeout(timer); + if (signal) { + signal.removeEventListener("abort", onAbort); + } + }, + }; +} + +async function requestJson(params: { + apiParams: ApiParams; + endpointPath: string; + init?: RequestInit; + signal?: AbortSignal; +}): Promise> { + const url = buildEndpointUrl(params.apiParams.apiUrl, params.endpointPath); + const headers = new Headers(params.init?.headers); + headers.set("x-proxy-token", params.apiParams.proxyToken); + const timeout = withTimeoutSignal(params.apiParams.timeoutMs, params.signal); + + try { + const res = await fetch(url, { + ...params.init, + headers, + signal: timeout.signal, + }); + return await parseResponse(res); + } catch (err) { + if (err instanceof Error && err.name === "AbortError") { + return { + ok: false, + error: `Pazi Browser Use API request timed out after ${String(params.apiParams.timeoutMs)}ms`, + }; + } + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } finally { + timeout.cleanup(); + } +} + +export async function createSession( + params: { + pluginConfig: Record | null; + body?: Record; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: "session", + init: { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(params.body ?? {}), + }, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function getSessionStatus( + params: { + pluginConfig: Record | null; + sessionId: string; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: `session/${encodeURIComponent(params.sessionId)}`, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function getSnapshot( + params: { + pluginConfig: Record | null; + sessionId: string; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: `session/${encodeURIComponent(params.sessionId)}/snapshot`, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function getScreenshot( + params: { + pluginConfig: Record | null; + sessionId: string; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: `session/${encodeURIComponent(params.sessionId)}/screenshot`, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function runTask( + params: { + pluginConfig: Record | null; + body: { + task: string; + sessionId?: string; + }; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: "task", + init: { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(params.body), + }, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function getTaskStatus( + params: { + pluginConfig: Record | null; + taskId: string; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: `task/${encodeURIComponent(params.taskId)}`, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} + +export async function stopSession( + params: { + pluginConfig: Record | null; + sessionId: string; + }, + signal?: AbortSignal, +): Promise> { + try { + const apiParams = resolveApiParams(params.pluginConfig); + return await requestJson({ + apiParams, + endpointPath: `session/${encodeURIComponent(params.sessionId)}`, + init: { method: "DELETE" }, + signal, + }); + } catch (err) { + return { ok: false, error: err instanceof Error ? err.message : String(err) }; + } +} diff --git a/extensions/pazi/src/browser-use/config.ts b/extensions/pazi/src/browser-use/config.ts new file mode 100644 index 0000000000..70c2be1c88 --- /dev/null +++ b/extensions/pazi/src/browser-use/config.ts @@ -0,0 +1,93 @@ +import { resolvePaziBillingConfig } from "../config.js"; + +export type BrowserUseConfig = { + browserUseEnabled: boolean; + browserUseApiUrl?: string; + browserUseTimeoutMs: number; +}; + +const DEFAULT_BROWSER_USE_TIMEOUT_MS = 120_000; + +function normalizeString(value: unknown): string | undefined { + if (typeof value !== "string") { + return undefined; + } + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : undefined; +} + +function normalizeNumber(value: unknown): number | undefined { + if (typeof value === "number" && Number.isFinite(value) && value > 0) { + return Math.floor(value); + } + if (typeof value === "string" && value.trim().length > 0) { + const parsed = Number.parseInt(value, 10); + if (Number.isFinite(parsed) && parsed > 0) { + return parsed; + } + } + return undefined; +} + +function normalizeBoolean(value: unknown): boolean | undefined { + if (typeof value === "boolean") { + return value; + } + if (typeof value === "string") { + const normalized = value.trim().toLowerCase(); + if (["1", "true", "yes", "on"].includes(normalized)) { + return true; + } + if (["0", "false", "no", "off"].includes(normalized)) { + return false; + } + } + return undefined; +} + +function withBrowserUsePath(baseUrl: string): string { + try { + const url = new URL(baseUrl); + const normalizedPath = url.pathname.replace(/\/+$/, ""); + if (normalizedPath.endsWith("/browser-use")) { + url.pathname = normalizedPath; + } else if (normalizedPath.length === 0 || normalizedPath === "/") { + url.pathname = "/browser-use"; + } else { + url.pathname = `${normalizedPath}/browser-use`; + } + return url.toString(); + } catch { + return baseUrl; + } +} + +export function resolveBrowserUseConfig(params: { + pluginConfig?: Record | null; + env?: NodeJS.ProcessEnv; +}): BrowserUseConfig { + const env = params.env ?? process.env; + const raw = params.pluginConfig ?? {}; + + const browserUseEnabled = + normalizeBoolean(raw.browserUseEnabled) ?? normalizeBoolean(env.BROWSER_USE_ENABLED) ?? false; + + const browserUseTimeoutMs = + normalizeNumber(raw.browserUseTimeoutMs) ?? + normalizeNumber(env.BROWSER_USE_TIMEOUT_MS) ?? + DEFAULT_BROWSER_USE_TIMEOUT_MS; + + const billingConfig = resolvePaziBillingConfig({ + pluginConfig: params.pluginConfig, + env, + }); + + const browserUseApiBase = + normalizeString(env.BROWSER_USE_API_URL) ?? normalizeString(billingConfig.apiUrl); + + return { + browserUseEnabled, + browserUseApiUrl: browserUseApiBase ? withBrowserUsePath(browserUseApiBase) : undefined, + browserUseTimeoutMs, + }; +} diff --git a/extensions/pazi/src/browser-use/tools.ts b/extensions/pazi/src/browser-use/tools.ts new file mode 100644 index 0000000000..90442726fb --- /dev/null +++ b/extensions/pazi/src/browser-use/tools.ts @@ -0,0 +1,411 @@ +import { mkdtemp, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { extname, join } from "node:path"; +import { Type } from "@sinclair/typebox"; +import type { AnyAgentTool } from "openclaw/plugin-sdk"; +import { + createSession, + getSessionStatus, + getSnapshot, + getScreenshot, + getTaskStatus, + runTask, + stopSession, +} from "./api.js"; +import { resolveBrowserUseConfig } from "./config.js"; + +const BROWSER_USE_ACTIONS = [ + "run", + "session_create", + "session_stop", + "snapshot", + "screenshot", + "status", +] as const; + +type BrowserUseAction = (typeof BROWSER_USE_ACTIONS)[number]; + +type AgentToolResult = { + content: Array<{ type: "text"; text: string }>; + details?: unknown; +}; + +export type BrowserUseToolsDeps = { + pluginConfig: Record | null; +}; + +function stringEnum( + values: T, + options: { description?: string } = {}, +) { + return Type.Unsafe({ + type: "string", + enum: [...values], + ...options, + }); +} + +function json(payload: unknown, summary?: string): AgentToolResult { + const details = payload as Record; + const text = summary + ? `${summary}\n\n${JSON.stringify(payload, null, 2)}` + : JSON.stringify(payload, null, 2); + return { + content: [{ type: "text", text }], + details, + }; +} + +function readRequiredString(params: Record, key: string): string { + const value = params[key]; + if (typeof value !== "string") { + throw new Error(`${key} required`); + } + const trimmed = value.trim(); + if (!trimmed) { + throw new Error(`${key} required`); + } + return trimmed; +} + +function readOptionalString(params: Record, key: string): string | undefined { + const value = params[key]; + if (typeof value !== "string") { + return undefined; + } + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : undefined; +} + +function fileExtensionFromContentType(contentType: string | null): string | undefined { + if (!contentType) { + return undefined; + } + const normalized = contentType.toLowerCase(); + if (normalized.includes("image/png")) { + return ".png"; + } + if (normalized.includes("image/jpeg") || normalized.includes("image/jpg")) { + return ".jpg"; + } + if (normalized.includes("image/webp")) { + return ".webp"; + } + return undefined; +} + +function extensionFromUrl(rawUrl: string): string | undefined { + try { + const parsed = new URL(rawUrl); + const extension = extname(parsed.pathname).trim().toLowerCase(); + if (!extension) { + return undefined; + } + if (extension.length > 10) { + return undefined; + } + return extension; + } catch { + return undefined; + } +} + +function withTimeoutSignal( + timeoutMs: number, + signal?: AbortSignal, +): { + signal: AbortSignal; + cleanup: () => void; +} { + const controller = new AbortController(); + const timer = setTimeout(() => { + controller.abort(); + }, timeoutMs); + + const onAbort = () => { + controller.abort(); + }; + + if (signal) { + if (signal.aborted) { + controller.abort(); + } else { + signal.addEventListener("abort", onAbort, { once: true }); + } + } + + return { + signal: controller.signal, + cleanup: () => { + clearTimeout(timer); + if (signal) { + signal.removeEventListener("abort", onAbort); + } + }, + }; +} + +async function downloadScreenshot(params: { + url: string; + timeoutMs: number; + signal?: AbortSignal; +}): Promise<{ path: string; bytes: number; mimeType?: string }> { + const timeout = withTimeoutSignal(params.timeoutMs, params.signal); + + try { + const res = await fetch(params.url, { + method: "GET", + signal: timeout.signal, + }); + + if (!res.ok) { + const statusText = res.statusText || "request_failed"; + throw new Error(`Screenshot download failed (${String(res.status)}): ${statusText}`); + } + + const bytes = Buffer.from(await res.arrayBuffer()); + const extension = + fileExtensionFromContentType(res.headers.get("content-type")) ?? + extensionFromUrl(params.url) ?? + ".png"; + + const dir = await mkdtemp(join(tmpdir(), "openclaw-browser-use-")); + const path = join(dir, `screenshot${extension}`); + await writeFile(path, bytes); + + return { + path, + bytes: bytes.byteLength, + mimeType: res.headers.get("content-type") ?? undefined, + }; + } finally { + timeout.cleanup(); + } +} + +function buildStatusHint(action: BrowserUseAction): string { + if (action === "run") { + return "Task started. Poll with action=status and taskId until status is completed or failed."; + } + if (action === "session_create") { + return "Session created. Use snapshot/screenshot/status/session_stop with this sessionId."; + } + return ""; +} + +export function createBrowserUseTools(deps: BrowserUseToolsDeps): AnyAgentTool[] { + return [ + { + name: "browser_use", + label: "Browser Use", + description: + "Stealth cloud browser automation via Pazi Browser Use API. Supports async run tasks and direct session controls.", + parameters: Type.Object( + { + action: stringEnum(BROWSER_USE_ACTIONS, { + description: `Action to perform: ${BROWSER_USE_ACTIONS.join(", ")}`, + }), + task: Type.Optional( + Type.String({ + description: "Natural language browsing task for action=run.", + }), + ), + taskId: Type.Optional(Type.String({ description: "Task ID for action=status." })), + sessionId: Type.Optional( + Type.String({ + description: + "Session ID for session_stop, snapshot, screenshot, or session status checks.", + }), + ), + url: Type.Optional( + Type.String({ + description: "Optional starting URL used when creating a new session.", + }), + ), + }, + { additionalProperties: false }, + ), + async execute(_toolCallId: string, params: Record, signal?: AbortSignal) { + try { + const actionRaw = params.action; + const action = + typeof actionRaw === "string" ? (actionRaw.trim() as BrowserUseAction) : undefined; + if (!action) { + throw new Error("action required"); + } + + switch (action) { + case "run": { + const task = readRequiredString(params, "task"); + const sessionId = readOptionalString(params, "sessionId"); + const result = await runTask( + { + pluginConfig: deps.pluginConfig, + body: { + task, + ...(sessionId ? { sessionId } : {}), + }, + }, + signal, + ); + if (!result.ok) { + return json({ error: result.error }); + } + + return json( + { + status: typeof result.data.status === "string" ? result.data.status : "running", + taskId: result.data.taskId, + liveUrl: result.data.liveUrl, + hint: buildStatusHint(action), + }, + "Browser Use task started.", + ); + } + + case "session_create": { + const startUrl = readOptionalString(params, "url"); + const result = await createSession( + { + pluginConfig: deps.pluginConfig, + body: startUrl ? { url: startUrl } : undefined, + }, + signal, + ); + if (!result.ok) { + return json({ error: result.error }); + } + + return json( + { + sessionId: result.data.sessionId, + liveUrl: result.data.liveUrl, + status: result.data.status, + hint: buildStatusHint(action), + }, + "Browser Use session created.", + ); + } + + case "session_stop": { + const sessionId = readRequiredString(params, "sessionId"); + const result = await stopSession( + { pluginConfig: deps.pluginConfig, sessionId }, + signal, + ); + if (!result.ok) { + return json({ error: result.error }); + } + return json({ sessionId, ...result.data }, "Browser Use session stopped."); + } + + case "snapshot": { + const sessionId = readRequiredString(params, "sessionId"); + const result = await getSnapshot( + { pluginConfig: deps.pluginConfig, sessionId }, + signal, + ); + if (!result.ok) { + return json({ error: result.error }); + } + if (typeof result.data.text !== "string") { + return json({ error: "Snapshot response missing text" }); + } + return { + content: [{ type: "text", text: result.data.text }], + details: { + sessionId, + text: result.data.text, + }, + }; + } + + case "screenshot": { + const sessionId = readRequiredString(params, "sessionId"); + const screenshot = await getScreenshot( + { pluginConfig: deps.pluginConfig, sessionId }, + signal, + ); + if (!screenshot.ok) { + return json({ error: screenshot.error }); + } + + const screenshotUrl = + typeof screenshot.data.url === "string" ? screenshot.data.url.trim() : ""; + if (!screenshotUrl) { + return json({ error: "Screenshot response missing URL" }); + } + + const resolvedCfg = resolveBrowserUseConfig({ + pluginConfig: deps.pluginConfig, + env: process.env, + }); + + const downloaded = await downloadScreenshot({ + url: screenshotUrl, + timeoutMs: resolvedCfg.browserUseTimeoutMs, + signal, + }); + + return { + content: [{ type: "text", text: `FILE:${downloaded.path}` }], + details: { + sessionId, + url: screenshotUrl, + path: downloaded.path, + bytes: downloaded.bytes, + mimeType: downloaded.mimeType, + imagePaths: [downloaded.path], + }, + }; + } + + case "status": { + const taskId = readOptionalString(params, "taskId"); + const sessionId = readOptionalString(params, "sessionId"); + + if (!taskId && !sessionId) { + throw new Error("taskId or sessionId required"); + } + if (taskId && sessionId) { + throw new Error("Provide either taskId or sessionId, not both"); + } + + if (taskId) { + const result = await getTaskStatus( + { pluginConfig: deps.pluginConfig, taskId }, + signal, + ); + if (!result.ok) { + return json({ error: result.error }); + } + + return json({ taskId, ...result.data }, "Browser Use task status."); + } + + const sessionResult = await getSessionStatus( + { + pluginConfig: deps.pluginConfig, + sessionId: sessionId as string, + }, + signal, + ); + if (!sessionResult.ok) { + return json({ error: sessionResult.error }); + } + + return json({ sessionId, ...sessionResult.data }, "Browser Use session status."); + } + + default: { + action satisfies never; + return json({ error: `Unsupported action: ${String(action)}` }); + } + } + } catch (err) { + return json({ error: err instanceof Error ? err.message : String(err) }); + } + }, + }, + ]; +} From 19f2b3f759c6a51c95d34ec5af235c8a2ea2e343 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 08:08:14 +0000 Subject: [PATCH 38/80] chore: release 2026.3.9 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ed5e9651db..c2a2e87e5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.8", + "version": "2026.3.9", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From ffbdf65ba865bd690b13874bb3f1ac43b9494a30 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 6 Mar 2026 09:19:01 +0100 Subject: [PATCH 39/80] Fix gateway --- extensions/pazi/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index 1417c55a64..b5de510fff 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -60,6 +60,7 @@ export default { api.registerHttpRoute({ path: "/pazi/context", + auth: "gateway", handler: async (req, res) => { if (req.method !== "POST") { res.statusCode = 404; @@ -73,6 +74,7 @@ export default { api.registerHttpRoute({ path: "/health", + auth: "gateway", handler: (_req, res) => { res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); res.end(JSON.stringify({ status: "ok", timestamp: new Date().toISOString() })); @@ -81,6 +83,7 @@ export default { api.registerHttpRoute({ path: "/status", + auth: "gateway", handler: (_req, res) => { res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); res.end( @@ -96,6 +99,7 @@ export default { api.registerHttpRoute({ path: "/pazi/upload", + auth: "gateway", handler: async (req, res) => { if (req.method !== "POST") { res.statusCode = 404; From 2818c4916b28a0ecfb776ea7a3da9e7790efb329 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 08:26:23 +0000 Subject: [PATCH 40/80] chore: release 2026.3.10 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c2a2e87e5a..023b43afe6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.9", + "version": "2026.3.10", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From f75be51fbf8ffd455cd9ce5b828b30732223a17a Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 6 Mar 2026 09:54:52 +0100 Subject: [PATCH 41/80] Trigger build --- Dockerfile.pazi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index e99ae9118d..56de1545a9 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -1,5 +1,4 @@ -# Dockerfile.pazi -#Pazi production wrapper +# Dockerfile.pazi - Pazi production wrapper # Builds the OpenClaw agent, then layers desktop services on top. # --------------------------------------------------------------------------- From 25effe4caddf88ef87a5c94ca7c882fc3c595402 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Fri, 6 Mar 2026 09:55:33 +0100 Subject: [PATCH 42/80] Docker: remove pazi entrypoint wrapper --- Dockerfile.pazi | 4 +- entrypoint.pazi.sh | 110 --------------------------------------------- 2 files changed, 1 insertion(+), 113 deletions(-) delete mode 100755 entrypoint.pazi.sh diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 3c7de460ec..9a4cb4c96a 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -94,8 +94,6 @@ RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share & # Supervisord config COPY supervisord.pazi.conf /etc/supervisor/conf.d/supervisord.conf -COPY entrypoint.pazi.sh /usr/local/bin/entrypoint.pazi.sh -RUN chmod +x /usr/local/bin/entrypoint.pazi.sh ENV NODE_ENV=production \ OPENCLAW_GATEWAY_PORT=3000 \ @@ -111,4 +109,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ # supervisord runs as root to manage child processes with different users USER root -CMD ["/usr/local/bin/entrypoint.pazi.sh"] +CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] diff --git a/entrypoint.pazi.sh b/entrypoint.pazi.sh deleted file mode 100755 index 9ab0be5178..0000000000 --- a/entrypoint.pazi.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -is_truthy() { - local raw="${1:-}" - raw="$(printf '%s' "$raw" | tr '[:upper:]' '[:lower:]')" - case "$raw" in - 1|true|yes|on) return 0 ;; - *) return 1 ;; - esac -} - -PAZI_HOME="${PAZI_HOME:-/home/pazi}" -DEFAULT_CONFIG_PATH="$PAZI_HOME/.openclaw/openclaw.json" -CONFIG_PATH="${OPENCLAW_CONFIG_PATH:-$DEFAULT_CONFIG_PATH}" -mkdir -p "$(dirname "$CONFIG_PATH")" - -BROWSER_USE_FLAG="${BROWSER_USE_ENABLED:-}" - -node - "$CONFIG_PATH" "$BROWSER_USE_FLAG" <<'NODE' -const fs = require("node:fs"); -const path = require("node:path"); - -let JSON5; -try { - JSON5 = require("json5"); -} catch { - JSON5 = { parse: JSON.parse }; -} - -const configPath = process.argv[2]; -const rawEnabled = String(process.argv[3] ?? "").trim(); -const browserUseEnabled = /^(1|true|yes|on)$/i.test(rawEnabled); - -const readConfig = () => { - if (!fs.existsSync(configPath)) { - return {}; - } - const raw = fs.readFileSync(configPath, "utf8"); - if (!raw.trim()) { - return {}; - } - try { - const parsed = JSON5.parse(raw); - if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) { - return parsed; - } - return {}; - } catch { - return {}; - } -}; - -const cfg = readConfig(); - -if (browserUseEnabled) { - if (!cfg.browser || typeof cfg.browser !== "object" || Array.isArray(cfg.browser)) { - cfg.browser = {}; - } - cfg.browser.enabled = false; - - if (!cfg.tools || typeof cfg.tools !== "object" || Array.isArray(cfg.tools)) { - cfg.tools = {}; - } - - const existingDeny = Array.isArray(cfg.tools.deny) - ? cfg.tools.deny.filter((entry) => typeof entry === "string") - : []; - if (!existingDeny.includes("browser")) { - existingDeny.push("browser"); - } - cfg.tools.deny = existingDeny; -} else { - if (cfg.browser && typeof cfg.browser === "object" && !Array.isArray(cfg.browser)) { - delete cfg.browser.enabled; - if (Object.keys(cfg.browser).length === 0) { - delete cfg.browser; - } - } - - if (cfg.tools && typeof cfg.tools === "object" && !Array.isArray(cfg.tools)) { - if (Array.isArray(cfg.tools.deny)) { - const nextDeny = cfg.tools.deny.filter((entry) => entry !== "browser"); - if (nextDeny.length > 0) { - cfg.tools.deny = nextDeny; - } else { - delete cfg.tools.deny; - } - } - if (Object.keys(cfg.tools).length === 0) { - delete cfg.tools; - } - } -} - -fs.mkdirSync(path.dirname(configPath), { recursive: true }); -fs.writeFileSync(configPath, `${JSON.stringify(cfg, null, 2)}\n`, "utf8"); -NODE - -if is_truthy "$BROWSER_USE_FLAG"; then - echo "BROWSER_USE_ENABLED=true: disabled built-in browser and denied browser tool in $CONFIG_PATH" -else - echo "BROWSER_USE_ENABLED is false/unset: removed Browser Use override keys in $CONFIG_PATH" -fi - -if id -u pazi >/dev/null 2>&1; then - chown pazi:pazi "$CONFIG_PATH" || true -fi - -exec supervisord -c /etc/supervisor/conf.d/supervisord.conf From ac5462d0461a1a79853fee1104ebc87578338168 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 09:02:22 +0000 Subject: [PATCH 43/80] chore: release 2026.3.11 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 023b43afe6..06fab73dc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.10", + "version": "2026.3.11", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 0eaad08e60f048fa01c80b5c7f5cdfaa55a90e97 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 10:53:10 +0000 Subject: [PATCH 44/80] chore: release 2026.3.12 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 06fab73dc9..7551bf32e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.11", + "version": "2026.3.12", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From a44bdd0d4565d6581aa814db158e6b25833ff3d0 Mon Sep 17 00:00:00 2001 From: mijauexe Date: Fri, 6 Mar 2026 13:36:26 +0100 Subject: [PATCH 45/80] CI: enable custom branch deployment for pazi-agent workflow Add workflow_dispatch inputs for environment and branch selection, matching the pazi API deploy pattern. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/deploy-pazi-agent.yml | 257 +++++++++++++----------- 1 file changed, 140 insertions(+), 117 deletions(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 927c10a51f..6c7ff3bdf2 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -1,126 +1,149 @@ name: Deploy Pazi Agent on: - push: - branches: [main, staging] - - workflow_dispatch: + push: + branches: [main, staging] + + workflow_dispatch: + inputs: + environment: + description: 'Environment to deploy to' + required: true + type: choice + options: + - staging + - production + default: staging + branch: + description: 'Branch to deploy' + required: true + type: string + default: staging permissions: - contents: write - packages: write + contents: write + packages: write env: - AWS_REGION: us-east-1 - GHCR_IMAGE: ghcr.io/pythagora-io/pazi-agent + AWS_REGION: us-east-1 + GHCR_IMAGE: ghcr.io/pythagora-io/pazi-agent jobs: - build-and-push: - runs-on: ubuntu-latest - - outputs: - image_tag: ${{ steps.build-image.outputs.image_tag }} - version: ${{ steps.get_version.outputs.VERSION }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Read version from package.json - id: get_version - run: | - VERSION=$(node -p "require('./package.json').version") - echo "Version: v${VERSION}" - echo "VERSION=v${VERSION}" >> $GITHUB_OUTPUT - - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GHCR_TOKEN }} - - - name: Determine environment - id: env - run: | - if [[ "${{ github.ref_name }}" == "main" ]]; then - echo "environment=production" >> $GITHUB_OUTPUT - echo "suffix=" >> $GITHUB_OUTPUT - else - echo "environment=staging" >> $GITHUB_OUTPUT - echo "suffix=-staging" >> $GITHUB_OUTPUT - fi - - - name: Build, tag, and push image to GHCR - id: build-image - env: - IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }}${{ steps.env.outputs.suffix }} - LATEST_TAG: latest${{ steps.env.outputs.suffix }} - run: | - docker build -f Dockerfile.pazi -t $GHCR_IMAGE:$IMAGE_TAG . - docker tag $GHCR_IMAGE:$IMAGE_TAG $GHCR_IMAGE:$LATEST_TAG - - docker push $GHCR_IMAGE:$IMAGE_TAG - docker push $GHCR_IMAGE:$LATEST_TAG - - echo "image=$GHCR_IMAGE:$IMAGE_TAG" >> $GITHUB_OUTPUT - echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - - - name: Upload latest version to S3 - env: - IMAGE_TAG: ${{ steps.build-image.outputs.image_tag }} - run: | - if [[ "${{ github.ref_name }}" == "main" ]]; then - S3_KEY="latest.txt" - else - S3_KEY="latest-staging.txt" - fi - echo "$IMAGE_TAG" > "$S3_KEY" - aws s3 cp "$S3_KEY" "s3://assets.pazi.ai/cloud/$S3_KEY" - - - name: Deployment Summary - if: success() - run: | - echo "### Build and Push Successful! :rocket:" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Image:** ${{ steps.build-image.outputs.image }}" >> $GITHUB_STEP_SUMMARY - echo "**Registry:** GHCR (${{ env.GHCR_IMAGE }})" >> $GITHUB_STEP_SUMMARY - echo "**Version:** ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY - - push-version-tag: - if: github.ref_name == 'main' - runs-on: ubuntu-latest - needs: build-and-push - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_PAT }} - fetch-depth: 0 - - - name: Tag and bump version - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - git tag ${{ needs.build-and-push.outputs.version }} - git push origin ${{ needs.build-and-push.outputs.version }} - - CURRENT=$(node -p "require('./package.json').version") - IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" - NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" - node -e "const pkg=require('./package.json'); pkg.version='${NEXT}'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n')" - - git add package.json - git commit -m "chore: release ${NEXT} [skip ci]" - git push origin HEAD:${{ github.ref_name }} + build-and-push: + runs-on: ubuntu-latest + + outputs: + image_tag: ${{ steps.build-image.outputs.image_tag }} + version: ${{ steps.get_version.outputs.VERSION }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch || github.ref }} + fetch-depth: 0 + + - name: Read version from package.json + id: get_version + run: | + VERSION=$(node -p "require('./package.json').version") + echo "Version: v${VERSION}" + echo "VERSION=v${VERSION}" >> $GITHUB_OUTPUT + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + + - name: Determine environment + id: env + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + ENVIRONMENT="${{ github.event.inputs.environment }}" + elif [[ "${{ github.ref_name }}" == "main" ]]; then + ENVIRONMENT="production" + else + ENVIRONMENT="staging" + fi + + if [ "$ENVIRONMENT" = "production" ]; then + echo "environment=production" >> $GITHUB_OUTPUT + echo "suffix=" >> $GITHUB_OUTPUT + else + echo "environment=staging" >> $GITHUB_OUTPUT + echo "suffix=-staging" >> $GITHUB_OUTPUT + fi + + - name: Build, tag, and push image to GHCR + id: build-image + env: + IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }}${{ steps.env.outputs.suffix }} + LATEST_TAG: latest${{ steps.env.outputs.suffix }} + run: | + docker build -f Dockerfile.pazi -t $GHCR_IMAGE:$IMAGE_TAG . + docker tag $GHCR_IMAGE:$IMAGE_TAG $GHCR_IMAGE:$LATEST_TAG + + docker push $GHCR_IMAGE:$IMAGE_TAG + docker push $GHCR_IMAGE:$LATEST_TAG + + echo "image=$GHCR_IMAGE:$IMAGE_TAG" >> $GITHUB_OUTPUT + echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Upload latest version to S3 + env: + IMAGE_TAG: ${{ steps.build-image.outputs.image_tag }} + run: | + if [ "${{ steps.env.outputs.environment }}" = "production" ]; then + S3_KEY="latest.txt" + else + S3_KEY="latest-staging.txt" + fi + echo "$IMAGE_TAG" > "$S3_KEY" + aws s3 cp "$S3_KEY" "s3://assets.pazi.ai/cloud/$S3_KEY" + + - name: Deployment Summary + if: success() + run: | + echo "### Build and Push Successful! :rocket:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Image:** ${{ steps.build-image.outputs.image }}" >> $GITHUB_STEP_SUMMARY + echo "**Registry:** GHCR (${{ env.GHCR_IMAGE }})" >> $GITHUB_STEP_SUMMARY + echo "**Version:** ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY + + push-version-tag: + if: github.ref_name == 'main' + runs-on: ubuntu-latest + needs: build-and-push + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Tag and bump version + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + git tag ${{ needs.build-and-push.outputs.version }} + git push origin ${{ needs.build-and-push.outputs.version }} + + CURRENT=$(node -p "require('./package.json').version") + IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" + NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" + node -e "const pkg=require('./package.json'); pkg.version='${NEXT}'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n')" + + git add package.json + git commit -m "chore: release ${NEXT} [skip ci]" + git push origin HEAD:${{ github.ref_name }} From f148986d10f02532eb91a503a443488775ca77ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 12:42:33 +0000 Subject: [PATCH 46/80] chore: release 2026.3.13 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7551bf32e0..7c130ec074 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.12", + "version": "2026.3.13", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 19b7a58f2a39665a40f42484cfc05698e5613d1d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 13:17:48 +0000 Subject: [PATCH 47/80] chore: release 2026.3.14 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c130ec074..577be6e381 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.13", + "version": "2026.3.14", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 38094bb973db174a476659a84f23bab4a0c4e924 Mon Sep 17 00:00:00 2001 From: Pazi Bot Date: Fri, 6 Mar 2026 15:04:24 +0000 Subject: [PATCH 48/80] feat: add pazi.channels.configure RPC for Slack and Telegram token setup Add a unified gateway method that validates tokens via probe, persists config, and restarts channel accounts. Supports both default and named accounts for Slack (botToken + appToken) and Telegram (botToken). Co-Authored-By: Claude Opus 4.6 --- extensions/pazi/index.ts | 12 + extensions/pazi/src/channels-configure.ts | 263 ++++++++++++++++++++++ 2 files changed, 275 insertions(+) create mode 100644 extensions/pazi/src/channels-configure.ts diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index cee5b1a718..b466fb5d5a 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -7,6 +7,7 @@ import { getProxyContext } from "./src/context.js"; import { createPipedreamTools } from "./src/pipedream/tools.js"; import { createPaziContextHandler } from "./src/proxy/pazi-context.js"; import { startPaziProxy } from "./src/proxy/pazi-proxy.js"; +import { createPaziChannelsConfigureHandler } from "./src/channels-configure.js"; import { createPaziUploadHandler } from "./src/proxy/pazi-upload.js"; function normalizePluginConfig( @@ -52,6 +53,17 @@ export default { respond(true, { emitted: true }); }); + api.registerGatewayMethod( + "pazi.channels.configure", + createPaziChannelsConfigureHandler({ + loadConfig: () => api.runtime.config.loadConfig(), + writeConfigFile: (cfg) => api.runtime.config.writeConfigFile(cfg), + probeSlack: (token, timeoutMs) => api.runtime.channel.slack.probeSlack(token, timeoutMs), + probeTelegram: (token, timeoutMs, proxyUrl) => + api.runtime.channel.telegram.probeTelegram(token, timeoutMs, proxyUrl), + }), + ); + const tools = createPipedreamTools({ pluginConfig, config: api.config, diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts new file mode 100644 index 0000000000..588aabf6ed --- /dev/null +++ b/extensions/pazi/src/channels-configure.ts @@ -0,0 +1,263 @@ +type ChannelType = "slack" | "telegram"; + +interface ChannelConfigureParams { + channel: ChannelType; + accountId?: string; + timeoutMs?: number; + config: { + name?: string; + botToken?: string; + appToken?: string; + token?: string; + }; +} + +interface ProbeResult { + ok: boolean; + status?: number | null; + error?: string | null; + bot?: { id?: string | number; name?: string | null; username?: string | null }; + team?: { id?: string; name?: string }; + elapsedMs?: number; +} + +interface ChannelConfigureResult { + ok: true; + channel: ChannelType; + accountId: string; + probe?: ProbeResult; +} + +interface GatewayMethodContext { + params: unknown; + respond: (ok: boolean, data: unknown) => void; + context: { + stopChannel: (channel: string, accountId?: string) => void; + startChannel: (channel: string, accountId?: string) => void; + }; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type OpenClawConfig = Record; + +interface ChannelConfigureDeps { + loadConfig: () => OpenClawConfig; + writeConfigFile: (cfg: OpenClawConfig) => void | Promise; + probeSlack: (token: string, timeoutMs: number) => Promise; + probeTelegram: ( + token: string, + timeoutMs: number, + proxyUrl: string | undefined, + ) => Promise; +} + +const VALID_CHANNELS: ReadonlySet = new Set(["slack", "telegram"]); + +function isChannelType(value: unknown): value is ChannelType { + return typeof value === "string" && VALID_CHANNELS.has(value); +} + +function validateParams(raw: unknown): { + ok: boolean; + error?: string; + params?: ChannelConfigureParams; +} { + if (!raw || typeof raw !== "object") { + return { ok: false, error: "params must be an object" }; + } + const p = raw as Record; + + if (!isChannelType(p.channel)) { + return { ok: false, error: "channel must be 'slack' or 'telegram'" }; + } + + const config = p.config; + if (!config || typeof config !== "object") { + return { ok: false, error: "config must be an object" }; + } + const cfg = config as Record; + + if (p.channel === "slack") { + const botToken = typeof cfg.botToken === "string" ? cfg.botToken.trim() : ""; + const appToken = typeof cfg.appToken === "string" ? cfg.appToken.trim() : ""; + if (!botToken || !appToken) { + return { ok: false, error: "Slack requires botToken and appToken" }; + } + } + + if (p.channel === "telegram") { + const token = + typeof cfg.token === "string" + ? cfg.token.trim() + : typeof cfg.botToken === "string" + ? cfg.botToken.trim() + : ""; + if (!token) { + return { ok: false, error: "Telegram requires token or botToken" }; + } + } + + return { + ok: true, + params: { + channel: p.channel, + accountId: typeof p.accountId === "string" ? p.accountId : undefined, + timeoutMs: typeof p.timeoutMs === "number" ? p.timeoutMs : undefined, + config: { + name: typeof cfg.name === "string" ? cfg.name : undefined, + botToken: typeof cfg.botToken === "string" ? cfg.botToken : undefined, + appToken: typeof cfg.appToken === "string" ? cfg.appToken : undefined, + token: typeof cfg.token === "string" ? cfg.token : undefined, + }, + }, + }; +} + +function applySlackConfig( + cfg: OpenClawConfig, + accountId: string, + input: ChannelConfigureParams["config"], +): OpenClawConfig { + const botToken = input.botToken?.trim() ?? ""; + const appToken = input.appToken?.trim() ?? ""; + + if (accountId === "default") { + return { + ...cfg, + channels: { + ...cfg.channels, + slack: { + ...cfg.channels?.slack, + enabled: true, + botToken, + appToken, + ...(input.name ? { name: input.name } : {}), + }, + }, + }; + } + + return { + ...cfg, + channels: { + ...cfg.channels, + slack: { + ...cfg.channels?.slack, + enabled: true, + accounts: { + ...cfg.channels?.slack?.accounts, + [accountId]: { + ...cfg.channels?.slack?.accounts?.[accountId], + enabled: true, + botToken, + appToken, + ...(input.name ? { name: input.name } : {}), + }, + }, + }, + }, + }; +} + +function applyTelegramConfig( + cfg: OpenClawConfig, + accountId: string, + input: ChannelConfigureParams["config"], +): OpenClawConfig { + const token = (input.token ?? input.botToken ?? "").trim(); + + if (accountId === "default") { + return { + ...cfg, + channels: { + ...cfg.channels, + telegram: { + ...cfg.channels?.telegram, + enabled: true, + botToken: token, + ...(input.name ? { name: input.name } : {}), + }, + }, + }; + } + + return { + ...cfg, + channels: { + ...cfg.channels, + telegram: { + ...cfg.channels?.telegram, + enabled: true, + accounts: { + ...cfg.channels?.telegram?.accounts, + [accountId]: { + ...cfg.channels?.telegram?.accounts?.[accountId], + enabled: true, + botToken: token, + ...(input.name ? { name: input.name } : {}), + }, + }, + }, + }, + }; +} + +export function createPaziChannelsConfigureHandler( + deps: ChannelConfigureDeps, +): (ctx: GatewayMethodContext) => Promise { + return async ({ params, respond, context }: GatewayMethodContext) => { + const validation = validateParams(params); + if (!validation.ok || !validation.params) { + respond(false, { error: validation.error ?? "invalid params" }); + return; + } + + const { channel, config: inputConfig } = validation.params; + const accountId = validation.params.accountId || "default"; + const timeoutMs = validation.params.timeoutMs ?? 5000; + + let probe: ProbeResult; + try { + if (channel === "slack") { + const token = inputConfig.botToken?.trim() ?? ""; + probe = await deps.probeSlack(token, timeoutMs); + } else { + const token = (inputConfig.token ?? inputConfig.botToken ?? "").trim(); + probe = await deps.probeTelegram(token, timeoutMs, undefined); + } + } catch (err) { + respond(false, { + error: `probe failed: ${err instanceof Error ? err.message : String(err)}`, + }); + return; + } + + if (!probe.ok) { + respond(false, { + error: probe.error ?? "token probe failed", + probe, + }); + return; + } + + context.stopChannel(channel, accountId); + + let cfg = deps.loadConfig(); + if (channel === "slack") { + cfg = applySlackConfig(cfg, accountId, inputConfig); + } else { + cfg = applyTelegramConfig(cfg, accountId, inputConfig); + } + await deps.writeConfigFile(cfg); + + context.startChannel(channel, accountId); + + const result: ChannelConfigureResult = { + ok: true, + channel, + accountId, + probe, + }; + respond(true, result); + }; +} From 22fdc21f4f30ed7f510b33976115b22f9b085251 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Fri, 6 Mar 2026 17:24:47 +0100 Subject: [PATCH 49/80] fix: harden channel configure handler lifecycle --- extensions/pazi/src/channels-configure.ts | 100 +++++++++++++++++----- 1 file changed, 77 insertions(+), 23 deletions(-) diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index 588aabf6ed..ab6e5dedf5 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -16,9 +16,9 @@ interface ProbeResult { ok: boolean; status?: number | null; error?: string | null; - bot?: { id?: string | number; name?: string | null; username?: string | null }; - team?: { id?: string; name?: string }; - elapsedMs?: number; + bot?: { id?: string | number | null; name?: string | null; username?: string | null }; + team?: { id?: string | null; name?: string | null }; + elapsedMs?: number | null; } interface ChannelConfigureResult { @@ -28,12 +28,17 @@ interface ChannelConfigureResult { probe?: ProbeResult; } +type GatewayErrorShape = { + code: string; + message: string; +}; + interface GatewayMethodContext { params: unknown; - respond: (ok: boolean, data: unknown) => void; + respond: (ok: boolean, data?: unknown, error?: GatewayErrorShape) => void; context: { - stopChannel: (channel: string, accountId?: string) => void; - startChannel: (channel: string, accountId?: string) => void; + stopChannel: (channel: string, accountId?: string) => Promise; + startChannel: (channel: string, accountId?: string) => Promise; }; } @@ -52,6 +57,17 @@ interface ChannelConfigureDeps { } const VALID_CHANNELS: ReadonlySet = new Set(["slack", "telegram"]); +const ERROR_INVALID_REQUEST = "INVALID_REQUEST"; +const ERROR_UNAVAILABLE = "UNAVAILABLE"; + +function respondError( + respond: GatewayMethodContext["respond"], + code: string, + message: string, + payload?: unknown, +): void { + respond(false, payload, { code, message }); +} function isChannelType(value: unknown): value is ChannelType { return typeof value === "string" && VALID_CHANNELS.has(value); @@ -208,49 +224,87 @@ export function createPaziChannelsConfigureHandler( return async ({ params, respond, context }: GatewayMethodContext) => { const validation = validateParams(params); if (!validation.ok || !validation.params) { - respond(false, { error: validation.error ?? "invalid params" }); + respondError(respond, ERROR_INVALID_REQUEST, validation.error ?? "invalid params"); return; } const { channel, config: inputConfig } = validation.params; - const accountId = validation.params.accountId || "default"; + const rawAccountId = validation.params.accountId?.trim(); + const accountId = rawAccountId || "default"; const timeoutMs = validation.params.timeoutMs ?? 5000; let probe: ProbeResult; try { if (channel === "slack") { const token = inputConfig.botToken?.trim() ?? ""; + // probeSlack validates botToken. appToken validity is verified on channel restart. probe = await deps.probeSlack(token, timeoutMs); } else { const token = (inputConfig.token ?? inputConfig.botToken ?? "").trim(); probe = await deps.probeTelegram(token, timeoutMs, undefined); } } catch (err) { - respond(false, { - error: `probe failed: ${err instanceof Error ? err.message : String(err)}`, - }); + respondError( + respond, + ERROR_UNAVAILABLE, + `probe failed: ${err instanceof Error ? err.message : String(err)}`, + ); return; } if (!probe.ok) { - respond(false, { - error: probe.error ?? "token probe failed", - probe, - }); + respondError(respond, ERROR_UNAVAILABLE, probe.error ?? "token probe failed", { probe }); return; } - context.stopChannel(channel, accountId); + try { + await context.stopChannel(channel, accountId); + } catch (err) { + respondError( + respond, + ERROR_UNAVAILABLE, + `failed to stop channel: ${err instanceof Error ? err.message : String(err)}`, + ); + return; + } - let cfg = deps.loadConfig(); - if (channel === "slack") { - cfg = applySlackConfig(cfg, accountId, inputConfig); - } else { - cfg = applyTelegramConfig(cfg, accountId, inputConfig); + try { + let cfg = deps.loadConfig(); + if (channel === "slack") { + cfg = applySlackConfig(cfg, accountId, inputConfig); + } else { + cfg = applyTelegramConfig(cfg, accountId, inputConfig); + } + await deps.writeConfigFile(cfg); + } catch (err) { + try { + await context.startChannel(channel, accountId); + } catch (restartErr) { + respondError( + respond, + ERROR_UNAVAILABLE, + `config write failed and restart failed: ${restartErr instanceof Error ? restartErr.message : String(restartErr)}`, + ); + return; + } + respondError( + respond, + ERROR_UNAVAILABLE, + `config write failed: ${err instanceof Error ? err.message : String(err)}`, + ); + return; } - await deps.writeConfigFile(cfg); - context.startChannel(channel, accountId); + try { + await context.startChannel(channel, accountId); + } catch (err) { + respondError( + respond, + ERROR_UNAVAILABLE, + `channel restart failed after config update: ${err instanceof Error ? err.message : String(err)}`, + ); + return; + } const result: ChannelConfigureResult = { ok: true, From f7de4b8e7097f65ef471755daeff1e4835a3fd6b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 16:32:34 +0000 Subject: [PATCH 50/80] chore: release 2026.3.15 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 577be6e381..37d1626347 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.14", + "version": "2026.3.15", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From abf546280856c0946cce60963f6d472a47a0d5d9 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 9 Mar 2026 11:16:56 +0100 Subject: [PATCH 51/80] add dmPolicy to channels --- extensions/pazi/src/channels-configure.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index ab6e5dedf5..b28def5ef4 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -147,6 +147,7 @@ function applySlackConfig( enabled: true, botToken, appToken, + dmPolicy: "open", ...(input.name ? { name: input.name } : {}), }, }, @@ -167,6 +168,7 @@ function applySlackConfig( enabled: true, botToken, appToken, + dmPolicy: "open", ...(input.name ? { name: input.name } : {}), }, }, @@ -191,6 +193,7 @@ function applyTelegramConfig( ...cfg.channels?.telegram, enabled: true, botToken: token, + dmPolicy: "open", ...(input.name ? { name: input.name } : {}), }, }, @@ -210,6 +213,7 @@ function applyTelegramConfig( ...cfg.channels?.telegram?.accounts?.[accountId], enabled: true, botToken: token, + dmPolicy: "open", ...(input.name ? { name: input.name } : {}), }, }, From 249333296a92141d38de7431bd5e87044f5bc264 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 9 Mar 2026 19:09:13 +0100 Subject: [PATCH 52/80] Enable sudo for pazi workspace user --- Dockerfile.pazi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 56de1545a9..b9f4c14136 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -60,7 +60,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins # Screenshot capture for desktop preview scrot \ # Utilities - git curl ca-certificates procps \ + git curl ca-certificates procps sudo \ # Process manager supervisor \ && apt-get clean && rm -rf /var/lib/apt/lists/* @@ -76,7 +76,8 @@ RUN SELKIES_VERSION="$(curl -fsSL \ echo "Selkies-GStreamer v${SELKIES_VERSION} installed" # Create pazi user (UID 1001 — matches host /home/pazi volume mounts) -RUN groupadd -g 1001 pazi && useradd -u 1001 -g 1001 -m -d /home/pazi pazi +RUN groupadd -g 1001 pazi && useradd -u 1001 -g 1001 -m -d /home/pazi pazi && \ + echo "pazi ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/pazi && chmod 440 /etc/sudoers.d/pazi WORKDIR /app From 353ada3d2ea8b47cf45836cc46fc0d8df9854b6f Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 9 Mar 2026 21:35:30 +0100 Subject: [PATCH 53/80] fix(telegram): secure channel onboarding with start-code pairing --- extensions/pazi/index.ts | 16 +- extensions/pazi/src/channels-configure.ts | 50 +++++- extensions/test-utils/plugin-runtime-mock.ts | 8 +- src/pairing/pairing-store.test.ts | 55 +++++++ src/pairing/pairing-store.ts | 113 +++++++++++++- src/plugins/runtime/runtime-channel.ts | 8 + src/plugins/runtime/types-channel.ts | 13 +- src/telegram/dm-access.test.ts | 153 +++++++++++++++++++ src/telegram/dm-access.ts | 52 ++++++- 9 files changed, 457 insertions(+), 11 deletions(-) create mode 100644 src/telegram/dm-access.test.ts diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index b466fb5d5a..d85c0de251 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -2,12 +2,12 @@ import type { Server as HttpServer } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import { resolveBrowserUseConfig } from "./src/browser-use/config.js"; import { createBrowserUseTools } from "./src/browser-use/tools.js"; +import { createPaziChannelsConfigureHandler } from "./src/channels-configure.js"; import { resolvePaziBillingConfig } from "./src/config.js"; import { getProxyContext } from "./src/context.js"; import { createPipedreamTools } from "./src/pipedream/tools.js"; import { createPaziContextHandler } from "./src/proxy/pazi-context.js"; import { startPaziProxy } from "./src/proxy/pazi-proxy.js"; -import { createPaziChannelsConfigureHandler } from "./src/channels-configure.js"; import { createPaziUploadHandler } from "./src/proxy/pazi-upload.js"; function normalizePluginConfig( @@ -61,6 +61,12 @@ export default { probeSlack: (token, timeoutMs) => api.runtime.channel.slack.probeSlack(token, timeoutMs), probeTelegram: (token, timeoutMs, proxyUrl) => api.runtime.channel.telegram.probeTelegram(token, timeoutMs, proxyUrl), + issueOnboardingCode: ({ channel, accountId, ttlMs }) => + api.runtime.channel.pairing.issueOnboardingCode({ + channel, + accountId, + ttlMs, + }), }), ); @@ -101,7 +107,9 @@ export default { path: "/health", auth: "gateway", handler: (_req, res) => { - res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); + res.writeHead(200, { + "Content-Type": "application/json; charset=utf-8", + }); res.end(JSON.stringify({ status: "ok", timestamp: new Date().toISOString() })); }, }); @@ -110,7 +118,9 @@ export default { path: "/status", auth: "gateway", handler: (_req, res) => { - res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" }); + res.writeHead(200, { + "Content-Type": "application/json; charset=utf-8", + }); res.end( JSON.stringify({ status: "running", diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index b28def5ef4..d888afbbf9 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -16,16 +16,30 @@ interface ProbeResult { ok: boolean; status?: number | null; error?: string | null; - bot?: { id?: string | number | null; name?: string | null; username?: string | null }; + bot?: { + id?: string | number | null; + name?: string | null; + username?: string | null; + }; team?: { id?: string | null; name?: string | null }; elapsedMs?: number | null; } +interface TelegramOnboardingResult { + mode: "start-code"; + dmPolicy: "pairing"; + command: string; + codeExpiresAt: string; + botUsername?: string | null; + deepLink?: string; +} + interface ChannelConfigureResult { ok: true; channel: ChannelType; accountId: string; probe?: ProbeResult; + onboarding?: TelegramOnboardingResult; } type GatewayErrorShape = { @@ -54,11 +68,17 @@ interface ChannelConfigureDeps { timeoutMs: number, proxyUrl: string | undefined, ) => Promise; + issueOnboardingCode: (params: { + channel: "telegram"; + accountId: string; + ttlMs?: number; + }) => Promise<{ code: string; expiresAt: string }>; } const VALID_CHANNELS: ReadonlySet = new Set(["slack", "telegram"]); const ERROR_INVALID_REQUEST = "INVALID_REQUEST"; const ERROR_UNAVAILABLE = "UNAVAILABLE"; +const TELEGRAM_ONBOARDING_TTL_MS = 15 * 60 * 1000; function respondError( respond: GatewayMethodContext["respond"], @@ -193,7 +213,7 @@ function applyTelegramConfig( ...cfg.channels?.telegram, enabled: true, botToken: token, - dmPolicy: "open", + dmPolicy: "pairing", ...(input.name ? { name: input.name } : {}), }, }, @@ -213,7 +233,7 @@ function applyTelegramConfig( ...cfg.channels?.telegram?.accounts?.[accountId], enabled: true, botToken: token, - dmPolicy: "open", + dmPolicy: "pairing", ...(input.name ? { name: input.name } : {}), }, }, @@ -316,6 +336,30 @@ export function createPaziChannelsConfigureHandler( accountId, probe, }; + if (channel === "telegram") { + try { + const onboardingCode = await deps.issueOnboardingCode({ + channel: "telegram", + accountId, + ttlMs: TELEGRAM_ONBOARDING_TTL_MS, + }); + const botUsername = probe.bot?.username?.trim() ?? ""; + result.onboarding = { + mode: "start-code", + dmPolicy: "pairing", + command: `/start ${onboardingCode.code}`, + codeExpiresAt: onboardingCode.expiresAt, + botUsername: botUsername || undefined, + ...(botUsername + ? { + deepLink: `https://t.me/${encodeURIComponent(botUsername)}?start=${onboardingCode.code}`, + } + : {}), + }; + } catch { + // Fail open on onboarding hint generation so channel configuration still succeeds. + } + } respond(true, result); }; } diff --git a/extensions/test-utils/plugin-runtime-mock.ts b/extensions/test-utils/plugin-runtime-mock.ts index 8c599599a3..e37cf02a34 100644 --- a/extensions/test-utils/plugin-runtime-mock.ts +++ b/extensions/test-utils/plugin-runtime-mock.ts @@ -17,7 +17,9 @@ function isObject(value: unknown): value is Record { } function mergeDeep(base: T, overrides: DeepPartial): T { - const result: Record = { ...(base as Record) }; + const result: Record = { + ...(base as Record), + }; for (const [key, overrideValue] of Object.entries(overrides as Record)) { if (overrideValue === undefined) { continue; @@ -153,6 +155,10 @@ export function createPluginRuntimeMock(overrides: DeepPartial = code: "TESTCODE", created: true, }) as unknown as PluginRuntime["channel"]["pairing"]["upsertPairingRequest"], + issueOnboardingCode: vi.fn().mockResolvedValue({ + code: "TESTCODE", + expiresAt: "2099-01-01T00:00:00.000Z", + }) as unknown as PluginRuntime["channel"]["pairing"]["issueOnboardingCode"], }, media: { fetchRemoteMedia: diff --git a/src/pairing/pairing-store.test.ts b/src/pairing/pairing-store.test.ts index c323c153d0..db6e50cd73 100644 --- a/src/pairing/pairing-store.test.ts +++ b/src/pairing/pairing-store.test.ts @@ -10,6 +10,8 @@ import { withEnvAsync } from "../test-utils/env.js"; import { addChannelAllowFromStoreEntry, clearPairingAllowFromReadCacheForTest, + consumeChannelOnboardingCode, + issueChannelOnboardingCode, approveChannelPairingCode, listChannelPairingRequests, readChannelAllowFromStore, @@ -474,6 +476,59 @@ describe("pairing store", () => { }); }); + it("issues onboarding codes and consumes them once", async () => { + await withTempStateDir(async () => { + const issued = await issueChannelOnboardingCode({ + channel: "telegram", + accountId: "yy", + }); + expect(issued.code).toMatch(/^[A-Z2-9]{8}$/); + expect(issued.expiresAt).toMatch(/^\d{4}-\d{2}-\d{2}T/); + + const consumed = await consumeChannelOnboardingCode({ + channel: "telegram", + accountId: "yy", + code: issued.code.toLowerCase(), + }); + expect(consumed).toBe(true); + + const consumedAgain = await consumeChannelOnboardingCode({ + channel: "telegram", + accountId: "yy", + code: issued.code, + }); + expect(consumedAgain).toBe(false); + }); + }); + + it("rejects onboarding codes for wrong account and after expiry", async () => { + await withTempStateDir(async () => { + const issued = await issueChannelOnboardingCode({ + channel: "telegram", + accountId: "yy", + ttlMs: 5, + }); + + const mismatchedAccount = await consumeChannelOnboardingCode({ + channel: "telegram", + accountId: "zz", + code: issued.code, + }); + expect(mismatchedAccount).toBe(false); + + await new Promise((resolve) => { + setTimeout(resolve, 20); + }); + + const expired = await consumeChannelOnboardingCode({ + channel: "telegram", + accountId: "yy", + code: issued.code, + }); + expect(expired).toBe(false); + }); + }); + it("reuses cached async allowFrom reads and invalidates on file updates", async () => { await withTempStateDir(async (stateDir) => { await withAllowFromCacheReadSpy({ diff --git a/src/pairing/pairing-store.ts b/src/pairing/pairing-store.ts index 89b65925ac..fc370dff78 100644 --- a/src/pairing/pairing-store.ts +++ b/src/pairing/pairing-store.ts @@ -14,6 +14,7 @@ const PAIRING_CODE_LENGTH = 8; const PAIRING_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"; const PAIRING_PENDING_TTL_MS = 60 * 60 * 1000; const PAIRING_PENDING_MAX = 3; +const CHANNEL_ONBOARDING_CODE_TTL_MS = 15 * 60 * 1000; const PAIRING_STORE_LOCK_OPTIONS = { retries: { retries: 10, @@ -54,6 +55,13 @@ type AllowFromStore = { allowFrom: string[]; }; +type ChannelOnboardingCodeStore = { + version: 1; + code: string; + issuedAt: string; + expiresAt: string; +}; + function resolveCredentialsDir(env: NodeJS.ProcessEnv = process.env): string { const stateDir = resolveStateDir(env, () => resolveRequiredHomeDir(env, os.homedir)); return resolveOAuthDir(env, stateDir); @@ -104,6 +112,19 @@ function resolveAllowFromPath( ); } +function resolveOnboardingCodePath( + channel: PairingChannel, + env: NodeJS.ProcessEnv = process.env, + accountId?: string, +): string { + const base = safeChannelKey(channel); + const resolvedAccountId = resolveAllowFromAccountId(accountId); + return path.join( + resolveCredentialsDir(env), + `${base}-${safeAccountKey(resolvedAccountId)}-onboarding.json`, + ); +} + export function resolveChannelAllowFromPath( channel: PairingChannel, env: NodeJS.ProcessEnv = process.env, @@ -221,6 +242,10 @@ function generateUniqueCode(existing: Set): string { throw new Error("failed to generate unique pairing code"); } +function normalizePairingCode(value: string): string { + return value.trim().toUpperCase(); +} + function normalizePairingAccountId(accountId?: string): string { return accountId?.trim().toLowerCase() || ""; } @@ -803,7 +828,7 @@ export async function approveChannelPairingCode(params: { env?: NodeJS.ProcessEnv; }): Promise<{ id: string; entry?: PairingRequest } | null> { const env = params.env ?? process.env; - const code = params.code.trim().toUpperCase(); + const code = normalizePairingCode(params.code); if (!code) { return null; } @@ -850,3 +875,89 @@ export async function approveChannelPairingCode(params: { }, ); } + +export async function issueChannelOnboardingCode(params: { + channel: PairingChannel; + accountId?: string; + ttlMs?: number; + env?: NodeJS.ProcessEnv; +}): Promise<{ code: string; expiresAt: string }> { + const env = params.env ?? process.env; + const filePath = resolveOnboardingCodePath(params.channel, env, params.accountId); + const requestedTtlMs = + typeof params.ttlMs === "number" && Number.isFinite(params.ttlMs) + ? Math.floor(params.ttlMs) + : CHANNEL_ONBOARDING_CODE_TTL_MS; + const ttlMs = + requestedTtlMs > 0 + ? Math.min(requestedTtlMs, 24 * 60 * 60 * 1000) + : CHANNEL_ONBOARDING_CODE_TTL_MS; + return await withFileLock( + filePath, + { + version: 1, + code: "", + issuedAt: "", + expiresAt: "", + } satisfies ChannelOnboardingCodeStore, + async () => { + const nowMs = Date.now(); + const code = randomCode(); + const issuedAt = new Date(nowMs).toISOString(); + const expiresAt = new Date(nowMs + ttlMs).toISOString(); + await writeJsonFile(filePath, { + version: 1, + code, + issuedAt, + expiresAt, + } satisfies ChannelOnboardingCodeStore); + return { code, expiresAt }; + }, + ); +} + +export async function consumeChannelOnboardingCode(params: { + channel: PairingChannel; + accountId?: string; + code: string; + env?: NodeJS.ProcessEnv; +}): Promise { + const env = params.env ?? process.env; + const requestedCode = normalizePairingCode(params.code); + if (!requestedCode) { + return false; + } + const filePath = resolveOnboardingCodePath(params.channel, env, params.accountId); + try { + await fs.promises.access(filePath); + } catch (err) { + if ((err as NodeJS.ErrnoException).code === "ENOENT") { + return false; + } + throw err; + } + const emptyStore = { + version: 1, + code: "", + issuedAt: "", + expiresAt: "", + } satisfies ChannelOnboardingCodeStore; + return await withFileLock(filePath, emptyStore, async () => { + const { value } = await readJsonFile(filePath, emptyStore); + const storedCode = normalizePairingCode(typeof value.code === "string" ? value.code : ""); + if (!storedCode) { + return false; + } + const expiresAtMs = parseTimestamp(value.expiresAt); + const expired = expiresAtMs === null || expiresAtMs <= Date.now(); + if (expired) { + await writeJsonFile(filePath, emptyStore); + return false; + } + if (storedCode !== requestedCode) { + return false; + } + await writeJsonFile(filePath, emptyStore); + return true; + }); +} diff --git a/src/plugins/runtime/runtime-channel.ts b/src/plugins/runtime/runtime-channel.ts index 13c87d7080..5613939ccd 100644 --- a/src/plugins/runtime/runtime-channel.ts +++ b/src/plugins/runtime/runtime-channel.ts @@ -90,6 +90,7 @@ import { saveMediaBuffer } from "../../media/store.js"; import { buildPairingReply } from "../../pairing/pairing-messages.js"; import { readChannelAllowFromStore, + issueChannelOnboardingCode, upsertChannelPairingRequest, } from "../../pairing/pairing-store.js"; import { buildAgentSessionKey, resolveAgentRoute } from "../../routing/resolve-route.js"; @@ -160,6 +161,13 @@ export function createRuntimeChannel(): PluginRuntime["channel"] { env, pairingAdapter, }), + issueOnboardingCode: ({ channel, accountId, env, ttlMs }) => + issueChannelOnboardingCode({ + channel, + accountId, + env, + ttlMs, + }), }, media: { fetchRemoteMedia, diff --git a/src/plugins/runtime/types-channel.ts b/src/plugins/runtime/types-channel.ts index 0d1da0e24f..0c7e26a608 100644 --- a/src/plugins/runtime/types-channel.ts +++ b/src/plugins/runtime/types-channel.ts @@ -2,6 +2,8 @@ type ReadChannelAllowFromStore = typeof import("../../pairing/pairing-store.js").readChannelAllowFromStore; type UpsertChannelPairingRequest = typeof import("../../pairing/pairing-store.js").upsertChannelPairingRequest; +type IssueChannelOnboardingCode = + typeof import("../../pairing/pairing-store.js").issueChannelOnboardingCode; type ReadChannelAllowFromStoreForAccount = (params: { channel: Parameters[0]; @@ -10,9 +12,17 @@ type ReadChannelAllowFromStoreForAccount = (params: { }) => ReturnType; type UpsertChannelPairingRequestForAccount = ( - params: Omit[0], "accountId"> & { accountId: string }, + params: Omit[0], "accountId"> & { + accountId: string; + }, ) => ReturnType; +type IssueChannelOnboardingCodeForAccount = ( + params: Omit[0], "accountId"> & { + accountId: string; + }, +) => ReturnType; + export type PluginRuntimeChannel = { text: { chunkByNewline: typeof import("../../auto-reply/chunk.js").chunkByNewline; @@ -47,6 +57,7 @@ export type PluginRuntimeChannel = { buildPairingReply: typeof import("../../pairing/pairing-messages.js").buildPairingReply; readAllowFromStore: ReadChannelAllowFromStoreForAccount; upsertPairingRequest: UpsertChannelPairingRequestForAccount; + issueOnboardingCode: IssueChannelOnboardingCodeForAccount; }; media: { fetchRemoteMedia: typeof import("../../media/fetch.js").fetchRemoteMedia; diff --git a/src/telegram/dm-access.test.ts b/src/telegram/dm-access.test.ts new file mode 100644 index 0000000000..940853c133 --- /dev/null +++ b/src/telegram/dm-access.test.ts @@ -0,0 +1,153 @@ +import type { Message } from "@grammyjs/types"; +import type { Bot } from "grammy"; +import { beforeEach, describe, expect, it, vi } from "vitest"; +import { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; +import type { NormalizedAllowFrom } from "./bot-access.js"; + +const hoisted = vi.hoisted(() => ({ + consumeChannelOnboardingCode: vi.fn(async () => false), + addChannelAllowFromStoreEntry: vi.fn(async () => ({ + changed: true, + allowFrom: [] as string[], + })), + upsertChannelPairingRequest: vi.fn(async () => ({ + code: "PAIRCODE", + created: true, + })), + issuePairingChallenge: vi.fn(async () => ({ + created: true, + code: "PAIRCODE", + })), +})); + +vi.mock("../pairing/pairing-store.js", () => ({ + consumeChannelOnboardingCode: hoisted.consumeChannelOnboardingCode, + addChannelAllowFromStoreEntry: hoisted.addChannelAllowFromStoreEntry, + upsertChannelPairingRequest: hoisted.upsertChannelPairingRequest, +})); + +vi.mock("../pairing/pairing-challenge.js", () => ({ + issuePairingChallenge: hoisted.issuePairingChallenge, +})); + +const { enforceTelegramDmAccess } = await import("./dm-access.js"); + +const EMPTY_DM_ALLOW: NormalizedAllowFrom = { + entries: [], + hasWildcard: false, + hasEntries: false, + invalidEntries: [], +}; + +function buildMessage(text: string): Message { + return { + chat: { id: 1001, type: "private" }, + from: { id: 999, username: "owner", first_name: "Owner" }, + text, + } as unknown as Message; +} + +function buildBot(sendMessage: ReturnType): Bot { + return { + api: { + sendMessage, + }, + } as unknown as Bot; +} + +describe("enforceTelegramDmAccess onboarding flow", () => { + beforeEach(() => { + hoisted.consumeChannelOnboardingCode.mockReset(); + hoisted.consumeChannelOnboardingCode.mockResolvedValue(false); + hoisted.addChannelAllowFromStoreEntry.mockReset(); + hoisted.addChannelAllowFromStoreEntry.mockResolvedValue({ + changed: true, + allowFrom: [], + }); + hoisted.upsertChannelPairingRequest.mockReset(); + hoisted.upsertChannelPairingRequest.mockResolvedValue({ + code: "PAIRCODE", + created: true, + }); + hoisted.issuePairingChallenge.mockReset(); + hoisted.issuePairingChallenge.mockResolvedValue({ + created: true, + code: "PAIRCODE", + }); + }); + + it("auto-approves sender when /start payload matches onboarding code", async () => { + hoisted.consumeChannelOnboardingCode.mockResolvedValue(true); + const sendMessage = vi.fn(async () => undefined); + const logger = { info: vi.fn() }; + + const allowed = await enforceTelegramDmAccess({ + isGroup: false, + dmPolicy: "pairing", + msg: buildMessage("/start CLAIMME1"), + chatId: 1001, + effectiveDmAllow: EMPTY_DM_ALLOW, + accountId: "default", + bot: buildBot(sendMessage), + logger, + }); + + expect(allowed).toBe(false); + expect(hoisted.consumeChannelOnboardingCode).toHaveBeenCalledWith({ + channel: "telegram", + accountId: "default", + code: "CLAIMME1", + }); + expect(hoisted.addChannelAllowFromStoreEntry).toHaveBeenCalledWith({ + channel: "telegram", + accountId: "default", + entry: "999", + }); + expect(sendMessage).toHaveBeenCalledWith(1001, PAIRING_APPROVED_MESSAGE); + expect(hoisted.issuePairingChallenge).not.toHaveBeenCalled(); + }); + + it("falls back to pairing challenge when onboarding payload does not match", async () => { + hoisted.consumeChannelOnboardingCode.mockResolvedValue(false); + const sendMessage = vi.fn(async () => undefined); + + const allowed = await enforceTelegramDmAccess({ + isGroup: false, + dmPolicy: "pairing", + msg: buildMessage("/start INVALID"), + chatId: 1001, + effectiveDmAllow: EMPTY_DM_ALLOW, + accountId: "default", + bot: buildBot(sendMessage), + logger: { info: vi.fn() }, + }); + + expect(allowed).toBe(false); + expect(hoisted.issuePairingChallenge).toHaveBeenCalledTimes(1); + expect(hoisted.addChannelAllowFromStoreEntry).not.toHaveBeenCalled(); + }); + + it("allows sender when already authorized", async () => { + const allowlist: NormalizedAllowFrom = { + entries: ["999"], + hasWildcard: false, + hasEntries: true, + invalidEntries: [], + }; + + const allowed = await enforceTelegramDmAccess({ + isGroup: false, + dmPolicy: "allowlist", + msg: buildMessage("hello"), + chatId: 1001, + effectiveDmAllow: allowlist, + accountId: "default", + bot: buildBot(vi.fn(async () => undefined)), + logger: { info: vi.fn() }, + }); + + expect(allowed).toBe(true); + expect(hoisted.consumeChannelOnboardingCode).not.toHaveBeenCalled(); + expect(hoisted.issuePairingChallenge).not.toHaveBeenCalled(); + }); +}); diff --git a/src/telegram/dm-access.ts b/src/telegram/dm-access.ts index 26734b6960..ad8fb85795 100644 --- a/src/telegram/dm-access.ts +++ b/src/telegram/dm-access.ts @@ -1,9 +1,10 @@ import type { Message } from "@grammyjs/types"; import type { Bot } from "grammy"; +import { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; import type { DmPolicy } from "../config/types.js"; import { logVerbose } from "../globals.js"; import { issuePairingChallenge } from "../pairing/pairing-challenge.js"; -import { upsertChannelPairingRequest } from "../pairing/pairing-store.js"; +import * as pairingStore from "../pairing/pairing-store.js"; import { withTelegramApiErrorLogging } from "./api-logging.js"; import { resolveSenderAllowMatch, type NormalizedAllowFrom } from "./bot-access.js"; @@ -31,6 +32,16 @@ function resolveTelegramSenderIdentity(msg: Message, chatId: number): TelegramSe }; } +function resolveTelegramStartPayload(msg: Message): string | null { + const text = typeof msg.text === "string" ? msg.text.trim() : ""; + if (!text) { + return null; + } + const match = text.match(/^\/start(?:@[a-z0-9_]+)?(?:\s+([a-z0-9_-]{1,64}))?\s*$/i); + const payload = match?.[1]?.trim(); + return payload || null; +} + export async function enforceTelegramDmAccess(params: { isGroup: boolean; dmPolicy: DmPolicy; @@ -53,6 +64,43 @@ export async function enforceTelegramDmAccess(params: { } const sender = resolveTelegramSenderIdentity(msg, chatId); + const onboardingPayload = resolveTelegramStartPayload(msg); + if (onboardingPayload) { + try { + const consumed = await pairingStore.consumeChannelOnboardingCode({ + channel: "telegram", + accountId, + code: onboardingPayload, + }); + if (consumed) { + const approvedId = sender.userId ?? sender.candidateId; + await pairingStore.addChannelAllowFromStoreEntry({ + channel: "telegram", + accountId, + entry: approvedId, + }); + logger.info( + { + chatId: String(chatId), + senderUserId: sender.userId ?? undefined, + username: sender.username || undefined, + firstName: sender.firstName, + lastName: sender.lastName, + }, + "telegram onboarding approved sender", + ); + await withTelegramApiErrorLogging({ + operation: "sendMessage", + fn: () => bot.api.sendMessage(chatId, PAIRING_APPROVED_MESSAGE), + }); + // /start is a setup handshake; ask for a follow-up message after approval. + return false; + } + } catch (err) { + logVerbose(`telegram onboarding flow failed for chat ${chatId}: ${String(err)}`); + } + } + const allowMatch = resolveSenderAllowMatch({ allow: effectiveDmAllow, senderId: sender.candidateId, @@ -80,7 +128,7 @@ export async function enforceTelegramDmAccess(params: { lastName: sender.lastName, }, upsertPairingRequest: async ({ id, meta }) => - await upsertChannelPairingRequest({ + await pairingStore.upsertChannelPairingRequest({ channel: "telegram", id, accountId, From 6255307059096ff0030bd46390167573fcf8f395 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 9 Mar 2026 21:59:48 +0100 Subject: [PATCH 54/80] fix(pazi): keep telegram onboarding in extension-only flow --- extensions/pazi/index.ts | 59 ++++- extensions/pazi/src/channels-configure.ts | 45 ++-- extensions/pazi/src/channels-pairing.ts | 231 +++++++++++++++++++ extensions/test-utils/plugin-runtime-mock.ts | 8 +- src/pairing/pairing-store.test.ts | 55 ----- src/pairing/pairing-store.ts | 113 +-------- src/plugins/runtime/runtime-channel.ts | 8 - src/plugins/runtime/types-channel.ts | 13 +- src/telegram/dm-access.test.ts | 153 ------------ src/telegram/dm-access.ts | 52 +---- 10 files changed, 302 insertions(+), 435 deletions(-) create mode 100644 extensions/pazi/src/channels-pairing.ts delete mode 100644 src/telegram/dm-access.test.ts diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index d85c0de251..44db3571d8 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -1,8 +1,17 @@ import type { Server as HttpServer } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import { notifyPairingApproved } from "../../src/channels/plugins/pairing.js"; +import { + approveChannelPairingCode, + listChannelPairingRequests, +} from "../../src/pairing/pairing-store.js"; import { resolveBrowserUseConfig } from "./src/browser-use/config.js"; import { createBrowserUseTools } from "./src/browser-use/tools.js"; import { createPaziChannelsConfigureHandler } from "./src/channels-configure.js"; +import { + createPaziChannelsPairingApproveHandler, + createPaziChannelsPairingListHandler, +} from "./src/channels-pairing.js"; import { resolvePaziBillingConfig } from "./src/config.js"; import { getProxyContext } from "./src/context.js"; import { createPipedreamTools } from "./src/pipedream/tools.js"; @@ -36,14 +45,18 @@ export default { description: "Routes Anthropic calls through the Pazi API.", register(api: OpenClawPluginApi) { const pluginConfig = normalizePluginConfig(api.pluginConfig); + const gatewayAuthToken = + typeof api.config.gateway?.auth?.token === "string" + ? api.config.gateway.auth.token + : undefined; const contextHandler = createPaziContextHandler({ - configToken: api.config.gateway?.auth?.token, + configToken: gatewayAuthToken, env: process.env, logger: api.logger, }); const uploadHandler = createPaziUploadHandler({ - configToken: api.config.gateway?.auth?.token, + configToken: gatewayAuthToken, env: process.env, logger: api.logger, }); @@ -61,14 +74,44 @@ export default { probeSlack: (token, timeoutMs) => api.runtime.channel.slack.probeSlack(token, timeoutMs), probeTelegram: (token, timeoutMs, proxyUrl) => api.runtime.channel.telegram.probeTelegram(token, timeoutMs, proxyUrl), - issueOnboardingCode: ({ channel, accountId, ttlMs }) => - api.runtime.channel.pairing.issueOnboardingCode({ - channel, - accountId, - ttlMs, - }), }), ); + const pairingGatewayDeps = { + loadConfig: () => api.runtime.config.loadConfig(), + listRequests: async (channel: "telegram", accountId?: string) => + await listChannelPairingRequests(channel, process.env, accountId), + approveCode: async ({ + channel, + accountId, + code, + }: { + channel: "telegram"; + accountId?: string; + code: string; + }) => await approveChannelPairingCode({ channel, accountId, code }), + notifyApproved: async ({ + channelId, + id, + cfg, + }: { + channelId: "telegram"; + id: string; + cfg: Record; + }) => + await notifyPairingApproved({ + channelId, + id, + cfg, + }), + }; + api.registerGatewayMethod( + "pazi.channels.pairing.list", + createPaziChannelsPairingListHandler(pairingGatewayDeps), + ); + api.registerGatewayMethod( + "pazi.channels.pairing.approve", + createPaziChannelsPairingApproveHandler(pairingGatewayDeps), + ); const tools = createPipedreamTools({ pluginConfig, diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index d888afbbf9..9ff6ec94d9 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -26,12 +26,12 @@ interface ProbeResult { } interface TelegramOnboardingResult { - mode: "start-code"; + mode: "pairing"; dmPolicy: "pairing"; command: string; - codeExpiresAt: string; botUsername?: string | null; deepLink?: string; + pollingIntervalMs?: number; } interface ChannelConfigureResult { @@ -68,17 +68,11 @@ interface ChannelConfigureDeps { timeoutMs: number, proxyUrl: string | undefined, ) => Promise; - issueOnboardingCode: (params: { - channel: "telegram"; - accountId: string; - ttlMs?: number; - }) => Promise<{ code: string; expiresAt: string }>; } const VALID_CHANNELS: ReadonlySet = new Set(["slack", "telegram"]); const ERROR_INVALID_REQUEST = "INVALID_REQUEST"; const ERROR_UNAVAILABLE = "UNAVAILABLE"; -const TELEGRAM_ONBOARDING_TTL_MS = 15 * 60 * 1000; function respondError( respond: GatewayMethodContext["respond"], @@ -337,28 +331,19 @@ export function createPaziChannelsConfigureHandler( probe, }; if (channel === "telegram") { - try { - const onboardingCode = await deps.issueOnboardingCode({ - channel: "telegram", - accountId, - ttlMs: TELEGRAM_ONBOARDING_TTL_MS, - }); - const botUsername = probe.bot?.username?.trim() ?? ""; - result.onboarding = { - mode: "start-code", - dmPolicy: "pairing", - command: `/start ${onboardingCode.code}`, - codeExpiresAt: onboardingCode.expiresAt, - botUsername: botUsername || undefined, - ...(botUsername - ? { - deepLink: `https://t.me/${encodeURIComponent(botUsername)}?start=${onboardingCode.code}`, - } - : {}), - }; - } catch { - // Fail open on onboarding hint generation so channel configuration still succeeds. - } + const botUsername = probe.bot?.username?.trim() ?? ""; + result.onboarding = { + mode: "pairing", + dmPolicy: "pairing", + command: "/start", + botUsername: botUsername || undefined, + pollingIntervalMs: 3000, + ...(botUsername + ? { + deepLink: `https://t.me/${encodeURIComponent(botUsername)}`, + } + : {}), + }; } respond(true, result); }; diff --git a/extensions/pazi/src/channels-pairing.ts b/extensions/pazi/src/channels-pairing.ts new file mode 100644 index 0000000000..2bb668271c --- /dev/null +++ b/extensions/pazi/src/channels-pairing.ts @@ -0,0 +1,231 @@ +import type { PairingRequest } from "../../../src/pairing/pairing-store.js"; + +type ChannelType = "telegram"; +type OpenClawConfig = Record; + +interface PairingListParams { + channel: ChannelType; + accountId?: string; +} + +interface PairingApproveParams extends PairingListParams { + code: string; +} + +interface PairingListResult { + ok: true; + channel: ChannelType; + accountId: string; + pending: PairingRequestSummary[]; +} + +interface PairingApproveResult { + ok: true; + channel: ChannelType; + accountId: string; + approved: boolean; + id?: string; +} + +interface PairingRequestSummary { + id: string; + code: string; + createdAt: string; + lastSeenAt: string; + meta?: { + accountId?: string; + username?: string; + firstName?: string; + lastName?: string; + senderUserId?: string; + }; +} + +type GatewayErrorShape = { + code: string; + message: string; +}; + +interface GatewayMethodContext { + params: unknown; + respond: (ok: boolean, data?: unknown, error?: GatewayErrorShape) => void; +} + +interface PairingHandlersDeps { + loadConfig: () => OpenClawConfig; + listRequests: (channel: ChannelType, accountId?: string) => Promise; + approveCode: (params: { + channel: ChannelType; + accountId?: string; + code: string; + }) => Promise<{ id: string; entry?: PairingRequest } | null>; + notifyApproved: (params: { + channelId: ChannelType; + id: string; + cfg: OpenClawConfig; + }) => Promise; +} + +const DEFAULT_ACCOUNT_ID = "default"; +const VALID_CHANNELS: ReadonlySet = new Set(["telegram"]); +const ERROR_INVALID_REQUEST = "INVALID_REQUEST"; +const ERROR_UNAVAILABLE = "UNAVAILABLE"; + +function respondError( + respond: GatewayMethodContext["respond"], + code: string, + message: string, + payload?: unknown, +): void { + respond(false, payload, { code, message }); +} + +function resolveAccountId(raw: unknown): string { + if (typeof raw !== "string") { + return DEFAULT_ACCOUNT_ID; + } + const trimmed = raw.trim(); + return trimmed || DEFAULT_ACCOUNT_ID; +} + +function parseListParams( + raw: unknown, +): { ok: true; value: PairingListParams } | { ok: false; error: string } { + if (!raw || typeof raw !== "object") { + return { ok: false, error: "params must be an object" }; + } + const params = raw as Record; + const channel = params.channel === "telegram" ? "telegram" : null; + if (!channel || !VALID_CHANNELS.has(channel)) { + return { ok: false, error: "channel must be 'telegram'" }; + } + return { + ok: true, + value: { + channel, + accountId: typeof params.accountId === "string" ? params.accountId : undefined, + }, + }; +} + +function parseApproveParams( + raw: unknown, +): { ok: true; value: PairingApproveParams } | { ok: false; error: string } { + const parsed = parseListParams(raw); + if (!parsed.ok) { + return parsed; + } + const params = raw as Record; + const code = typeof params.code === "string" ? params.code.trim() : ""; + if (!code) { + return { ok: false, error: "code is required" }; + } + return { + ok: true, + value: { + ...parsed.value, + code, + }, + }; +} + +function summarizePairingRequest(request: PairingRequest): PairingRequestSummary { + const meta = request.meta ?? {}; + return { + id: request.id, + code: request.code, + createdAt: request.createdAt, + lastSeenAt: request.lastSeenAt, + meta: { + accountId: typeof meta.accountId === "string" ? meta.accountId : undefined, + username: typeof meta.username === "string" ? meta.username : undefined, + firstName: typeof meta.firstName === "string" ? meta.firstName : undefined, + lastName: typeof meta.lastName === "string" ? meta.lastName : undefined, + senderUserId: typeof meta.senderUserId === "string" ? meta.senderUserId : undefined, + }, + }; +} + +export function createPaziChannelsPairingListHandler( + deps: PairingHandlersDeps, +): (ctx: GatewayMethodContext) => Promise { + return async ({ params, respond }: GatewayMethodContext) => { + const parsed = parseListParams(params); + if (!parsed.ok) { + respondError(respond, ERROR_INVALID_REQUEST, parsed.error); + return; + } + + const accountId = resolveAccountId(parsed.value.accountId); + try { + const pending = await deps.listRequests(parsed.value.channel, accountId); + const result: PairingListResult = { + ok: true, + channel: parsed.value.channel, + accountId, + pending: pending.map((entry) => summarizePairingRequest(entry)), + }; + respond(true, result); + } catch (err) { + respondError( + respond, + ERROR_UNAVAILABLE, + `failed to load pairing requests: ${err instanceof Error ? err.message : String(err)}`, + ); + } + }; +} + +export function createPaziChannelsPairingApproveHandler( + deps: PairingHandlersDeps, +): (ctx: GatewayMethodContext) => Promise { + return async ({ params, respond }: GatewayMethodContext) => { + const parsed = parseApproveParams(params); + if (!parsed.ok) { + respondError(respond, ERROR_INVALID_REQUEST, parsed.error); + return; + } + + const accountId = resolveAccountId(parsed.value.accountId); + try { + const approved = await deps.approveCode({ + channel: parsed.value.channel, + accountId, + code: parsed.value.code, + }); + if (!approved) { + const result: PairingApproveResult = { + ok: true, + channel: parsed.value.channel, + accountId, + approved: false, + }; + respond(true, result); + return; + } + try { + await deps.notifyApproved({ + channelId: parsed.value.channel, + id: approved.id, + cfg: deps.loadConfig(), + }); + } catch { + // Approval is persisted even when notification back to Telegram fails. + } + const result: PairingApproveResult = { + ok: true, + channel: parsed.value.channel, + accountId, + approved: true, + id: approved.id, + }; + respond(true, result); + } catch (err) { + respondError( + respond, + ERROR_UNAVAILABLE, + `failed to approve pairing request: ${err instanceof Error ? err.message : String(err)}`, + ); + } + }; +} diff --git a/extensions/test-utils/plugin-runtime-mock.ts b/extensions/test-utils/plugin-runtime-mock.ts index e37cf02a34..8c599599a3 100644 --- a/extensions/test-utils/plugin-runtime-mock.ts +++ b/extensions/test-utils/plugin-runtime-mock.ts @@ -17,9 +17,7 @@ function isObject(value: unknown): value is Record { } function mergeDeep(base: T, overrides: DeepPartial): T { - const result: Record = { - ...(base as Record), - }; + const result: Record = { ...(base as Record) }; for (const [key, overrideValue] of Object.entries(overrides as Record)) { if (overrideValue === undefined) { continue; @@ -155,10 +153,6 @@ export function createPluginRuntimeMock(overrides: DeepPartial = code: "TESTCODE", created: true, }) as unknown as PluginRuntime["channel"]["pairing"]["upsertPairingRequest"], - issueOnboardingCode: vi.fn().mockResolvedValue({ - code: "TESTCODE", - expiresAt: "2099-01-01T00:00:00.000Z", - }) as unknown as PluginRuntime["channel"]["pairing"]["issueOnboardingCode"], }, media: { fetchRemoteMedia: diff --git a/src/pairing/pairing-store.test.ts b/src/pairing/pairing-store.test.ts index db6e50cd73..c323c153d0 100644 --- a/src/pairing/pairing-store.test.ts +++ b/src/pairing/pairing-store.test.ts @@ -10,8 +10,6 @@ import { withEnvAsync } from "../test-utils/env.js"; import { addChannelAllowFromStoreEntry, clearPairingAllowFromReadCacheForTest, - consumeChannelOnboardingCode, - issueChannelOnboardingCode, approveChannelPairingCode, listChannelPairingRequests, readChannelAllowFromStore, @@ -476,59 +474,6 @@ describe("pairing store", () => { }); }); - it("issues onboarding codes and consumes them once", async () => { - await withTempStateDir(async () => { - const issued = await issueChannelOnboardingCode({ - channel: "telegram", - accountId: "yy", - }); - expect(issued.code).toMatch(/^[A-Z2-9]{8}$/); - expect(issued.expiresAt).toMatch(/^\d{4}-\d{2}-\d{2}T/); - - const consumed = await consumeChannelOnboardingCode({ - channel: "telegram", - accountId: "yy", - code: issued.code.toLowerCase(), - }); - expect(consumed).toBe(true); - - const consumedAgain = await consumeChannelOnboardingCode({ - channel: "telegram", - accountId: "yy", - code: issued.code, - }); - expect(consumedAgain).toBe(false); - }); - }); - - it("rejects onboarding codes for wrong account and after expiry", async () => { - await withTempStateDir(async () => { - const issued = await issueChannelOnboardingCode({ - channel: "telegram", - accountId: "yy", - ttlMs: 5, - }); - - const mismatchedAccount = await consumeChannelOnboardingCode({ - channel: "telegram", - accountId: "zz", - code: issued.code, - }); - expect(mismatchedAccount).toBe(false); - - await new Promise((resolve) => { - setTimeout(resolve, 20); - }); - - const expired = await consumeChannelOnboardingCode({ - channel: "telegram", - accountId: "yy", - code: issued.code, - }); - expect(expired).toBe(false); - }); - }); - it("reuses cached async allowFrom reads and invalidates on file updates", async () => { await withTempStateDir(async (stateDir) => { await withAllowFromCacheReadSpy({ diff --git a/src/pairing/pairing-store.ts b/src/pairing/pairing-store.ts index fc370dff78..89b65925ac 100644 --- a/src/pairing/pairing-store.ts +++ b/src/pairing/pairing-store.ts @@ -14,7 +14,6 @@ const PAIRING_CODE_LENGTH = 8; const PAIRING_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"; const PAIRING_PENDING_TTL_MS = 60 * 60 * 1000; const PAIRING_PENDING_MAX = 3; -const CHANNEL_ONBOARDING_CODE_TTL_MS = 15 * 60 * 1000; const PAIRING_STORE_LOCK_OPTIONS = { retries: { retries: 10, @@ -55,13 +54,6 @@ type AllowFromStore = { allowFrom: string[]; }; -type ChannelOnboardingCodeStore = { - version: 1; - code: string; - issuedAt: string; - expiresAt: string; -}; - function resolveCredentialsDir(env: NodeJS.ProcessEnv = process.env): string { const stateDir = resolveStateDir(env, () => resolveRequiredHomeDir(env, os.homedir)); return resolveOAuthDir(env, stateDir); @@ -112,19 +104,6 @@ function resolveAllowFromPath( ); } -function resolveOnboardingCodePath( - channel: PairingChannel, - env: NodeJS.ProcessEnv = process.env, - accountId?: string, -): string { - const base = safeChannelKey(channel); - const resolvedAccountId = resolveAllowFromAccountId(accountId); - return path.join( - resolveCredentialsDir(env), - `${base}-${safeAccountKey(resolvedAccountId)}-onboarding.json`, - ); -} - export function resolveChannelAllowFromPath( channel: PairingChannel, env: NodeJS.ProcessEnv = process.env, @@ -242,10 +221,6 @@ function generateUniqueCode(existing: Set): string { throw new Error("failed to generate unique pairing code"); } -function normalizePairingCode(value: string): string { - return value.trim().toUpperCase(); -} - function normalizePairingAccountId(accountId?: string): string { return accountId?.trim().toLowerCase() || ""; } @@ -828,7 +803,7 @@ export async function approveChannelPairingCode(params: { env?: NodeJS.ProcessEnv; }): Promise<{ id: string; entry?: PairingRequest } | null> { const env = params.env ?? process.env; - const code = normalizePairingCode(params.code); + const code = params.code.trim().toUpperCase(); if (!code) { return null; } @@ -875,89 +850,3 @@ export async function approveChannelPairingCode(params: { }, ); } - -export async function issueChannelOnboardingCode(params: { - channel: PairingChannel; - accountId?: string; - ttlMs?: number; - env?: NodeJS.ProcessEnv; -}): Promise<{ code: string; expiresAt: string }> { - const env = params.env ?? process.env; - const filePath = resolveOnboardingCodePath(params.channel, env, params.accountId); - const requestedTtlMs = - typeof params.ttlMs === "number" && Number.isFinite(params.ttlMs) - ? Math.floor(params.ttlMs) - : CHANNEL_ONBOARDING_CODE_TTL_MS; - const ttlMs = - requestedTtlMs > 0 - ? Math.min(requestedTtlMs, 24 * 60 * 60 * 1000) - : CHANNEL_ONBOARDING_CODE_TTL_MS; - return await withFileLock( - filePath, - { - version: 1, - code: "", - issuedAt: "", - expiresAt: "", - } satisfies ChannelOnboardingCodeStore, - async () => { - const nowMs = Date.now(); - const code = randomCode(); - const issuedAt = new Date(nowMs).toISOString(); - const expiresAt = new Date(nowMs + ttlMs).toISOString(); - await writeJsonFile(filePath, { - version: 1, - code, - issuedAt, - expiresAt, - } satisfies ChannelOnboardingCodeStore); - return { code, expiresAt }; - }, - ); -} - -export async function consumeChannelOnboardingCode(params: { - channel: PairingChannel; - accountId?: string; - code: string; - env?: NodeJS.ProcessEnv; -}): Promise { - const env = params.env ?? process.env; - const requestedCode = normalizePairingCode(params.code); - if (!requestedCode) { - return false; - } - const filePath = resolveOnboardingCodePath(params.channel, env, params.accountId); - try { - await fs.promises.access(filePath); - } catch (err) { - if ((err as NodeJS.ErrnoException).code === "ENOENT") { - return false; - } - throw err; - } - const emptyStore = { - version: 1, - code: "", - issuedAt: "", - expiresAt: "", - } satisfies ChannelOnboardingCodeStore; - return await withFileLock(filePath, emptyStore, async () => { - const { value } = await readJsonFile(filePath, emptyStore); - const storedCode = normalizePairingCode(typeof value.code === "string" ? value.code : ""); - if (!storedCode) { - return false; - } - const expiresAtMs = parseTimestamp(value.expiresAt); - const expired = expiresAtMs === null || expiresAtMs <= Date.now(); - if (expired) { - await writeJsonFile(filePath, emptyStore); - return false; - } - if (storedCode !== requestedCode) { - return false; - } - await writeJsonFile(filePath, emptyStore); - return true; - }); -} diff --git a/src/plugins/runtime/runtime-channel.ts b/src/plugins/runtime/runtime-channel.ts index 5613939ccd..13c87d7080 100644 --- a/src/plugins/runtime/runtime-channel.ts +++ b/src/plugins/runtime/runtime-channel.ts @@ -90,7 +90,6 @@ import { saveMediaBuffer } from "../../media/store.js"; import { buildPairingReply } from "../../pairing/pairing-messages.js"; import { readChannelAllowFromStore, - issueChannelOnboardingCode, upsertChannelPairingRequest, } from "../../pairing/pairing-store.js"; import { buildAgentSessionKey, resolveAgentRoute } from "../../routing/resolve-route.js"; @@ -161,13 +160,6 @@ export function createRuntimeChannel(): PluginRuntime["channel"] { env, pairingAdapter, }), - issueOnboardingCode: ({ channel, accountId, env, ttlMs }) => - issueChannelOnboardingCode({ - channel, - accountId, - env, - ttlMs, - }), }, media: { fetchRemoteMedia, diff --git a/src/plugins/runtime/types-channel.ts b/src/plugins/runtime/types-channel.ts index 0c7e26a608..0d1da0e24f 100644 --- a/src/plugins/runtime/types-channel.ts +++ b/src/plugins/runtime/types-channel.ts @@ -2,8 +2,6 @@ type ReadChannelAllowFromStore = typeof import("../../pairing/pairing-store.js").readChannelAllowFromStore; type UpsertChannelPairingRequest = typeof import("../../pairing/pairing-store.js").upsertChannelPairingRequest; -type IssueChannelOnboardingCode = - typeof import("../../pairing/pairing-store.js").issueChannelOnboardingCode; type ReadChannelAllowFromStoreForAccount = (params: { channel: Parameters[0]; @@ -12,17 +10,9 @@ type ReadChannelAllowFromStoreForAccount = (params: { }) => ReturnType; type UpsertChannelPairingRequestForAccount = ( - params: Omit[0], "accountId"> & { - accountId: string; - }, + params: Omit[0], "accountId"> & { accountId: string }, ) => ReturnType; -type IssueChannelOnboardingCodeForAccount = ( - params: Omit[0], "accountId"> & { - accountId: string; - }, -) => ReturnType; - export type PluginRuntimeChannel = { text: { chunkByNewline: typeof import("../../auto-reply/chunk.js").chunkByNewline; @@ -57,7 +47,6 @@ export type PluginRuntimeChannel = { buildPairingReply: typeof import("../../pairing/pairing-messages.js").buildPairingReply; readAllowFromStore: ReadChannelAllowFromStoreForAccount; upsertPairingRequest: UpsertChannelPairingRequestForAccount; - issueOnboardingCode: IssueChannelOnboardingCodeForAccount; }; media: { fetchRemoteMedia: typeof import("../../media/fetch.js").fetchRemoteMedia; diff --git a/src/telegram/dm-access.test.ts b/src/telegram/dm-access.test.ts deleted file mode 100644 index 940853c133..0000000000 --- a/src/telegram/dm-access.test.ts +++ /dev/null @@ -1,153 +0,0 @@ -import type { Message } from "@grammyjs/types"; -import type { Bot } from "grammy"; -import { beforeEach, describe, expect, it, vi } from "vitest"; -import { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -import type { NormalizedAllowFrom } from "./bot-access.js"; - -const hoisted = vi.hoisted(() => ({ - consumeChannelOnboardingCode: vi.fn(async () => false), - addChannelAllowFromStoreEntry: vi.fn(async () => ({ - changed: true, - allowFrom: [] as string[], - })), - upsertChannelPairingRequest: vi.fn(async () => ({ - code: "PAIRCODE", - created: true, - })), - issuePairingChallenge: vi.fn(async () => ({ - created: true, - code: "PAIRCODE", - })), -})); - -vi.mock("../pairing/pairing-store.js", () => ({ - consumeChannelOnboardingCode: hoisted.consumeChannelOnboardingCode, - addChannelAllowFromStoreEntry: hoisted.addChannelAllowFromStoreEntry, - upsertChannelPairingRequest: hoisted.upsertChannelPairingRequest, -})); - -vi.mock("../pairing/pairing-challenge.js", () => ({ - issuePairingChallenge: hoisted.issuePairingChallenge, -})); - -const { enforceTelegramDmAccess } = await import("./dm-access.js"); - -const EMPTY_DM_ALLOW: NormalizedAllowFrom = { - entries: [], - hasWildcard: false, - hasEntries: false, - invalidEntries: [], -}; - -function buildMessage(text: string): Message { - return { - chat: { id: 1001, type: "private" }, - from: { id: 999, username: "owner", first_name: "Owner" }, - text, - } as unknown as Message; -} - -function buildBot(sendMessage: ReturnType): Bot { - return { - api: { - sendMessage, - }, - } as unknown as Bot; -} - -describe("enforceTelegramDmAccess onboarding flow", () => { - beforeEach(() => { - hoisted.consumeChannelOnboardingCode.mockReset(); - hoisted.consumeChannelOnboardingCode.mockResolvedValue(false); - hoisted.addChannelAllowFromStoreEntry.mockReset(); - hoisted.addChannelAllowFromStoreEntry.mockResolvedValue({ - changed: true, - allowFrom: [], - }); - hoisted.upsertChannelPairingRequest.mockReset(); - hoisted.upsertChannelPairingRequest.mockResolvedValue({ - code: "PAIRCODE", - created: true, - }); - hoisted.issuePairingChallenge.mockReset(); - hoisted.issuePairingChallenge.mockResolvedValue({ - created: true, - code: "PAIRCODE", - }); - }); - - it("auto-approves sender when /start payload matches onboarding code", async () => { - hoisted.consumeChannelOnboardingCode.mockResolvedValue(true); - const sendMessage = vi.fn(async () => undefined); - const logger = { info: vi.fn() }; - - const allowed = await enforceTelegramDmAccess({ - isGroup: false, - dmPolicy: "pairing", - msg: buildMessage("/start CLAIMME1"), - chatId: 1001, - effectiveDmAllow: EMPTY_DM_ALLOW, - accountId: "default", - bot: buildBot(sendMessage), - logger, - }); - - expect(allowed).toBe(false); - expect(hoisted.consumeChannelOnboardingCode).toHaveBeenCalledWith({ - channel: "telegram", - accountId: "default", - code: "CLAIMME1", - }); - expect(hoisted.addChannelAllowFromStoreEntry).toHaveBeenCalledWith({ - channel: "telegram", - accountId: "default", - entry: "999", - }); - expect(sendMessage).toHaveBeenCalledWith(1001, PAIRING_APPROVED_MESSAGE); - expect(hoisted.issuePairingChallenge).not.toHaveBeenCalled(); - }); - - it("falls back to pairing challenge when onboarding payload does not match", async () => { - hoisted.consumeChannelOnboardingCode.mockResolvedValue(false); - const sendMessage = vi.fn(async () => undefined); - - const allowed = await enforceTelegramDmAccess({ - isGroup: false, - dmPolicy: "pairing", - msg: buildMessage("/start INVALID"), - chatId: 1001, - effectiveDmAllow: EMPTY_DM_ALLOW, - accountId: "default", - bot: buildBot(sendMessage), - logger: { info: vi.fn() }, - }); - - expect(allowed).toBe(false); - expect(hoisted.issuePairingChallenge).toHaveBeenCalledTimes(1); - expect(hoisted.addChannelAllowFromStoreEntry).not.toHaveBeenCalled(); - }); - - it("allows sender when already authorized", async () => { - const allowlist: NormalizedAllowFrom = { - entries: ["999"], - hasWildcard: false, - hasEntries: true, - invalidEntries: [], - }; - - const allowed = await enforceTelegramDmAccess({ - isGroup: false, - dmPolicy: "allowlist", - msg: buildMessage("hello"), - chatId: 1001, - effectiveDmAllow: allowlist, - accountId: "default", - bot: buildBot(vi.fn(async () => undefined)), - logger: { info: vi.fn() }, - }); - - expect(allowed).toBe(true); - expect(hoisted.consumeChannelOnboardingCode).not.toHaveBeenCalled(); - expect(hoisted.issuePairingChallenge).not.toHaveBeenCalled(); - }); -}); diff --git a/src/telegram/dm-access.ts b/src/telegram/dm-access.ts index ad8fb85795..26734b6960 100644 --- a/src/telegram/dm-access.ts +++ b/src/telegram/dm-access.ts @@ -1,10 +1,9 @@ import type { Message } from "@grammyjs/types"; import type { Bot } from "grammy"; -import { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; import type { DmPolicy } from "../config/types.js"; import { logVerbose } from "../globals.js"; import { issuePairingChallenge } from "../pairing/pairing-challenge.js"; -import * as pairingStore from "../pairing/pairing-store.js"; +import { upsertChannelPairingRequest } from "../pairing/pairing-store.js"; import { withTelegramApiErrorLogging } from "./api-logging.js"; import { resolveSenderAllowMatch, type NormalizedAllowFrom } from "./bot-access.js"; @@ -32,16 +31,6 @@ function resolveTelegramSenderIdentity(msg: Message, chatId: number): TelegramSe }; } -function resolveTelegramStartPayload(msg: Message): string | null { - const text = typeof msg.text === "string" ? msg.text.trim() : ""; - if (!text) { - return null; - } - const match = text.match(/^\/start(?:@[a-z0-9_]+)?(?:\s+([a-z0-9_-]{1,64}))?\s*$/i); - const payload = match?.[1]?.trim(); - return payload || null; -} - export async function enforceTelegramDmAccess(params: { isGroup: boolean; dmPolicy: DmPolicy; @@ -64,43 +53,6 @@ export async function enforceTelegramDmAccess(params: { } const sender = resolveTelegramSenderIdentity(msg, chatId); - const onboardingPayload = resolveTelegramStartPayload(msg); - if (onboardingPayload) { - try { - const consumed = await pairingStore.consumeChannelOnboardingCode({ - channel: "telegram", - accountId, - code: onboardingPayload, - }); - if (consumed) { - const approvedId = sender.userId ?? sender.candidateId; - await pairingStore.addChannelAllowFromStoreEntry({ - channel: "telegram", - accountId, - entry: approvedId, - }); - logger.info( - { - chatId: String(chatId), - senderUserId: sender.userId ?? undefined, - username: sender.username || undefined, - firstName: sender.firstName, - lastName: sender.lastName, - }, - "telegram onboarding approved sender", - ); - await withTelegramApiErrorLogging({ - operation: "sendMessage", - fn: () => bot.api.sendMessage(chatId, PAIRING_APPROVED_MESSAGE), - }); - // /start is a setup handshake; ask for a follow-up message after approval. - return false; - } - } catch (err) { - logVerbose(`telegram onboarding flow failed for chat ${chatId}: ${String(err)}`); - } - } - const allowMatch = resolveSenderAllowMatch({ allow: effectiveDmAllow, senderId: sender.candidateId, @@ -128,7 +80,7 @@ export async function enforceTelegramDmAccess(params: { lastName: sender.lastName, }, upsertPairingRequest: async ({ id, meta }) => - await pairingStore.upsertChannelPairingRequest({ + await upsertChannelPairingRequest({ channel: "telegram", id, accountId, From 37c2403ce6d292e0711185212f57d71ce4b46772 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 9 Mar 2026 22:29:39 +0100 Subject: [PATCH 55/80] fix(pazi): harden pairing handlers and notification logging --- extensions/pazi/index.ts | 28 +++++++++++++++++------ extensions/pazi/src/channels-configure.ts | 3 ++- extensions/pazi/src/channels-pairing.ts | 28 +++++++++++++++++++---- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index 44db3571d8..a7351df956 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -76,20 +76,34 @@ export default { api.runtime.channel.telegram.probeTelegram(token, timeoutMs, proxyUrl), }), ); + const gatewayEnv = process.env; const pairingGatewayDeps = { loadConfig: () => api.runtime.config.loadConfig(), - listRequests: async (channel: "telegram", accountId?: string) => - await listChannelPairingRequests(channel, process.env, accountId), - approveCode: async ({ + env: gatewayEnv, + logWarn: (message: string) => { + api.logger.warn(message); + }, + listRequests: ({ + channel, + accountId, + env, + }: { + channel: "telegram"; + accountId: string; + env: NodeJS.ProcessEnv; + }) => listChannelPairingRequests(channel, env, accountId), + approveCode: ({ channel, accountId, code, + env, }: { channel: "telegram"; - accountId?: string; + accountId: string; code: string; - }) => await approveChannelPairingCode({ channel, accountId, code }), - notifyApproved: async ({ + env: NodeJS.ProcessEnv; + }) => approveChannelPairingCode({ channel, accountId, code, env }), + notifyApproved: ({ channelId, id, cfg, @@ -98,7 +112,7 @@ export default { id: string; cfg: Record; }) => - await notifyPairingApproved({ + notifyPairingApproved({ channelId, id, cfg, diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index 9ff6ec94d9..d1c68cdc11 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -73,6 +73,7 @@ interface ChannelConfigureDeps { const VALID_CHANNELS: ReadonlySet = new Set(["slack", "telegram"]); const ERROR_INVALID_REQUEST = "INVALID_REQUEST"; const ERROR_UNAVAILABLE = "UNAVAILABLE"; +const TELEGRAM_PAIRING_POLL_INTERVAL_MS = 3000; function respondError( respond: GatewayMethodContext["respond"], @@ -337,7 +338,7 @@ export function createPaziChannelsConfigureHandler( dmPolicy: "pairing", command: "/start", botUsername: botUsername || undefined, - pollingIntervalMs: 3000, + pollingIntervalMs: TELEGRAM_PAIRING_POLL_INTERVAL_MS, ...(botUsername ? { deepLink: `https://t.me/${encodeURIComponent(botUsername)}`, diff --git a/extensions/pazi/src/channels-pairing.ts b/extensions/pazi/src/channels-pairing.ts index 2bb668271c..af4ac48413 100644 --- a/extensions/pazi/src/channels-pairing.ts +++ b/extensions/pazi/src/channels-pairing.ts @@ -53,11 +53,18 @@ interface GatewayMethodContext { interface PairingHandlersDeps { loadConfig: () => OpenClawConfig; - listRequests: (channel: ChannelType, accountId?: string) => Promise; + env: NodeJS.ProcessEnv; + logWarn: (message: string) => void; + listRequests: (params: { + channel: ChannelType; + accountId: string; + env: NodeJS.ProcessEnv; + }) => Promise; approveCode: (params: { channel: ChannelType; - accountId?: string; + accountId: string; code: string; + env: NodeJS.ProcessEnv; }) => Promise<{ id: string; entry?: PairingRequest } | null>; notifyApproved: (params: { channelId: ChannelType; @@ -81,6 +88,8 @@ function respondError( } function resolveAccountId(raw: unknown): string { + // These gateway methods are intentionally account-scoped. Missing/blank account IDs default + // to "default" instead of unscoped pairing-store reads. if (typeof raw !== "string") { return DEFAULT_ACCOUNT_ID; } @@ -158,7 +167,11 @@ export function createPaziChannelsPairingListHandler( const accountId = resolveAccountId(parsed.value.accountId); try { - const pending = await deps.listRequests(parsed.value.channel, accountId); + const pending = await deps.listRequests({ + channel: parsed.value.channel, + accountId, + env: deps.env, + }); const result: PairingListResult = { ok: true, channel: parsed.value.channel, @@ -188,10 +201,12 @@ export function createPaziChannelsPairingApproveHandler( const accountId = resolveAccountId(parsed.value.accountId); try { + const cfgSnapshot = deps.loadConfig(); const approved = await deps.approveCode({ channel: parsed.value.channel, accountId, code: parsed.value.code, + env: deps.env, }); if (!approved) { const result: PairingApproveResult = { @@ -207,9 +222,12 @@ export function createPaziChannelsPairingApproveHandler( await deps.notifyApproved({ channelId: parsed.value.channel, id: approved.id, - cfg: deps.loadConfig(), + cfg: cfgSnapshot, }); - } catch { + } catch (err) { + deps.logWarn( + `pazi.channels.pairing.approve notification failed for telegram id=${approved.id}: ${String(err)}`, + ); // Approval is persisted even when notification back to Telegram fails. } const result: PairingApproveResult = { From 5aeb523f51e8366ab1edc17c9b5de3b4ba93e3c0 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 9 Mar 2026 22:37:50 +0100 Subject: [PATCH 56/80] fix(pazi): avoid config-load and approve error conflation --- extensions/pazi/src/channels-pairing.ts | 33 +++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/extensions/pazi/src/channels-pairing.ts b/extensions/pazi/src/channels-pairing.ts index af4ac48413..905d571858 100644 --- a/extensions/pazi/src/channels-pairing.ts +++ b/extensions/pazi/src/channels-pairing.ts @@ -200,8 +200,15 @@ export function createPaziChannelsPairingApproveHandler( } const accountId = resolveAccountId(parsed.value.accountId); + let cfgSnapshot: OpenClawConfig | null = null; + try { + cfgSnapshot = deps.loadConfig(); + } catch (err) { + deps.logWarn( + `pazi.channels.pairing.approve failed to load config snapshot before approval: ${String(err)}`, + ); + } try { - const cfgSnapshot = deps.loadConfig(); const approved = await deps.approveCode({ channel: parsed.value.channel, accountId, @@ -218,17 +225,23 @@ export function createPaziChannelsPairingApproveHandler( respond(true, result); return; } - try { - await deps.notifyApproved({ - channelId: parsed.value.channel, - id: approved.id, - cfg: cfgSnapshot, - }); - } catch (err) { + if (cfgSnapshot) { + try { + await deps.notifyApproved({ + channelId: parsed.value.channel, + id: approved.id, + cfg: cfgSnapshot, + }); + } catch (err) { + deps.logWarn( + `pazi.channels.pairing.approve notification failed for telegram id=${approved.id}: ${String(err)}`, + ); + // Approval is persisted even when notification back to Telegram fails. + } + } else { deps.logWarn( - `pazi.channels.pairing.approve notification failed for telegram id=${approved.id}: ${String(err)}`, + `pazi.channels.pairing.approve notification skipped for telegram id=${approved.id} because config snapshot was unavailable`, ); - // Approval is persisted even when notification back to Telegram fails. } const result: PairingApproveResult = { ok: true, From 6e9e9d008f58a6371c5d38142414a0599bfb0952 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Mar 2026 13:53:16 +0000 Subject: [PATCH 57/80] chore: release 2026.3.16 [skip ci] --- package.json | 910 +++++++++++++++++++++++++-------------------------- 1 file changed, 455 insertions(+), 455 deletions(-) diff --git a/package.json b/package.json index a1a5beb585..248aa68086 100644 --- a/package.json +++ b/package.json @@ -1,457 +1,457 @@ { - "name": "openclaw", - "version": "2026.3.15", - "description": "Multi-channel AI gateway with extensible messaging integrations", - "keywords": [], - "homepage": "https://github.com/openclaw/openclaw#readme", - "bugs": { - "url": "https://github.com/openclaw/openclaw/issues" - }, - "license": "MIT", - "author": "", - "repository": { - "type": "git", - "url": "git+https://github.com/openclaw/openclaw.git" - }, - "bin": { - "openclaw": "openclaw.mjs" - }, - "directories": { - "doc": "docs", - "test": "test" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "openclaw.mjs", - "README-header.png", - "README.md", - "assets/", - "dist/", - "docs/", - "extensions/", - "skills/" - ], - "type": "module", - "main": "dist/index.js", - "exports": { - ".": "./dist/index.js", - "./plugin-sdk": { - "types": "./dist/plugin-sdk/index.d.ts", - "default": "./dist/plugin-sdk/index.js" - }, - "./plugin-sdk/core": { - "types": "./dist/plugin-sdk/core.d.ts", - "default": "./dist/plugin-sdk/core.js" - }, - "./plugin-sdk/compat": { - "types": "./dist/plugin-sdk/compat.d.ts", - "default": "./dist/plugin-sdk/compat.js" - }, - "./plugin-sdk/telegram": { - "types": "./dist/plugin-sdk/telegram.d.ts", - "default": "./dist/plugin-sdk/telegram.js" - }, - "./plugin-sdk/discord": { - "types": "./dist/plugin-sdk/discord.d.ts", - "default": "./dist/plugin-sdk/discord.js" - }, - "./plugin-sdk/slack": { - "types": "./dist/plugin-sdk/slack.d.ts", - "default": "./dist/plugin-sdk/slack.js" - }, - "./plugin-sdk/signal": { - "types": "./dist/plugin-sdk/signal.d.ts", - "default": "./dist/plugin-sdk/signal.js" - }, - "./plugin-sdk/imessage": { - "types": "./dist/plugin-sdk/imessage.d.ts", - "default": "./dist/plugin-sdk/imessage.js" - }, - "./plugin-sdk/whatsapp": { - "types": "./dist/plugin-sdk/whatsapp.d.ts", - "default": "./dist/plugin-sdk/whatsapp.js" - }, - "./plugin-sdk/line": { - "types": "./dist/plugin-sdk/line.d.ts", - "default": "./dist/plugin-sdk/line.js" - }, - "./plugin-sdk/msteams": { - "types": "./dist/plugin-sdk/msteams.d.ts", - "default": "./dist/plugin-sdk/msteams.js" - }, - "./plugin-sdk/acpx": { - "types": "./dist/plugin-sdk/acpx.d.ts", - "default": "./dist/plugin-sdk/acpx.js" - }, - "./plugin-sdk/bluebubbles": { - "types": "./dist/plugin-sdk/bluebubbles.d.ts", - "default": "./dist/plugin-sdk/bluebubbles.js" - }, - "./plugin-sdk/copilot-proxy": { - "types": "./dist/plugin-sdk/copilot-proxy.d.ts", - "default": "./dist/plugin-sdk/copilot-proxy.js" - }, - "./plugin-sdk/device-pair": { - "types": "./dist/plugin-sdk/device-pair.d.ts", - "default": "./dist/plugin-sdk/device-pair.js" - }, - "./plugin-sdk/diagnostics-otel": { - "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", - "default": "./dist/plugin-sdk/diagnostics-otel.js" - }, - "./plugin-sdk/diffs": { - "types": "./dist/plugin-sdk/diffs.d.ts", - "default": "./dist/plugin-sdk/diffs.js" - }, - "./plugin-sdk/feishu": { - "types": "./dist/plugin-sdk/feishu.d.ts", - "default": "./dist/plugin-sdk/feishu.js" - }, - "./plugin-sdk/google-gemini-cli-auth": { - "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", - "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" - }, - "./plugin-sdk/googlechat": { - "types": "./dist/plugin-sdk/googlechat.d.ts", - "default": "./dist/plugin-sdk/googlechat.js" - }, - "./plugin-sdk/irc": { - "types": "./dist/plugin-sdk/irc.d.ts", - "default": "./dist/plugin-sdk/irc.js" - }, - "./plugin-sdk/llm-task": { - "types": "./dist/plugin-sdk/llm-task.d.ts", - "default": "./dist/plugin-sdk/llm-task.js" - }, - "./plugin-sdk/lobster": { - "types": "./dist/plugin-sdk/lobster.d.ts", - "default": "./dist/plugin-sdk/lobster.js" - }, - "./plugin-sdk/matrix": { - "types": "./dist/plugin-sdk/matrix.d.ts", - "default": "./dist/plugin-sdk/matrix.js" - }, - "./plugin-sdk/mattermost": { - "types": "./dist/plugin-sdk/mattermost.d.ts", - "default": "./dist/plugin-sdk/mattermost.js" - }, - "./plugin-sdk/memory-core": { - "types": "./dist/plugin-sdk/memory-core.d.ts", - "default": "./dist/plugin-sdk/memory-core.js" - }, - "./plugin-sdk/memory-lancedb": { - "types": "./dist/plugin-sdk/memory-lancedb.d.ts", - "default": "./dist/plugin-sdk/memory-lancedb.js" - }, - "./plugin-sdk/minimax-portal-auth": { - "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", - "default": "./dist/plugin-sdk/minimax-portal-auth.js" - }, - "./plugin-sdk/nextcloud-talk": { - "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", - "default": "./dist/plugin-sdk/nextcloud-talk.js" - }, - "./plugin-sdk/nostr": { - "types": "./dist/plugin-sdk/nostr.d.ts", - "default": "./dist/plugin-sdk/nostr.js" - }, - "./plugin-sdk/open-prose": { - "types": "./dist/plugin-sdk/open-prose.d.ts", - "default": "./dist/plugin-sdk/open-prose.js" - }, - "./plugin-sdk/phone-control": { - "types": "./dist/plugin-sdk/phone-control.d.ts", - "default": "./dist/plugin-sdk/phone-control.js" - }, - "./plugin-sdk/qwen-portal-auth": { - "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", - "default": "./dist/plugin-sdk/qwen-portal-auth.js" - }, - "./plugin-sdk/synology-chat": { - "types": "./dist/plugin-sdk/synology-chat.d.ts", - "default": "./dist/plugin-sdk/synology-chat.js" - }, - "./plugin-sdk/talk-voice": { - "types": "./dist/plugin-sdk/talk-voice.d.ts", - "default": "./dist/plugin-sdk/talk-voice.js" - }, - "./plugin-sdk/test-utils": { - "types": "./dist/plugin-sdk/test-utils.d.ts", - "default": "./dist/plugin-sdk/test-utils.js" - }, - "./plugin-sdk/thread-ownership": { - "types": "./dist/plugin-sdk/thread-ownership.d.ts", - "default": "./dist/plugin-sdk/thread-ownership.js" - }, - "./plugin-sdk/tlon": { - "types": "./dist/plugin-sdk/tlon.d.ts", - "default": "./dist/plugin-sdk/tlon.js" - }, - "./plugin-sdk/twitch": { - "types": "./dist/plugin-sdk/twitch.d.ts", - "default": "./dist/plugin-sdk/twitch.js" - }, - "./plugin-sdk/voice-call": { - "types": "./dist/plugin-sdk/voice-call.d.ts", - "default": "./dist/plugin-sdk/voice-call.js" - }, - "./plugin-sdk/zalo": { - "types": "./dist/plugin-sdk/zalo.d.ts", - "default": "./dist/plugin-sdk/zalo.js" - }, - "./plugin-sdk/zalouser": { - "types": "./dist/plugin-sdk/zalouser.d.ts", - "default": "./dist/plugin-sdk/zalouser.js" - }, - "./plugin-sdk/account-id": { - "types": "./dist/plugin-sdk/account-id.d.ts", - "default": "./dist/plugin-sdk/account-id.js" - }, - "./plugin-sdk/keyed-async-queue": { - "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", - "default": "./dist/plugin-sdk/keyed-async-queue.js" - }, - "./cli-entry": "./openclaw.mjs" - }, - "scripts": { - "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", - "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", - "android:install": "cd apps/android && ./gradlew :app:installDebug", - "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", - "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", - "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", - "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", - "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", - "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", - "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", - "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", - "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", - "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", - "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", - "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", - "deadcode:ci": "pnpm deadcode:report:ci:knip", - "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", - "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", - "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", - "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", - "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", - "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", - "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", - "dev": "node scripts/run-node.mjs", - "docs:bin": "node scripts/build-docs-list.mjs", - "docs:check-links": "node scripts/docs-link-audit.mjs", - "docs:dev": "cd docs && mint dev", - "docs:list": "node scripts/docs-list.js", - "docs:spellcheck": "bash scripts/docs-spellcheck.sh", - "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", - "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", - "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", - "format": "oxfmt --write", - "format:all": "pnpm format && pnpm format:swift", - "format:check": "oxfmt --check", - "format:diff": "oxfmt --write && git --no-pager diff", - "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", - "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", - "format:fix": "oxfmt --write", - "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", - "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", - "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", - "gateway:watch": "node scripts/watch-node.mjs gateway --force", - "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", - "ghsa:patch": "node scripts/ghsa-patch.mjs", - "ios:build": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", - "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate'", - "ios:open": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", - "ios:run": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware", - "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", - "lint:all": "pnpm lint && pnpm lint:swift", - "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", - "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", - "lint:docs": "pnpm dlx markdownlint-cli2", - "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", - "lint:fix": "oxlint --type-aware --fix && pnpm format", - "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", - "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", - "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", - "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", - "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", - "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", - "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", - "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", - "mac:open": "open dist/OpenClaw.app", - "mac:package": "bash scripts/package-mac-app.sh", - "mac:restart": "bash scripts/restart-mac.sh", - "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "openclaw": "node scripts/run-node.mjs", - "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", - "prepack": "pnpm build && pnpm ui:build", - "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", - "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift", - "protocol:gen": "node --import tsx scripts/protocol-gen.ts", - "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", - "release:check": "node --import tsx scripts/release-check.ts", - "start": "node scripts/run-node.mjs", - "test": "node scripts/test-parallel.mjs", - "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", - "test:channels": "vitest run --config vitest.channels.config.ts", - "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", - "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", - "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", - "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", - "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", - "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", - "test:docker:live-models": "bash scripts/test-live-models-docker.sh", - "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", - "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", - "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", - "test:e2e": "vitest run --config vitest.e2e.config.ts", - "test:extensions": "vitest run --config vitest.extensions.config.ts", - "test:fast": "vitest run --config vitest.unit.config.ts", - "test:force": "node --import tsx scripts/test-force.ts", - "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", - "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", - "test:install:smoke": "bash scripts/test-install-sh-docker.sh", - "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", - "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", - "test:perf:budget": "node scripts/test-perf-budget.mjs", - "test:perf:hotspots": "node scripts/test-hotspots.mjs", - "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", - "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", - "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", - "test:watch": "vitest", - "tui": "node scripts/run-node.mjs tui", - "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", - "ui:build": "node scripts/ui.js build", - "ui:dev": "node scripts/ui.js dev", - "ui:install": "node scripts/ui.js install" - }, - "dependencies": { - "@agentclientprotocol/sdk": "0.15.0", - "@aws-sdk/client-bedrock": "^3.1004.0", - "@buape/carbon": "0.0.0-beta-20260216184201", - "@clack/prompts": "^1.1.0", - "@discordjs/voice": "^0.19.0", - "@grammyjs/runner": "^2.0.3", - "@grammyjs/transformer-throttler": "^1.2.1", - "@homebridge/ciao": "^1.3.5", - "@larksuiteoapi/node-sdk": "^1.59.0", - "@line/bot-sdk": "^10.6.0", - "@lydell/node-pty": "1.2.0-beta.3", - "@mariozechner/pi-agent-core": "0.57.1", - "@mariozechner/pi-ai": "0.57.1", - "@mariozechner/pi-coding-agent": "0.57.1", - "@mariozechner/pi-tui": "0.57.1", - "@mozilla/readability": "^0.6.0", - "@sinclair/typebox": "0.34.48", - "@slack/bolt": "^4.6.0", - "@slack/web-api": "^7.14.1", - "@whiskeysockets/baileys": "7.0.0-rc.9", - "ajv": "^8.18.0", - "chalk": "^5.6.2", - "chokidar": "^5.0.0", - "cli-highlight": "^2.1.11", - "commander": "^14.0.3", - "croner": "^10.0.1", - "discord-api-types": "^0.38.41", - "dotenv": "^17.3.1", - "express": "^5.2.1", - "file-type": "^21.3.0", - "grammy": "^1.41.1", - "https-proxy-agent": "^7.0.6", - "ipaddr.js": "^2.3.0", - "jiti": "^2.6.1", - "json5": "^2.2.3", - "jszip": "^3.10.1", - "linkedom": "^0.18.12", - "long": "^5.3.2", - "markdown-it": "^14.1.1", - "node-edge-tts": "^1.2.10", - "opusscript": "^0.1.1", - "osc-progress": "^0.3.0", - "pdfjs-dist": "^5.5.207", - "playwright-core": "1.58.2", - "qrcode-terminal": "^0.12.0", - "sharp": "^0.34.5", - "sqlite-vec": "0.1.7-alpha.2", - "tar": "7.5.11", - "tslog": "^4.10.2", - "undici": "^7.22.0", - "ws": "^8.19.0", - "yaml": "^2.8.2", - "zod": "^4.3.6" - }, - "devDependencies": { - "@grammyjs/types": "^3.25.0", - "@lit-labs/signals": "^0.2.0", - "@lit/context": "^1.1.6", - "@types/express": "^5.0.6", - "@types/markdown-it": "^14.1.2", - "@types/node": "^25.3.5", - "@types/qrcode-terminal": "^0.12.2", - "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260308.1", - "@vitest/coverage-v8": "^4.0.18", - "jscpd": "4.0.8", - "lit": "^3.3.2", - "oxfmt": "0.36.0", - "oxlint": "^1.51.0", - "oxlint-tsgolint": "^0.16.0", - "signal-utils": "0.21.1", - "tsdown": "0.21.0", - "tsx": "^4.21.0", - "typescript": "^5.9.3", - "vitest": "^4.0.18" - }, - "peerDependencies": { - "@napi-rs/canvas": "^0.1.89", - "node-llama-cpp": "3.16.2" - }, - "engines": { - "node": ">=22.12.0" - }, - "packageManager": "pnpm@10.23.0", - "pnpm": { - "minimumReleaseAge": 2880, - "overrides": { - "hono": "4.12.5", - "@hono/node-server": "1.19.10", - "fast-xml-parser": "5.3.8", - "request": "npm:@cypress/request@3.0.10", - "request-promise": "npm:@cypress/request-promise@5.0.0", - "form-data": "2.5.4", - "minimatch": "10.2.4", - "qs": "6.14.2", - "node-domexception": "npm:@nolyfill/domexception@^1.0.28", - "@sinclair/typebox": "0.34.48", - "tar": "7.5.10", - "tough-cookie": "4.1.3" - }, - "onlyBuiltDependencies": [ - "@lydell/node-pty", - "@matrix-org/matrix-sdk-crypto-nodejs", - "@napi-rs/canvas", - "@tloncorp/api", - "@whiskeysockets/baileys", - "authenticate-pam", - "esbuild", - "koffi", - "node-llama-cpp", - "protobufjs", - "sharp" - ], - "packageExtensions": { - "@mariozechner/pi-coding-agent": { - "dependencies": { - "strip-ansi": "^7.2.0" - } - } - } - } + "name": "openclaw", + "version": "2026.3.16", + "description": "Multi-channel AI gateway with extensible messaging integrations", + "keywords": [], + "homepage": "https://github.com/openclaw/openclaw#readme", + "bugs": { + "url": "https://github.com/openclaw/openclaw/issues" + }, + "license": "MIT", + "author": "", + "repository": { + "type": "git", + "url": "git+https://github.com/openclaw/openclaw.git" + }, + "bin": { + "openclaw": "openclaw.mjs" + }, + "directories": { + "doc": "docs", + "test": "test" + }, + "files": [ + "CHANGELOG.md", + "LICENSE", + "openclaw.mjs", + "README-header.png", + "README.md", + "assets/", + "dist/", + "docs/", + "extensions/", + "skills/" + ], + "type": "module", + "main": "dist/index.js", + "exports": { + ".": "./dist/index.js", + "./plugin-sdk": { + "types": "./dist/plugin-sdk/index.d.ts", + "default": "./dist/plugin-sdk/index.js" + }, + "./plugin-sdk/core": { + "types": "./dist/plugin-sdk/core.d.ts", + "default": "./dist/plugin-sdk/core.js" + }, + "./plugin-sdk/compat": { + "types": "./dist/plugin-sdk/compat.d.ts", + "default": "./dist/plugin-sdk/compat.js" + }, + "./plugin-sdk/telegram": { + "types": "./dist/plugin-sdk/telegram.d.ts", + "default": "./dist/plugin-sdk/telegram.js" + }, + "./plugin-sdk/discord": { + "types": "./dist/plugin-sdk/discord.d.ts", + "default": "./dist/plugin-sdk/discord.js" + }, + "./plugin-sdk/slack": { + "types": "./dist/plugin-sdk/slack.d.ts", + "default": "./dist/plugin-sdk/slack.js" + }, + "./plugin-sdk/signal": { + "types": "./dist/plugin-sdk/signal.d.ts", + "default": "./dist/plugin-sdk/signal.js" + }, + "./plugin-sdk/imessage": { + "types": "./dist/plugin-sdk/imessage.d.ts", + "default": "./dist/plugin-sdk/imessage.js" + }, + "./plugin-sdk/whatsapp": { + "types": "./dist/plugin-sdk/whatsapp.d.ts", + "default": "./dist/plugin-sdk/whatsapp.js" + }, + "./plugin-sdk/line": { + "types": "./dist/plugin-sdk/line.d.ts", + "default": "./dist/plugin-sdk/line.js" + }, + "./plugin-sdk/msteams": { + "types": "./dist/plugin-sdk/msteams.d.ts", + "default": "./dist/plugin-sdk/msteams.js" + }, + "./plugin-sdk/acpx": { + "types": "./dist/plugin-sdk/acpx.d.ts", + "default": "./dist/plugin-sdk/acpx.js" + }, + "./plugin-sdk/bluebubbles": { + "types": "./dist/plugin-sdk/bluebubbles.d.ts", + "default": "./dist/plugin-sdk/bluebubbles.js" + }, + "./plugin-sdk/copilot-proxy": { + "types": "./dist/plugin-sdk/copilot-proxy.d.ts", + "default": "./dist/plugin-sdk/copilot-proxy.js" + }, + "./plugin-sdk/device-pair": { + "types": "./dist/plugin-sdk/device-pair.d.ts", + "default": "./dist/plugin-sdk/device-pair.js" + }, + "./plugin-sdk/diagnostics-otel": { + "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", + "default": "./dist/plugin-sdk/diagnostics-otel.js" + }, + "./plugin-sdk/diffs": { + "types": "./dist/plugin-sdk/diffs.d.ts", + "default": "./dist/plugin-sdk/diffs.js" + }, + "./plugin-sdk/feishu": { + "types": "./dist/plugin-sdk/feishu.d.ts", + "default": "./dist/plugin-sdk/feishu.js" + }, + "./plugin-sdk/google-gemini-cli-auth": { + "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", + "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" + }, + "./plugin-sdk/googlechat": { + "types": "./dist/plugin-sdk/googlechat.d.ts", + "default": "./dist/plugin-sdk/googlechat.js" + }, + "./plugin-sdk/irc": { + "types": "./dist/plugin-sdk/irc.d.ts", + "default": "./dist/plugin-sdk/irc.js" + }, + "./plugin-sdk/llm-task": { + "types": "./dist/plugin-sdk/llm-task.d.ts", + "default": "./dist/plugin-sdk/llm-task.js" + }, + "./plugin-sdk/lobster": { + "types": "./dist/plugin-sdk/lobster.d.ts", + "default": "./dist/plugin-sdk/lobster.js" + }, + "./plugin-sdk/matrix": { + "types": "./dist/plugin-sdk/matrix.d.ts", + "default": "./dist/plugin-sdk/matrix.js" + }, + "./plugin-sdk/mattermost": { + "types": "./dist/plugin-sdk/mattermost.d.ts", + "default": "./dist/plugin-sdk/mattermost.js" + }, + "./plugin-sdk/memory-core": { + "types": "./dist/plugin-sdk/memory-core.d.ts", + "default": "./dist/plugin-sdk/memory-core.js" + }, + "./plugin-sdk/memory-lancedb": { + "types": "./dist/plugin-sdk/memory-lancedb.d.ts", + "default": "./dist/plugin-sdk/memory-lancedb.js" + }, + "./plugin-sdk/minimax-portal-auth": { + "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", + "default": "./dist/plugin-sdk/minimax-portal-auth.js" + }, + "./plugin-sdk/nextcloud-talk": { + "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", + "default": "./dist/plugin-sdk/nextcloud-talk.js" + }, + "./plugin-sdk/nostr": { + "types": "./dist/plugin-sdk/nostr.d.ts", + "default": "./dist/plugin-sdk/nostr.js" + }, + "./plugin-sdk/open-prose": { + "types": "./dist/plugin-sdk/open-prose.d.ts", + "default": "./dist/plugin-sdk/open-prose.js" + }, + "./plugin-sdk/phone-control": { + "types": "./dist/plugin-sdk/phone-control.d.ts", + "default": "./dist/plugin-sdk/phone-control.js" + }, + "./plugin-sdk/qwen-portal-auth": { + "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", + "default": "./dist/plugin-sdk/qwen-portal-auth.js" + }, + "./plugin-sdk/synology-chat": { + "types": "./dist/plugin-sdk/synology-chat.d.ts", + "default": "./dist/plugin-sdk/synology-chat.js" + }, + "./plugin-sdk/talk-voice": { + "types": "./dist/plugin-sdk/talk-voice.d.ts", + "default": "./dist/plugin-sdk/talk-voice.js" + }, + "./plugin-sdk/test-utils": { + "types": "./dist/plugin-sdk/test-utils.d.ts", + "default": "./dist/plugin-sdk/test-utils.js" + }, + "./plugin-sdk/thread-ownership": { + "types": "./dist/plugin-sdk/thread-ownership.d.ts", + "default": "./dist/plugin-sdk/thread-ownership.js" + }, + "./plugin-sdk/tlon": { + "types": "./dist/plugin-sdk/tlon.d.ts", + "default": "./dist/plugin-sdk/tlon.js" + }, + "./plugin-sdk/twitch": { + "types": "./dist/plugin-sdk/twitch.d.ts", + "default": "./dist/plugin-sdk/twitch.js" + }, + "./plugin-sdk/voice-call": { + "types": "./dist/plugin-sdk/voice-call.d.ts", + "default": "./dist/plugin-sdk/voice-call.js" + }, + "./plugin-sdk/zalo": { + "types": "./dist/plugin-sdk/zalo.d.ts", + "default": "./dist/plugin-sdk/zalo.js" + }, + "./plugin-sdk/zalouser": { + "types": "./dist/plugin-sdk/zalouser.d.ts", + "default": "./dist/plugin-sdk/zalouser.js" + }, + "./plugin-sdk/account-id": { + "types": "./dist/plugin-sdk/account-id.d.ts", + "default": "./dist/plugin-sdk/account-id.js" + }, + "./plugin-sdk/keyed-async-queue": { + "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", + "default": "./dist/plugin-sdk/keyed-async-queue.js" + }, + "./cli-entry": "./openclaw.mjs" + }, + "scripts": { + "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", + "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", + "android:install": "cd apps/android && ./gradlew :app:installDebug", + "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", + "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", + "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", + "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", + "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", + "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", + "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", + "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", + "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", + "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", + "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", + "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", + "deadcode:ci": "pnpm deadcode:report:ci:knip", + "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", + "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", + "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", + "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", + "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", + "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", + "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", + "dev": "node scripts/run-node.mjs", + "docs:bin": "node scripts/build-docs-list.mjs", + "docs:check-links": "node scripts/docs-link-audit.mjs", + "docs:dev": "cd docs && mint dev", + "docs:list": "node scripts/docs-list.js", + "docs:spellcheck": "bash scripts/docs-spellcheck.sh", + "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", + "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", + "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", + "format": "oxfmt --write", + "format:all": "pnpm format && pnpm format:swift", + "format:check": "oxfmt --check", + "format:diff": "oxfmt --write && git --no-pager diff", + "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", + "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", + "format:fix": "oxfmt --write", + "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", + "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", + "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", + "gateway:watch": "node scripts/watch-node.mjs gateway --force", + "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", + "ghsa:patch": "node scripts/ghsa-patch.mjs", + "ios:build": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", + "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate'", + "ios:open": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", + "ios:run": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", + "lint": "oxlint --type-aware", + "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", + "lint:all": "pnpm lint && pnpm lint:swift", + "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", + "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", + "lint:docs": "pnpm dlx markdownlint-cli2", + "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", + "lint:fix": "oxlint --type-aware --fix && pnpm format", + "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", + "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", + "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", + "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", + "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", + "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", + "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", + "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", + "mac:open": "open dist/OpenClaw.app", + "mac:package": "bash scripts/package-mac-app.sh", + "mac:restart": "bash scripts/restart-mac.sh", + "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "openclaw": "node scripts/run-node.mjs", + "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", + "prepack": "pnpm build && pnpm ui:build", + "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", + "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift", + "protocol:gen": "node --import tsx scripts/protocol-gen.ts", + "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", + "release:check": "node --import tsx scripts/release-check.ts", + "start": "node scripts/run-node.mjs", + "test": "node scripts/test-parallel.mjs", + "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", + "test:channels": "vitest run --config vitest.channels.config.ts", + "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", + "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", + "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", + "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", + "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", + "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", + "test:docker:live-models": "bash scripts/test-live-models-docker.sh", + "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", + "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", + "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", + "test:e2e": "vitest run --config vitest.e2e.config.ts", + "test:extensions": "vitest run --config vitest.extensions.config.ts", + "test:fast": "vitest run --config vitest.unit.config.ts", + "test:force": "node --import tsx scripts/test-force.ts", + "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", + "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", + "test:install:smoke": "bash scripts/test-install-sh-docker.sh", + "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", + "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", + "test:perf:budget": "node scripts/test-perf-budget.mjs", + "test:perf:hotspots": "node scripts/test-hotspots.mjs", + "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", + "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", + "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", + "test:watch": "vitest", + "tui": "node scripts/run-node.mjs tui", + "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", + "ui:build": "node scripts/ui.js build", + "ui:dev": "node scripts/ui.js dev", + "ui:install": "node scripts/ui.js install" + }, + "dependencies": { + "@agentclientprotocol/sdk": "0.15.0", + "@aws-sdk/client-bedrock": "^3.1004.0", + "@buape/carbon": "0.0.0-beta-20260216184201", + "@clack/prompts": "^1.1.0", + "@discordjs/voice": "^0.19.0", + "@grammyjs/runner": "^2.0.3", + "@grammyjs/transformer-throttler": "^1.2.1", + "@homebridge/ciao": "^1.3.5", + "@larksuiteoapi/node-sdk": "^1.59.0", + "@line/bot-sdk": "^10.6.0", + "@lydell/node-pty": "1.2.0-beta.3", + "@mariozechner/pi-agent-core": "0.57.1", + "@mariozechner/pi-ai": "0.57.1", + "@mariozechner/pi-coding-agent": "0.57.1", + "@mariozechner/pi-tui": "0.57.1", + "@mozilla/readability": "^0.6.0", + "@sinclair/typebox": "0.34.48", + "@slack/bolt": "^4.6.0", + "@slack/web-api": "^7.14.1", + "@whiskeysockets/baileys": "7.0.0-rc.9", + "ajv": "^8.18.0", + "chalk": "^5.6.2", + "chokidar": "^5.0.0", + "cli-highlight": "^2.1.11", + "commander": "^14.0.3", + "croner": "^10.0.1", + "discord-api-types": "^0.38.41", + "dotenv": "^17.3.1", + "express": "^5.2.1", + "file-type": "^21.3.0", + "grammy": "^1.41.1", + "https-proxy-agent": "^7.0.6", + "ipaddr.js": "^2.3.0", + "jiti": "^2.6.1", + "json5": "^2.2.3", + "jszip": "^3.10.1", + "linkedom": "^0.18.12", + "long": "^5.3.2", + "markdown-it": "^14.1.1", + "node-edge-tts": "^1.2.10", + "opusscript": "^0.1.1", + "osc-progress": "^0.3.0", + "pdfjs-dist": "^5.5.207", + "playwright-core": "1.58.2", + "qrcode-terminal": "^0.12.0", + "sharp": "^0.34.5", + "sqlite-vec": "0.1.7-alpha.2", + "tar": "7.5.11", + "tslog": "^4.10.2", + "undici": "^7.22.0", + "ws": "^8.19.0", + "yaml": "^2.8.2", + "zod": "^4.3.6" + }, + "devDependencies": { + "@grammyjs/types": "^3.25.0", + "@lit-labs/signals": "^0.2.0", + "@lit/context": "^1.1.6", + "@types/express": "^5.0.6", + "@types/markdown-it": "^14.1.2", + "@types/node": "^25.3.5", + "@types/qrcode-terminal": "^0.12.2", + "@types/ws": "^8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260308.1", + "@vitest/coverage-v8": "^4.0.18", + "jscpd": "4.0.8", + "lit": "^3.3.2", + "oxfmt": "0.36.0", + "oxlint": "^1.51.0", + "oxlint-tsgolint": "^0.16.0", + "signal-utils": "0.21.1", + "tsdown": "0.21.0", + "tsx": "^4.21.0", + "typescript": "^5.9.3", + "vitest": "^4.0.18" + }, + "peerDependencies": { + "@napi-rs/canvas": "^0.1.89", + "node-llama-cpp": "3.16.2" + }, + "engines": { + "node": ">=22.12.0" + }, + "packageManager": "pnpm@10.23.0", + "pnpm": { + "minimumReleaseAge": 2880, + "overrides": { + "hono": "4.12.5", + "@hono/node-server": "1.19.10", + "fast-xml-parser": "5.3.8", + "request": "npm:@cypress/request@3.0.10", + "request-promise": "npm:@cypress/request-promise@5.0.0", + "form-data": "2.5.4", + "minimatch": "10.2.4", + "qs": "6.14.2", + "node-domexception": "npm:@nolyfill/domexception@^1.0.28", + "@sinclair/typebox": "0.34.48", + "tar": "7.5.10", + "tough-cookie": "4.1.3" + }, + "onlyBuiltDependencies": [ + "@lydell/node-pty", + "@matrix-org/matrix-sdk-crypto-nodejs", + "@napi-rs/canvas", + "@tloncorp/api", + "@whiskeysockets/baileys", + "authenticate-pam", + "esbuild", + "koffi", + "node-llama-cpp", + "protobufjs", + "sharp" + ], + "packageExtensions": { + "@mariozechner/pi-coding-agent": { + "dependencies": { + "strip-ansi": "^7.2.0" + } + } + } + } } From cfe126c01850f5e5c6406b63c50c327a3bfcbe9c Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Tue, 10 Mar 2026 17:59:39 +0100 Subject: [PATCH 58/80] Docker: add default CLI tools and desktop file viewers --- Dockerfile.pazi | 10 ++++++++-- Dockerfile.sandbox | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index b9f4c14136..149b1a0b16 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -50,6 +50,12 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins fonts-liberation fonts-noto-color-emoji \ # Desktop environment (Xvfb + XFCE4) xvfb xfce4 xfce4-terminal dbus-x11 \ + # GUI viewers for common local files in Selkies sessions + mousepad ristretto evince parole \ + # MIME + desktop integration for file open actions + xdg-utils shared-mime-info gvfs gvfs-backends \ + # Media codecs for MP4/MP3 playback in Parole + gstreamer1.0-libav gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ # Selkies-GStreamer dependencies python3 python3-gi python3-setuptools python3-pip python3-dev \ libpulse0 libwayland-dev libwayland-egl1 \ @@ -59,8 +65,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins jq \ # Screenshot capture for desktop preview scrot \ - # Utilities - git curl ca-certificates procps sudo \ + # Utilities + baseline CLI tools for workspace terminals + git curl wget nano less file unzip zip ca-certificates procps sudo \ # Process manager supervisor \ && apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile.sandbox b/Dockerfile.sandbox index 8b50c7a674..19e993ba26 100644 --- a/Dockerfile.sandbox +++ b/Dockerfile.sandbox @@ -11,10 +11,16 @@ RUN --mount=type=cache,id=openclaw-sandbox-bookworm-apt-cache,target=/var/cache/ bash \ ca-certificates \ curl \ + file \ git \ jq \ + less \ + nano \ python3 \ - ripgrep + ripgrep \ + unzip \ + wget \ + zip RUN useradd --create-home --shell /bin/bash sandbox USER sandbox From aeadb383c16484bcd1afc8523ed0b427748930ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Mar 2026 17:07:04 +0000 Subject: [PATCH 59/80] chore: release 2026.3.17 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 248aa68086..907f5f4df1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.16", + "version": "2026.3.17", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From b7dec861c8c4a3b04d36bfde43ddeb8539fc25af Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Tue, 10 Mar 2026 18:27:24 +0100 Subject: [PATCH 60/80] feat(pazi): support per-agent pazi.files workspace resolution --- extensions/pazi/index.ts | 24 +++ extensions/pazi/src/gateway/pazi-files.ts | 231 ++++++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 extensions/pazi/src/gateway/pazi-files.ts diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index a7351df956..545b0abeed 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -1,10 +1,12 @@ import type { Server as HttpServer } from "node:http"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../src/agents/agent-scope.js"; import { notifyPairingApproved } from "../../src/channels/plugins/pairing.js"; import { approveChannelPairingCode, listChannelPairingRequests, } from "../../src/pairing/pairing-store.js"; +import { normalizeAgentId } from "../../src/routing/session-key.js"; import { resolveBrowserUseConfig } from "./src/browser-use/config.js"; import { createBrowserUseTools } from "./src/browser-use/tools.js"; import { createPaziChannelsConfigureHandler } from "./src/channels-configure.js"; @@ -14,6 +16,11 @@ import { } from "./src/channels-pairing.js"; import { resolvePaziBillingConfig } from "./src/config.js"; import { getProxyContext } from "./src/context.js"; +import { + createPaziFilesGet, + createPaziFilesList, + createPaziFilesSet, +} from "./src/gateway/pazi-files.js"; import { createPipedreamTools } from "./src/pipedream/tools.js"; import { createPaziContextHandler } from "./src/proxy/pazi-context.js"; import { startPaziProxy } from "./src/proxy/pazi-proxy.js"; @@ -44,6 +51,20 @@ export default { name: "Pazi Proxy", description: "Routes Anthropic calls through the Pazi API.", register(api: OpenClawPluginApi) { + const defaultAgentId = resolveDefaultAgentId(api.config); + const resolveWorkspace = (requestedAgentId: unknown) => { + const requested = + typeof requestedAgentId === "number" ? String(requestedAgentId) : requestedAgentId; + const normalized = + typeof requested === "string" && requested.trim() + ? normalizeAgentId(requested) + : defaultAgentId; + return { + agentId: normalized, + workspaceDir: resolveAgentWorkspaceDir(api.config, normalized), + }; + }; + const pluginConfig = normalizePluginConfig(api.pluginConfig); const gatewayAuthToken = typeof api.config.gateway?.auth?.token === "string" @@ -65,6 +86,9 @@ export default { context.broadcast("integration", params); respond(true, { emitted: true }); }); + api.registerGatewayMethod("pazi.files.list", createPaziFilesList(resolveWorkspace)); + api.registerGatewayMethod("pazi.files.get", createPaziFilesGet(resolveWorkspace)); + api.registerGatewayMethod("pazi.files.set", createPaziFilesSet(resolveWorkspace)); api.registerGatewayMethod( "pazi.channels.configure", diff --git a/extensions/pazi/src/gateway/pazi-files.ts b/extensions/pazi/src/gateway/pazi-files.ts new file mode 100644 index 0000000000..b5211c06d5 --- /dev/null +++ b/extensions/pazi/src/gateway/pazi-files.ts @@ -0,0 +1,231 @@ +import fs from "node:fs/promises"; +import path from "node:path"; +import { ErrorCodes, errorShape } from "../../../../src/gateway/protocol/index.js"; +import type { GatewayRequestHandler } from "../../../../src/gateway/server-methods/types.js"; +import { + readFileWithinRoot, + writeFileWithinRoot, + SafeOpenError, +} from "../../../../src/infra/fs-safe.js"; + +const SCAN_SKIP_DIRS = new Set([".git", "node_modules", ".DS_Store", "__pycache__", ".cache"]); +const SCAN_MAX_FILES = 10_000; +const SCAN_MAX_DEPTH = 10; + +type ResolvedWorkspace = { + agentId: string; + workspaceDir: string; +}; + +type ResolveWorkspace = (agentId: unknown) => ResolvedWorkspace | null; + +async function listFiles(workspaceDir: string) { + const files: Array<{ + name: string; + path: string; + missing: boolean; + size?: number; + updatedAtMs?: number; + }> = []; + + const resolvedWorkspace = path.resolve(workspaceDir); + + try { + await fs.access(resolvedWorkspace); + } catch { + return files; + } + + const queue: Array<{ dir: string; depth: number }> = [{ dir: resolvedWorkspace, depth: 0 }]; + + while (queue.length > 0 && files.length < SCAN_MAX_FILES) { + const current = queue.shift()!; + if (current.depth > SCAN_MAX_DEPTH) { + continue; + } + + let dirEntries: string[]; + try { + dirEntries = await fs.readdir(current.dir); + } catch { + continue; + } + + for (const entryName of dirEntries) { + if (files.length >= SCAN_MAX_FILES) { + break; + } + if (SCAN_SKIP_DIRS.has(entryName)) { + continue; + } + + const fullPath = path.join(current.dir, entryName); + + let entryStat: Awaited>; + try { + entryStat = await fs.lstat(fullPath); + } catch { + continue; + } + + if (entryStat.isDirectory()) { + queue.push({ dir: fullPath, depth: current.depth + 1 }); + continue; + } + + if (!entryStat.isFile() || entryStat.isSymbolicLink()) { + continue; + } + + files.push({ + name: path.relative(resolvedWorkspace, fullPath), + path: fullPath, + missing: false, + size: entryStat.size, + updatedAtMs: Math.floor(entryStat.mtimeMs), + }); + } + } + + return files; +} + +function resolveRequestWorkspace( + params: unknown, + resolveWorkspace: ResolveWorkspace, +): ResolvedWorkspace | null { + const agentId = + params && typeof params === "object" ? (params as { agentId?: unknown }).agentId : undefined; + return resolveWorkspace(agentId); +} + +export function createPaziFilesList(resolveWorkspace: ResolveWorkspace): GatewayRequestHandler { + return async ({ params, respond }) => { + const resolved = resolveRequestWorkspace(params, resolveWorkspace); + if (!resolved) { + respond(false, undefined, errorShape(ErrorCodes.INVALID_REQUEST, "unknown agent id")); + return; + } + const files = await listFiles(resolved.workspaceDir); + respond(true, { + agentId: resolved.agentId, + workspace: resolved.workspaceDir, + files, + }); + }; +} + +export function createPaziFilesGet(resolveWorkspace: ResolveWorkspace): GatewayRequestHandler { + return async ({ params, respond }) => { + const resolved = resolveRequestWorkspace(params, resolveWorkspace); + if (!resolved) { + respond(false, undefined, errorShape(ErrorCodes.INVALID_REQUEST, "unknown agent id")); + return; + } + const { agentId, workspaceDir } = resolved; + const name = typeof params.name === "string" ? params.name.trim() : ""; + if (!name || name.includes("\0")) { + respond( + false, + undefined, + errorShape(ErrorCodes.INVALID_REQUEST, `invalid file name "${name}"`), + ); + return; + } + + try { + const result = await readFileWithinRoot({ + rootDir: workspaceDir, + relativePath: name, + }); + const filePath = path.join(workspaceDir, name); + respond(true, { + agentId, + workspace: workspaceDir, + file: { + name, + path: filePath, + missing: false, + size: result.stat.size, + updatedAtMs: Math.floor(result.stat.mtimeMs), + content: result.buffer.toString("utf-8"), + }, + }); + } catch (err) { + if (err instanceof SafeOpenError) { + if (err.code === "not-found") { + respond(true, { + agentId, + workspace: workspaceDir, + file: { name, path: path.join(workspaceDir, name), missing: true }, + }); + return; + } + respond( + false, + undefined, + errorShape(ErrorCodes.INVALID_REQUEST, `invalid file: ${err.message}`), + ); + return; + } + respond(false, undefined, errorShape(ErrorCodes.UNAVAILABLE, "read_failed")); + } + }; +} + +export function createPaziFilesSet(resolveWorkspace: ResolveWorkspace): GatewayRequestHandler { + return async ({ params, respond }) => { + const resolved = resolveRequestWorkspace(params, resolveWorkspace); + if (!resolved) { + respond(false, undefined, errorShape(ErrorCodes.INVALID_REQUEST, "unknown agent id")); + return; + } + const { agentId, workspaceDir } = resolved; + const name = typeof params.name === "string" ? params.name.trim() : ""; + if (!name || name.includes("\0")) { + respond( + false, + undefined, + errorShape(ErrorCodes.INVALID_REQUEST, `invalid file name "${name}"`), + ); + return; + } + + const content = String(params.content ?? ""); + + try { + await writeFileWithinRoot({ + rootDir: workspaceDir, + relativePath: name, + data: content, + encoding: "utf8", + mkdir: true, + }); + } catch { + respond( + false, + undefined, + errorShape(ErrorCodes.INVALID_REQUEST, `unsafe workspace file "${name}"`), + ); + return; + } + + const filePath = path.join(workspaceDir, name); + let size: number | undefined; + let updatedAtMs: number | undefined; + try { + const stat = await fs.stat(filePath); + size = stat.size; + updatedAtMs = Math.floor(stat.mtimeMs); + } catch { + // best effort + } + + respond(true, { + ok: true, + agentId, + workspace: workspaceDir, + file: { name, path: filePath, missing: false, size, updatedAtMs, content }, + }); + }; +} From e6d113f2a25b791723650ff0868c7d7860b5c0f5 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Tue, 10 Mar 2026 18:50:36 +0100 Subject: [PATCH 61/80] pazi: add lastActivityAt and stale busy timeout --- extensions/pazi/index.ts | 7 +++- extensions/pazi/src/context.test.ts | 50 +++++++++++++++++++++++++ extensions/pazi/src/context.ts | 19 ++++++++++ extensions/pazi/src/proxy/pazi-proxy.ts | 3 +- 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 extensions/pazi/src/context.test.ts diff --git a/extensions/pazi/index.ts b/extensions/pazi/index.ts index 545b0abeed..013cace552 100644 --- a/extensions/pazi/index.ts +++ b/extensions/pazi/index.ts @@ -15,7 +15,7 @@ import { createPaziChannelsPairingListHandler, } from "./src/channels-pairing.js"; import { resolvePaziBillingConfig } from "./src/config.js"; -import { getProxyContext } from "./src/context.js"; +import { getProxyLastActivityAt, isProxyBusyForStatus } from "./src/context.js"; import { createPaziFilesGet, createPaziFilesList, @@ -199,13 +199,16 @@ export default { path: "/status", auth: "gateway", handler: (_req, res) => { + const lastActivityAtMs = getProxyLastActivityAt(); res.writeHead(200, { "Content-Type": "application/json; charset=utf-8", }); res.end( JSON.stringify({ status: "running", - busy: getProxyContext() !== null, + busy: isProxyBusyForStatus(), + lastActivityAt: + lastActivityAtMs === null ? null : new Date(lastActivityAtMs).toISOString(), version: process.env.AGENT_VERSION ?? "unknown", environment: process.env.NODE_ENV ?? "development", }), diff --git a/extensions/pazi/src/context.test.ts b/extensions/pazi/src/context.test.ts new file mode 100644 index 0000000000..5debe6d0c9 --- /dev/null +++ b/extensions/pazi/src/context.test.ts @@ -0,0 +1,50 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { + clearProxyContext, + getProxyLastActivityAt, + isProxyBusyForStatus, + markProxyActivity, + setProxyContext, +} from "./context.js"; + +describe("pazi context busy status", () => { + beforeEach(() => { + clearProxyContext(); + }); + + it("returns not busy when no context has been set", () => { + expect(isProxyBusyForStatus(1_000_000)).toBe(false); + expect(getProxyLastActivityAt()).toBeNull(); + }); + + it("returns not busy when context exists but there is no activity yet", () => { + setProxyContext({ + userId: "u1", + agentId: "a1", + proxyToken: "p1", + }); + expect(isProxyBusyForStatus(1_000_000)).toBe(false); + }); + + it("returns busy when activity is within the 30-minute window", () => { + const nowMs = 1_000_000; + setProxyContext({ + userId: "u1", + agentId: "a1", + proxyToken: "p1", + }); + markProxyActivity(nowMs - 29 * 60 * 1000); + expect(isProxyBusyForStatus(nowMs)).toBe(true); + }); + + it("returns not busy when activity is older than 30 minutes", () => { + const nowMs = 1_000_000; + setProxyContext({ + userId: "u1", + agentId: "a1", + proxyToken: "p1", + }); + markProxyActivity(nowMs - 31 * 60 * 1000); + expect(isProxyBusyForStatus(nowMs)).toBe(false); + }); +}); diff --git a/extensions/pazi/src/context.ts b/extensions/pazi/src/context.ts index 8897fcb055..6755f89f8d 100644 --- a/extensions/pazi/src/context.ts +++ b/extensions/pazi/src/context.ts @@ -4,7 +4,10 @@ type ProxyContext = { proxyToken: string; }; +const STALE_BUSY_AFTER_MS = 30 * 60 * 1000; + let currentContext: ProxyContext | null = null; +let lastProxyActivityAtMs: number | null = null; export function getProxyContext(): ProxyContext | null { return currentContext; @@ -14,6 +17,22 @@ export function setProxyContext(ctx: ProxyContext): void { currentContext = ctx; } +export function markProxyActivity(atMs = Date.now()): void { + lastProxyActivityAtMs = atMs; +} + +export function getProxyLastActivityAt(): number | null { + return lastProxyActivityAtMs; +} + +export function isProxyBusyForStatus(nowMs = Date.now()): boolean { + if (!currentContext || lastProxyActivityAtMs === null) { + return false; + } + return nowMs - lastProxyActivityAtMs <= STALE_BUSY_AFTER_MS; +} + export function clearProxyContext(): void { currentContext = null; + lastProxyActivityAtMs = null; } diff --git a/extensions/pazi/src/proxy/pazi-proxy.ts b/extensions/pazi/src/proxy/pazi-proxy.ts index ff3ab2625c..210747065f 100644 --- a/extensions/pazi/src/proxy/pazi-proxy.ts +++ b/extensions/pazi/src/proxy/pazi-proxy.ts @@ -1,7 +1,7 @@ import http from "node:http"; import type { IncomingHttpHeaders } from "node:http"; import https from "node:https"; -import { getProxyContext } from "../context.js"; +import { getProxyContext, markProxyActivity } from "../context.js"; type ProxyLogger = { info: (message: string) => void; @@ -68,6 +68,7 @@ export async function startPaziProxy(params: StartProxyParams): Promise Date: Wed, 11 Mar 2026 07:49:57 +0100 Subject: [PATCH 62/80] ci: skip existing release tag in pazi deploy workflow --- .github/workflows/deploy-pazi-agent.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 6c7ff3bdf2..776145e1c4 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -136,8 +136,13 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git tag ${{ needs.build-and-push.outputs.version }} - git push origin ${{ needs.build-and-push.outputs.version }} + RELEASE_TAG="${{ needs.build-and-push.outputs.version }}" + if git ls-remote --exit-code --tags origin "refs/tags/${RELEASE_TAG}" >/dev/null; then + echo "Tag ${RELEASE_TAG} already exists on origin; skipping tag creation." + else + git tag "${RELEASE_TAG}" + git push origin "${RELEASE_TAG}" + fi CURRENT=$(node -p "require('./package.json').version") IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" From e33f7565144812291e0a4dd66ee61874aad5cf29 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Mar 2026 06:58:05 +0000 Subject: [PATCH 63/80] chore: release 2026.3.18 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 907f5f4df1..934c302f00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.17", + "version": "2026.3.18", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From b8ba6df966ed07fc81469de5e909a4b4f03b4b22 Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Wed, 11 Mar 2026 20:00:55 +0100 Subject: [PATCH 64/80] Add Slack setup skill for PAZI_COMMAND:SLACK_SETUP Adds a skill that teaches the agent to output the PAZI_COMMAND:SLACK_SETUP marker, which triggers an interactive Slack setup form in the dashboard chat. Archived old slack-setup and gateway-restart skills. Co-Authored-By: Claude Opus 4.6 --- skills/.archived/gateway-restart/SKILL.md | 50 +++++++++++++ skills/.archived/slack-setup/SKILL.md | 85 +++++++++++++++++++++++ skills/slack-setup/SKILL.md | 74 ++++++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 skills/.archived/gateway-restart/SKILL.md create mode 100644 skills/.archived/slack-setup/SKILL.md create mode 100644 skills/slack-setup/SKILL.md diff --git a/skills/.archived/gateway-restart/SKILL.md b/skills/.archived/gateway-restart/SKILL.md new file mode 100644 index 0000000000..b52b8033af --- /dev/null +++ b/skills/.archived/gateway-restart/SKILL.md @@ -0,0 +1,50 @@ +--- +name: gateway-restart +description: Use when the agent needs to restart the gateway after channel configuration changes (e.g. after setting up Slack, Telegram, or other messaging integrations). This triggers an interactive restart card in the dashboard chat. +metadata: { "openclaw": { "emoji": "🔄" } } +--- + +# Gateway Restart + +## When to use + +Use this skill when: + +- You have made changes to channel configuration (Slack, Telegram, WhatsApp, etc.) +- The gateway needs to restart to apply channel changes +- A messaging integration setup has been completed and the gateway must reload + +## How it works + +The Pazi dashboard supports inline interactive commands. When you output a special command marker in your response, the dashboard renders the corresponding interactive UI component directly in the chat. + +## Command + +### Restart the gateway + +Output the following command marker on its own line to trigger a gateway restart in the dashboard: + +``` +PAZI_COMMAND:RESTART_GATEWAY +``` + +The dashboard will show a loading indicator while the gateway restarts and confirm when complete. Channel changes are applied automatically during the restart. + +## Example conversation + +**User:** I've finished setting up my Slack bot credentials + +**Agent response:** + +``` +Great, the Slack integration is configured. I'll restart the gateway now to apply the changes. + +PAZI_COMMAND:RESTART_GATEWAY +``` + +## Important notes + +- Always provide a brief explanation before outputting the command marker +- The command marker must appear exactly as shown: `PAZI_COMMAND:RESTART_GATEWAY` +- Only output ONE command per message +- After `PAZI_COMMAND:RESTART_GATEWAY`, do not add further text — the restart card will appear where the marker is diff --git a/skills/.archived/slack-setup/SKILL.md b/skills/.archived/slack-setup/SKILL.md new file mode 100644 index 0000000000..90f1487583 --- /dev/null +++ b/skills/.archived/slack-setup/SKILL.md @@ -0,0 +1,85 @@ +--- +name: slack-setup +description: Use when the user wants to set up, connect, or integrate Slack with their agent. This skill triggers the interactive Slack setup form in the dashboard chat. +metadata: { "openclaw": { "emoji": "🔧" } } +--- + +# Slack Integration Setup + +## When to use + +Use this skill when the user asks to: + +- Set up Slack integration +- Connect their agent to Slack +- Configure a Slack bot for their agent +- Integrate Slack with Pazi + +## How it works + +The Pazi dashboard supports inline interactive commands. When you output a special command marker in your response, the dashboard renders the corresponding interactive UI component directly in the chat. + +## Commands + +### Show the Slack setup form + +Output the following command marker on its own line to trigger the interactive Slack setup form in the chat: + +``` +PAZI_COMMAND:SLACK_SETUP +``` + +The dashboard will replace this marker with a full interactive Slack setup form that guides the user through: + +1. Creating a Slack app at api.slack.com/apps +2. Copying the pre-generated app manifest +3. Entering the App ID, App Token, and Bot Token +4. Configuring access controls (open/closed DM policy, group access) +5. Connecting the bot + +After the user submits the form, the gateway automatically restarts to apply the channel changes. + +### Restart the gateway + +After any channel configuration change (including Slack setup), the gateway needs to restart. If the setup form was used, this happens automatically. However, if you configured a channel through other means (e.g., via a tool or API), output this command to trigger a gateway restart: + +``` +PAZI_COMMAND:RESTART_GATEWAY +``` + +The dashboard will show a loading overlay while the gateway restarts and confirm when complete. + +## Default Slack behavior + +Once connected, the agent behaves as follows by default. Communicate these defaults to the user so they know what to expect: + +- **Thread replies**: The agent always responds in a Slack thread. When someone messages the bot (DM or channel mention), the reply appears as a threaded reply to the original message, keeping conversations organized. +- **Channel access**: The agent can read and respond in any channel it has been added to. Users can invite the bot to channels and mention it with `@BotName` to interact. +- **Group access (default: open)**: The bot can respond in channels and group DMs when mentioned. This is configurable via the setup form. +- **Typing indicator**: While the agent is processing a reply, a typing/thinking animation is shown in Slack (via Slack's native streaming or a reaction-based indicator). This gives users visual feedback that the agent is working on a response. +- **DM access (default: open)**: Any Slack user in the workspace can DM the bot. This can be restricted to specific Slack user IDs via the setup form. + +## Example conversation + +**User:** I want to connect my agent to Slack + +**Agent response:** + +``` +I'll help you set up Slack integration! I'm opening the setup form for you now. Follow the step-by-step instructions to create your Slack app and connect it. + +Once connected, your agent will: +- Reply in Slack threads to keep conversations organized +- Respond in any channel it's added to when mentioned +- Show a thinking animation while processing replies + +PAZI_COMMAND:SLACK_SETUP +``` + +## Important notes + +- Always provide a brief explanation before outputting the command marker +- The command marker must appear exactly as shown — `PAZI_COMMAND:SLACK_SETUP` or `PAZI_COMMAND:RESTART_GATEWAY` +- Only output ONE command per message +- After `PAZI_COMMAND:SLACK_SETUP`, do not add further text — the form will appear where the marker is +- The Slack setup form handles the full flow including gateway restart, so you do not need to send `PAZI_COMMAND:RESTART_GATEWAY` separately after the Slack form diff --git a/skills/slack-setup/SKILL.md b/skills/slack-setup/SKILL.md new file mode 100644 index 0000000000..0fdc40891d --- /dev/null +++ b/skills/slack-setup/SKILL.md @@ -0,0 +1,74 @@ +--- +name: slack-setup +description: Use when the user wants to set up, connect, or integrate Slack with their agent. This skill triggers the interactive Slack setup form in the dashboard chat. +metadata: { "openclaw": { "emoji": "🔧" } } +--- + +# Slack Integration Setup + +## When to use + +Use this skill when the user asks to: + +- Set up Slack integration +- Connect their agent to Slack +- Configure a Slack bot for their agent +- Integrate Slack with Pazi + +## How it works + +The Pazi dashboard supports inline interactive commands. When you output a special command marker in your response, the dashboard renders the corresponding interactive UI component directly in the chat. + +## Command + +### Show the Slack setup form + +Output the following command marker on its own line to trigger the interactive Slack setup form in the chat: + +``` +PAZI_COMMAND:SLACK_SETUP +``` + +The dashboard will replace this marker with a full interactive Slack setup form that guides the user through: + +1. Creating a Slack app at api.slack.com/apps +2. Copying the pre-generated app manifest +3. Entering the App ID, App Token, and Bot Token +4. Configuring access controls (open/closed DM policy, group access) +5. Connecting the bot + +After the user submits the form, the gateway automatically restarts to apply the channel changes. + +If the user sends a new message instead of filling the form, the form is automatically dismissed and normal conversation continues. + +## Default Slack behavior + +Once connected, the agent behaves as follows by default. Communicate these defaults to the user so they know what to expect: + +- **Thread replies**: The agent always responds in a Slack thread. When someone messages the bot (DM or channel mention), the reply appears as a threaded reply to the original message, keeping conversations organized. +- **Channel access**: The agent can read and respond in any channel it has been added to. Users can invite the bot to channels and mention it with `@BotName` to interact. +- **Group access (default: open)**: The bot can respond in channels and group DMs when mentioned. This is configurable via the setup form. +- **DM access (default: open)**: Any Slack user in the workspace can DM the bot. This can be restricted to specific Slack user IDs via the setup form. + +## Example conversation + +**User:** I want to connect my agent to Slack + +**Agent response:** + +``` +I'll help you set up Slack integration! I'm opening the setup form for you now. Follow the step-by-step instructions to create your Slack app and connect it. + +Once connected, your agent will: +- Reply in Slack threads to keep conversations organized +- Respond in any channel it's added to when mentioned + +PAZI_COMMAND:SLACK_SETUP +``` + +## Important notes + +- Always provide a brief explanation before outputting the command marker +- The command marker must appear exactly as shown: `PAZI_COMMAND:SLACK_SETUP` +- Only output ONE command per message +- After `PAZI_COMMAND:SLACK_SETUP`, do not add further text — the form will appear where the marker is From 94478c3d2fbb7194a6613080db7cc7dc1be723f0 Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Thu, 12 Mar 2026 10:54:48 +0100 Subject: [PATCH 65/80] Remove archived skills Co-Authored-By: Claude Opus 4.6 --- skills/.archived/gateway-restart/SKILL.md | 50 ------------- skills/.archived/slack-setup/SKILL.md | 85 ----------------------- 2 files changed, 135 deletions(-) delete mode 100644 skills/.archived/gateway-restart/SKILL.md delete mode 100644 skills/.archived/slack-setup/SKILL.md diff --git a/skills/.archived/gateway-restart/SKILL.md b/skills/.archived/gateway-restart/SKILL.md deleted file mode 100644 index b52b8033af..0000000000 --- a/skills/.archived/gateway-restart/SKILL.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: gateway-restart -description: Use when the agent needs to restart the gateway after channel configuration changes (e.g. after setting up Slack, Telegram, or other messaging integrations). This triggers an interactive restart card in the dashboard chat. -metadata: { "openclaw": { "emoji": "🔄" } } ---- - -# Gateway Restart - -## When to use - -Use this skill when: - -- You have made changes to channel configuration (Slack, Telegram, WhatsApp, etc.) -- The gateway needs to restart to apply channel changes -- A messaging integration setup has been completed and the gateway must reload - -## How it works - -The Pazi dashboard supports inline interactive commands. When you output a special command marker in your response, the dashboard renders the corresponding interactive UI component directly in the chat. - -## Command - -### Restart the gateway - -Output the following command marker on its own line to trigger a gateway restart in the dashboard: - -``` -PAZI_COMMAND:RESTART_GATEWAY -``` - -The dashboard will show a loading indicator while the gateway restarts and confirm when complete. Channel changes are applied automatically during the restart. - -## Example conversation - -**User:** I've finished setting up my Slack bot credentials - -**Agent response:** - -``` -Great, the Slack integration is configured. I'll restart the gateway now to apply the changes. - -PAZI_COMMAND:RESTART_GATEWAY -``` - -## Important notes - -- Always provide a brief explanation before outputting the command marker -- The command marker must appear exactly as shown: `PAZI_COMMAND:RESTART_GATEWAY` -- Only output ONE command per message -- After `PAZI_COMMAND:RESTART_GATEWAY`, do not add further text — the restart card will appear where the marker is diff --git a/skills/.archived/slack-setup/SKILL.md b/skills/.archived/slack-setup/SKILL.md deleted file mode 100644 index 90f1487583..0000000000 --- a/skills/.archived/slack-setup/SKILL.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -name: slack-setup -description: Use when the user wants to set up, connect, or integrate Slack with their agent. This skill triggers the interactive Slack setup form in the dashboard chat. -metadata: { "openclaw": { "emoji": "🔧" } } ---- - -# Slack Integration Setup - -## When to use - -Use this skill when the user asks to: - -- Set up Slack integration -- Connect their agent to Slack -- Configure a Slack bot for their agent -- Integrate Slack with Pazi - -## How it works - -The Pazi dashboard supports inline interactive commands. When you output a special command marker in your response, the dashboard renders the corresponding interactive UI component directly in the chat. - -## Commands - -### Show the Slack setup form - -Output the following command marker on its own line to trigger the interactive Slack setup form in the chat: - -``` -PAZI_COMMAND:SLACK_SETUP -``` - -The dashboard will replace this marker with a full interactive Slack setup form that guides the user through: - -1. Creating a Slack app at api.slack.com/apps -2. Copying the pre-generated app manifest -3. Entering the App ID, App Token, and Bot Token -4. Configuring access controls (open/closed DM policy, group access) -5. Connecting the bot - -After the user submits the form, the gateway automatically restarts to apply the channel changes. - -### Restart the gateway - -After any channel configuration change (including Slack setup), the gateway needs to restart. If the setup form was used, this happens automatically. However, if you configured a channel through other means (e.g., via a tool or API), output this command to trigger a gateway restart: - -``` -PAZI_COMMAND:RESTART_GATEWAY -``` - -The dashboard will show a loading overlay while the gateway restarts and confirm when complete. - -## Default Slack behavior - -Once connected, the agent behaves as follows by default. Communicate these defaults to the user so they know what to expect: - -- **Thread replies**: The agent always responds in a Slack thread. When someone messages the bot (DM or channel mention), the reply appears as a threaded reply to the original message, keeping conversations organized. -- **Channel access**: The agent can read and respond in any channel it has been added to. Users can invite the bot to channels and mention it with `@BotName` to interact. -- **Group access (default: open)**: The bot can respond in channels and group DMs when mentioned. This is configurable via the setup form. -- **Typing indicator**: While the agent is processing a reply, a typing/thinking animation is shown in Slack (via Slack's native streaming or a reaction-based indicator). This gives users visual feedback that the agent is working on a response. -- **DM access (default: open)**: Any Slack user in the workspace can DM the bot. This can be restricted to specific Slack user IDs via the setup form. - -## Example conversation - -**User:** I want to connect my agent to Slack - -**Agent response:** - -``` -I'll help you set up Slack integration! I'm opening the setup form for you now. Follow the step-by-step instructions to create your Slack app and connect it. - -Once connected, your agent will: -- Reply in Slack threads to keep conversations organized -- Respond in any channel it's added to when mentioned -- Show a thinking animation while processing replies - -PAZI_COMMAND:SLACK_SETUP -``` - -## Important notes - -- Always provide a brief explanation before outputting the command marker -- The command marker must appear exactly as shown — `PAZI_COMMAND:SLACK_SETUP` or `PAZI_COMMAND:RESTART_GATEWAY` -- Only output ONE command per message -- After `PAZI_COMMAND:SLACK_SETUP`, do not add further text — the form will appear where the marker is -- The Slack setup form handles the full flow including gateway restart, so you do not need to send `PAZI_COMMAND:RESTART_GATEWAY` separately after the Slack form From 5f384594fdb43c6c2b63f392361397c8f868ce88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 12 Mar 2026 10:03:33 +0000 Subject: [PATCH 66/80] chore: release 2026.3.19 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 934c302f00..d82f49eef8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.18", + "version": "2026.3.19", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 6a81c83fd6303d7181624e7939f963d032e6aae4 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 12 Mar 2026 14:28:59 +0100 Subject: [PATCH 67/80] fix: inject channel summary for all new sessions, not just main Task sessions (agent:{id}:task:{uuid}) were missing the channel summary context that main chat gets on first turn. This caused the agent to lack awareness of configured channels and capabilities in new tasks. Co-Authored-By: Claude Opus 4.6 --- src/auto-reply/reply/session-updates.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auto-reply/reply/session-updates.ts b/src/auto-reply/reply/session-updates.ts index 96243e919b..8f880c4dd9 100644 --- a/src/auto-reply/reply/session-updates.ts +++ b/src/auto-reply/reply/session-updates.ts @@ -97,7 +97,9 @@ export async function drainFormattedSystemEvents(params: { }) .filter((v): v is string => Boolean(v)), ); - if (params.isMainSession && params.isNewSession) { + // Inject channel summary on any new session (not just main) so task sessions + // also get awareness of configured channels and capabilities. + if (params.isNewSession) { const summary = await buildChannelSummary(params.cfg); if (summary.length > 0) { systemLines.unshift(...summary); From 5caebe25a3ec428f87782b7c96a8d5d5a6580794 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 12 Mar 2026 14:07:37 +0000 Subject: [PATCH 68/80] chore: release 2026.3.20 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d82f49eef8..8cd6b5404e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.19", + "version": "2026.3.20", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From ba1b4ff70cc668a8941e98776173a8a30c8fb8b8 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 12 Mar 2026 19:36:38 +0100 Subject: [PATCH 69/80] Switch to 4-part versioning: UPSTREAM.PAZI_PATCH (e.g. 2026.3.11.9) Avoids tag conflicts with upstream openclaw releases by embedding the upstream version as the first 3 segments and using a 4th segment for internal Pazi patch numbers. CI auto-bump, Docker tagging, release checks, and pazi extension sync all updated for the new format. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/deploy-pazi-agent.yml | 11 +- .github/workflows/docker-release.yml | 2 +- extensions/pazi/package.json | 2 +- package.json | 910 ++++++++++++------------ scripts/release-check.ts | 9 +- 5 files changed, 471 insertions(+), 463 deletions(-) diff --git a/.github/workflows/deploy-pazi-agent.yml b/.github/workflows/deploy-pazi-agent.yml index 776145e1c4..5cb9fd605e 100644 --- a/.github/workflows/deploy-pazi-agent.yml +++ b/.github/workflows/deploy-pazi-agent.yml @@ -145,10 +145,15 @@ jobs: fi CURRENT=$(node -p "require('./package.json').version") - IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" - NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" + # Version format: UPSTREAM.PAZI_PATCH (e.g. 2026.3.11.9) + # Bump only the 4th segment (pazi patch number) + IFS='.' read -r MAJOR MINOR UPSTREAM_PATCH PAZI_PATCH <<< "$CURRENT" + NEXT="${MAJOR}.${MINOR}.${UPSTREAM_PATCH}.$((PAZI_PATCH + 1))" node -e "const pkg=require('./package.json'); pkg.version='${NEXT}'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n')" - git add package.json + # Sync pazi extension version to match root (upstream extensions keep their own versions) + node -e "const fs=require('fs'),p='extensions/pazi/package.json',pkg=JSON.parse(fs.readFileSync(p,'utf8'));pkg.version='${NEXT}';fs.writeFileSync(p,JSON.stringify(pkg,null,2)+'\n')" + + git add package.json extensions/pazi/package.json git commit -m "chore: release ${NEXT} [skip ci]" git push origin HEAD:${{ github.ref_name }} diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 1e57e24480..bc89ea2c90 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -259,7 +259,7 @@ jobs: version="${GITHUB_REF#refs/tags/v}" tags+=("${IMAGE}:${version}") slim_tags+=("${IMAGE}:${version}-slim") - if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?$ ]]; then + if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(-[0-9]+)?$ ]]; then tags+=("${IMAGE}:latest") slim_tags+=("${IMAGE}:slim") fi diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json index 6eff493c19..3b1245bfa7 100644 --- a/extensions/pazi/package.json +++ b/extensions/pazi/package.json @@ -1,6 +1,6 @@ { "name": "@openclaw/pazi", - "version": "2026.2.25", + "version": "2026.3.11.9", "private": true, "description": "OpenClaw Pazi proxy", "type": "module", diff --git a/package.json b/package.json index 8cd6b5404e..abb332a255 100644 --- a/package.json +++ b/package.json @@ -1,457 +1,457 @@ { - "name": "openclaw", - "version": "2026.3.20", - "description": "Multi-channel AI gateway with extensible messaging integrations", - "keywords": [], - "homepage": "https://github.com/openclaw/openclaw#readme", - "bugs": { - "url": "https://github.com/openclaw/openclaw/issues" - }, - "license": "MIT", - "author": "", - "repository": { - "type": "git", - "url": "git+https://github.com/openclaw/openclaw.git" - }, - "bin": { - "openclaw": "openclaw.mjs" - }, - "directories": { - "doc": "docs", - "test": "test" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "openclaw.mjs", - "README-header.png", - "README.md", - "assets/", - "dist/", - "docs/", - "extensions/", - "skills/" - ], - "type": "module", - "main": "dist/index.js", - "exports": { - ".": "./dist/index.js", - "./plugin-sdk": { - "types": "./dist/plugin-sdk/index.d.ts", - "default": "./dist/plugin-sdk/index.js" - }, - "./plugin-sdk/core": { - "types": "./dist/plugin-sdk/core.d.ts", - "default": "./dist/plugin-sdk/core.js" - }, - "./plugin-sdk/compat": { - "types": "./dist/plugin-sdk/compat.d.ts", - "default": "./dist/plugin-sdk/compat.js" - }, - "./plugin-sdk/telegram": { - "types": "./dist/plugin-sdk/telegram.d.ts", - "default": "./dist/plugin-sdk/telegram.js" - }, - "./plugin-sdk/discord": { - "types": "./dist/plugin-sdk/discord.d.ts", - "default": "./dist/plugin-sdk/discord.js" - }, - "./plugin-sdk/slack": { - "types": "./dist/plugin-sdk/slack.d.ts", - "default": "./dist/plugin-sdk/slack.js" - }, - "./plugin-sdk/signal": { - "types": "./dist/plugin-sdk/signal.d.ts", - "default": "./dist/plugin-sdk/signal.js" - }, - "./plugin-sdk/imessage": { - "types": "./dist/plugin-sdk/imessage.d.ts", - "default": "./dist/plugin-sdk/imessage.js" - }, - "./plugin-sdk/whatsapp": { - "types": "./dist/plugin-sdk/whatsapp.d.ts", - "default": "./dist/plugin-sdk/whatsapp.js" - }, - "./plugin-sdk/line": { - "types": "./dist/plugin-sdk/line.d.ts", - "default": "./dist/plugin-sdk/line.js" - }, - "./plugin-sdk/msteams": { - "types": "./dist/plugin-sdk/msteams.d.ts", - "default": "./dist/plugin-sdk/msteams.js" - }, - "./plugin-sdk/acpx": { - "types": "./dist/plugin-sdk/acpx.d.ts", - "default": "./dist/plugin-sdk/acpx.js" - }, - "./plugin-sdk/bluebubbles": { - "types": "./dist/plugin-sdk/bluebubbles.d.ts", - "default": "./dist/plugin-sdk/bluebubbles.js" - }, - "./plugin-sdk/copilot-proxy": { - "types": "./dist/plugin-sdk/copilot-proxy.d.ts", - "default": "./dist/plugin-sdk/copilot-proxy.js" - }, - "./plugin-sdk/device-pair": { - "types": "./dist/plugin-sdk/device-pair.d.ts", - "default": "./dist/plugin-sdk/device-pair.js" - }, - "./plugin-sdk/diagnostics-otel": { - "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", - "default": "./dist/plugin-sdk/diagnostics-otel.js" - }, - "./plugin-sdk/diffs": { - "types": "./dist/plugin-sdk/diffs.d.ts", - "default": "./dist/plugin-sdk/diffs.js" - }, - "./plugin-sdk/feishu": { - "types": "./dist/plugin-sdk/feishu.d.ts", - "default": "./dist/plugin-sdk/feishu.js" - }, - "./plugin-sdk/google-gemini-cli-auth": { - "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", - "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" - }, - "./plugin-sdk/googlechat": { - "types": "./dist/plugin-sdk/googlechat.d.ts", - "default": "./dist/plugin-sdk/googlechat.js" - }, - "./plugin-sdk/irc": { - "types": "./dist/plugin-sdk/irc.d.ts", - "default": "./dist/plugin-sdk/irc.js" - }, - "./plugin-sdk/llm-task": { - "types": "./dist/plugin-sdk/llm-task.d.ts", - "default": "./dist/plugin-sdk/llm-task.js" - }, - "./plugin-sdk/lobster": { - "types": "./dist/plugin-sdk/lobster.d.ts", - "default": "./dist/plugin-sdk/lobster.js" - }, - "./plugin-sdk/matrix": { - "types": "./dist/plugin-sdk/matrix.d.ts", - "default": "./dist/plugin-sdk/matrix.js" - }, - "./plugin-sdk/mattermost": { - "types": "./dist/plugin-sdk/mattermost.d.ts", - "default": "./dist/plugin-sdk/mattermost.js" - }, - "./plugin-sdk/memory-core": { - "types": "./dist/plugin-sdk/memory-core.d.ts", - "default": "./dist/plugin-sdk/memory-core.js" - }, - "./plugin-sdk/memory-lancedb": { - "types": "./dist/plugin-sdk/memory-lancedb.d.ts", - "default": "./dist/plugin-sdk/memory-lancedb.js" - }, - "./plugin-sdk/minimax-portal-auth": { - "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", - "default": "./dist/plugin-sdk/minimax-portal-auth.js" - }, - "./plugin-sdk/nextcloud-talk": { - "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", - "default": "./dist/plugin-sdk/nextcloud-talk.js" - }, - "./plugin-sdk/nostr": { - "types": "./dist/plugin-sdk/nostr.d.ts", - "default": "./dist/plugin-sdk/nostr.js" - }, - "./plugin-sdk/open-prose": { - "types": "./dist/plugin-sdk/open-prose.d.ts", - "default": "./dist/plugin-sdk/open-prose.js" - }, - "./plugin-sdk/phone-control": { - "types": "./dist/plugin-sdk/phone-control.d.ts", - "default": "./dist/plugin-sdk/phone-control.js" - }, - "./plugin-sdk/qwen-portal-auth": { - "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", - "default": "./dist/plugin-sdk/qwen-portal-auth.js" - }, - "./plugin-sdk/synology-chat": { - "types": "./dist/plugin-sdk/synology-chat.d.ts", - "default": "./dist/plugin-sdk/synology-chat.js" - }, - "./plugin-sdk/talk-voice": { - "types": "./dist/plugin-sdk/talk-voice.d.ts", - "default": "./dist/plugin-sdk/talk-voice.js" - }, - "./plugin-sdk/test-utils": { - "types": "./dist/plugin-sdk/test-utils.d.ts", - "default": "./dist/plugin-sdk/test-utils.js" - }, - "./plugin-sdk/thread-ownership": { - "types": "./dist/plugin-sdk/thread-ownership.d.ts", - "default": "./dist/plugin-sdk/thread-ownership.js" - }, - "./plugin-sdk/tlon": { - "types": "./dist/plugin-sdk/tlon.d.ts", - "default": "./dist/plugin-sdk/tlon.js" - }, - "./plugin-sdk/twitch": { - "types": "./dist/plugin-sdk/twitch.d.ts", - "default": "./dist/plugin-sdk/twitch.js" - }, - "./plugin-sdk/voice-call": { - "types": "./dist/plugin-sdk/voice-call.d.ts", - "default": "./dist/plugin-sdk/voice-call.js" - }, - "./plugin-sdk/zalo": { - "types": "./dist/plugin-sdk/zalo.d.ts", - "default": "./dist/plugin-sdk/zalo.js" - }, - "./plugin-sdk/zalouser": { - "types": "./dist/plugin-sdk/zalouser.d.ts", - "default": "./dist/plugin-sdk/zalouser.js" - }, - "./plugin-sdk/account-id": { - "types": "./dist/plugin-sdk/account-id.d.ts", - "default": "./dist/plugin-sdk/account-id.js" - }, - "./plugin-sdk/keyed-async-queue": { - "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", - "default": "./dist/plugin-sdk/keyed-async-queue.js" - }, - "./cli-entry": "./openclaw.mjs" - }, - "scripts": { - "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", - "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", - "android:install": "cd apps/android && ./gradlew :app:installDebug", - "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", - "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", - "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", - "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", - "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", - "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", - "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", - "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", - "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", - "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", - "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", - "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", - "deadcode:ci": "pnpm deadcode:report:ci:knip", - "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", - "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", - "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", - "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", - "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", - "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", - "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", - "dev": "node scripts/run-node.mjs", - "docs:bin": "node scripts/build-docs-list.mjs", - "docs:check-links": "node scripts/docs-link-audit.mjs", - "docs:dev": "cd docs && mint dev", - "docs:list": "node scripts/docs-list.js", - "docs:spellcheck": "bash scripts/docs-spellcheck.sh", - "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", - "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", - "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", - "format": "oxfmt --write", - "format:all": "pnpm format && pnpm format:swift", - "format:check": "oxfmt --check", - "format:diff": "oxfmt --write && git --no-pager diff", - "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", - "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", - "format:fix": "oxfmt --write", - "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", - "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", - "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", - "gateway:watch": "node scripts/watch-node.mjs gateway --force", - "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", - "ghsa:patch": "node scripts/ghsa-patch.mjs", - "ios:build": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", - "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate'", - "ios:open": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", - "ios:run": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware", - "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", - "lint:all": "pnpm lint && pnpm lint:swift", - "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", - "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", - "lint:docs": "pnpm dlx markdownlint-cli2", - "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", - "lint:fix": "oxlint --type-aware --fix && pnpm format", - "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", - "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", - "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", - "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", - "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", - "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", - "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", - "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", - "mac:open": "open dist/OpenClaw.app", - "mac:package": "bash scripts/package-mac-app.sh", - "mac:restart": "bash scripts/restart-mac.sh", - "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "openclaw": "node scripts/run-node.mjs", - "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", - "prepack": "pnpm build && pnpm ui:build", - "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", - "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift", - "protocol:gen": "node --import tsx scripts/protocol-gen.ts", - "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", - "release:check": "node --import tsx scripts/release-check.ts", - "start": "node scripts/run-node.mjs", - "test": "node scripts/test-parallel.mjs", - "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", - "test:channels": "vitest run --config vitest.channels.config.ts", - "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", - "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", - "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", - "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", - "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", - "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", - "test:docker:live-models": "bash scripts/test-live-models-docker.sh", - "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", - "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", - "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", - "test:e2e": "vitest run --config vitest.e2e.config.ts", - "test:extensions": "vitest run --config vitest.extensions.config.ts", - "test:fast": "vitest run --config vitest.unit.config.ts", - "test:force": "node --import tsx scripts/test-force.ts", - "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", - "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", - "test:install:smoke": "bash scripts/test-install-sh-docker.sh", - "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", - "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", - "test:perf:budget": "node scripts/test-perf-budget.mjs", - "test:perf:hotspots": "node scripts/test-hotspots.mjs", - "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", - "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", - "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", - "test:watch": "vitest", - "tui": "node scripts/run-node.mjs tui", - "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", - "ui:build": "node scripts/ui.js build", - "ui:dev": "node scripts/ui.js dev", - "ui:install": "node scripts/ui.js install" - }, - "dependencies": { - "@agentclientprotocol/sdk": "0.15.0", - "@aws-sdk/client-bedrock": "^3.1004.0", - "@buape/carbon": "0.0.0-beta-20260216184201", - "@clack/prompts": "^1.1.0", - "@discordjs/voice": "^0.19.0", - "@grammyjs/runner": "^2.0.3", - "@grammyjs/transformer-throttler": "^1.2.1", - "@homebridge/ciao": "^1.3.5", - "@larksuiteoapi/node-sdk": "^1.59.0", - "@line/bot-sdk": "^10.6.0", - "@lydell/node-pty": "1.2.0-beta.3", - "@mariozechner/pi-agent-core": "0.57.1", - "@mariozechner/pi-ai": "0.57.1", - "@mariozechner/pi-coding-agent": "0.57.1", - "@mariozechner/pi-tui": "0.57.1", - "@mozilla/readability": "^0.6.0", - "@sinclair/typebox": "0.34.48", - "@slack/bolt": "^4.6.0", - "@slack/web-api": "^7.14.1", - "@whiskeysockets/baileys": "7.0.0-rc.9", - "ajv": "^8.18.0", - "chalk": "^5.6.2", - "chokidar": "^5.0.0", - "cli-highlight": "^2.1.11", - "commander": "^14.0.3", - "croner": "^10.0.1", - "discord-api-types": "^0.38.41", - "dotenv": "^17.3.1", - "express": "^5.2.1", - "file-type": "^21.3.0", - "grammy": "^1.41.1", - "https-proxy-agent": "^7.0.6", - "ipaddr.js": "^2.3.0", - "jiti": "^2.6.1", - "json5": "^2.2.3", - "jszip": "^3.10.1", - "linkedom": "^0.18.12", - "long": "^5.3.2", - "markdown-it": "^14.1.1", - "node-edge-tts": "^1.2.10", - "opusscript": "^0.1.1", - "osc-progress": "^0.3.0", - "pdfjs-dist": "^5.5.207", - "playwright-core": "1.58.2", - "qrcode-terminal": "^0.12.0", - "sharp": "^0.34.5", - "sqlite-vec": "0.1.7-alpha.2", - "tar": "7.5.11", - "tslog": "^4.10.2", - "undici": "^7.22.0", - "ws": "^8.19.0", - "yaml": "^2.8.2", - "zod": "^4.3.6" - }, - "devDependencies": { - "@grammyjs/types": "^3.25.0", - "@lit-labs/signals": "^0.2.0", - "@lit/context": "^1.1.6", - "@types/express": "^5.0.6", - "@types/markdown-it": "^14.1.2", - "@types/node": "^25.3.5", - "@types/qrcode-terminal": "^0.12.2", - "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260308.1", - "@vitest/coverage-v8": "^4.0.18", - "jscpd": "4.0.8", - "lit": "^3.3.2", - "oxfmt": "0.36.0", - "oxlint": "^1.51.0", - "oxlint-tsgolint": "^0.16.0", - "signal-utils": "0.21.1", - "tsdown": "0.21.0", - "tsx": "^4.21.0", - "typescript": "^5.9.3", - "vitest": "^4.0.18" - }, - "peerDependencies": { - "@napi-rs/canvas": "^0.1.89", - "node-llama-cpp": "3.16.2" - }, - "engines": { - "node": ">=22.12.0" - }, - "packageManager": "pnpm@10.23.0", - "pnpm": { - "minimumReleaseAge": 2880, - "overrides": { - "hono": "4.12.5", - "@hono/node-server": "1.19.10", - "fast-xml-parser": "5.3.8", - "request": "npm:@cypress/request@3.0.10", - "request-promise": "npm:@cypress/request-promise@5.0.0", - "form-data": "2.5.4", - "minimatch": "10.2.4", - "qs": "6.14.2", - "node-domexception": "npm:@nolyfill/domexception@^1.0.28", - "@sinclair/typebox": "0.34.48", - "tar": "7.5.10", - "tough-cookie": "4.1.3" - }, - "onlyBuiltDependencies": [ - "@lydell/node-pty", - "@matrix-org/matrix-sdk-crypto-nodejs", - "@napi-rs/canvas", - "@tloncorp/api", - "@whiskeysockets/baileys", - "authenticate-pam", - "esbuild", - "koffi", - "node-llama-cpp", - "protobufjs", - "sharp" - ], - "packageExtensions": { - "@mariozechner/pi-coding-agent": { - "dependencies": { - "strip-ansi": "^7.2.0" - } - } - } - } + "name": "openclaw", + "version": "2026.3.11.9", + "description": "Multi-channel AI gateway with extensible messaging integrations", + "keywords": [], + "homepage": "https://github.com/openclaw/openclaw#readme", + "bugs": { + "url": "https://github.com/openclaw/openclaw/issues" + }, + "license": "MIT", + "author": "", + "repository": { + "type": "git", + "url": "git+https://github.com/openclaw/openclaw.git" + }, + "bin": { + "openclaw": "openclaw.mjs" + }, + "directories": { + "doc": "docs", + "test": "test" + }, + "files": [ + "CHANGELOG.md", + "LICENSE", + "openclaw.mjs", + "README-header.png", + "README.md", + "assets/", + "dist/", + "docs/", + "extensions/", + "skills/" + ], + "type": "module", + "main": "dist/index.js", + "exports": { + ".": "./dist/index.js", + "./plugin-sdk": { + "types": "./dist/plugin-sdk/index.d.ts", + "default": "./dist/plugin-sdk/index.js" + }, + "./plugin-sdk/core": { + "types": "./dist/plugin-sdk/core.d.ts", + "default": "./dist/plugin-sdk/core.js" + }, + "./plugin-sdk/compat": { + "types": "./dist/plugin-sdk/compat.d.ts", + "default": "./dist/plugin-sdk/compat.js" + }, + "./plugin-sdk/telegram": { + "types": "./dist/plugin-sdk/telegram.d.ts", + "default": "./dist/plugin-sdk/telegram.js" + }, + "./plugin-sdk/discord": { + "types": "./dist/plugin-sdk/discord.d.ts", + "default": "./dist/plugin-sdk/discord.js" + }, + "./plugin-sdk/slack": { + "types": "./dist/plugin-sdk/slack.d.ts", + "default": "./dist/plugin-sdk/slack.js" + }, + "./plugin-sdk/signal": { + "types": "./dist/plugin-sdk/signal.d.ts", + "default": "./dist/plugin-sdk/signal.js" + }, + "./plugin-sdk/imessage": { + "types": "./dist/plugin-sdk/imessage.d.ts", + "default": "./dist/plugin-sdk/imessage.js" + }, + "./plugin-sdk/whatsapp": { + "types": "./dist/plugin-sdk/whatsapp.d.ts", + "default": "./dist/plugin-sdk/whatsapp.js" + }, + "./plugin-sdk/line": { + "types": "./dist/plugin-sdk/line.d.ts", + "default": "./dist/plugin-sdk/line.js" + }, + "./plugin-sdk/msteams": { + "types": "./dist/plugin-sdk/msteams.d.ts", + "default": "./dist/plugin-sdk/msteams.js" + }, + "./plugin-sdk/acpx": { + "types": "./dist/plugin-sdk/acpx.d.ts", + "default": "./dist/plugin-sdk/acpx.js" + }, + "./plugin-sdk/bluebubbles": { + "types": "./dist/plugin-sdk/bluebubbles.d.ts", + "default": "./dist/plugin-sdk/bluebubbles.js" + }, + "./plugin-sdk/copilot-proxy": { + "types": "./dist/plugin-sdk/copilot-proxy.d.ts", + "default": "./dist/plugin-sdk/copilot-proxy.js" + }, + "./plugin-sdk/device-pair": { + "types": "./dist/plugin-sdk/device-pair.d.ts", + "default": "./dist/plugin-sdk/device-pair.js" + }, + "./plugin-sdk/diagnostics-otel": { + "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", + "default": "./dist/plugin-sdk/diagnostics-otel.js" + }, + "./plugin-sdk/diffs": { + "types": "./dist/plugin-sdk/diffs.d.ts", + "default": "./dist/plugin-sdk/diffs.js" + }, + "./plugin-sdk/feishu": { + "types": "./dist/plugin-sdk/feishu.d.ts", + "default": "./dist/plugin-sdk/feishu.js" + }, + "./plugin-sdk/google-gemini-cli-auth": { + "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", + "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" + }, + "./plugin-sdk/googlechat": { + "types": "./dist/plugin-sdk/googlechat.d.ts", + "default": "./dist/plugin-sdk/googlechat.js" + }, + "./plugin-sdk/irc": { + "types": "./dist/plugin-sdk/irc.d.ts", + "default": "./dist/plugin-sdk/irc.js" + }, + "./plugin-sdk/llm-task": { + "types": "./dist/plugin-sdk/llm-task.d.ts", + "default": "./dist/plugin-sdk/llm-task.js" + }, + "./plugin-sdk/lobster": { + "types": "./dist/plugin-sdk/lobster.d.ts", + "default": "./dist/plugin-sdk/lobster.js" + }, + "./plugin-sdk/matrix": { + "types": "./dist/plugin-sdk/matrix.d.ts", + "default": "./dist/plugin-sdk/matrix.js" + }, + "./plugin-sdk/mattermost": { + "types": "./dist/plugin-sdk/mattermost.d.ts", + "default": "./dist/plugin-sdk/mattermost.js" + }, + "./plugin-sdk/memory-core": { + "types": "./dist/plugin-sdk/memory-core.d.ts", + "default": "./dist/plugin-sdk/memory-core.js" + }, + "./plugin-sdk/memory-lancedb": { + "types": "./dist/plugin-sdk/memory-lancedb.d.ts", + "default": "./dist/plugin-sdk/memory-lancedb.js" + }, + "./plugin-sdk/minimax-portal-auth": { + "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", + "default": "./dist/plugin-sdk/minimax-portal-auth.js" + }, + "./plugin-sdk/nextcloud-talk": { + "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", + "default": "./dist/plugin-sdk/nextcloud-talk.js" + }, + "./plugin-sdk/nostr": { + "types": "./dist/plugin-sdk/nostr.d.ts", + "default": "./dist/plugin-sdk/nostr.js" + }, + "./plugin-sdk/open-prose": { + "types": "./dist/plugin-sdk/open-prose.d.ts", + "default": "./dist/plugin-sdk/open-prose.js" + }, + "./plugin-sdk/phone-control": { + "types": "./dist/plugin-sdk/phone-control.d.ts", + "default": "./dist/plugin-sdk/phone-control.js" + }, + "./plugin-sdk/qwen-portal-auth": { + "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", + "default": "./dist/plugin-sdk/qwen-portal-auth.js" + }, + "./plugin-sdk/synology-chat": { + "types": "./dist/plugin-sdk/synology-chat.d.ts", + "default": "./dist/plugin-sdk/synology-chat.js" + }, + "./plugin-sdk/talk-voice": { + "types": "./dist/plugin-sdk/talk-voice.d.ts", + "default": "./dist/plugin-sdk/talk-voice.js" + }, + "./plugin-sdk/test-utils": { + "types": "./dist/plugin-sdk/test-utils.d.ts", + "default": "./dist/plugin-sdk/test-utils.js" + }, + "./plugin-sdk/thread-ownership": { + "types": "./dist/plugin-sdk/thread-ownership.d.ts", + "default": "./dist/plugin-sdk/thread-ownership.js" + }, + "./plugin-sdk/tlon": { + "types": "./dist/plugin-sdk/tlon.d.ts", + "default": "./dist/plugin-sdk/tlon.js" + }, + "./plugin-sdk/twitch": { + "types": "./dist/plugin-sdk/twitch.d.ts", + "default": "./dist/plugin-sdk/twitch.js" + }, + "./plugin-sdk/voice-call": { + "types": "./dist/plugin-sdk/voice-call.d.ts", + "default": "./dist/plugin-sdk/voice-call.js" + }, + "./plugin-sdk/zalo": { + "types": "./dist/plugin-sdk/zalo.d.ts", + "default": "./dist/plugin-sdk/zalo.js" + }, + "./plugin-sdk/zalouser": { + "types": "./dist/plugin-sdk/zalouser.d.ts", + "default": "./dist/plugin-sdk/zalouser.js" + }, + "./plugin-sdk/account-id": { + "types": "./dist/plugin-sdk/account-id.d.ts", + "default": "./dist/plugin-sdk/account-id.js" + }, + "./plugin-sdk/keyed-async-queue": { + "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", + "default": "./dist/plugin-sdk/keyed-async-queue.js" + }, + "./cli-entry": "./openclaw.mjs" + }, + "scripts": { + "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", + "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", + "android:install": "cd apps/android && ./gradlew :app:installDebug", + "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", + "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", + "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", + "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", + "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", + "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", + "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", + "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", + "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", + "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", + "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", + "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", + "deadcode:ci": "pnpm deadcode:report:ci:knip", + "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", + "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", + "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", + "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", + "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", + "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", + "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", + "dev": "node scripts/run-node.mjs", + "docs:bin": "node scripts/build-docs-list.mjs", + "docs:check-links": "node scripts/docs-link-audit.mjs", + "docs:dev": "cd docs && mint dev", + "docs:list": "node scripts/docs-list.js", + "docs:spellcheck": "bash scripts/docs-spellcheck.sh", + "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", + "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", + "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", + "format": "oxfmt --write", + "format:all": "pnpm format && pnpm format:swift", + "format:check": "oxfmt --check", + "format:diff": "oxfmt --write && git --no-pager diff", + "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", + "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", + "format:fix": "oxfmt --write", + "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", + "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", + "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", + "gateway:watch": "node scripts/watch-node.mjs gateway --force", + "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", + "ghsa:patch": "node scripts/ghsa-patch.mjs", + "ios:build": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", + "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate'", + "ios:open": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", + "ios:run": "bash -lc './scripts/ios-configure-signing.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", + "lint": "oxlint --type-aware", + "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", + "lint:all": "pnpm lint && pnpm lint:swift", + "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", + "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", + "lint:docs": "pnpm dlx markdownlint-cli2", + "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", + "lint:fix": "oxlint --type-aware --fix && pnpm format", + "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", + "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", + "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", + "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", + "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", + "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", + "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", + "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", + "mac:open": "open dist/OpenClaw.app", + "mac:package": "bash scripts/package-mac-app.sh", + "mac:restart": "bash scripts/restart-mac.sh", + "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "openclaw": "node scripts/run-node.mjs", + "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", + "prepack": "pnpm build && pnpm ui:build", + "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", + "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift", + "protocol:gen": "node --import tsx scripts/protocol-gen.ts", + "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", + "release:check": "node --import tsx scripts/release-check.ts", + "start": "node scripts/run-node.mjs", + "test": "node scripts/test-parallel.mjs", + "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", + "test:channels": "vitest run --config vitest.channels.config.ts", + "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", + "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", + "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", + "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", + "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", + "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", + "test:docker:live-models": "bash scripts/test-live-models-docker.sh", + "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", + "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", + "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", + "test:e2e": "vitest run --config vitest.e2e.config.ts", + "test:extensions": "vitest run --config vitest.extensions.config.ts", + "test:fast": "vitest run --config vitest.unit.config.ts", + "test:force": "node --import tsx scripts/test-force.ts", + "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", + "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", + "test:install:smoke": "bash scripts/test-install-sh-docker.sh", + "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", + "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", + "test:perf:budget": "node scripts/test-perf-budget.mjs", + "test:perf:hotspots": "node scripts/test-hotspots.mjs", + "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", + "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", + "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", + "test:watch": "vitest", + "tui": "node scripts/run-node.mjs tui", + "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", + "ui:build": "node scripts/ui.js build", + "ui:dev": "node scripts/ui.js dev", + "ui:install": "node scripts/ui.js install" + }, + "dependencies": { + "@agentclientprotocol/sdk": "0.15.0", + "@aws-sdk/client-bedrock": "^3.1004.0", + "@buape/carbon": "0.0.0-beta-20260216184201", + "@clack/prompts": "^1.1.0", + "@discordjs/voice": "^0.19.0", + "@grammyjs/runner": "^2.0.3", + "@grammyjs/transformer-throttler": "^1.2.1", + "@homebridge/ciao": "^1.3.5", + "@larksuiteoapi/node-sdk": "^1.59.0", + "@line/bot-sdk": "^10.6.0", + "@lydell/node-pty": "1.2.0-beta.3", + "@mariozechner/pi-agent-core": "0.57.1", + "@mariozechner/pi-ai": "0.57.1", + "@mariozechner/pi-coding-agent": "0.57.1", + "@mariozechner/pi-tui": "0.57.1", + "@mozilla/readability": "^0.6.0", + "@sinclair/typebox": "0.34.48", + "@slack/bolt": "^4.6.0", + "@slack/web-api": "^7.14.1", + "@whiskeysockets/baileys": "7.0.0-rc.9", + "ajv": "^8.18.0", + "chalk": "^5.6.2", + "chokidar": "^5.0.0", + "cli-highlight": "^2.1.11", + "commander": "^14.0.3", + "croner": "^10.0.1", + "discord-api-types": "^0.38.41", + "dotenv": "^17.3.1", + "express": "^5.2.1", + "file-type": "^21.3.0", + "grammy": "^1.41.1", + "https-proxy-agent": "^7.0.6", + "ipaddr.js": "^2.3.0", + "jiti": "^2.6.1", + "json5": "^2.2.3", + "jszip": "^3.10.1", + "linkedom": "^0.18.12", + "long": "^5.3.2", + "markdown-it": "^14.1.1", + "node-edge-tts": "^1.2.10", + "opusscript": "^0.1.1", + "osc-progress": "^0.3.0", + "pdfjs-dist": "^5.5.207", + "playwright-core": "1.58.2", + "qrcode-terminal": "^0.12.0", + "sharp": "^0.34.5", + "sqlite-vec": "0.1.7-alpha.2", + "tar": "7.5.11", + "tslog": "^4.10.2", + "undici": "^7.22.0", + "ws": "^8.19.0", + "yaml": "^2.8.2", + "zod": "^4.3.6" + }, + "devDependencies": { + "@grammyjs/types": "^3.25.0", + "@lit-labs/signals": "^0.2.0", + "@lit/context": "^1.1.6", + "@types/express": "^5.0.6", + "@types/markdown-it": "^14.1.2", + "@types/node": "^25.3.5", + "@types/qrcode-terminal": "^0.12.2", + "@types/ws": "^8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260308.1", + "@vitest/coverage-v8": "^4.0.18", + "jscpd": "4.0.8", + "lit": "^3.3.2", + "oxfmt": "0.36.0", + "oxlint": "^1.51.0", + "oxlint-tsgolint": "^0.16.0", + "signal-utils": "0.21.1", + "tsdown": "0.21.0", + "tsx": "^4.21.0", + "typescript": "^5.9.3", + "vitest": "^4.0.18" + }, + "peerDependencies": { + "@napi-rs/canvas": "^0.1.89", + "node-llama-cpp": "3.16.2" + }, + "engines": { + "node": ">=22.12.0" + }, + "packageManager": "pnpm@10.23.0", + "pnpm": { + "minimumReleaseAge": 2880, + "overrides": { + "hono": "4.12.5", + "@hono/node-server": "1.19.10", + "fast-xml-parser": "5.3.8", + "request": "npm:@cypress/request@3.0.10", + "request-promise": "npm:@cypress/request-promise@5.0.0", + "form-data": "2.5.4", + "minimatch": "10.2.4", + "qs": "6.14.2", + "node-domexception": "npm:@nolyfill/domexception@^1.0.28", + "@sinclair/typebox": "0.34.48", + "tar": "7.5.10", + "tough-cookie": "4.1.3" + }, + "onlyBuiltDependencies": [ + "@lydell/node-pty", + "@matrix-org/matrix-sdk-crypto-nodejs", + "@napi-rs/canvas", + "@tloncorp/api", + "@whiskeysockets/baileys", + "authenticate-pam", + "esbuild", + "koffi", + "node-llama-cpp", + "protobufjs", + "sharp" + ], + "packageExtensions": { + "@mariozechner/pi-coding-agent": { + "dependencies": { + "strip-ansi": "^7.2.0" + } + } + } + } } diff --git a/scripts/release-check.ts b/scripts/release-check.ts index fe2a9a1ea9..ea4b27c10e 100755 --- a/scripts/release-check.ts +++ b/scripts/release-check.ts @@ -118,7 +118,7 @@ const laneFloorAdoptionDateKey = 20260227; function normalizePluginSyncVersion(version: string): string { const normalized = version.trim().replace(/^v/, ""); - const base = /^([0-9]+\.[0-9]+\.[0-9]+)/.exec(normalized)?.[1]; + const base = /^([0-9]+\.[0-9]+\.[0-9]+(?:\.[0-9]+)?)/.exec(normalized)?.[1]; if (base) { return base; } @@ -218,6 +218,9 @@ function runPackDry(): PackResult[] { return JSON.parse(raw) as PackResult[]; } +// Only the pazi extension must match root version; upstream extensions keep their own versions. +const paziManagedExtensions = new Set(["pazi"]); + function checkPluginVersions() { const rootPackagePath = resolve("package.json"); const rootPackage = JSON.parse(readFileSync(rootPackagePath, "utf8")) as PackageJson; @@ -230,8 +233,8 @@ function checkPluginVersions() { } const extensionsDir = resolve("extensions"); - const entries = readdirSync(extensionsDir, { withFileTypes: true }).filter((entry) => - entry.isDirectory(), + const entries = readdirSync(extensionsDir, { withFileTypes: true }).filter( + (entry) => entry.isDirectory() && paziManagedExtensions.has(entry.name), ); const mismatches: string[] = []; From 98c3d07f810451f94629f320daff412a5d0ff976 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 12 Mar 2026 21:03:15 +0100 Subject: [PATCH 70/80] fix: handle 4-part versions in update check and fix release-check guidance - Update parseComparableSemver to parse optional 4th segment (subpatch) so versions like 2026.3.11.9 are correctly compared for update checks - Add subpatch comparison to compareSemverStrings - Replace misleading `pnpm plugins:sync` guidance in release-check error since that command updates all extensions, not just pazi-managed ones Co-Authored-By: Claude Opus 4.6 --- scripts/release-check.ts | 4 +++- src/infra/update-check.ts | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/release-check.ts b/scripts/release-check.ts index ea4b27c10e..75bdc53c36 100755 --- a/scripts/release-check.ts +++ b/scripts/release-check.ts @@ -264,7 +264,9 @@ function checkPluginVersions() { for (const item of mismatches) { console.error(` - ${item}`); } - console.error("release-check: run `pnpm plugins:sync` to align plugin versions."); + console.error( + "release-check: manually update the version in the mismatched extension's package.json to align.", + ); process.exit(1); } } diff --git a/src/infra/update-check.ts b/src/infra/update-check.ts index 3890ceb8c4..a8cb152e4e 100644 --- a/src/infra/update-check.ts +++ b/src/infra/update-check.ts @@ -355,6 +355,9 @@ export function compareSemverStrings(a: string | null, b: string | null): number if (pa.patch !== pb.patch) { return pa.patch < pb.patch ? -1 : 1; } + if (pa.subpatch !== pb.subpatch) { + return pa.subpatch < pb.subpatch ? -1 : 1; + } return comparePrerelease(pa.prerelease, pb.prerelease); } @@ -362,6 +365,7 @@ type ComparableSemver = { major: number; minor: number; patch: number; + subpatch: number; prerelease: string[] | null; }; @@ -370,13 +374,14 @@ function parseComparableSemver(version: string | null): ComparableSemver | null return null; } const normalized = normalizeLegacyDotBetaVersion(version.trim()); - const match = /^v?([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec( - normalized, - ); + const match = + /^v?([0-9]+)\.([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec( + normalized, + ); if (!match) { return null; } - const [, major, minor, patch, prereleaseRaw] = match; + const [, major, minor, patch, subpatch, prereleaseRaw] = match; if (!major || !minor || !patch) { return null; } @@ -384,6 +389,7 @@ function parseComparableSemver(version: string | null): ComparableSemver | null major: Number.parseInt(major, 10), minor: Number.parseInt(minor, 10), patch: Number.parseInt(patch, 10), + subpatch: subpatch ? Number.parseInt(subpatch, 10) : 0, prerelease: prereleaseRaw ? prereleaseRaw.split(".").filter(Boolean) : null, }; } From 001b9920f3e336163dfdca9d5433adf5c0a62524 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Fri, 13 Mar 2026 09:32:44 +0100 Subject: [PATCH 71/80] revert: remove unnecessary changes to core openclaw files Update check, release-check, and docker-release are upstream openclaw concerns. The pazi fork runs in Docker where the npm-based update mechanism is irrelevant, and pazi CI uses deploy-pazi-agent.yml only. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/docker-release.yml | 2 +- scripts/release-check.ts | 13 ++++--------- src/infra/update-check.ts | 14 ++++---------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index bc89ea2c90..1e57e24480 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -259,7 +259,7 @@ jobs: version="${GITHUB_REF#refs/tags/v}" tags+=("${IMAGE}:${version}") slim_tags+=("${IMAGE}:${version}-slim") - if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(-[0-9]+)?$ ]]; then + if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?$ ]]; then tags+=("${IMAGE}:latest") slim_tags+=("${IMAGE}:slim") fi diff --git a/scripts/release-check.ts b/scripts/release-check.ts index 75bdc53c36..fe2a9a1ea9 100755 --- a/scripts/release-check.ts +++ b/scripts/release-check.ts @@ -118,7 +118,7 @@ const laneFloorAdoptionDateKey = 20260227; function normalizePluginSyncVersion(version: string): string { const normalized = version.trim().replace(/^v/, ""); - const base = /^([0-9]+\.[0-9]+\.[0-9]+(?:\.[0-9]+)?)/.exec(normalized)?.[1]; + const base = /^([0-9]+\.[0-9]+\.[0-9]+)/.exec(normalized)?.[1]; if (base) { return base; } @@ -218,9 +218,6 @@ function runPackDry(): PackResult[] { return JSON.parse(raw) as PackResult[]; } -// Only the pazi extension must match root version; upstream extensions keep their own versions. -const paziManagedExtensions = new Set(["pazi"]); - function checkPluginVersions() { const rootPackagePath = resolve("package.json"); const rootPackage = JSON.parse(readFileSync(rootPackagePath, "utf8")) as PackageJson; @@ -233,8 +230,8 @@ function checkPluginVersions() { } const extensionsDir = resolve("extensions"); - const entries = readdirSync(extensionsDir, { withFileTypes: true }).filter( - (entry) => entry.isDirectory() && paziManagedExtensions.has(entry.name), + const entries = readdirSync(extensionsDir, { withFileTypes: true }).filter((entry) => + entry.isDirectory(), ); const mismatches: string[] = []; @@ -264,9 +261,7 @@ function checkPluginVersions() { for (const item of mismatches) { console.error(` - ${item}`); } - console.error( - "release-check: manually update the version in the mismatched extension's package.json to align.", - ); + console.error("release-check: run `pnpm plugins:sync` to align plugin versions."); process.exit(1); } } diff --git a/src/infra/update-check.ts b/src/infra/update-check.ts index a8cb152e4e..3890ceb8c4 100644 --- a/src/infra/update-check.ts +++ b/src/infra/update-check.ts @@ -355,9 +355,6 @@ export function compareSemverStrings(a: string | null, b: string | null): number if (pa.patch !== pb.patch) { return pa.patch < pb.patch ? -1 : 1; } - if (pa.subpatch !== pb.subpatch) { - return pa.subpatch < pb.subpatch ? -1 : 1; - } return comparePrerelease(pa.prerelease, pb.prerelease); } @@ -365,7 +362,6 @@ type ComparableSemver = { major: number; minor: number; patch: number; - subpatch: number; prerelease: string[] | null; }; @@ -374,14 +370,13 @@ function parseComparableSemver(version: string | null): ComparableSemver | null return null; } const normalized = normalizeLegacyDotBetaVersion(version.trim()); - const match = - /^v?([0-9]+)\.([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec( - normalized, - ); + const match = /^v?([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec( + normalized, + ); if (!match) { return null; } - const [, major, minor, patch, subpatch, prereleaseRaw] = match; + const [, major, minor, patch, prereleaseRaw] = match; if (!major || !minor || !patch) { return null; } @@ -389,7 +384,6 @@ function parseComparableSemver(version: string | null): ComparableSemver | null major: Number.parseInt(major, 10), minor: Number.parseInt(minor, 10), patch: Number.parseInt(patch, 10), - subpatch: subpatch ? Number.parseInt(subpatch, 10) : 0, prerelease: prereleaseRaw ? prereleaseRaw.split(".").filter(Boolean) : null, }; } From 493d7e62d64ecf2757c1d949e4f0b8006b4dc8d6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Mar 2026 09:03:14 +0000 Subject: [PATCH 72/80] chore: release 2026.3.13 [skip ci] --- package.json | 936 +++++++++++++++++++++++++-------------------------- 1 file changed, 468 insertions(+), 468 deletions(-) diff --git a/package.json b/package.json index a3cfeb8d4a..19fc9347c3 100644 --- a/package.json +++ b/package.json @@ -1,470 +1,470 @@ { - "name": "openclaw", - "version": "2026.3.12", - "description": "Multi-channel AI gateway with extensible messaging integrations", - "keywords": [], - "homepage": "https://github.com/openclaw/openclaw#readme", - "bugs": { - "url": "https://github.com/openclaw/openclaw/issues" - }, - "license": "MIT", - "author": "", - "repository": { - "type": "git", - "url": "git+https://github.com/openclaw/openclaw.git" - }, - "bin": { - "openclaw": "openclaw.mjs" - }, - "directories": { - "doc": "docs", - "test": "test" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "openclaw.mjs", - "README-header.png", - "README.md", - "assets/", - "dist/", - "docs/", - "extensions/", - "skills/" - ], - "type": "module", - "main": "dist/index.js", - "exports": { - ".": "./dist/index.js", - "./plugin-sdk": { - "types": "./dist/plugin-sdk/index.d.ts", - "default": "./dist/plugin-sdk/index.js" - }, - "./plugin-sdk/core": { - "types": "./dist/plugin-sdk/core.d.ts", - "default": "./dist/plugin-sdk/core.js" - }, - "./plugin-sdk/compat": { - "types": "./dist/plugin-sdk/compat.d.ts", - "default": "./dist/plugin-sdk/compat.js" - }, - "./plugin-sdk/telegram": { - "types": "./dist/plugin-sdk/telegram.d.ts", - "default": "./dist/plugin-sdk/telegram.js" - }, - "./plugin-sdk/discord": { - "types": "./dist/plugin-sdk/discord.d.ts", - "default": "./dist/plugin-sdk/discord.js" - }, - "./plugin-sdk/slack": { - "types": "./dist/plugin-sdk/slack.d.ts", - "default": "./dist/plugin-sdk/slack.js" - }, - "./plugin-sdk/signal": { - "types": "./dist/plugin-sdk/signal.d.ts", - "default": "./dist/plugin-sdk/signal.js" - }, - "./plugin-sdk/imessage": { - "types": "./dist/plugin-sdk/imessage.d.ts", - "default": "./dist/plugin-sdk/imessage.js" - }, - "./plugin-sdk/whatsapp": { - "types": "./dist/plugin-sdk/whatsapp.d.ts", - "default": "./dist/plugin-sdk/whatsapp.js" - }, - "./plugin-sdk/line": { - "types": "./dist/plugin-sdk/line.d.ts", - "default": "./dist/plugin-sdk/line.js" - }, - "./plugin-sdk/msteams": { - "types": "./dist/plugin-sdk/msteams.d.ts", - "default": "./dist/plugin-sdk/msteams.js" - }, - "./plugin-sdk/acpx": { - "types": "./dist/plugin-sdk/acpx.d.ts", - "default": "./dist/plugin-sdk/acpx.js" - }, - "./plugin-sdk/bluebubbles": { - "types": "./dist/plugin-sdk/bluebubbles.d.ts", - "default": "./dist/plugin-sdk/bluebubbles.js" - }, - "./plugin-sdk/copilot-proxy": { - "types": "./dist/plugin-sdk/copilot-proxy.d.ts", - "default": "./dist/plugin-sdk/copilot-proxy.js" - }, - "./plugin-sdk/device-pair": { - "types": "./dist/plugin-sdk/device-pair.d.ts", - "default": "./dist/plugin-sdk/device-pair.js" - }, - "./plugin-sdk/diagnostics-otel": { - "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", - "default": "./dist/plugin-sdk/diagnostics-otel.js" - }, - "./plugin-sdk/diffs": { - "types": "./dist/plugin-sdk/diffs.d.ts", - "default": "./dist/plugin-sdk/diffs.js" - }, - "./plugin-sdk/feishu": { - "types": "./dist/plugin-sdk/feishu.d.ts", - "default": "./dist/plugin-sdk/feishu.js" - }, - "./plugin-sdk/google-gemini-cli-auth": { - "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", - "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" - }, - "./plugin-sdk/googlechat": { - "types": "./dist/plugin-sdk/googlechat.d.ts", - "default": "./dist/plugin-sdk/googlechat.js" - }, - "./plugin-sdk/irc": { - "types": "./dist/plugin-sdk/irc.d.ts", - "default": "./dist/plugin-sdk/irc.js" - }, - "./plugin-sdk/llm-task": { - "types": "./dist/plugin-sdk/llm-task.d.ts", - "default": "./dist/plugin-sdk/llm-task.js" - }, - "./plugin-sdk/lobster": { - "types": "./dist/plugin-sdk/lobster.d.ts", - "default": "./dist/plugin-sdk/lobster.js" - }, - "./plugin-sdk/matrix": { - "types": "./dist/plugin-sdk/matrix.d.ts", - "default": "./dist/plugin-sdk/matrix.js" - }, - "./plugin-sdk/mattermost": { - "types": "./dist/plugin-sdk/mattermost.d.ts", - "default": "./dist/plugin-sdk/mattermost.js" - }, - "./plugin-sdk/memory-core": { - "types": "./dist/plugin-sdk/memory-core.d.ts", - "default": "./dist/plugin-sdk/memory-core.js" - }, - "./plugin-sdk/memory-lancedb": { - "types": "./dist/plugin-sdk/memory-lancedb.d.ts", - "default": "./dist/plugin-sdk/memory-lancedb.js" - }, - "./plugin-sdk/minimax-portal-auth": { - "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", - "default": "./dist/plugin-sdk/minimax-portal-auth.js" - }, - "./plugin-sdk/nextcloud-talk": { - "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", - "default": "./dist/plugin-sdk/nextcloud-talk.js" - }, - "./plugin-sdk/nostr": { - "types": "./dist/plugin-sdk/nostr.d.ts", - "default": "./dist/plugin-sdk/nostr.js" - }, - "./plugin-sdk/open-prose": { - "types": "./dist/plugin-sdk/open-prose.d.ts", - "default": "./dist/plugin-sdk/open-prose.js" - }, - "./plugin-sdk/phone-control": { - "types": "./dist/plugin-sdk/phone-control.d.ts", - "default": "./dist/plugin-sdk/phone-control.js" - }, - "./plugin-sdk/qwen-portal-auth": { - "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", - "default": "./dist/plugin-sdk/qwen-portal-auth.js" - }, - "./plugin-sdk/synology-chat": { - "types": "./dist/plugin-sdk/synology-chat.d.ts", - "default": "./dist/plugin-sdk/synology-chat.js" - }, - "./plugin-sdk/talk-voice": { - "types": "./dist/plugin-sdk/talk-voice.d.ts", - "default": "./dist/plugin-sdk/talk-voice.js" - }, - "./plugin-sdk/test-utils": { - "types": "./dist/plugin-sdk/test-utils.d.ts", - "default": "./dist/plugin-sdk/test-utils.js" - }, - "./plugin-sdk/thread-ownership": { - "types": "./dist/plugin-sdk/thread-ownership.d.ts", - "default": "./dist/plugin-sdk/thread-ownership.js" - }, - "./plugin-sdk/tlon": { - "types": "./dist/plugin-sdk/tlon.d.ts", - "default": "./dist/plugin-sdk/tlon.js" - }, - "./plugin-sdk/twitch": { - "types": "./dist/plugin-sdk/twitch.d.ts", - "default": "./dist/plugin-sdk/twitch.js" - }, - "./plugin-sdk/voice-call": { - "types": "./dist/plugin-sdk/voice-call.d.ts", - "default": "./dist/plugin-sdk/voice-call.js" - }, - "./plugin-sdk/zalo": { - "types": "./dist/plugin-sdk/zalo.d.ts", - "default": "./dist/plugin-sdk/zalo.js" - }, - "./plugin-sdk/zalouser": { - "types": "./dist/plugin-sdk/zalouser.d.ts", - "default": "./dist/plugin-sdk/zalouser.js" - }, - "./plugin-sdk/account-id": { - "types": "./dist/plugin-sdk/account-id.d.ts", - "default": "./dist/plugin-sdk/account-id.js" - }, - "./plugin-sdk/keyed-async-queue": { - "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", - "default": "./dist/plugin-sdk/keyed-async-queue.js" - }, - "./cli-entry": "./openclaw.mjs" - }, - "scripts": { - "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", - "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", - "android:install": "cd apps/android && ./gradlew :app:installDebug", - "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", - "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", - "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", - "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", - "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", - "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", - "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", - "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", - "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", - "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", - "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", - "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", - "deadcode:ci": "pnpm deadcode:report:ci:knip", - "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", - "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", - "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", - "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", - "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", - "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", - "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", - "dev": "node scripts/run-node.mjs", - "docs:bin": "node scripts/build-docs-list.mjs", - "docs:check-links": "node scripts/docs-link-audit.mjs", - "docs:dev": "cd docs && mint dev", - "docs:list": "node scripts/docs-list.js", - "docs:spellcheck": "bash scripts/docs-spellcheck.sh", - "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", - "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", - "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", - "format": "oxfmt --write", - "format:all": "pnpm format && pnpm format:swift", - "format:check": "oxfmt --check", - "format:diff": "oxfmt --write && git --no-pager diff", - "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", - "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", - "format:fix": "oxfmt --write", - "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", - "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", - "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", - "gateway:watch": "node scripts/watch-node.mjs gateway --force", - "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", - "ghsa:patch": "node scripts/ghsa-patch.mjs", - "ios:beta": "bash scripts/ios-beta-release.sh", - "ios:beta:archive": "bash scripts/ios-beta-archive.sh", - "ios:beta:prepare": "bash scripts/ios-beta-prepare.sh", - "ios:build": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", - "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate'", - "ios:open": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", - "ios:run": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware", - "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", - "lint:all": "pnpm lint && pnpm lint:swift", - "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", - "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", - "lint:docs": "pnpm dlx markdownlint-cli2", - "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", - "lint:fix": "oxlint --type-aware --fix && pnpm format", - "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", - "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", - "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", - "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", - "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", - "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", - "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", - "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", - "mac:open": "open dist/OpenClaw.app", - "mac:package": "bash scripts/package-mac-app.sh", - "mac:restart": "bash scripts/restart-mac.sh", - "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "openclaw": "node scripts/run-node.mjs", - "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", - "prepack": "pnpm build && pnpm ui:build", - "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", - "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift", - "protocol:gen": "node --import tsx scripts/protocol-gen.ts", - "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", - "release:check": "node --import tsx scripts/release-check.ts", - "release:openclaw:npm:check": "node --import tsx scripts/openclaw-npm-release-check.ts", - "start": "node scripts/run-node.mjs", - "test": "node scripts/test-parallel.mjs", - "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", - "test:auth:compat": "vitest run --config vitest.gateway.config.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/client.test.ts src/gateway/reconnect-gating.test.ts src/gateway/protocol/connect-error-details.test.ts", - "test:channels": "vitest run --config vitest.channels.config.ts", - "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", - "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", - "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", - "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", - "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", - "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", - "test:docker:live-models": "bash scripts/test-live-models-docker.sh", - "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", - "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", - "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", - "test:e2e": "vitest run --config vitest.e2e.config.ts", - "test:extensions": "vitest run --config vitest.extensions.config.ts", - "test:fast": "vitest run --config vitest.unit.config.ts", - "test:force": "node --import tsx scripts/test-force.ts", - "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", - "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", - "test:install:smoke": "bash scripts/test-install-sh-docker.sh", - "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", - "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", - "test:perf:budget": "node scripts/test-perf-budget.mjs", - "test:perf:hotspots": "node scripts/test-hotspots.mjs", - "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", - "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", - "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", - "test:watch": "vitest", - "tui": "node scripts/run-node.mjs tui", - "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", - "ui:build": "node scripts/ui.js build", - "ui:dev": "node scripts/ui.js dev", - "ui:install": "node scripts/ui.js install" - }, - "dependencies": { - "@agentclientprotocol/sdk": "0.16.1", - "@aws-sdk/client-bedrock": "^3.1008.0", - "@buape/carbon": "0.0.0-beta-20260216184201", - "@clack/prompts": "^1.1.0", - "@discordjs/voice": "^0.19.1", - "@grammyjs/runner": "^2.0.3", - "@grammyjs/transformer-throttler": "^1.2.1", - "@homebridge/ciao": "^1.3.5", - "@larksuiteoapi/node-sdk": "^1.59.0", - "@line/bot-sdk": "^10.6.0", - "@lydell/node-pty": "1.2.0-beta.3", - "@mariozechner/pi-agent-core": "0.57.1", - "@mariozechner/pi-ai": "0.57.1", - "@mariozechner/pi-coding-agent": "0.57.1", - "@mariozechner/pi-tui": "0.57.1", - "@mozilla/readability": "^0.6.0", - "@sinclair/typebox": "0.34.48", - "@slack/bolt": "^4.6.0", - "@slack/web-api": "^7.14.1", - "@whiskeysockets/baileys": "7.0.0-rc.9", - "ajv": "^8.18.0", - "chalk": "^5.6.2", - "chokidar": "^5.0.0", - "cli-highlight": "^2.1.11", - "commander": "^14.0.3", - "croner": "^10.0.1", - "discord-api-types": "^0.38.42", - "dotenv": "^17.3.1", - "express": "^5.2.1", - "file-type": "^21.3.1", - "grammy": "^1.41.1", - "hono": "4.12.7", - "https-proxy-agent": "^8.0.0", - "ipaddr.js": "^2.3.0", - "jiti": "^2.6.1", - "json5": "^2.2.3", - "jszip": "^3.10.1", - "linkedom": "^0.18.12", - "long": "^5.3.2", - "markdown-it": "^14.1.1", - "node-edge-tts": "^1.2.10", - "opusscript": "^0.1.1", - "osc-progress": "^0.3.0", - "pdfjs-dist": "^5.5.207", - "playwright-core": "1.58.2", - "qrcode-terminal": "^0.12.0", - "sharp": "^0.34.5", - "sqlite-vec": "0.1.7-alpha.2", - "tar": "7.5.11", - "tslog": "^4.10.2", - "undici": "^7.24.0", - "ws": "^8.19.0", - "yaml": "^2.8.2", - "zod": "^4.3.6" - }, - "devDependencies": { - "@grammyjs/types": "^3.25.0", - "@lit-labs/signals": "^0.2.0", - "@lit/context": "^1.1.6", - "@types/express": "^5.0.6", - "@types/markdown-it": "^14.1.2", - "@types/node": "^25.5.0", - "@types/qrcode-terminal": "^0.12.2", - "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260312.1", - "@vitest/coverage-v8": "^4.1.0", - "jscpd": "4.0.8", - "jsdom": "^28.1.0", - "lit": "^3.3.2", - "oxfmt": "0.40.0", - "oxlint": "^1.55.0", - "oxlint-tsgolint": "^0.16.0", - "signal-utils": "0.21.1", - "tsdown": "0.21.2", - "tsx": "^4.21.0", - "typescript": "^5.9.3", - "vitest": "^4.1.0" - }, - "peerDependencies": { - "@napi-rs/canvas": "^0.1.89", - "node-llama-cpp": "3.16.2" - }, - "peerDependenciesMeta": { - "node-llama-cpp": { - "optional": true - } - }, - "engines": { - "node": ">=22.16.0" - }, - "packageManager": "pnpm@10.23.0", - "pnpm": { - "minimumReleaseAge": 2880, - "overrides": { - "hono": "4.12.7", - "@hono/node-server": "1.19.10", - "fast-xml-parser": "5.3.8", - "request": "npm:@cypress/request@3.0.10", - "request-promise": "npm:@cypress/request-promise@5.0.0", - "file-type": "21.3.1", - "form-data": "2.5.4", - "minimatch": "10.2.4", - "qs": "6.14.2", - "node-domexception": "npm:@nolyfill/domexception@^1.0.28", - "@sinclair/typebox": "0.34.48", - "tar": "7.5.11", - "tough-cookie": "4.1.3" - }, - "onlyBuiltDependencies": [ - "@lydell/node-pty", - "@matrix-org/matrix-sdk-crypto-nodejs", - "@napi-rs/canvas", - "@tloncorp/api", - "@whiskeysockets/baileys", - "authenticate-pam", - "esbuild", - "koffi", - "node-llama-cpp", - "protobufjs", - "sharp" - ], - "packageExtensions": { - "@mariozechner/pi-coding-agent": { - "dependencies": { - "strip-ansi": "^7.2.0" - } - } - } - } + "name": "openclaw", + "version": "2026.3.13", + "description": "Multi-channel AI gateway with extensible messaging integrations", + "keywords": [], + "homepage": "https://github.com/openclaw/openclaw#readme", + "bugs": { + "url": "https://github.com/openclaw/openclaw/issues" + }, + "license": "MIT", + "author": "", + "repository": { + "type": "git", + "url": "git+https://github.com/openclaw/openclaw.git" + }, + "bin": { + "openclaw": "openclaw.mjs" + }, + "directories": { + "doc": "docs", + "test": "test" + }, + "files": [ + "CHANGELOG.md", + "LICENSE", + "openclaw.mjs", + "README-header.png", + "README.md", + "assets/", + "dist/", + "docs/", + "extensions/", + "skills/" + ], + "type": "module", + "main": "dist/index.js", + "exports": { + ".": "./dist/index.js", + "./plugin-sdk": { + "types": "./dist/plugin-sdk/index.d.ts", + "default": "./dist/plugin-sdk/index.js" + }, + "./plugin-sdk/core": { + "types": "./dist/plugin-sdk/core.d.ts", + "default": "./dist/plugin-sdk/core.js" + }, + "./plugin-sdk/compat": { + "types": "./dist/plugin-sdk/compat.d.ts", + "default": "./dist/plugin-sdk/compat.js" + }, + "./plugin-sdk/telegram": { + "types": "./dist/plugin-sdk/telegram.d.ts", + "default": "./dist/plugin-sdk/telegram.js" + }, + "./plugin-sdk/discord": { + "types": "./dist/plugin-sdk/discord.d.ts", + "default": "./dist/plugin-sdk/discord.js" + }, + "./plugin-sdk/slack": { + "types": "./dist/plugin-sdk/slack.d.ts", + "default": "./dist/plugin-sdk/slack.js" + }, + "./plugin-sdk/signal": { + "types": "./dist/plugin-sdk/signal.d.ts", + "default": "./dist/plugin-sdk/signal.js" + }, + "./plugin-sdk/imessage": { + "types": "./dist/plugin-sdk/imessage.d.ts", + "default": "./dist/plugin-sdk/imessage.js" + }, + "./plugin-sdk/whatsapp": { + "types": "./dist/plugin-sdk/whatsapp.d.ts", + "default": "./dist/plugin-sdk/whatsapp.js" + }, + "./plugin-sdk/line": { + "types": "./dist/plugin-sdk/line.d.ts", + "default": "./dist/plugin-sdk/line.js" + }, + "./plugin-sdk/msteams": { + "types": "./dist/plugin-sdk/msteams.d.ts", + "default": "./dist/plugin-sdk/msteams.js" + }, + "./plugin-sdk/acpx": { + "types": "./dist/plugin-sdk/acpx.d.ts", + "default": "./dist/plugin-sdk/acpx.js" + }, + "./plugin-sdk/bluebubbles": { + "types": "./dist/plugin-sdk/bluebubbles.d.ts", + "default": "./dist/plugin-sdk/bluebubbles.js" + }, + "./plugin-sdk/copilot-proxy": { + "types": "./dist/plugin-sdk/copilot-proxy.d.ts", + "default": "./dist/plugin-sdk/copilot-proxy.js" + }, + "./plugin-sdk/device-pair": { + "types": "./dist/plugin-sdk/device-pair.d.ts", + "default": "./dist/plugin-sdk/device-pair.js" + }, + "./plugin-sdk/diagnostics-otel": { + "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", + "default": "./dist/plugin-sdk/diagnostics-otel.js" + }, + "./plugin-sdk/diffs": { + "types": "./dist/plugin-sdk/diffs.d.ts", + "default": "./dist/plugin-sdk/diffs.js" + }, + "./plugin-sdk/feishu": { + "types": "./dist/plugin-sdk/feishu.d.ts", + "default": "./dist/plugin-sdk/feishu.js" + }, + "./plugin-sdk/google-gemini-cli-auth": { + "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", + "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" + }, + "./plugin-sdk/googlechat": { + "types": "./dist/plugin-sdk/googlechat.d.ts", + "default": "./dist/plugin-sdk/googlechat.js" + }, + "./plugin-sdk/irc": { + "types": "./dist/plugin-sdk/irc.d.ts", + "default": "./dist/plugin-sdk/irc.js" + }, + "./plugin-sdk/llm-task": { + "types": "./dist/plugin-sdk/llm-task.d.ts", + "default": "./dist/plugin-sdk/llm-task.js" + }, + "./plugin-sdk/lobster": { + "types": "./dist/plugin-sdk/lobster.d.ts", + "default": "./dist/plugin-sdk/lobster.js" + }, + "./plugin-sdk/matrix": { + "types": "./dist/plugin-sdk/matrix.d.ts", + "default": "./dist/plugin-sdk/matrix.js" + }, + "./plugin-sdk/mattermost": { + "types": "./dist/plugin-sdk/mattermost.d.ts", + "default": "./dist/plugin-sdk/mattermost.js" + }, + "./plugin-sdk/memory-core": { + "types": "./dist/plugin-sdk/memory-core.d.ts", + "default": "./dist/plugin-sdk/memory-core.js" + }, + "./plugin-sdk/memory-lancedb": { + "types": "./dist/plugin-sdk/memory-lancedb.d.ts", + "default": "./dist/plugin-sdk/memory-lancedb.js" + }, + "./plugin-sdk/minimax-portal-auth": { + "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", + "default": "./dist/plugin-sdk/minimax-portal-auth.js" + }, + "./plugin-sdk/nextcloud-talk": { + "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", + "default": "./dist/plugin-sdk/nextcloud-talk.js" + }, + "./plugin-sdk/nostr": { + "types": "./dist/plugin-sdk/nostr.d.ts", + "default": "./dist/plugin-sdk/nostr.js" + }, + "./plugin-sdk/open-prose": { + "types": "./dist/plugin-sdk/open-prose.d.ts", + "default": "./dist/plugin-sdk/open-prose.js" + }, + "./plugin-sdk/phone-control": { + "types": "./dist/plugin-sdk/phone-control.d.ts", + "default": "./dist/plugin-sdk/phone-control.js" + }, + "./plugin-sdk/qwen-portal-auth": { + "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", + "default": "./dist/plugin-sdk/qwen-portal-auth.js" + }, + "./plugin-sdk/synology-chat": { + "types": "./dist/plugin-sdk/synology-chat.d.ts", + "default": "./dist/plugin-sdk/synology-chat.js" + }, + "./plugin-sdk/talk-voice": { + "types": "./dist/plugin-sdk/talk-voice.d.ts", + "default": "./dist/plugin-sdk/talk-voice.js" + }, + "./plugin-sdk/test-utils": { + "types": "./dist/plugin-sdk/test-utils.d.ts", + "default": "./dist/plugin-sdk/test-utils.js" + }, + "./plugin-sdk/thread-ownership": { + "types": "./dist/plugin-sdk/thread-ownership.d.ts", + "default": "./dist/plugin-sdk/thread-ownership.js" + }, + "./plugin-sdk/tlon": { + "types": "./dist/plugin-sdk/tlon.d.ts", + "default": "./dist/plugin-sdk/tlon.js" + }, + "./plugin-sdk/twitch": { + "types": "./dist/plugin-sdk/twitch.d.ts", + "default": "./dist/plugin-sdk/twitch.js" + }, + "./plugin-sdk/voice-call": { + "types": "./dist/plugin-sdk/voice-call.d.ts", + "default": "./dist/plugin-sdk/voice-call.js" + }, + "./plugin-sdk/zalo": { + "types": "./dist/plugin-sdk/zalo.d.ts", + "default": "./dist/plugin-sdk/zalo.js" + }, + "./plugin-sdk/zalouser": { + "types": "./dist/plugin-sdk/zalouser.d.ts", + "default": "./dist/plugin-sdk/zalouser.js" + }, + "./plugin-sdk/account-id": { + "types": "./dist/plugin-sdk/account-id.d.ts", + "default": "./dist/plugin-sdk/account-id.js" + }, + "./plugin-sdk/keyed-async-queue": { + "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", + "default": "./dist/plugin-sdk/keyed-async-queue.js" + }, + "./cli-entry": "./openclaw.mjs" + }, + "scripts": { + "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", + "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", + "android:install": "cd apps/android && ./gradlew :app:installDebug", + "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", + "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", + "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", + "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", + "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", + "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", + "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", + "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", + "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", + "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", + "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", + "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", + "deadcode:ci": "pnpm deadcode:report:ci:knip", + "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", + "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", + "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", + "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", + "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", + "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", + "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", + "dev": "node scripts/run-node.mjs", + "docs:bin": "node scripts/build-docs-list.mjs", + "docs:check-links": "node scripts/docs-link-audit.mjs", + "docs:dev": "cd docs && mint dev", + "docs:list": "node scripts/docs-list.js", + "docs:spellcheck": "bash scripts/docs-spellcheck.sh", + "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", + "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", + "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", + "format": "oxfmt --write", + "format:all": "pnpm format && pnpm format:swift", + "format:check": "oxfmt --check", + "format:diff": "oxfmt --write && git --no-pager diff", + "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", + "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", + "format:fix": "oxfmt --write", + "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", + "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", + "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", + "gateway:watch": "node scripts/watch-node.mjs gateway --force", + "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", + "ghsa:patch": "node scripts/ghsa-patch.mjs", + "ios:beta": "bash scripts/ios-beta-release.sh", + "ios:beta:archive": "bash scripts/ios-beta-archive.sh", + "ios:beta:prepare": "bash scripts/ios-beta-prepare.sh", + "ios:build": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", + "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate'", + "ios:open": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", + "ios:run": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", + "lint": "oxlint --type-aware", + "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", + "lint:all": "pnpm lint && pnpm lint:swift", + "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", + "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", + "lint:docs": "pnpm dlx markdownlint-cli2", + "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", + "lint:fix": "oxlint --type-aware --fix && pnpm format", + "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", + "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", + "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", + "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", + "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", + "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", + "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", + "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", + "mac:open": "open dist/OpenClaw.app", + "mac:package": "bash scripts/package-mac-app.sh", + "mac:restart": "bash scripts/restart-mac.sh", + "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "openclaw": "node scripts/run-node.mjs", + "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", + "prepack": "pnpm build && pnpm ui:build", + "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", + "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift", + "protocol:gen": "node --import tsx scripts/protocol-gen.ts", + "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", + "release:check": "node --import tsx scripts/release-check.ts", + "release:openclaw:npm:check": "node --import tsx scripts/openclaw-npm-release-check.ts", + "start": "node scripts/run-node.mjs", + "test": "node scripts/test-parallel.mjs", + "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", + "test:auth:compat": "vitest run --config vitest.gateway.config.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/client.test.ts src/gateway/reconnect-gating.test.ts src/gateway/protocol/connect-error-details.test.ts", + "test:channels": "vitest run --config vitest.channels.config.ts", + "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", + "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", + "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", + "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", + "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", + "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", + "test:docker:live-models": "bash scripts/test-live-models-docker.sh", + "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", + "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", + "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", + "test:e2e": "vitest run --config vitest.e2e.config.ts", + "test:extensions": "vitest run --config vitest.extensions.config.ts", + "test:fast": "vitest run --config vitest.unit.config.ts", + "test:force": "node --import tsx scripts/test-force.ts", + "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", + "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", + "test:install:smoke": "bash scripts/test-install-sh-docker.sh", + "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", + "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", + "test:perf:budget": "node scripts/test-perf-budget.mjs", + "test:perf:hotspots": "node scripts/test-hotspots.mjs", + "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", + "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", + "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", + "test:watch": "vitest", + "tui": "node scripts/run-node.mjs tui", + "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", + "ui:build": "node scripts/ui.js build", + "ui:dev": "node scripts/ui.js dev", + "ui:install": "node scripts/ui.js install" + }, + "dependencies": { + "@agentclientprotocol/sdk": "0.16.1", + "@aws-sdk/client-bedrock": "^3.1008.0", + "@buape/carbon": "0.0.0-beta-20260216184201", + "@clack/prompts": "^1.1.0", + "@discordjs/voice": "^0.19.1", + "@grammyjs/runner": "^2.0.3", + "@grammyjs/transformer-throttler": "^1.2.1", + "@homebridge/ciao": "^1.3.5", + "@larksuiteoapi/node-sdk": "^1.59.0", + "@line/bot-sdk": "^10.6.0", + "@lydell/node-pty": "1.2.0-beta.3", + "@mariozechner/pi-agent-core": "0.57.1", + "@mariozechner/pi-ai": "0.57.1", + "@mariozechner/pi-coding-agent": "0.57.1", + "@mariozechner/pi-tui": "0.57.1", + "@mozilla/readability": "^0.6.0", + "@sinclair/typebox": "0.34.48", + "@slack/bolt": "^4.6.0", + "@slack/web-api": "^7.14.1", + "@whiskeysockets/baileys": "7.0.0-rc.9", + "ajv": "^8.18.0", + "chalk": "^5.6.2", + "chokidar": "^5.0.0", + "cli-highlight": "^2.1.11", + "commander": "^14.0.3", + "croner": "^10.0.1", + "discord-api-types": "^0.38.42", + "dotenv": "^17.3.1", + "express": "^5.2.1", + "file-type": "^21.3.1", + "grammy": "^1.41.1", + "hono": "4.12.7", + "https-proxy-agent": "^8.0.0", + "ipaddr.js": "^2.3.0", + "jiti": "^2.6.1", + "json5": "^2.2.3", + "jszip": "^3.10.1", + "linkedom": "^0.18.12", + "long": "^5.3.2", + "markdown-it": "^14.1.1", + "node-edge-tts": "^1.2.10", + "opusscript": "^0.1.1", + "osc-progress": "^0.3.0", + "pdfjs-dist": "^5.5.207", + "playwright-core": "1.58.2", + "qrcode-terminal": "^0.12.0", + "sharp": "^0.34.5", + "sqlite-vec": "0.1.7-alpha.2", + "tar": "7.5.11", + "tslog": "^4.10.2", + "undici": "^7.24.0", + "ws": "^8.19.0", + "yaml": "^2.8.2", + "zod": "^4.3.6" + }, + "devDependencies": { + "@grammyjs/types": "^3.25.0", + "@lit-labs/signals": "^0.2.0", + "@lit/context": "^1.1.6", + "@types/express": "^5.0.6", + "@types/markdown-it": "^14.1.2", + "@types/node": "^25.5.0", + "@types/qrcode-terminal": "^0.12.2", + "@types/ws": "^8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260312.1", + "@vitest/coverage-v8": "^4.1.0", + "jscpd": "4.0.8", + "jsdom": "^28.1.0", + "lit": "^3.3.2", + "oxfmt": "0.40.0", + "oxlint": "^1.55.0", + "oxlint-tsgolint": "^0.16.0", + "signal-utils": "0.21.1", + "tsdown": "0.21.2", + "tsx": "^4.21.0", + "typescript": "^5.9.3", + "vitest": "^4.1.0" + }, + "peerDependencies": { + "@napi-rs/canvas": "^0.1.89", + "node-llama-cpp": "3.16.2" + }, + "peerDependenciesMeta": { + "node-llama-cpp": { + "optional": true + } + }, + "engines": { + "node": ">=22.16.0" + }, + "packageManager": "pnpm@10.23.0", + "pnpm": { + "minimumReleaseAge": 2880, + "overrides": { + "hono": "4.12.7", + "@hono/node-server": "1.19.10", + "fast-xml-parser": "5.3.8", + "request": "npm:@cypress/request@3.0.10", + "request-promise": "npm:@cypress/request-promise@5.0.0", + "file-type": "21.3.1", + "form-data": "2.5.4", + "minimatch": "10.2.4", + "qs": "6.14.2", + "node-domexception": "npm:@nolyfill/domexception@^1.0.28", + "@sinclair/typebox": "0.34.48", + "tar": "7.5.11", + "tough-cookie": "4.1.3" + }, + "onlyBuiltDependencies": [ + "@lydell/node-pty", + "@matrix-org/matrix-sdk-crypto-nodejs", + "@napi-rs/canvas", + "@tloncorp/api", + "@whiskeysockets/baileys", + "authenticate-pam", + "esbuild", + "koffi", + "node-llama-cpp", + "protobufjs", + "sharp" + ], + "packageExtensions": { + "@mariozechner/pi-coding-agent": { + "dependencies": { + "strip-ansi": "^7.2.0" + } + } + } + } } From ac0ad063bebdd6366cf4ac27a8c98cc658791484 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Mar 2026 09:41:06 +0000 Subject: [PATCH 73/80] chore: release 2026.3.12.2 [skip ci] --- extensions/pazi/package.json | 2 +- package.json | 936 +++++++++++++++++------------------ 2 files changed, 469 insertions(+), 469 deletions(-) diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json index 9a0a4fa05c..57554d31d1 100644 --- a/extensions/pazi/package.json +++ b/extensions/pazi/package.json @@ -1,6 +1,6 @@ { "name": "@openclaw/pazi", - "version": "2026.3.12.1", + "version": "2026.3.12.2", "private": true, "description": "OpenClaw Pazi proxy", "type": "module", diff --git a/package.json b/package.json index dd8f0a7383..57e3cb1885 100644 --- a/package.json +++ b/package.json @@ -1,470 +1,470 @@ { - "name": "openclaw", - "version": "2026.3.12.1", - "description": "Multi-channel AI gateway with extensible messaging integrations", - "keywords": [], - "homepage": "https://github.com/openclaw/openclaw#readme", - "bugs": { - "url": "https://github.com/openclaw/openclaw/issues" - }, - "license": "MIT", - "author": "", - "repository": { - "type": "git", - "url": "git+https://github.com/openclaw/openclaw.git" - }, - "bin": { - "openclaw": "openclaw.mjs" - }, - "directories": { - "doc": "docs", - "test": "test" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "openclaw.mjs", - "README-header.png", - "README.md", - "assets/", - "dist/", - "docs/", - "extensions/", - "skills/" - ], - "type": "module", - "main": "dist/index.js", - "exports": { - ".": "./dist/index.js", - "./plugin-sdk": { - "types": "./dist/plugin-sdk/index.d.ts", - "default": "./dist/plugin-sdk/index.js" - }, - "./plugin-sdk/core": { - "types": "./dist/plugin-sdk/core.d.ts", - "default": "./dist/plugin-sdk/core.js" - }, - "./plugin-sdk/compat": { - "types": "./dist/plugin-sdk/compat.d.ts", - "default": "./dist/plugin-sdk/compat.js" - }, - "./plugin-sdk/telegram": { - "types": "./dist/plugin-sdk/telegram.d.ts", - "default": "./dist/plugin-sdk/telegram.js" - }, - "./plugin-sdk/discord": { - "types": "./dist/plugin-sdk/discord.d.ts", - "default": "./dist/plugin-sdk/discord.js" - }, - "./plugin-sdk/slack": { - "types": "./dist/plugin-sdk/slack.d.ts", - "default": "./dist/plugin-sdk/slack.js" - }, - "./plugin-sdk/signal": { - "types": "./dist/plugin-sdk/signal.d.ts", - "default": "./dist/plugin-sdk/signal.js" - }, - "./plugin-sdk/imessage": { - "types": "./dist/plugin-sdk/imessage.d.ts", - "default": "./dist/plugin-sdk/imessage.js" - }, - "./plugin-sdk/whatsapp": { - "types": "./dist/plugin-sdk/whatsapp.d.ts", - "default": "./dist/plugin-sdk/whatsapp.js" - }, - "./plugin-sdk/line": { - "types": "./dist/plugin-sdk/line.d.ts", - "default": "./dist/plugin-sdk/line.js" - }, - "./plugin-sdk/msteams": { - "types": "./dist/plugin-sdk/msteams.d.ts", - "default": "./dist/plugin-sdk/msteams.js" - }, - "./plugin-sdk/acpx": { - "types": "./dist/plugin-sdk/acpx.d.ts", - "default": "./dist/plugin-sdk/acpx.js" - }, - "./plugin-sdk/bluebubbles": { - "types": "./dist/plugin-sdk/bluebubbles.d.ts", - "default": "./dist/plugin-sdk/bluebubbles.js" - }, - "./plugin-sdk/copilot-proxy": { - "types": "./dist/plugin-sdk/copilot-proxy.d.ts", - "default": "./dist/plugin-sdk/copilot-proxy.js" - }, - "./plugin-sdk/device-pair": { - "types": "./dist/plugin-sdk/device-pair.d.ts", - "default": "./dist/plugin-sdk/device-pair.js" - }, - "./plugin-sdk/diagnostics-otel": { - "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", - "default": "./dist/plugin-sdk/diagnostics-otel.js" - }, - "./plugin-sdk/diffs": { - "types": "./dist/plugin-sdk/diffs.d.ts", - "default": "./dist/plugin-sdk/diffs.js" - }, - "./plugin-sdk/feishu": { - "types": "./dist/plugin-sdk/feishu.d.ts", - "default": "./dist/plugin-sdk/feishu.js" - }, - "./plugin-sdk/google-gemini-cli-auth": { - "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", - "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" - }, - "./plugin-sdk/googlechat": { - "types": "./dist/plugin-sdk/googlechat.d.ts", - "default": "./dist/plugin-sdk/googlechat.js" - }, - "./plugin-sdk/irc": { - "types": "./dist/plugin-sdk/irc.d.ts", - "default": "./dist/plugin-sdk/irc.js" - }, - "./plugin-sdk/llm-task": { - "types": "./dist/plugin-sdk/llm-task.d.ts", - "default": "./dist/plugin-sdk/llm-task.js" - }, - "./plugin-sdk/lobster": { - "types": "./dist/plugin-sdk/lobster.d.ts", - "default": "./dist/plugin-sdk/lobster.js" - }, - "./plugin-sdk/matrix": { - "types": "./dist/plugin-sdk/matrix.d.ts", - "default": "./dist/plugin-sdk/matrix.js" - }, - "./plugin-sdk/mattermost": { - "types": "./dist/plugin-sdk/mattermost.d.ts", - "default": "./dist/plugin-sdk/mattermost.js" - }, - "./plugin-sdk/memory-core": { - "types": "./dist/plugin-sdk/memory-core.d.ts", - "default": "./dist/plugin-sdk/memory-core.js" - }, - "./plugin-sdk/memory-lancedb": { - "types": "./dist/plugin-sdk/memory-lancedb.d.ts", - "default": "./dist/plugin-sdk/memory-lancedb.js" - }, - "./plugin-sdk/minimax-portal-auth": { - "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", - "default": "./dist/plugin-sdk/minimax-portal-auth.js" - }, - "./plugin-sdk/nextcloud-talk": { - "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", - "default": "./dist/plugin-sdk/nextcloud-talk.js" - }, - "./plugin-sdk/nostr": { - "types": "./dist/plugin-sdk/nostr.d.ts", - "default": "./dist/plugin-sdk/nostr.js" - }, - "./plugin-sdk/open-prose": { - "types": "./dist/plugin-sdk/open-prose.d.ts", - "default": "./dist/plugin-sdk/open-prose.js" - }, - "./plugin-sdk/phone-control": { - "types": "./dist/plugin-sdk/phone-control.d.ts", - "default": "./dist/plugin-sdk/phone-control.js" - }, - "./plugin-sdk/qwen-portal-auth": { - "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", - "default": "./dist/plugin-sdk/qwen-portal-auth.js" - }, - "./plugin-sdk/synology-chat": { - "types": "./dist/plugin-sdk/synology-chat.d.ts", - "default": "./dist/plugin-sdk/synology-chat.js" - }, - "./plugin-sdk/talk-voice": { - "types": "./dist/plugin-sdk/talk-voice.d.ts", - "default": "./dist/plugin-sdk/talk-voice.js" - }, - "./plugin-sdk/test-utils": { - "types": "./dist/plugin-sdk/test-utils.d.ts", - "default": "./dist/plugin-sdk/test-utils.js" - }, - "./plugin-sdk/thread-ownership": { - "types": "./dist/plugin-sdk/thread-ownership.d.ts", - "default": "./dist/plugin-sdk/thread-ownership.js" - }, - "./plugin-sdk/tlon": { - "types": "./dist/plugin-sdk/tlon.d.ts", - "default": "./dist/plugin-sdk/tlon.js" - }, - "./plugin-sdk/twitch": { - "types": "./dist/plugin-sdk/twitch.d.ts", - "default": "./dist/plugin-sdk/twitch.js" - }, - "./plugin-sdk/voice-call": { - "types": "./dist/plugin-sdk/voice-call.d.ts", - "default": "./dist/plugin-sdk/voice-call.js" - }, - "./plugin-sdk/zalo": { - "types": "./dist/plugin-sdk/zalo.d.ts", - "default": "./dist/plugin-sdk/zalo.js" - }, - "./plugin-sdk/zalouser": { - "types": "./dist/plugin-sdk/zalouser.d.ts", - "default": "./dist/plugin-sdk/zalouser.js" - }, - "./plugin-sdk/account-id": { - "types": "./dist/plugin-sdk/account-id.d.ts", - "default": "./dist/plugin-sdk/account-id.js" - }, - "./plugin-sdk/keyed-async-queue": { - "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", - "default": "./dist/plugin-sdk/keyed-async-queue.js" - }, - "./cli-entry": "./openclaw.mjs" - }, - "scripts": { - "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", - "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", - "android:install": "cd apps/android && ./gradlew :app:installDebug", - "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", - "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", - "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", - "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", - "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", - "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", - "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", - "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", - "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", - "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", - "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", - "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", - "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", - "deadcode:ci": "pnpm deadcode:report:ci:knip", - "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", - "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", - "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", - "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", - "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", - "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", - "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", - "dev": "node scripts/run-node.mjs", - "docs:bin": "node scripts/build-docs-list.mjs", - "docs:check-links": "node scripts/docs-link-audit.mjs", - "docs:dev": "cd docs && mint dev", - "docs:list": "node scripts/docs-list.js", - "docs:spellcheck": "bash scripts/docs-spellcheck.sh", - "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", - "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", - "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", - "format": "oxfmt --write", - "format:all": "pnpm format && pnpm format:swift", - "format:check": "oxfmt --check", - "format:diff": "oxfmt --write && git --no-pager diff", - "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", - "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", - "format:fix": "oxfmt --write", - "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", - "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", - "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", - "gateway:watch": "node scripts/watch-node.mjs gateway --force", - "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", - "ghsa:patch": "node scripts/ghsa-patch.mjs", - "ios:beta": "bash scripts/ios-beta-release.sh", - "ios:beta:archive": "bash scripts/ios-beta-archive.sh", - "ios:beta:prepare": "bash scripts/ios-beta-prepare.sh", - "ios:build": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", - "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate'", - "ios:open": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", - "ios:run": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware", - "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", - "lint:all": "pnpm lint && pnpm lint:swift", - "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", - "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", - "lint:docs": "pnpm dlx markdownlint-cli2", - "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", - "lint:fix": "oxlint --type-aware --fix && pnpm format", - "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", - "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", - "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", - "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", - "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", - "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", - "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", - "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", - "mac:open": "open dist/OpenClaw.app", - "mac:package": "bash scripts/package-mac-app.sh", - "mac:restart": "bash scripts/restart-mac.sh", - "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "openclaw": "node scripts/run-node.mjs", - "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", - "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", - "prepack": "pnpm build && pnpm ui:build", - "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", - "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift", - "protocol:gen": "node --import tsx scripts/protocol-gen.ts", - "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", - "release:check": "node --import tsx scripts/release-check.ts", - "release:openclaw:npm:check": "node --import tsx scripts/openclaw-npm-release-check.ts", - "start": "node scripts/run-node.mjs", - "test": "node scripts/test-parallel.mjs", - "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", - "test:auth:compat": "vitest run --config vitest.gateway.config.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/client.test.ts src/gateway/reconnect-gating.test.ts src/gateway/protocol/connect-error-details.test.ts", - "test:channels": "vitest run --config vitest.channels.config.ts", - "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", - "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", - "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", - "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", - "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", - "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", - "test:docker:live-models": "bash scripts/test-live-models-docker.sh", - "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", - "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", - "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", - "test:e2e": "vitest run --config vitest.e2e.config.ts", - "test:extensions": "vitest run --config vitest.extensions.config.ts", - "test:fast": "vitest run --config vitest.unit.config.ts", - "test:force": "node --import tsx scripts/test-force.ts", - "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", - "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", - "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", - "test:install:smoke": "bash scripts/test-install-sh-docker.sh", - "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", - "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", - "test:perf:budget": "node scripts/test-perf-budget.mjs", - "test:perf:hotspots": "node scripts/test-hotspots.mjs", - "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", - "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", - "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", - "test:watch": "vitest", - "tui": "node scripts/run-node.mjs tui", - "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", - "ui:build": "node scripts/ui.js build", - "ui:dev": "node scripts/ui.js dev", - "ui:install": "node scripts/ui.js install" - }, - "dependencies": { - "@agentclientprotocol/sdk": "0.16.1", - "@aws-sdk/client-bedrock": "^3.1008.0", - "@buape/carbon": "0.0.0-beta-20260216184201", - "@clack/prompts": "^1.1.0", - "@discordjs/voice": "^0.19.1", - "@grammyjs/runner": "^2.0.3", - "@grammyjs/transformer-throttler": "^1.2.1", - "@homebridge/ciao": "^1.3.5", - "@larksuiteoapi/node-sdk": "^1.59.0", - "@line/bot-sdk": "^10.6.0", - "@lydell/node-pty": "1.2.0-beta.3", - "@mariozechner/pi-agent-core": "0.57.1", - "@mariozechner/pi-ai": "0.57.1", - "@mariozechner/pi-coding-agent": "0.57.1", - "@mariozechner/pi-tui": "0.57.1", - "@mozilla/readability": "^0.6.0", - "@sinclair/typebox": "0.34.48", - "@slack/bolt": "^4.6.0", - "@slack/web-api": "^7.14.1", - "@whiskeysockets/baileys": "7.0.0-rc.9", - "ajv": "^8.18.0", - "chalk": "^5.6.2", - "chokidar": "^5.0.0", - "cli-highlight": "^2.1.11", - "commander": "^14.0.3", - "croner": "^10.0.1", - "discord-api-types": "^0.38.42", - "dotenv": "^17.3.1", - "express": "^5.2.1", - "file-type": "^21.3.1", - "grammy": "^1.41.1", - "hono": "4.12.7", - "https-proxy-agent": "^8.0.0", - "ipaddr.js": "^2.3.0", - "jiti": "^2.6.1", - "json5": "^2.2.3", - "jszip": "^3.10.1", - "linkedom": "^0.18.12", - "long": "^5.3.2", - "markdown-it": "^14.1.1", - "node-edge-tts": "^1.2.10", - "opusscript": "^0.1.1", - "osc-progress": "^0.3.0", - "pdfjs-dist": "^5.5.207", - "playwright-core": "1.58.2", - "qrcode-terminal": "^0.12.0", - "sharp": "^0.34.5", - "sqlite-vec": "0.1.7-alpha.2", - "tar": "7.5.11", - "tslog": "^4.10.2", - "undici": "^7.24.0", - "ws": "^8.19.0", - "yaml": "^2.8.2", - "zod": "^4.3.6" - }, - "devDependencies": { - "@grammyjs/types": "^3.25.0", - "@lit-labs/signals": "^0.2.0", - "@lit/context": "^1.1.6", - "@types/express": "^5.0.6", - "@types/markdown-it": "^14.1.2", - "@types/node": "^25.5.0", - "@types/qrcode-terminal": "^0.12.2", - "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260312.1", - "@vitest/coverage-v8": "^4.1.0", - "jscpd": "4.0.8", - "jsdom": "^28.1.0", - "lit": "^3.3.2", - "oxfmt": "0.40.0", - "oxlint": "^1.55.0", - "oxlint-tsgolint": "^0.16.0", - "signal-utils": "0.21.1", - "tsdown": "0.21.2", - "tsx": "^4.21.0", - "typescript": "^5.9.3", - "vitest": "^4.1.0" - }, - "peerDependencies": { - "@napi-rs/canvas": "^0.1.89", - "node-llama-cpp": "3.16.2" - }, - "peerDependenciesMeta": { - "node-llama-cpp": { - "optional": true - } - }, - "engines": { - "node": ">=22.16.0" - }, - "packageManager": "pnpm@10.23.0", - "pnpm": { - "minimumReleaseAge": 2880, - "overrides": { - "hono": "4.12.7", - "@hono/node-server": "1.19.10", - "fast-xml-parser": "5.3.8", - "request": "npm:@cypress/request@3.0.10", - "request-promise": "npm:@cypress/request-promise@5.0.0", - "file-type": "21.3.1", - "form-data": "2.5.4", - "minimatch": "10.2.4", - "qs": "6.14.2", - "node-domexception": "npm:@nolyfill/domexception@^1.0.28", - "@sinclair/typebox": "0.34.48", - "tar": "7.5.11", - "tough-cookie": "4.1.3" - }, - "onlyBuiltDependencies": [ - "@lydell/node-pty", - "@matrix-org/matrix-sdk-crypto-nodejs", - "@napi-rs/canvas", - "@tloncorp/api", - "@whiskeysockets/baileys", - "authenticate-pam", - "esbuild", - "koffi", - "node-llama-cpp", - "protobufjs", - "sharp" - ], - "packageExtensions": { - "@mariozechner/pi-coding-agent": { - "dependencies": { - "strip-ansi": "^7.2.0" - } - } - } - } + "name": "openclaw", + "version": "2026.3.12.2", + "description": "Multi-channel AI gateway with extensible messaging integrations", + "keywords": [], + "homepage": "https://github.com/openclaw/openclaw#readme", + "bugs": { + "url": "https://github.com/openclaw/openclaw/issues" + }, + "license": "MIT", + "author": "", + "repository": { + "type": "git", + "url": "git+https://github.com/openclaw/openclaw.git" + }, + "bin": { + "openclaw": "openclaw.mjs" + }, + "directories": { + "doc": "docs", + "test": "test" + }, + "files": [ + "CHANGELOG.md", + "LICENSE", + "openclaw.mjs", + "README-header.png", + "README.md", + "assets/", + "dist/", + "docs/", + "extensions/", + "skills/" + ], + "type": "module", + "main": "dist/index.js", + "exports": { + ".": "./dist/index.js", + "./plugin-sdk": { + "types": "./dist/plugin-sdk/index.d.ts", + "default": "./dist/plugin-sdk/index.js" + }, + "./plugin-sdk/core": { + "types": "./dist/plugin-sdk/core.d.ts", + "default": "./dist/plugin-sdk/core.js" + }, + "./plugin-sdk/compat": { + "types": "./dist/plugin-sdk/compat.d.ts", + "default": "./dist/plugin-sdk/compat.js" + }, + "./plugin-sdk/telegram": { + "types": "./dist/plugin-sdk/telegram.d.ts", + "default": "./dist/plugin-sdk/telegram.js" + }, + "./plugin-sdk/discord": { + "types": "./dist/plugin-sdk/discord.d.ts", + "default": "./dist/plugin-sdk/discord.js" + }, + "./plugin-sdk/slack": { + "types": "./dist/plugin-sdk/slack.d.ts", + "default": "./dist/plugin-sdk/slack.js" + }, + "./plugin-sdk/signal": { + "types": "./dist/plugin-sdk/signal.d.ts", + "default": "./dist/plugin-sdk/signal.js" + }, + "./plugin-sdk/imessage": { + "types": "./dist/plugin-sdk/imessage.d.ts", + "default": "./dist/plugin-sdk/imessage.js" + }, + "./plugin-sdk/whatsapp": { + "types": "./dist/plugin-sdk/whatsapp.d.ts", + "default": "./dist/plugin-sdk/whatsapp.js" + }, + "./plugin-sdk/line": { + "types": "./dist/plugin-sdk/line.d.ts", + "default": "./dist/plugin-sdk/line.js" + }, + "./plugin-sdk/msteams": { + "types": "./dist/plugin-sdk/msteams.d.ts", + "default": "./dist/plugin-sdk/msteams.js" + }, + "./plugin-sdk/acpx": { + "types": "./dist/plugin-sdk/acpx.d.ts", + "default": "./dist/plugin-sdk/acpx.js" + }, + "./plugin-sdk/bluebubbles": { + "types": "./dist/plugin-sdk/bluebubbles.d.ts", + "default": "./dist/plugin-sdk/bluebubbles.js" + }, + "./plugin-sdk/copilot-proxy": { + "types": "./dist/plugin-sdk/copilot-proxy.d.ts", + "default": "./dist/plugin-sdk/copilot-proxy.js" + }, + "./plugin-sdk/device-pair": { + "types": "./dist/plugin-sdk/device-pair.d.ts", + "default": "./dist/plugin-sdk/device-pair.js" + }, + "./plugin-sdk/diagnostics-otel": { + "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", + "default": "./dist/plugin-sdk/diagnostics-otel.js" + }, + "./plugin-sdk/diffs": { + "types": "./dist/plugin-sdk/diffs.d.ts", + "default": "./dist/plugin-sdk/diffs.js" + }, + "./plugin-sdk/feishu": { + "types": "./dist/plugin-sdk/feishu.d.ts", + "default": "./dist/plugin-sdk/feishu.js" + }, + "./plugin-sdk/google-gemini-cli-auth": { + "types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts", + "default": "./dist/plugin-sdk/google-gemini-cli-auth.js" + }, + "./plugin-sdk/googlechat": { + "types": "./dist/plugin-sdk/googlechat.d.ts", + "default": "./dist/plugin-sdk/googlechat.js" + }, + "./plugin-sdk/irc": { + "types": "./dist/plugin-sdk/irc.d.ts", + "default": "./dist/plugin-sdk/irc.js" + }, + "./plugin-sdk/llm-task": { + "types": "./dist/plugin-sdk/llm-task.d.ts", + "default": "./dist/plugin-sdk/llm-task.js" + }, + "./plugin-sdk/lobster": { + "types": "./dist/plugin-sdk/lobster.d.ts", + "default": "./dist/plugin-sdk/lobster.js" + }, + "./plugin-sdk/matrix": { + "types": "./dist/plugin-sdk/matrix.d.ts", + "default": "./dist/plugin-sdk/matrix.js" + }, + "./plugin-sdk/mattermost": { + "types": "./dist/plugin-sdk/mattermost.d.ts", + "default": "./dist/plugin-sdk/mattermost.js" + }, + "./plugin-sdk/memory-core": { + "types": "./dist/plugin-sdk/memory-core.d.ts", + "default": "./dist/plugin-sdk/memory-core.js" + }, + "./plugin-sdk/memory-lancedb": { + "types": "./dist/plugin-sdk/memory-lancedb.d.ts", + "default": "./dist/plugin-sdk/memory-lancedb.js" + }, + "./plugin-sdk/minimax-portal-auth": { + "types": "./dist/plugin-sdk/minimax-portal-auth.d.ts", + "default": "./dist/plugin-sdk/minimax-portal-auth.js" + }, + "./plugin-sdk/nextcloud-talk": { + "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", + "default": "./dist/plugin-sdk/nextcloud-talk.js" + }, + "./plugin-sdk/nostr": { + "types": "./dist/plugin-sdk/nostr.d.ts", + "default": "./dist/plugin-sdk/nostr.js" + }, + "./plugin-sdk/open-prose": { + "types": "./dist/plugin-sdk/open-prose.d.ts", + "default": "./dist/plugin-sdk/open-prose.js" + }, + "./plugin-sdk/phone-control": { + "types": "./dist/plugin-sdk/phone-control.d.ts", + "default": "./dist/plugin-sdk/phone-control.js" + }, + "./plugin-sdk/qwen-portal-auth": { + "types": "./dist/plugin-sdk/qwen-portal-auth.d.ts", + "default": "./dist/plugin-sdk/qwen-portal-auth.js" + }, + "./plugin-sdk/synology-chat": { + "types": "./dist/plugin-sdk/synology-chat.d.ts", + "default": "./dist/plugin-sdk/synology-chat.js" + }, + "./plugin-sdk/talk-voice": { + "types": "./dist/plugin-sdk/talk-voice.d.ts", + "default": "./dist/plugin-sdk/talk-voice.js" + }, + "./plugin-sdk/test-utils": { + "types": "./dist/plugin-sdk/test-utils.d.ts", + "default": "./dist/plugin-sdk/test-utils.js" + }, + "./plugin-sdk/thread-ownership": { + "types": "./dist/plugin-sdk/thread-ownership.d.ts", + "default": "./dist/plugin-sdk/thread-ownership.js" + }, + "./plugin-sdk/tlon": { + "types": "./dist/plugin-sdk/tlon.d.ts", + "default": "./dist/plugin-sdk/tlon.js" + }, + "./plugin-sdk/twitch": { + "types": "./dist/plugin-sdk/twitch.d.ts", + "default": "./dist/plugin-sdk/twitch.js" + }, + "./plugin-sdk/voice-call": { + "types": "./dist/plugin-sdk/voice-call.d.ts", + "default": "./dist/plugin-sdk/voice-call.js" + }, + "./plugin-sdk/zalo": { + "types": "./dist/plugin-sdk/zalo.d.ts", + "default": "./dist/plugin-sdk/zalo.js" + }, + "./plugin-sdk/zalouser": { + "types": "./dist/plugin-sdk/zalouser.d.ts", + "default": "./dist/plugin-sdk/zalouser.js" + }, + "./plugin-sdk/account-id": { + "types": "./dist/plugin-sdk/account-id.d.ts", + "default": "./dist/plugin-sdk/account-id.js" + }, + "./plugin-sdk/keyed-async-queue": { + "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", + "default": "./dist/plugin-sdk/keyed-async-queue.js" + }, + "./cli-entry": "./openclaw.mjs" + }, + "scripts": { + "android:assemble": "cd apps/android && ./gradlew :app:assembleDebug", + "android:format": "cd apps/android && ./gradlew :app:ktlintFormat :benchmark:ktlintFormat", + "android:install": "cd apps/android && ./gradlew :app:installDebug", + "android:lint": "cd apps/android && ./gradlew :app:ktlintCheck :benchmark:ktlintCheck", + "android:lint:android": "cd apps/android && ./gradlew :app:lintDebug", + "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.app/.MainActivity", + "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", + "android:test:integration": "OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_ANDROID_NODE=1 vitest run --config vitest.live.config.ts src/gateway/android-node.capabilities.live.test.ts", + "build": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:docker": "node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts", + "build:plugin-sdk:dts": "tsc -p tsconfig.plugin-sdk.dts.json", + "build:strict-smoke": "pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts", + "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", + "check": "pnpm check:host-env-policy:swift && pnpm format:check && pnpm tsgo && pnpm lint && pnpm lint:tmp:no-random-messaging && pnpm lint:tmp:channel-agnostic-boundaries && pnpm lint:tmp:no-raw-channel-fetch && pnpm lint:agent:ingress-owner && pnpm lint:plugins:no-register-http-handler && pnpm lint:plugins:no-monolithic-plugin-sdk-entry-imports && pnpm lint:webhook:no-low-level-body-read && pnpm lint:auth:no-pairing-store-group && pnpm lint:auth:pairing-account-scope", + "check:docs": "pnpm format:docs:check && pnpm lint:docs && pnpm docs:check-links", + "check:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --check", + "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", + "deadcode:ci": "pnpm deadcode:report:ci:knip", + "deadcode:knip": "pnpm dlx knip --config knip.config.ts --isolate-workspaces --production --no-progress --reporter compact --files --dependencies", + "deadcode:report": "pnpm deadcode:knip; pnpm deadcode:ts-prune; pnpm deadcode:ts-unused", + "deadcode:report:ci:knip": "mkdir -p .artifacts/deadcode && pnpm deadcode:knip > .artifacts/deadcode/knip.txt 2>&1 || true", + "deadcode:report:ci:ts-prune": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-prune > .artifacts/deadcode/ts-prune.txt 2>&1 || true", + "deadcode:report:ci:ts-unused": "mkdir -p .artifacts/deadcode && pnpm deadcode:ts-unused > .artifacts/deadcode/ts-unused-exports.txt 2>&1 || true", + "deadcode:ts-prune": "pnpm dlx ts-prune src extensions scripts", + "deadcode:ts-unused": "pnpm dlx ts-unused-exports tsconfig.json --ignoreTestFiles --exitWithCount", + "dev": "node scripts/run-node.mjs", + "docs:bin": "node scripts/build-docs-list.mjs", + "docs:check-links": "node scripts/docs-link-audit.mjs", + "docs:dev": "cd docs && mint dev", + "docs:list": "node scripts/docs-list.js", + "docs:spellcheck": "bash scripts/docs-spellcheck.sh", + "docs:spellcheck:fix": "bash scripts/docs-spellcheck.sh --write", + "dup:check": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters console", + "dup:check:json": "jscpd src extensions test scripts --format typescript,javascript --pattern \"**/*.{ts,tsx,js,mjs,cjs}\" --gitignore --noSymlinks --ignore \"**/node_modules/**,**/dist/**,**/.git/**,**/coverage/**,**/build/**,**/.build/**,**/.artifacts/**\" --min-lines 12 --min-tokens 80 --reporters json --output .artifacts/jscpd", + "format": "oxfmt --write", + "format:all": "pnpm format && pnpm format:swift", + "format:check": "oxfmt --check", + "format:diff": "oxfmt --write && git --no-pager diff", + "format:docs": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --write", + "format:docs:check": "git ls-files 'docs/**/*.md' 'docs/**/*.mdx' 'README.md' | xargs oxfmt --check", + "format:fix": "oxfmt --write", + "format:swift": "swiftformat --lint --config .swiftformat apps/macos/Sources apps/ios/Sources apps/shared/OpenClawKit/Sources", + "gateway:dev": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway", + "gateway:dev:reset": "OPENCLAW_SKIP_CHANNELS=1 CLAWDBOT_SKIP_CHANNELS=1 node scripts/run-node.mjs --dev gateway --reset", + "gateway:watch": "node scripts/watch-node.mjs gateway --force", + "gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write", + "ghsa:patch": "node scripts/ghsa-patch.mjs", + "ios:beta": "bash scripts/ios-beta-release.sh", + "ios:beta:archive": "bash scripts/ios-beta-archive.sh", + "ios:beta:prepare": "bash scripts/ios-beta-prepare.sh", + "ios:build": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build'", + "ios:gen": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate'", + "ios:open": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj'", + "ios:run": "bash -lc './scripts/ios-configure-signing.sh && ./scripts/ios-write-version-xcconfig.sh && cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", + "lint": "oxlint --type-aware", + "lint:agent:ingress-owner": "node scripts/check-ingress-agent-owner-context.mjs", + "lint:all": "pnpm lint && pnpm lint:swift", + "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", + "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", + "lint:docs": "pnpm dlx markdownlint-cli2", + "lint:docs:fix": "pnpm dlx markdownlint-cli2 --fix", + "lint:fix": "oxlint --type-aware --fix && pnpm format", + "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", + "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", + "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", + "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", + "lint:tmp:no-random-messaging": "node scripts/check-no-random-messaging-tmp.mjs", + "lint:tmp:no-raw-channel-fetch": "node scripts/check-no-raw-channel-fetch.mjs", + "lint:ui:no-raw-window-open": "node scripts/check-no-raw-window-open.mjs", + "lint:webhook:no-low-level-body-read": "node scripts/check-webhook-auth-body-order.mjs", + "mac:open": "open dist/OpenClaw.app", + "mac:package": "bash scripts/package-mac-app.sh", + "mac:restart": "bash scripts/restart-mac.sh", + "moltbot:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "openclaw": "node scripts/run-node.mjs", + "openclaw:rpc": "node scripts/run-node.mjs agent --mode rpc --json", + "plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts", + "prepack": "pnpm build && pnpm ui:build", + "prepare": "command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", + "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenClawProtocol/GatewayModels.swift apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift", + "protocol:gen": "node --import tsx scripts/protocol-gen.ts", + "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", + "release:check": "node --import tsx scripts/release-check.ts", + "release:openclaw:npm:check": "node --import tsx scripts/openclaw-npm-release-check.ts", + "start": "node scripts/run-node.mjs", + "test": "node scripts/test-parallel.mjs", + "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", + "test:auth:compat": "vitest run --config vitest.gateway.config.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/client.test.ts src/gateway/reconnect-gating.test.ts src/gateway/protocol/connect-error-details.test.ts", + "test:channels": "vitest run --config vitest.channels.config.ts", + "test:coverage": "vitest run --config vitest.unit.config.ts --coverage", + "test:docker:all": "pnpm test:docker:live-models && pnpm test:docker:live-gateway && pnpm test:docker:onboard && pnpm test:docker:gateway-network && pnpm test:docker:qr && pnpm test:docker:doctor-switch && pnpm test:docker:plugins && pnpm test:docker:cleanup", + "test:docker:cleanup": "bash scripts/test-cleanup-docker.sh", + "test:docker:doctor-switch": "bash scripts/e2e/doctor-install-switch-docker.sh", + "test:docker:gateway-network": "bash scripts/e2e/gateway-network-docker.sh", + "test:docker:live-gateway": "bash scripts/test-live-gateway-models-docker.sh", + "test:docker:live-models": "bash scripts/test-live-models-docker.sh", + "test:docker:onboard": "bash scripts/e2e/onboard-docker.sh", + "test:docker:plugins": "bash scripts/e2e/plugins-docker.sh", + "test:docker:qr": "bash scripts/e2e/qr-import-docker.sh", + "test:e2e": "vitest run --config vitest.e2e.config.ts", + "test:extensions": "vitest run --config vitest.extensions.config.ts", + "test:fast": "vitest run --config vitest.unit.config.ts", + "test:force": "node --import tsx scripts/test-force.ts", + "test:gateway": "vitest run --config vitest.gateway.config.ts --pool=forks", + "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic CLAWDBOT_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", + "test:install:e2e:openai": "OPENCLAW_E2E_MODELS=openai CLAWDBOT_E2E_MODELS=openai bash scripts/test-install-sh-e2e-docker.sh", + "test:install:smoke": "bash scripts/test-install-sh-docker.sh", + "test:live": "OPENCLAW_LIVE_TEST=1 CLAWDBOT_LIVE_TEST=1 vitest run --config vitest.live.config.ts", + "test:macmini": "OPENCLAW_TEST_VM_FORKS=0 OPENCLAW_TEST_PROFILE=serial node scripts/test-parallel.mjs", + "test:perf:budget": "node scripts/test-perf-budget.mjs", + "test:perf:hotspots": "node scripts/test-hotspots.mjs", + "test:sectriage": "pnpm exec vitest run --config vitest.gateway.config.ts && vitest run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", + "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", + "test:voicecall:closedloop": "vitest run extensions/voice-call/src/manager.test.ts extensions/voice-call/src/media-stream.test.ts src/plugins/voice-call.plugin.test.ts --maxWorkers=1", + "test:watch": "vitest", + "tui": "node scripts/run-node.mjs tui", + "tui:dev": "OPENCLAW_PROFILE=dev CLAWDBOT_PROFILE=dev node scripts/run-node.mjs --dev tui", + "ui:build": "node scripts/ui.js build", + "ui:dev": "node scripts/ui.js dev", + "ui:install": "node scripts/ui.js install" + }, + "dependencies": { + "@agentclientprotocol/sdk": "0.16.1", + "@aws-sdk/client-bedrock": "^3.1008.0", + "@buape/carbon": "0.0.0-beta-20260216184201", + "@clack/prompts": "^1.1.0", + "@discordjs/voice": "^0.19.1", + "@grammyjs/runner": "^2.0.3", + "@grammyjs/transformer-throttler": "^1.2.1", + "@homebridge/ciao": "^1.3.5", + "@larksuiteoapi/node-sdk": "^1.59.0", + "@line/bot-sdk": "^10.6.0", + "@lydell/node-pty": "1.2.0-beta.3", + "@mariozechner/pi-agent-core": "0.57.1", + "@mariozechner/pi-ai": "0.57.1", + "@mariozechner/pi-coding-agent": "0.57.1", + "@mariozechner/pi-tui": "0.57.1", + "@mozilla/readability": "^0.6.0", + "@sinclair/typebox": "0.34.48", + "@slack/bolt": "^4.6.0", + "@slack/web-api": "^7.14.1", + "@whiskeysockets/baileys": "7.0.0-rc.9", + "ajv": "^8.18.0", + "chalk": "^5.6.2", + "chokidar": "^5.0.0", + "cli-highlight": "^2.1.11", + "commander": "^14.0.3", + "croner": "^10.0.1", + "discord-api-types": "^0.38.42", + "dotenv": "^17.3.1", + "express": "^5.2.1", + "file-type": "^21.3.1", + "grammy": "^1.41.1", + "hono": "4.12.7", + "https-proxy-agent": "^8.0.0", + "ipaddr.js": "^2.3.0", + "jiti": "^2.6.1", + "json5": "^2.2.3", + "jszip": "^3.10.1", + "linkedom": "^0.18.12", + "long": "^5.3.2", + "markdown-it": "^14.1.1", + "node-edge-tts": "^1.2.10", + "opusscript": "^0.1.1", + "osc-progress": "^0.3.0", + "pdfjs-dist": "^5.5.207", + "playwright-core": "1.58.2", + "qrcode-terminal": "^0.12.0", + "sharp": "^0.34.5", + "sqlite-vec": "0.1.7-alpha.2", + "tar": "7.5.11", + "tslog": "^4.10.2", + "undici": "^7.24.0", + "ws": "^8.19.0", + "yaml": "^2.8.2", + "zod": "^4.3.6" + }, + "devDependencies": { + "@grammyjs/types": "^3.25.0", + "@lit-labs/signals": "^0.2.0", + "@lit/context": "^1.1.6", + "@types/express": "^5.0.6", + "@types/markdown-it": "^14.1.2", + "@types/node": "^25.5.0", + "@types/qrcode-terminal": "^0.12.2", + "@types/ws": "^8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260312.1", + "@vitest/coverage-v8": "^4.1.0", + "jscpd": "4.0.8", + "jsdom": "^28.1.0", + "lit": "^3.3.2", + "oxfmt": "0.40.0", + "oxlint": "^1.55.0", + "oxlint-tsgolint": "^0.16.0", + "signal-utils": "0.21.1", + "tsdown": "0.21.2", + "tsx": "^4.21.0", + "typescript": "^5.9.3", + "vitest": "^4.1.0" + }, + "peerDependencies": { + "@napi-rs/canvas": "^0.1.89", + "node-llama-cpp": "3.16.2" + }, + "peerDependenciesMeta": { + "node-llama-cpp": { + "optional": true + } + }, + "engines": { + "node": ">=22.16.0" + }, + "packageManager": "pnpm@10.23.0", + "pnpm": { + "minimumReleaseAge": 2880, + "overrides": { + "hono": "4.12.7", + "@hono/node-server": "1.19.10", + "fast-xml-parser": "5.3.8", + "request": "npm:@cypress/request@3.0.10", + "request-promise": "npm:@cypress/request-promise@5.0.0", + "file-type": "21.3.1", + "form-data": "2.5.4", + "minimatch": "10.2.4", + "qs": "6.14.2", + "node-domexception": "npm:@nolyfill/domexception@^1.0.28", + "@sinclair/typebox": "0.34.48", + "tar": "7.5.11", + "tough-cookie": "4.1.3" + }, + "onlyBuiltDependencies": [ + "@lydell/node-pty", + "@matrix-org/matrix-sdk-crypto-nodejs", + "@napi-rs/canvas", + "@tloncorp/api", + "@whiskeysockets/baileys", + "authenticate-pam", + "esbuild", + "koffi", + "node-llama-cpp", + "protobufjs", + "sharp" + ], + "packageExtensions": { + "@mariozechner/pi-coding-agent": { + "dependencies": { + "strip-ansi": "^7.2.0" + } + } + } + } } From 5404edeba0a626424f158ca584a69bce430df6aa Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Fri, 13 Mar 2026 11:10:43 +0100 Subject: [PATCH 74/80] fix: multi-agent Slack support with per-account config and routing bindings Each agent now writes its Slack tokens to a separate channels.slack.accounts[agentId] slot instead of overwriting the shared default slot. upsertChannelAgentBinding() creates routing entries so the gateway routes incoming messages to the correct agent. Also adds access control (accessMode, groupAccessMode, allowFrom) and enriches the configure response with appId, teamId, dmPolicy, and groupPolicy. Co-Authored-By: Claude Opus 4.6 --- extensions/pazi/src/channels-configure.ts | 181 +++++++++++++++++----- 1 file changed, 146 insertions(+), 35 deletions(-) diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index d1c68cdc11..a22ec78ef3 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -8,6 +8,10 @@ interface ChannelConfigureParams { name?: string; botToken?: string; appToken?: string; + appId?: string; + accessMode?: "open" | "closed"; + groupAccessMode?: "open" | "closed"; + allowFrom?: string[]; token?: string; }; } @@ -39,6 +43,11 @@ interface ChannelConfigureResult { channel: ChannelType; accountId: string; probe?: ProbeResult; + appId?: string; + teamId?: string; + dmPolicy?: "open" | "allowlist"; + groupPolicy?: "open" | "allowlist"; + allowFrom?: string[]; onboarding?: TelegramOnboardingResult; } @@ -111,9 +120,21 @@ function validateParams(raw: unknown): { if (p.channel === "slack") { const botToken = typeof cfg.botToken === "string" ? cfg.botToken.trim() : ""; const appToken = typeof cfg.appToken === "string" ? cfg.appToken.trim() : ""; + const accessMode = cfg.accessMode === "closed" ? "closed" : "open"; + const allowFrom = Array.isArray(cfg.allowFrom) + ? cfg.allowFrom.filter( + (entry): entry is string => typeof entry === "string" && entry.trim().length > 0, + ) + : []; if (!botToken || !appToken) { return { ok: false, error: "Slack requires botToken and appToken" }; } + if (accessMode === "closed" && allowFrom.length === 0) { + return { + ok: false, + error: "Closed Slack access requires at least one allowed Slack user ID", + }; + } } if (p.channel === "telegram") { @@ -138,19 +159,79 @@ function validateParams(raw: unknown): { name: typeof cfg.name === "string" ? cfg.name : undefined, botToken: typeof cfg.botToken === "string" ? cfg.botToken : undefined, appToken: typeof cfg.appToken === "string" ? cfg.appToken : undefined, + appId: typeof cfg.appId === "string" ? cfg.appId : undefined, + accessMode: cfg.accessMode === "closed" ? "closed" : "open", + groupAccessMode: cfg.groupAccessMode === "closed" ? "closed" : "open", + allowFrom: Array.isArray(cfg.allowFrom) + ? cfg.allowFrom.filter((entry): entry is string => typeof entry === "string") + : undefined, token: typeof cfg.token === "string" ? cfg.token : undefined, }, }, }; } +function normalizeSlackAllowFrom(input: string[] | undefined): string[] { + return (input ?? []) + .map((entry) => entry.trim().toUpperCase()) + .filter((entry) => entry.length > 0); +} + +function normalizeBindingChannel(channel: string): string { + return channel.trim().toLowerCase(); +} + +function upsertChannelAgentBinding( + cfg: OpenClawConfig, + params: { channel: ChannelType; accountId: string; agentId: string }, +): OpenClawConfig { + const channel = normalizeBindingChannel(params.channel); + const accountId = params.accountId.trim(); + const agentId = params.agentId.trim(); + if (!channel || !accountId || !agentId || accountId === "default") { + return cfg; + } + + const existing = Array.isArray(cfg.bindings) ? cfg.bindings : []; + const filtered = existing.filter((binding) => { + const match = binding?.match; + return !( + binding?.agentId && + typeof match?.channel === "string" && + typeof match?.accountId === "string" && + normalizeBindingChannel(match.channel) === channel && + match.accountId.trim() === accountId + ); + }); + + return { + ...cfg, + bindings: [ + ...filtered, + { + agentId, + match: { channel, accountId }, + }, + ], + }; +} + function applySlackConfig( cfg: OpenClawConfig, accountId: string, input: ChannelConfigureParams["config"], + probe: ProbeResult, ): OpenClawConfig { const botToken = input.botToken?.trim() ?? ""; const appToken = input.appToken?.trim() ?? ""; + const appId = input.appId?.trim().toUpperCase() || undefined; + const teamId = probe.team?.id?.trim() || undefined; + const accessMode = input.accessMode === "closed" ? "closed" : "open"; + const groupAccessMode = input.groupAccessMode === "closed" ? "closed" : "open"; + const allowFrom = accessMode === "open" ? ["*"] : normalizeSlackAllowFrom(input.allowFrom); + const dmPolicy = accessMode === "open" ? "open" : "allowlist"; + const groupPolicy = groupAccessMode === "open" ? "open" : "allowlist"; + const dm = { policy: dmPolicy, allowFrom }; if (accountId === "default") { return { @@ -162,34 +243,47 @@ function applySlackConfig( enabled: true, botToken, appToken, - dmPolicy: "open", + ...(appId ? { appId } : {}), + ...(teamId ? { teamId } : {}), + dmPolicy, + groupPolicy, + allowFrom, + dm, ...(input.name ? { name: input.name } : {}), }, }, }; } - return { - ...cfg, - channels: { - ...cfg.channels, - slack: { - ...cfg.channels?.slack, - enabled: true, - accounts: { - ...cfg.channels?.slack?.accounts, - [accountId]: { - ...cfg.channels?.slack?.accounts?.[accountId], - enabled: true, - botToken, - appToken, - dmPolicy: "open", - ...(input.name ? { name: input.name } : {}), + return upsertChannelAgentBinding( + { + ...cfg, + channels: { + ...cfg.channels, + slack: { + ...cfg.channels?.slack, + enabled: true, + accounts: { + ...cfg.channels?.slack?.accounts, + [accountId]: { + ...cfg.channels?.slack?.accounts?.[accountId], + enabled: true, + botToken, + appToken, + ...(appId ? { appId } : {}), + ...(teamId ? { teamId } : {}), + dmPolicy, + groupPolicy, + allowFrom, + dm, + ...(input.name ? { name: input.name } : {}), + }, }, }, }, }, - }; + { channel: "slack", accountId, agentId: accountId }, + ); } function applyTelegramConfig( @@ -215,26 +309,29 @@ function applyTelegramConfig( }; } - return { - ...cfg, - channels: { - ...cfg.channels, - telegram: { - ...cfg.channels?.telegram, - enabled: true, - accounts: { - ...cfg.channels?.telegram?.accounts, - [accountId]: { - ...cfg.channels?.telegram?.accounts?.[accountId], - enabled: true, - botToken: token, - dmPolicy: "pairing", - ...(input.name ? { name: input.name } : {}), + return upsertChannelAgentBinding( + { + ...cfg, + channels: { + ...cfg.channels, + telegram: { + ...cfg.channels?.telegram, + enabled: true, + accounts: { + ...cfg.channels?.telegram?.accounts, + [accountId]: { + ...cfg.channels?.telegram?.accounts?.[accountId], + enabled: true, + botToken: token, + dmPolicy: "pairing", + ...(input.name ? { name: input.name } : {}), + }, }, }, }, }, - }; + { channel: "telegram", accountId, agentId: accountId }, + ); } export function createPaziChannelsConfigureHandler( @@ -290,7 +387,7 @@ export function createPaziChannelsConfigureHandler( try { let cfg = deps.loadConfig(); if (channel === "slack") { - cfg = applySlackConfig(cfg, accountId, inputConfig); + cfg = applySlackConfig(cfg, accountId, inputConfig, probe); } else { cfg = applyTelegramConfig(cfg, accountId, inputConfig); } @@ -330,6 +427,20 @@ export function createPaziChannelsConfigureHandler( channel, accountId, probe, + ...(channel === "slack" && inputConfig.appId?.trim() + ? { appId: inputConfig.appId.trim().toUpperCase() } + : {}), + ...(channel === "slack" && probe.team?.id?.trim() ? { teamId: probe.team.id.trim() } : {}), + ...(channel === "slack" + ? { + dmPolicy: inputConfig.accessMode === "closed" ? "allowlist" : "open", + groupPolicy: inputConfig.groupAccessMode === "closed" ? "allowlist" : "open", + allowFrom: + inputConfig.accessMode === "closed" + ? normalizeSlackAllowFrom(inputConfig.allowFrom) + : ["*"], + } + : {}), }; if (channel === "telegram") { const botUsername = probe.bot?.username?.trim() ?? ""; From ed239f0eb348bc775693ddf1b5d9a29430e9dad8 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Fri, 13 Mar 2026 11:17:53 +0100 Subject: [PATCH 75/80] chore(agent): move OpenClaw gateway to port 12420 --- Dockerfile.pazi | 8 ++++---- supervisord.pazi.conf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile.pazi b/Dockerfile.pazi index 149b1a0b16..2be9fc6594 100644 --- a/Dockerfile.pazi +++ b/Dockerfile.pazi @@ -103,15 +103,15 @@ RUN mkdir -p /home/pazi/generations /home/pazi/.config /home/pazi/.local/share & COPY supervisord.pazi.conf /etc/supervisor/conf.d/supervisord.conf ENV NODE_ENV=production \ - OPENCLAW_GATEWAY_PORT=3000 \ + OPENCLAW_GATEWAY_PORT=12420 \ GENERATIONS_DIR=/home/pazi/generations -# 3000 — OpenClaw gateway (HTTP + WS) +# 12420 — OpenClaw gateway (HTTP + WS) # 8080 — Selkies-GStreamer WebRTC desktop -EXPOSE 3000 8080 +EXPOSE 12420 8080 HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ - CMD curl -f http://127.0.0.1:3000/health || exit 1 + CMD curl -f http://127.0.0.1:12420/health || exit 1 # supervisord runs as root to manage child processes with different users USER root diff --git a/supervisord.pazi.conf b/supervisord.pazi.conf index 62facc827e..5c6a0af154 100644 --- a/supervisord.pazi.conf +++ b/supervisord.pazi.conf @@ -36,7 +36,7 @@ autorestart=true priority=35 [program:agent] -command=bash -c "sleep 8 && exec node /app/openclaw.mjs gateway --allow-unconfigured --bind lan" +command=bash -c "sleep 8 && exec node /app/openclaw.mjs gateway --allow-unconfigured --bind lan --port 12420" user=pazi environment=HOME="/home/pazi",DISPLAY=":1",NODE_ENV="production" autorestart=true From 030a0b90b9d491679b5a73db199cf5097a237341 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Mar 2026 10:21:52 +0000 Subject: [PATCH 76/80] chore: release 2026.3.12.3 [skip ci] --- extensions/pazi/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json index 57554d31d1..807775c9ba 100644 --- a/extensions/pazi/package.json +++ b/extensions/pazi/package.json @@ -1,6 +1,6 @@ { "name": "@openclaw/pazi", - "version": "2026.3.12.2", + "version": "2026.3.12.3", "private": true, "description": "OpenClaw Pazi proxy", "type": "module", diff --git a/package.json b/package.json index 57e3cb1885..4c2202bd97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.12.2", + "version": "2026.3.12.3", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 5da2ea93523c275f46e72ccbeb4d6ebef1879958 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Mar 2026 10:31:17 +0000 Subject: [PATCH 77/80] chore: release 2026.3.12.4 [skip ci] --- extensions/pazi/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json index 807775c9ba..227cccc034 100644 --- a/extensions/pazi/package.json +++ b/extensions/pazi/package.json @@ -1,6 +1,6 @@ { "name": "@openclaw/pazi", - "version": "2026.3.12.3", + "version": "2026.3.12.4", "private": true, "description": "OpenClaw Pazi proxy", "type": "module", diff --git a/package.json b/package.json index 4c2202bd97..91d23f004f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.12.3", + "version": "2026.3.12.4", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme", From 338d05bea0db5603e65577318ae8f959916c53ff Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Fri, 13 Mar 2026 11:59:11 +0100 Subject: [PATCH 78/80] fix: disable block streaming for Slack to suppress thinking flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set blockStreaming: false in the Slack channel config written by the configure handler. This prevents tool execution traces and intermediate steps from being posted to Slack — only the final assembled response is sent. Users still see a "Status: thinking..." draft message while the agent processes. Co-Authored-By: Claude Opus 4.6 --- extensions/pazi/src/channels-configure.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index a22ec78ef3..3a1e915f0a 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -249,6 +249,9 @@ function applySlackConfig( groupPolicy, allowFrom, dm, + // Disable block streaming so tool execution traces and intermediate + // steps are not posted to Slack — only the final response is sent. + blockStreaming: false, ...(input.name ? { name: input.name } : {}), }, }, @@ -276,6 +279,9 @@ function applySlackConfig( groupPolicy, allowFrom, dm, + // Disable block streaming so tool execution traces and intermediate + // steps are not posted to Slack — only the final response is sent. + blockStreaming: false, ...(input.name ? { name: input.name } : {}), }, }, From 1d6a667419fecd74c5ef1bfb5aea88f93ac6630f Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Fri, 13 Mar 2026 12:12:56 +0100 Subject: [PATCH 79/80] fix: stop writing appId/teamId to openclaw config SlackAccountSchema uses .strict() which rejects unknown keys. The appId and teamId values are still returned in the API response for the frontend to use, but no longer persisted to openclaw.json. Co-Authored-By: Claude Opus 4.6 --- extensions/pazi/src/channels-configure.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/extensions/pazi/src/channels-configure.ts b/extensions/pazi/src/channels-configure.ts index a22ec78ef3..1d1fc35d3c 100644 --- a/extensions/pazi/src/channels-configure.ts +++ b/extensions/pazi/src/channels-configure.ts @@ -224,8 +224,6 @@ function applySlackConfig( ): OpenClawConfig { const botToken = input.botToken?.trim() ?? ""; const appToken = input.appToken?.trim() ?? ""; - const appId = input.appId?.trim().toUpperCase() || undefined; - const teamId = probe.team?.id?.trim() || undefined; const accessMode = input.accessMode === "closed" ? "closed" : "open"; const groupAccessMode = input.groupAccessMode === "closed" ? "closed" : "open"; const allowFrom = accessMode === "open" ? ["*"] : normalizeSlackAllowFrom(input.allowFrom); @@ -243,8 +241,6 @@ function applySlackConfig( enabled: true, botToken, appToken, - ...(appId ? { appId } : {}), - ...(teamId ? { teamId } : {}), dmPolicy, groupPolicy, allowFrom, @@ -270,8 +266,6 @@ function applySlackConfig( enabled: true, botToken, appToken, - ...(appId ? { appId } : {}), - ...(teamId ? { teamId } : {}), dmPolicy, groupPolicy, allowFrom, From 598157f025321f5e1c5a51d7a3d457c6bf4d95f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Mar 2026 11:29:31 +0000 Subject: [PATCH 80/80] chore: release 2026.3.12.5 [skip ci] --- extensions/pazi/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/pazi/package.json b/extensions/pazi/package.json index 227cccc034..f65b16ace3 100644 --- a/extensions/pazi/package.json +++ b/extensions/pazi/package.json @@ -1,6 +1,6 @@ { "name": "@openclaw/pazi", - "version": "2026.3.12.4", + "version": "2026.3.12.5", "private": true, "description": "OpenClaw Pazi proxy", "type": "module", diff --git a/package.json b/package.json index 91d23f004f..5168579cc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw", - "version": "2026.3.12.4", + "version": "2026.3.12.5", "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "homepage": "https://github.com/openclaw/openclaw#readme",