import { DatasourceAction } from "./action.js";
import * as _tanstack_react_start10 from "@tanstack/react-start";

//#region src/mcp.d.ts

type SoftrMcpOptions = {
  /**
   * The actions to expose as tools, from `defineQuery` and `defineMutation`.
   *
   * Listing them is deliberate: an action left out is invisible over MCP, even
   * though the app's own pages may use it. The action's own `permissions` still
   * decide who may run the ones that are listed.
   */
  actions?: Array<DatasourceAction>;
};
/**
 * Serves the MCP endpoint and its OAuth flow from the app's own origin.
 *
 * Register it in the app's `src/start.ts`, ahead of `softrAuthMiddleware`: it
 * answers its own paths and resolves the caller from the bearer token, so it
 * must not sit behind the session lookup that middleware does on every
 * request. Everything else passes straight through.
 *
 * @example
 * import { publishedPosts, addCafe } from './actions'
 *
 * export const startInstance = createStart(() => ({
 *   requestMiddleware: [
 *     softrMcpMiddleware({ actions: [publishedPosts, addCafe] }),
 *     softrAuthMiddleware(),
 *   ],
 * }))
 */
declare function softrMcpMiddleware(options?: SoftrMcpOptions): _tanstack_react_start10.RequestMiddlewareAfterServer<{}, undefined, undefined>;
//#endregion
export { softrMcpMiddleware };