import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { z } from 'zod'; import { CplaceApiClient } from '../api.js'; export declare const ENUM_PROVIDER_SIMULATION_TOOL_DEFINITIONS: { readonly cplace_simulate_enum_provider: { readonly description: "Execute an enum provider script under the production enum-provider engine context — without persisting anything.\n\n**Two primary use cases:**\n1. **Pre-attach testing of a candidate script.** Attaching a provider via\ncplace_manage_enum_provider is destructive: its enumOptions() result REPLACES the\nattribute's stored enumeration options and the old static list cannot be recovered.\nSimulate the candidate first to see exactly what it would compute — zero changes\nto the attribute.\n2. **Per-page filterByValues verification.** filterByValues(ownerEntity) runs per\nentity at display time only; no write triggers it, so no other tool can verify it.\nPass ownerEntityUID to see the filtered subset a specific page would show.\n\n**Four modes** from the two optional parameters:\n- no `script`, no `ownerEntityUID`: re-runs the stored provider (cheap \"does the\n stored script still run\" check; executes the attached script even when the\n provider is disabled)\n- `script` only: candidate options preview\n- `script` + `ownerEntityUID`: candidate options + filtered subset for that page\n- `ownerEntityUID` only: stored provider options + filtered subset for that page\n\n**⚠️ Mode-dependent intersection semantics for filteredOptions:**\n- **Stored mode** (no `script`) mirrors what the page shows TODAY: the\n filterByValues result is intersected with the attribute's currently stored\n elements (production's display formula).\n- **Candidate mode** (`script` given) predicts the POST-ATTACH state: the\n filterByValues result is intersected with the candidate's own enumOptions()\n output instead.\nThe same script text can therefore yield different filteredOptions in the two\nmodes. The response names the base used in `intersectionBase`\n(\"storedElements\" | \"candidateOptions\").\n\n**Response**: `mode`, `options` (the enumOptions() output as\n{value, localizedName?, icon?}), `invalidOptionValues` (only when present:\noptions whose value is missing or type-mismatched for the attribute kind), and —\nonly when `ownerEntityUID` was given — `filterByValuesPresent`,\n`filteredOptions`, `intersectionBase`. When the script has no filterByValues,\n`filterByValuesPresent` is false and `filteredOptions` equals the full\nintersection base (production: no filtering). Script errors return\n{error: {message, line}}.\n\n**Injected bindings** (replicating the production engine row — see\n`script-context-cards/enum-provider.md`): `messages` (the type's message\nprovider), `enumValues` (the stored enumeration elements as primitives),\n`defaultValues` (the attribute's default values as primitives),\n`customAttribute` (the attribute's internal name).\n**Allowed type classes**: `Search`, `Filters`. **Mode**: read-only — the\nprovider script's execution path never writes. **Timeout**: 30 seconds.\n\n**Known deviations from production**: runs with the caller's read permissions\n(production suspends read checks); plugin-extension enumeration filters\n(FilterEnumerationValuesPluginExtension) are not applied.\n\n**Script contract**: the script must end with a top-level return of an object\nwith a mandatory enumOptions() function returning an array of options\n(plain value or {value, name, icon}), and an optional\nfilterByValues(ownerEntity) function. triggerEntities()/systemTriggers() may be\npresent but are not exercised by the simulation — nothing is persisted, so no\ntrigger registration happens. Only for low-code ENUM_PROVIDER scripts —\nnot the Java-class DynamicEnumerationProvider."; readonly inputSchema: { readonly workspaceId: z.ZodString; readonly typeInternalName: z.ZodString; readonly attributeName: z.ZodString; readonly script: z.ZodOptional; readonly ownerEntityUID: z.ZodOptional; }; readonly annotations: { readonly title: "Simulate Enum Provider Script"; }; }; }; export declare function registerEnumProviderSimulationTools(server: McpServer, client: CplaceApiClient): void; //# sourceMappingURL=enum-provider-simulation.d.ts.map