/** * Tool decorator functions (higher-order functions) * Mirrors Python @protected_by_AuthSec and @mcp_tool decorators */ import type { ToolDefinition, ToolHandler, ToolHandlerWithSession } from './types.js'; interface ProtectedToolOptions { toolName: string; roles?: string[]; groups?: string[]; resources?: string[]; scopes?: string[]; permissions?: string[]; requireAll?: boolean; description?: string; inputSchema?: Record; } /** * Protect a tool via SDK Manager auth service API with optional RBAC. * * The handler receives (arguments, session) where session contains user context. * * @example * ```ts * const adminTool = protectedByAuthSec({ * toolName: 'admin_dashboard', * roles: ['admin'], * description: 'Access admin dashboard', * }, async (args, session) => { * return [{ type: 'text', text: `Hello ${session.userId}` }]; * }); * ``` */ export declare function protectedByAuthSec(options: ProtectedToolOptions, handler: ToolHandler | ToolHandlerWithSession): ToolDefinition; interface McpToolOptions { name?: string; description?: string; inputSchema?: Record; } /** * Define a standard MCP tool (no authentication required). * * @example * ```ts * const echoTool = mcpTool({ * name: 'echo', * description: 'Echo a message', * inputSchema: { * type: 'object', * properties: { message: { type: 'string' } }, * required: ['message'], * }, * }, async (args) => { * return [{ type: 'text', text: args.message }]; * }); * ``` */ export declare function mcpTool(options: McpToolOptions, handler: ToolHandler): ToolDefinition; export {}; //# sourceMappingURL=decorators.d.ts.map