import type { IMastraLogger } from '../logger/index.js'; import type { ToolAction } from '../tools/types.js'; import type { ToolProvider, ToolProviders } from './types.js'; /** * Lookup function the runtime uses to resolve a registered provider by id. */ export type ToolProviderLookup = (providerId: string) => ToolProvider; export interface ResolveStoredToolProvidersOpts { /** Per-request context plumbed to each `provider.resolveToolsVNext` call. */ requestContext?: Record; /** * Agent author's user id. Used as the provider user bucket for * `kind: 'author'` connections so pinned credentials work for any invoker. */ authorId?: string; /** Optional logger for non-fatal per-connection warnings. */ logger?: IMastraLogger; } /** * Sanitize a connection label into the suffix segment appended to a tool slug * (`__`). * * Rules: * - Uppercase. * - Non-`[A-Z0-9_]` characters become `_`. * - On collision with `usedSuffixes`, append `_2`, `_3`, ... until unique. * - The returned suffix is added to `usedSuffixes` in place. */ export declare function buildConnectionSuffix(label: string | undefined, usedSuffixes: Set): string; /** * Provider-agnostic runtime fan-out. * * For every stored `toolProviders[providerId].connections[toolkit]` * entry, calls `provider.resolveToolsVNext` once per connection, then renames * the resulting tools with a `__