import type { ActionChangeResource, ActionMcpToolAnnotations, ActionOutputEffect, ActionPlanModeConfig } from "./action.js"; import type { ActionTool } from "./agent/types.js"; /** One call's effect, as its action declares it for those arguments. */ export interface ActionCallClassification { /** Whether the call is read-only; `undefined` when nothing declares it. */ readonly readOnly: boolean | undefined; /** * Whether plan mode may run the call: its `planMode` effect says it reads, * or, without `planMode`, the action is declared read-only. A predicate * that throws allows nothing. */ readonly planModeRead: boolean; } /** * Classifies one call, running its `planMode.effect` predicate once, so every * gate that reads the result agrees with the run that consumes it. */ export declare function classifyActionCall(entry: { readOnly?: boolean; planMode?: ActionPlanModeConfig; }, params: unknown): ActionCallClassification; /** * Whether one call is read-only, or `undefined` when neither `planMode` nor * `readOnly` says. */ export declare function actionCallReadOnly(entry: { readOnly?: boolean; planMode?: ActionPlanModeConfig; }, params: unknown): boolean | undefined; export declare function actionCallIsReadOnly(entry: { readOnly?: boolean; planMode?: ActionPlanModeConfig; }, params: unknown, fallback: boolean): boolean; /** * What a call that ran has done, for a failure reported after it ran. Only a * call declared read-only changed nothing. */ export declare function actionOutputEffect(readOnly: boolean | undefined): ActionOutputEffect; /** `actionCallEmitsChange` for a call already classified. */ export declare function classifiedCallEmitsChange(entry: { changeEvents?: boolean; }, readOnly: boolean | undefined, fallbackReadOnly: boolean): boolean; /** * Whether no call of this action can write. MCP has one hint and one OAuth * scope per tool, so it needs this rather than the per-call answer above: * `readOnly` is the in-app classification, which a plan-mode effect refines * per call, and an action whose writes its metadata cannot show declares * `readOnlyHint: false`. */ export declare function isMcpReadOnlyTool(entry: { readOnly?: boolean; planMode?: ActionPlanModeConfig; mcpAnnotations?: ActionMcpToolAnnotations; }): boolean; /** * Whether re-running this call after an error or a lost result is safe. An * action opts in with `retrySafe`; an undeclared action is not, so an * ambiguous write keeps blocking the run. A predicate sees the arguments after * the same gateway-string repair schema validation applies (`"true"` already * `true`), never the raw model input a stringified flag could slip past a * strict comparison in. */ export declare function actionCallIsRetrySafe(entry: { retrySafe?: boolean | ((input: any) => boolean); tool?: { parameters?: ActionTool["parameters"]; }; }, params: unknown): boolean; /** * Whether a successful call should publish an `action` change event. * * Read-only calls never do. An unclassified call does, on purpose: staying * quiet for an action nobody declared would hide real writes from other * sessions. A mutating action that never needs to refresh anyone else * (telemetry, playback position) opts out with `changeEvents: false`. */ export declare function actionCallEmitsChange(entry: { readOnly?: boolean; planMode?: ActionPlanModeConfig; changeEvents?: boolean; }, params: unknown, fallbackReadOnly: boolean): boolean; /** * The resource a successful call changed, for an action that declares * `changeResource`. A declaration that throws or returns something malformed * is a bug in the action: it is logged, and the event falls back to reaching * only the actor rather than failing a call that already succeeded. */ export declare function actionChangeResource(entry: { changeResource?: (input: any, result: any) => ActionChangeResource | null | undefined; }, params: unknown, result: unknown): ActionChangeResource | undefined;