/** * Per-action subcommand views for connector service tools (issue #51377). * * Service tools register one command whose flag set is the union of every * action's parameters, so a wrong-action flag parses fine and fails (or is * silently dropped) server-side. Servers that build the per-action map send * it as an additive `actions` field on the /tools entry; these helpers * validate that map into renderable views so index.ts can register each * action as a real Commander subcommand — scoped flags, parse-time * rejection of wrong-action flags, per-action --help. When the field is * absent (older server) or fails validation, the caller keeps today's * union-flag command unchanged. */ import type { ToolSchema } from './types.js'; export interface ActionView { name: string; description: string; /** Parameter names scoped to this action, in server order. */ parameters: string[]; /** Subset of `parameters` the server marks required. */ required: string[]; } /** * Build per-action views from a tool's `actions` map, or null when the * tool should keep the union-flag registration: no map (old server), * empty map, a primary_arg other than the action dispatcher, or a map * entry whose shape is not usable. All-or-nothing on purpose — a * partially-subcommanded tool would silently lose the missing actions. */ export declare function serviceActionViews(tool: ToolSchema): ActionView[] | null; /** * Extract one action's segment from a merged parameter description. * * The server tags shared parameters per owning action: * "[send] Body text | [upload] Caption for the file card" * A union command shows the whole string; a per-action subcommand should * show only its own segment. Splitting is anchored on the known action * names (`[name] ` at the start or after ` | `) so descriptions that * themselves contain pipes or brackets never split wrong. Returns the * input unchanged when it carries no tag for `action` (single-owner * parameters keep their `[action] ` prefix stripped only when it matches). */ export declare function actionScopedDescription(description: string, action: string, allActions: string[]): string; //# sourceMappingURL=serviceActions.d.ts.map