/**
 * @fileoverview Convenience builders for MCP Apps — `appTool()` and `appResource()`.
 * Wraps the standard `tool()` and `resource()` builders with MCP Apps-specific
 * defaults: auto-populates `_meta.ui.resourceUri`, sets the correct MIME type,
 * handles the compat key (`ui/resourceUri`) required by some hosts, and mirrors
 * app resource `_meta.ui` into `resources/read` content items.
 * @module src/mcp-server/apps/appBuilders
 */
import type { ZodObject, ZodRawShape } from 'zod';
import type { ResourceDefinition } from '../../mcp-server/resources/utils/resourceDefinition.js';
import type { ToolDefinition } from '../../mcp-server/tools/utils/toolDefinition.js';
import type { ErrorContract } from '../../types-global/errors.js';
/**
 * MIME type for MCP Apps HTML resources.
 * Matches `RESOURCE_MIME_TYPE` from `@modelcontextprotocol/ext-apps/server`
 * so consumers don't need the peer dependency for this constant alone.
 */
export declare const APP_RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
/** Options for `appTool()` — extends standard tool options with the UI resource URI. */
type AppToolOptions<TInput extends ZodObject<ZodRawShape>, TOutput extends ZodObject<ZodRawShape>, TErrors extends readonly ErrorContract[] | undefined = undefined> = Omit<ToolDefinition<TInput, TOutput, TErrors>, '_meta' | 'name'> & {
    /**
     * Additional `_meta` fields. `ui` sub-fields (e.g. `csp`, `visibility`, `permissions`)
     * are merged with the auto-populated `resourceUri`. The `resourceUri` value from the
     * top-level option always wins — it cannot be overridden via `extraMeta.ui.resourceUri`.
     */
    extraMeta?: Record<string, unknown>;
    /** URI of the `ui://` resource that hosts will fetch and render as a sandboxed iframe. */
    resourceUri: string;
};
/**
 * Creates an MCP Apps tool definition. Wraps `tool()` with:
 * - `_meta.ui.resourceUri` set automatically
 * - `_meta['ui/resourceUri']` compat key set automatically
 *
 * Accepts the same `errors: [...]` contract as the standard `tool()` builder —
 * the `const TErrors` modifier preserves literal reasons so the handler's
 * `ctx.fail` is typed against the declared reason union.
 *
 * @example
 * ```ts
 * import { appTool, z } from '@cyanheads/mcp-ts-core';
 *
 * export const myAppTool = appTool('my_app_tool', {
 *   resourceUri: 'ui://my-app/app.html',
 *   description: 'Interactive widget.',
 *   input: z.object({ query: z.string().describe('Search query') }),
 *   output: z.object({ items: z.array(z.string()).describe('Results') }),
 *   handler(input, ctx) { return { items: ['a', 'b'] }; },
 * });
 * ```
 */
export declare function appTool<TInput extends ZodObject<ZodRawShape>, TOutput extends ZodObject<ZodRawShape>, const TErrors extends readonly ErrorContract[] | undefined = undefined>(name: string, options: AppToolOptions<TInput, TOutput, TErrors>): ToolDefinition<TInput, TOutput, TErrors>;
/** Options for `appResource()` — standard resource options with app-specific defaults. */
type AppResourceOptions<TParams extends ZodObject<ZodRawShape>, TOutput extends ZodObject<ZodRawShape> | undefined = undefined, TErrors extends readonly ErrorContract[] | undefined = undefined> = Omit<ResourceDefinition<TParams, TOutput, TErrors>, 'mimeType' | 'uriTemplate'> & {
    /** Override the default `text/html;profile=mcp-app` MIME type. Rarely needed. */
    mimeType?: string;
};
/**
 * Creates an MCP Apps resource definition. Wraps `resource()` with:
 * - `mimeType` defaulting to `text/html;profile=mcp-app`
 * - `annotations.audience` defaulting to `['user']`
 * - `_meta.ui` preserved on the definition and mirrored into `resources/read`
 *   content items so hosts receive the same CSP/permission metadata at read time
 *
 * The `uriTemplate` should use the `ui://` scheme.
 *
 * @example
 * ```ts
 * import { appResource, z } from '@cyanheads/mcp-ts-core';
 *
 * export const myAppResource = appResource('ui://my-app/app.html', {
 *   name: 'my-app-ui',
 *   description: 'Interactive UI for my_app_tool.',
 *   params: z.object({}).describe('No parameters.'),
 *   _meta: {
 *     ui: {
 *       csp: { resourceDomains: ['https://cdn.example.com'] },
 *     },
 *   },
 *   handler(_params, ctx) {
 *     return '<html>...</html>';
 *   },
 * });
 * ```
 */
export declare function appResource<TParams extends ZodObject<ZodRawShape>, TOutput extends ZodObject<ZodRawShape> | undefined = undefined, const TErrors extends readonly ErrorContract[] | undefined = undefined>(uriTemplate: string, options: AppResourceOptions<TParams, TOutput, TErrors>): ResourceDefinition<TParams, TOutput, TErrors>;
export {};
//# sourceMappingURL=appBuilders.d.ts.map