/** * An MCP event's subscription settings as a form. MCP servers describe a * subscription's arguments with a JSON Schema; flat schemas of text, numbers, * yes/no and fixed choices become labelled fields, and anything richer is * edited as JSON. The draft keeps the arguments as JSON text either way, so * keys the form doesn't show survive an edit. */ /** One argument the form can edit. */ export type EventArgumentField = { name: string; /** The schema's title, else the property name in words. */ label: string; description: string | null; required: boolean; } & ({ kind: "text"; /** The schema's `format`, such as "uuid" or "email". */ format: string | null; placeholder: string | null; } | { kind: "number"; integer: boolean; placeholder: string | null; } | { kind: "boolean"; } | { kind: "choice"; options: EventArgumentOption[]; }); export interface EventArgumentOption { value: string | number | boolean; label: string; } /** "projectId" -> "Project id", "max_items" -> "Max items". */ export declare function eventArgumentLabel(name: string): string; /** * The fields for a subscription's arguments, required ones first; an empty * list when it takes none, and null when the schema needs JSON (nested * objects, lists, or types the form can't show). */ export declare function eventArgumentFields(schema: Record | null | undefined): EventArgumentField[] | null; /** The arguments in JSON text as an object; null when the text isn't a JSON object. */ export declare function eventArgumentsValue(text: string): Record | null; /** The JSON text with one argument set, or removed when `value` is undefined. */ export declare function withEventArgument(text: string, name: string, value: unknown): string; /** * The arguments for a newly picked event: what was already entered for * arguments it takes, else the host's defaults (such as the project a chat * belongs to). Arguments it doesn't take are dropped; text that isn't a JSON * object, or an event without a schema, keeps the text as it is. */ export declare function eventArgumentsForEvent(schema: Record | null | undefined, text: string, defaults: Readonly> | undefined): string;