Files
openclaw/src/plugins/tool-types.ts
Andy Ye ddacb7ba39 fix(memory): keep memory_search in transient qmd mode (#92639)
Summary:
- Merged fix(memory): keep memory_search in transient qmd mode after ClawSweeper review.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(memory): close transient search managers
- PR branch already contained follow-up commit before automerge: fix(memory): preserve default search managers
- PR branch already contained follow-up commit before automerge: fix(memory): preserve qmd cli boot freshness

Validation:
- ClawSweeper review passed for head 64fe82c24c.
- Required merge gates passed before the squash merge.

Prepared head SHA: 64fe82c24c
Review: https://github.com/openclaw/openclaw/pull/92639#issuecomment-4698763950

Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
2026-06-13 14:14:54 +00:00

73 lines
2.7 KiB
TypeScript

// Defines plugin tool metadata and filesystem policy types.
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";
export type OpenClawPluginActiveModelContext = {
provider?: string;
modelId?: string;
modelRef?: string;
};
/** 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;
/**
* Runtime-supplied active model metadata for informational use, diagnostics,
* and plugin-owned policy decisions. This is not a security boundary against
* the local operator, installed plugin code, or a modified OpenClaw runtime.
*/
activeModel?: OpenClawPluginActiveModelContext;
browser?: {
sandboxBridgeUrl?: string;
allowHostControl?: boolean;
};
messageChannel?: string;
agentAccountId?: string;
/** Trusted provider auth availability from the active auth profile store. */
hasAuthForProvider?: (providerId: string) => boolean;
/** Resolves an API key from the active auth profile store when available. */
resolveApiKeyForProvider?: (providerId: string) => Promise<string | undefined>;
/** Trusted ambient delivery route for the active agent/session. */
deliveryContext?: DeliveryContext;
/** Trusted sender id from inbound context (runtime-provided, not tool args). */
requesterSenderId?: string;
sandboxed?: boolean;
/**
* True for explicit one-shot local CLI runs that must release plugin-owned
* process resources before the command exits.
*/
oneShotCliRun?: 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;
};