import type { ActionEffect, ActionEffectSource } from "./types.js"; export interface ResolvedEffect { effect: ActionEffect; /** * `declared` means an ActionSpec in the graph said so. `undeclared` means * nothing in this server claims that name, and the answer is the default * below rather than a reading of the name. */ source: ActionEffectSource | "undeclared"; } /** * What a name nobody claims is treated as. * * An ActionSpec cannot fail to state its effect - the type requires it in * every variant - so this is never an action that forgot. It is a name no * action in this server carries: a flow step naming a task that does not * exist, a bridge method reached from somewhere this package cannot see, a * plugin calling through the bridge API with a method of its own. * * The answer is `mutate`, and not the verb lexicon's opinion of the name. A * list of verbs is what produced the failure this whole change removes, and * running it here would reintroduce it at exactly the point where the * information is thinnest. Something unrecognised is treated as a change, so * the gates refuse it, guard it and lock it. Being wrong costs one * unnecessary refusal; the other direction costs an unguarded write. */ export declare const UNDECLARED_EFFECT: ActionEffect; /** * Bridge methods a HANDLER calls directly, with what each does. * * The guard pipeline sits on `IBridge.call`, so it sees bridge method names. * Most of them belong to an action and carry that action's declared effect. * These do not: they are reached from inside a handler's own body, so no * ActionSpec forwards to them and the index below cannot see them. * * Enumerated rather than defaulted, because two of them are reads, and a read * defaulted to `mutate` would put `asset(search)` and `editor(get_engine_state)` * in front of every guard scoped to mutations for no reason. * `tests/unit/action-effects.test.ts` scans the source for raw `bridge.call` * sites and fails when one appears that is not listed here, so this cannot * quietly fall behind the code. Same shape as the hand-written halves of * `offline.ts`, and for the same reason. */ export declare const RAW_BRIDGE_METHODS: Readonly>; /** Drop the memo. Only tests that swap the published graph in place need this. */ export declare function resetEffectIndex(): void; /** What `${tool}.${action}` declares, or undefined when the graph has no such action. */ export declare function declaredActionEffect(tool: string, action: string): ActionEffect | undefined; /** * What `${tool}.${action}` does: what it declared, or `mutate` when this * server carries no such action. * * The undeclared branch covers a task name that never was an MCP action here: * a flow step naming something the graph does not have, a category served by a * session this process is not holding, a typo. */ export declare function actionEffect(tool: string, action: string): ResolvedEffect; /** The same, over a `category.action` task name. */ export declare function taskEffect(taskName: string): ResolvedEffect; /** * What a `category.action` task name declares, or undefined when the graph has * no such action. Never guesses, for the caller that wants to choose its own * fallback rather than take the lexicon's. */ export declare function declaredTaskEffect(taskName: string): ActionEffect | undefined; /** * What a BRIDGE METHOD does, given the arguments it was called with. * * Four sources, in order: an argument that decides it, the effects declared by * the actions that forward to the method, the hand-written table above for the * ones a handler calls directly, and `mutate` for a method this server does not * recognise at all. * * Never undefined. The guard pipeline and the source-control classifier both * ask this on every call and neither should be re-deriving a default of its * own, which is how three modules came to hold three different opinions in the * first place. * * `params` is optional so a caller asking about a method in the abstract still * gets the method's own answer. Every caller on a live path has them. */ export declare function bridgeMethodEffect(method: string, params?: Record): ResolvedEffect; /** Does this effect mean the call may change something? `unknown` counts. */ export declare function mayChangeState(effect: ActionEffect): boolean;