mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 11:50:45 +00:00
Summary: - Adds parser-derived exec approval command-span metadata through host registration, gateway validation, generated Swift models, Control UI parsing/rendering, tests, and changelog. - Reproducibility: not applicable. this is a feature PR rather than a bug report. The before/after behavior is ... rom current main’s plain command rendering to PR-head span generation, validation, and Web rendering tests. Automerge notes: - PR branch already contained follow-up commit before automerge: refactor: use neutral exec command spans - PR branch already contained follow-up commit before automerge: refactor: simplify exec command span extraction - PR branch already contained follow-up commit before automerge: refactor: inline approval command span params - PR branch already contained follow-up commit before automerge: fix: keep exec approval spans lazy - PR branch already contained follow-up commit before automerge: build: refresh exec approval protocol models - PR branch already contained follow-up commit before automerge: Highlight exec command risks in Web approvals Validation: - ClawSweeper review passed for head8d9977eb53. - Required merge gates passed before the squash merge. Prepared head SHA:8d9977eb53Review: https://github.com/openclaw/openclaw/pull/77153#issuecomment-4368769228 Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
import type { ToolFsPolicy } from "../agents/tool-fs-policy.types.js";
|
|
import type { AnyAgentTool } from "../agents/tools/common.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
import type { HookEntry } from "../hooks/types.js";
|
|
import type { DeliveryContext } from "../utils/delivery-context.types.js";
|
|
|
|
/** Trusted execution context passed to plugin-owned agent tool factories. */
|
|
export type OpenClawPluginToolContext = {
|
|
config?: OpenClawConfig;
|
|
/** Active runtime-resolved config snapshot when one is available. */
|
|
runtimeConfig?: OpenClawConfig;
|
|
/** Returns the latest runtime-resolved config snapshot for long-lived tool definitions. */
|
|
getRuntimeConfig?: () => OpenClawConfig | undefined;
|
|
/** Effective filesystem policy for the active tool run. */
|
|
fsPolicy?: ToolFsPolicy;
|
|
workspaceDir?: string;
|
|
agentDir?: string;
|
|
agentId?: string;
|
|
sessionKey?: string;
|
|
/** Ephemeral session UUID - regenerated on /new and /reset. Use for per-conversation isolation. */
|
|
sessionId?: string;
|
|
browser?: {
|
|
sandboxBridgeUrl?: string;
|
|
allowHostControl?: boolean;
|
|
};
|
|
messageChannel?: string;
|
|
agentAccountId?: string;
|
|
/** Trusted ambient delivery route for the active agent/session. */
|
|
deliveryContext?: DeliveryContext;
|
|
/** Trusted sender id from inbound context (runtime-provided, not tool args). */
|
|
requesterSenderId?: string;
|
|
/** Whether the trusted sender is an owner. */
|
|
senderIsOwner?: boolean;
|
|
sandboxed?: boolean;
|
|
};
|
|
|
|
export type OpenClawPluginToolFactory = (
|
|
ctx: OpenClawPluginToolContext,
|
|
) => AnyAgentTool | AnyAgentTool[] | null | undefined;
|
|
|
|
export type OpenClawPluginToolOptions = {
|
|
name?: string;
|
|
names?: string[];
|
|
optional?: boolean;
|
|
};
|
|
|
|
export type OpenClawPluginHookOptions = {
|
|
entry?: HookEntry;
|
|
name?: string;
|
|
description?: string;
|
|
register?: boolean;
|
|
};
|