import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { z } from 'zod'; import { CplaceApiClient } from '../api.js'; export declare const LAYOUT_RICHSTRING_WIDGET_TOOL_DEFINITIONS: { readonly cplace_layout_richstring_extract_widgets: { readonly description: "Extract all embedded widgets from a layout widget's richstring config. Returns structured inventory (IDs, types, properties) and a positional content map without loading the full layout script into context. Use this to discover widget IDs and positions before editing via cplace_edit_layout str_replace on decoded embedded-widget tags.\n\nSupported layout widget types: cf.platform.richString, cf.cplace.demoWidgets.demoRichString"; readonly inputSchema: { readonly context: z.ZodEffects; pageUID: z.ZodString; }, "strip", z.ZodTypeAny, { type: "page"; pageUID: string; }, { type: "page"; pageUID: string; }>, z.ZodObject<{ type: z.ZodLiteral<"type">; workspaceId: z.ZodString; typeInternalName: z.ZodString; alternativeLayoutName: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }, { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }>]>, { type: "page"; pageUID: string; } | { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }, unknown>; readonly widgetId: z.ZodString; }; readonly annotations: { readonly title: "Extract Embedded Widgets from Layout Widget RichString"; }; }; readonly cplace_richstring_set_widget_script: { readonly description: "Replace the entire script body of a script-typed attribute on an embedded widget inside a layout-resident rich-string container. Reads the layout, modifies the target attribute, and writes back via a single layout.updateWidget call — atomic.\n\nWhy this tool exists. When a rich-string widget (cf.platform.richString, cf.cplace.demoWidgets.demoRichString) is placed in a page or type layout via cplace_execute_layout_script, embedded widgets travel inline as tags. Authoring a script attribute inline forces it through four nested encoding layers (HTML → JSON → JS string literal → MCP wire). Use this tool instead: the script arrives as a plain string in a structured tool argument.\n\nWorkflow.\n1. Place the rich-string container with embedded children via cplace_execute_layout_script, initializing each script attribute to a minimal placeholder body (e.g. return '';).\n2. Run cplace_layout_richstring_extract_widgets to discover embedded widget IDs.\n3. For each embedded widget, call this tool with the real script body.\n\nKnown script-bearing embedded widget types and their attribute keys:\n- cf.cplace.lowCodeWidgets.lowCodeText → cf.cplace.lowCodeWidgets.lowCodeTextWidget.script\n- cf.cplace.lowCodeWidgets.lowCodeButton → cf.cplace.lowCodeWidgets.lowCodeButtonWidget.script\n- cf.cplace.visualizations.scriptingHighcharts → cf.cplace.visualization.script\n- cf.cplace.visualizations.scriptingLineChart → cf.cplace.visualization.script\n- cf.cplace.dynamicCodeBlockWidget.dynamicCodeBlockWidget → cf.cplace.dynamicCodeBlockWidget.script\n\nPassing a non-script attribute key writes the value as a string into that attribute (no guard) — verify the attribute key matches a script-typed attribute on the target widget type."; readonly inputSchema: { readonly context: z.ZodEffects; pageUID: z.ZodString; }, "strip", z.ZodTypeAny, { type: "page"; pageUID: string; }, { type: "page"; pageUID: string; }>, z.ZodObject<{ type: z.ZodLiteral<"type">; workspaceId: z.ZodString; typeInternalName: z.ZodString; alternativeLayoutName: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }, { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }>]>, { type: "page"; pageUID: string; } | { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }, unknown>; readonly containerWidgetId: z.ZodString; readonly embeddedWidgetId: z.ZodString; readonly attributeKey: z.ZodString; readonly script: z.ZodString; }; readonly annotations: { readonly title: "Set Embedded Widget Script in Layout RichString"; }; }; readonly cplace_richstring_edit_widget_script: { readonly description: "Apply a string-replacement edit to the script body of a script-typed attribute on an embedded widget inside a layout-resident rich-string container. oldString must match the current raw script body exactly once unless replaceAll is true. Atomic via a single layout.updateWidget call.\n\nUse this tool for iterative refinement of an already-set script body — small, focused diffs over the wire instead of resending the full script. Mirrors the contract of the file Edit tool: matches against the raw script body (the stored CplaceJsScript envelope is unwrapped server-side before matching), fails fast on zero or duplicate matches.\n\nSame target shape and constraints as cplace_richstring_set_widget_script — see that tool's description for the placeholder workflow, the list of script-bearing widget types, and the addressing model."; readonly inputSchema: { readonly context: z.ZodEffects; pageUID: z.ZodString; }, "strip", z.ZodTypeAny, { type: "page"; pageUID: string; }, { type: "page"; pageUID: string; }>, z.ZodObject<{ type: z.ZodLiteral<"type">; workspaceId: z.ZodString; typeInternalName: z.ZodString; alternativeLayoutName: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }, { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }>]>, { type: "page"; pageUID: string; } | { type: "type"; workspaceId: string; typeInternalName: string; alternativeLayoutName?: string | undefined; }, unknown>; readonly containerWidgetId: z.ZodString; readonly embeddedWidgetId: z.ZodString; readonly attributeKey: z.ZodString; readonly oldString: z.ZodString; readonly newString: z.ZodString; readonly replaceAll: z.ZodDefault>; }; readonly annotations: { readonly title: "Edit Embedded Widget Script in Layout RichString"; }; }; }; export declare function registerLayoutRichStringWidgetTools(server: McpServer, client: CplaceApiClient): void; //# sourceMappingURL=layout-richstring-widgets.d.ts.map