refactor: trim acpx config exports

This commit is contained in:
Peter Steinberger
2026-05-01 19:18:12 +01:00
parent cbf4f0f87a
commit bbf8bd56e6
2 changed files with 7 additions and 18 deletions

View File

@@ -1,9 +1,9 @@
import { z } from "openclaw/plugin-sdk/zod";
export const ACPX_PERMISSION_MODES = ["approve-all", "approve-reads", "deny-all"] as const;
const ACPX_PERMISSION_MODES = ["approve-all", "approve-reads", "deny-all"] as const;
export type AcpxPermissionMode = (typeof ACPX_PERMISSION_MODES)[number];
export const ACPX_NON_INTERACTIVE_POLICIES = ["deny", "fail"] as const;
const ACPX_NON_INTERACTIVE_POLICIES = ["deny", "fail"] as const;
export type AcpxNonInteractivePermissionPolicy = (typeof ACPX_NON_INTERACTIVE_POLICIES)[number];
export const DEFAULT_ACPX_TIMEOUT_SECONDS = 120;

View File

@@ -13,17 +13,10 @@ import type {
AcpxMcpServer,
ResolvedAcpxPluginConfig,
} from "./config-schema.js";
export {
type AcpxMcpServer,
type AcpxNonInteractivePermissionPolicy,
type AcpxPermissionMode,
type AcpxPluginConfig,
type McpServerConfig,
type ResolvedAcpxPluginConfig,
} from "./config-schema.js";
export { type ResolvedAcpxPluginConfig } from "./config-schema.js";
export const ACPX_PLUGIN_TOOLS_MCP_SERVER_NAME = "openclaw-plugin-tools";
export const ACPX_OPENCLAW_TOOLS_MCP_SERVER_NAME = "openclaw-tools";
const ACPX_PLUGIN_TOOLS_MCP_SERVER_NAME = "openclaw-plugin-tools";
const ACPX_OPENCLAW_TOOLS_MCP_SERVER_NAME = "openclaw-tools";
const requireFromHere = createRequire(import.meta.url);
function isAcpxPluginRoot(dir: string): boolean {
@@ -146,9 +139,7 @@ function resolveTsxImportSpecifier(): string {
}
}
export function resolvePluginToolsMcpServerConfig(
moduleUrl: string = import.meta.url,
): McpServerConfig {
function resolvePluginToolsMcpServerConfig(moduleUrl: string = import.meta.url): McpServerConfig {
const pluginRoot = resolveAcpxPluginRoot(moduleUrl);
const openClawRoot = resolveOpenClawRoot(pluginRoot);
const distEntry = path.join(openClawRoot, "dist", "mcp", "plugin-tools-serve.js");
@@ -165,9 +156,7 @@ export function resolvePluginToolsMcpServerConfig(
};
}
export function resolveOpenClawToolsMcpServerConfig(
moduleUrl: string = import.meta.url,
): McpServerConfig {
function resolveOpenClawToolsMcpServerConfig(moduleUrl: string = import.meta.url): McpServerConfig {
const pluginRoot = resolveAcpxPluginRoot(moduleUrl);
const openClawRoot = resolveOpenClawRoot(pluginRoot);
const distEntry = path.join(openClawRoot, "dist", "mcp", "openclaw-tools-serve.js");