UNPKG

@microsoft/agents-a365-tooling

Version:

Agent 365 Tooling SDK for AI agents built with TypeScript/Node.js

51 lines • 2.6 kB
import { RuntimeConfiguration } from '@microsoft/agents-a365-runtime'; import { ToolingConfigurationOptions } from './ToolingConfigurationOptions'; import { MCPServerConfig } from '../contracts'; /** * Resolve the OAuth scope to request for a given MCP server. * * V2 servers carry their own audience in the `audience` field and get a per-audience token. * V1 servers (no `audience`, or audience matching the shared scope's own audience in plain * or api:// form) fall back to `sharedScope` — the configured mcpPlatformAuthenticationScope. * * @param server The MCP server config returned by the gateway or manifest. * @param sharedScope The configured shared scope (mcpPlatformAuthenticationScope). * Defaults to the prod ATG scope so that external callers without a custom config * continue to work without passing the argument. */ export declare function resolveTokenScopeForServer(server: MCPServerConfig, sharedScope?: string): string; /** * Configuration for tooling package. * Inherits runtime settings and adds tooling-specific settings. */ export declare class ToolingConfiguration extends RuntimeConfiguration { protected get toolingOverrides(): ToolingConfigurationOptions; constructor(overrides?: ToolingConfigurationOptions); get mcpPlatformEndpoint(): string; /** * Whether to use the ToolingManifest.json file instead of gateway discovery. * Returns true when NODE_ENV is set to 'development' (case-insensitive), or * when explicitly overridden via configuration. */ get useToolingManifest(): boolean; /** * Gets the MCP platform authentication scope. * Used by AgenticAuthenticationService for token exchange. * Trims whitespace to prevent token exchange failures. */ get mcpPlatformAuthenticationScope(): string; /** * Returns the dev-mode bearer token for an MCP server by name. * Checks BEARER_TOKEN_<SERVERNAME_UPPER> first, then falls back to BEARER_TOKEN. * Returns undefined when the variable is not set (no Authorization header will be attached). */ getBearerTokenForServer(mcpServerName: string): string | undefined; /** * Returns true when a per-server bearer token env var (BEARER_TOKEN_<SERVERNAME_UPPER>) * is explicitly set for the given server, false when only the shared BEARER_TOKEN fallback * would be used. Used to detect V2 servers that are silently falling back to a * wrong-audience token in dev mode. */ hasPerServerBearerToken(mcpServerName: string): boolean; } //# sourceMappingURL=ToolingConfiguration.d.ts.map