@openclaw/acpx 2026.7.1-beta.6 → 2026.7.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ //#region extensions/acpx/src/config-schema.ts
3
+ /**
4
+ * ACPX plugin configuration schema and public config types. Runtime setup uses
5
+ * this file as the single source of truth for validation and defaulting.
6
+ */
7
+ const ACPX_PERMISSION_MODES = [
8
+ "approve-all",
9
+ "approve-reads",
10
+ "deny-all"
11
+ ];
12
+ const ACPX_NON_INTERACTIVE_POLICIES = ["deny", "fail"];
13
+ const nonEmptyTrimmedString = (message) => z.string({ error: message }).trim().min(1, { error: message });
14
+ const McpServerConfigSchema = z.object({
15
+ command: nonEmptyTrimmedString("command must be a non-empty string").describe("Command to run the MCP server"),
16
+ args: z.array(z.string({ error: "args must be an array of strings" }), { error: "args must be an array of strings" }).optional().describe("Arguments to pass to the command"),
17
+ env: z.record(z.string(), z.string({ error: "env values must be strings" }), { error: "env must be an object of strings" }).optional().describe("Environment variables for the MCP server")
18
+ });
19
+ /** Zod schema for validating raw ACPX plugin config from OpenClaw config. */
20
+ const AcpxPluginConfigSchema = z.strictObject({
21
+ cwd: nonEmptyTrimmedString("cwd must be a non-empty string").optional(),
22
+ stateDir: nonEmptyTrimmedString("stateDir must be a non-empty string").optional(),
23
+ probeAgent: nonEmptyTrimmedString("probeAgent must be a non-empty string").optional(),
24
+ permissionMode: z.enum(ACPX_PERMISSION_MODES, { error: `permissionMode must be one of: ${ACPX_PERMISSION_MODES.join(", ")}` }).optional(),
25
+ nonInteractivePermissions: z.enum(ACPX_NON_INTERACTIVE_POLICIES, { error: `nonInteractivePermissions must be one of: ${ACPX_NON_INTERACTIVE_POLICIES.join(", ")}` }).optional(),
26
+ pluginToolsMcpBridge: z.boolean({ error: "pluginToolsMcpBridge must be a boolean" }).optional(),
27
+ openClawToolsMcpBridge: z.boolean({ error: "openClawToolsMcpBridge must be a boolean" }).optional(),
28
+ strictWindowsCmdWrapper: z.boolean({ error: "strictWindowsCmdWrapper must be a boolean" }).optional(),
29
+ timeoutSeconds: z.number({ error: "timeoutSeconds must be a number >= 0.001" }).min(.001, { error: "timeoutSeconds must be a number >= 0.001" }).default(120),
30
+ queueOwnerTtlSeconds: z.number({ error: "queueOwnerTtlSeconds must be a number >= 0" }).min(0, { error: "queueOwnerTtlSeconds must be a number >= 0" }).optional(),
31
+ piSessionCatalog: z.strictObject({ enabled: z.boolean({ error: "piSessionCatalog.enabled must be a boolean" }).default(true) }).optional(),
32
+ mcpServers: z.record(z.string(), McpServerConfigSchema).optional(),
33
+ agents: z.record(z.string(), z.strictObject({
34
+ command: nonEmptyTrimmedString("agents.<id>.command must be a non-empty string"),
35
+ args: z.array(z.string({ error: "args must be an array of strings" })).optional()
36
+ })).optional()
37
+ });
38
+ //#endregion
39
+ export { AcpxPluginConfigSchema as t };