Freigeben über


@microsoft/agents-a365-runtime package

Klassen

AgenticAuthenticationService

Dienst für die Verarbeitung der agentischen Benutzerauthentifizierung.

DefaultConfigurationProvider

Standardanbieter, der umgebungsbasierte Konfiguration zurückgibt.

Überlegungen zu mehreren Mandanten: Dieser Anbieter erstellt zur Erstellungszeit eine einzelne Konfigurationsinstanz, die für alle Anforderungen in einem Prozess freigegeben wird. Die Standardanbieter auf Modulebene (z. B. defaultRuntimeConfigurationProvider) sind Singletons.

Für Szenarien mit mehreren Mandanten werden zwei Ansätze unterstützt:

  1. Dynamische Außerkraftsetzungsfunktionen (empfohlen): Übergeben Sie Überschreibungsfunktionen, die aus asynchronem Kontext (z. B. OpenTelemetry-Gepäck) zur Laufzeit gelesen werden. Die gleiche Konfigurationsinstanz gibt unterschiedliche Werte pro Anforderung zurück.

    const config = new ToolingConfiguration({
      mcpPlatformEndpoint: () => {
        const tenantConfig = context.active().getValue(TENANT_KEY);
        return tenantConfig?.endpoint ?? 'https://default.endpoint';
      }
    });
    
  2. Mandantenspezifische Anbieter: Erstellen Sie separate Anbieterinstanzen für jeden Mandanten, wenn unterschiedliche Mandanten unterschiedliche Außerkraftsetzungsfunktionen vollständig benötigen.

OperationError

Kapselt einen Fehler aus einem Vorgang.

OperationResult

Stellt das Ergebnis eines Vorgangs dar.

PowerPlatformApiDiscovery
RuntimeConfiguration

Basiskonfigurationsklasse für Agent365 SDK. Andere Pakete erweitern dies, um eigene Einstellungen hinzuzufügen.

Außerkraftsetzungsfunktionen werden für jeden Eigenschaftszugriff aufgerufen und ermöglichen die dynamische Auflösung aus asynchronem Kontext (z. B. OpenTelemetry-Gepäck) pro Anforderung.

Utility

Hilfsklasse, die Hilfsmethoden für Agent-Laufzeitvorgänge bereitstellt.

Schnittstellen

IConfigurationProvider

Generische Schnittstelle für die Konfiguration. Jedes Paket definiert seinen eigenen Konfigurationstyp T.

Typaliase

RuntimeConfigurationOptions

Laufzeitkonfigurationsoptionen – alle optionalen Funktionen. Funktionen werden für jeden Eigenschaftszugriff aufgerufen und ermöglichen die dynamische Auflösung. Nicht festgelegte Werte fallen auf Umgebungsvariablen zurück.

Enumerationen

ClusterCategory

Clusterkategorien für die Power Platform-API-Ermittlung. Die Zeichenfolgenumierung stellt sowohl die Sicherheit des Kompilierungszeittyps als auch die Laufzeitüberprüfung bereit.

Functions

getClusterCategory(IConfigurationProvider<RuntimeConfiguration>)

Ruft die Clusterkategorie aus Umgebungsvariablen ab.

Beispiel

// Before:
import { getClusterCategory } from '@microsoft/agents-a365-runtime';
const cluster = getClusterCategory();

// After:
import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
const cluster = defaultRuntimeConfigurationProvider.getConfiguration().clusterCategory;
getMcpPlatformAuthenticationScope()

Ruft den Authentifizierungsbereich der MCP-Plattform ab.

Beispiel

// Before:
import { getMcpPlatformAuthenticationScope } from '@microsoft/agents-a365-runtime';
const scope = getMcpPlatformAuthenticationScope();

// After:
import { defaultToolingConfigurationProvider } from '@microsoft/agents-a365-tooling';
const scope = defaultToolingConfigurationProvider.getConfiguration().mcpPlatformAuthenticationScope;
getObservabilityAuthenticationScope()

Gibt den Authentifizierungsbereich für den Observability-Dienst zurück.

Beispiel

// Before:
import { getObservabilityAuthenticationScope } from '@microsoft/agents-a365-runtime';
const scopes = getObservabilityAuthenticationScope();

// After:
import { defaultObservabilityConfigurationProvider } from '@microsoft/agents-a365-observability';
const scopes = [...defaultObservabilityConfigurationProvider.getConfiguration().observabilityAuthenticationScopes];
isDevelopmentEnvironment(IConfigurationProvider<RuntimeConfiguration>)

Gibt true zurück, wenn es sich bei der aktuellen Umgebung um eine Entwicklungsumgebung handelt.

Beispiel

// Before:
import { isDevelopmentEnvironment } from '@microsoft/agents-a365-runtime';
if (isDevelopmentEnvironment()) { ... }

// After:
import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
if (defaultRuntimeConfigurationProvider.getConfiguration().isDevelopmentEnvironment) { ... }

Variablen

DEVELOPMENT_ENVIRONMENT_NAME
PRODUCTION_ENVIRONMENT_NAME
PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE

Produktions-MCP-Plattformauthentifizierungsbereich.

PROD_OBSERVABILITY_CLUSTER_CATEGORY

Standardclusterkategorie für Produktionsumgebungen.

PROD_OBSERVABILITY_SCOPE

Produktions-Observability-Authentifizierungsbereich.

defaultRuntimeConfigurationProvider

Freigegebener Standardanbieter für RuntimeConfiguration. Verwendet Umgebungsvariablen ohne Außerkraftsetzungen – geeignet für Einzelmandantenbereitstellungen oder bei Verwendung dynamischer Außerkraftsetzungsfunktionen für mehrinstanzenfähig.

Details zur Funktion

getClusterCategory(IConfigurationProvider<RuntimeConfiguration>)

Warnung

Diese API ist nun veraltet.

Use RuntimeConfiguration.clusterCategory instead.

Ruft die Clusterkategorie aus Umgebungsvariablen ab.

Beispiel

// Before:
import { getClusterCategory } from '@microsoft/agents-a365-runtime';
const cluster = getClusterCategory();

// After:
import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
const cluster = defaultRuntimeConfigurationProvider.getConfiguration().clusterCategory;
function getClusterCategory(configProvider?: IConfigurationProvider<RuntimeConfiguration>): string

Parameter

configProvider

IConfigurationProvider<RuntimeConfiguration>

Optionaler Konfigurationsanbieter. Standardwert ist "defaultRuntimeConfigurationProvider", falls nicht angegeben.

Gibt zurück

string

Die Clusterkategorie von CLUSTER_CATEGORY env var, wird standardmäßig auf "prod" festgelegt.

getMcpPlatformAuthenticationScope()

Warnung

Diese API ist nun veraltet.

Use ToolingConfiguration.mcpPlatformAuthenticationScope instead.

Ruft den Authentifizierungsbereich der MCP-Plattform ab.

Beispiel

// Before:
import { getMcpPlatformAuthenticationScope } from '@microsoft/agents-a365-runtime';
const scope = getMcpPlatformAuthenticationScope();

// After:
import { defaultToolingConfigurationProvider } from '@microsoft/agents-a365-tooling';
const scope = defaultToolingConfigurationProvider.getConfiguration().mcpPlatformAuthenticationScope;
function getMcpPlatformAuthenticationScope(): string

Gibt zurück

string

Der Authentifizierungsbereich der MCP-Plattform.

getObservabilityAuthenticationScope()

Warnung

Diese API ist nun veraltet.

Use ObservabilityConfiguration.observabilityAuthenticationScopes instead.

Gibt den Authentifizierungsbereich für den Observability-Dienst zurück.

Beispiel

// Before:
import { getObservabilityAuthenticationScope } from '@microsoft/agents-a365-runtime';
const scopes = getObservabilityAuthenticationScope();

// After:
import { defaultObservabilityConfigurationProvider } from '@microsoft/agents-a365-observability';
const scopes = [...defaultObservabilityConfigurationProvider.getConfiguration().observabilityAuthenticationScopes];
function getObservabilityAuthenticationScope(): string[]

Gibt zurück

string[]

Die Authentifizierungsbereiche für die aktuelle Umgebung.

isDevelopmentEnvironment(IConfigurationProvider<RuntimeConfiguration>)

Warnung

Diese API ist nun veraltet.

Use RuntimeConfiguration.isDevelopmentEnvironment instead.

Gibt true zurück, wenn es sich bei der aktuellen Umgebung um eine Entwicklungsumgebung handelt.

Beispiel

// Before:
import { isDevelopmentEnvironment } from '@microsoft/agents-a365-runtime';
if (isDevelopmentEnvironment()) { ... }

// After:
import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
if (defaultRuntimeConfigurationProvider.getConfiguration().isDevelopmentEnvironment) { ... }
function isDevelopmentEnvironment(configProvider?: IConfigurationProvider<RuntimeConfiguration>): boolean

Parameter

configProvider

IConfigurationProvider<RuntimeConfiguration>

Optionaler Konfigurationsanbieter. Standardwert ist "defaultRuntimeConfigurationProvider", falls nicht angegeben.

Gibt zurück

boolean

True, wenn die aktuelle Umgebung entwicklung ist, andernfalls "false".

Details zu Variablen

DEVELOPMENT_ENVIRONMENT_NAME

DEVELOPMENT_ENVIRONMENT_NAME: "Development"

Typ

"Development"

PRODUCTION_ENVIRONMENT_NAME

PRODUCTION_ENVIRONMENT_NAME: "production"

Typ

"production"

PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE

Warnung

Diese API ist nun veraltet.

This constant is exported for backward compatibility only. For new code, use ToolingConfiguration.mcpPlatformAuthenticationScope instead.

Produktions-MCP-Plattformauthentifizierungsbereich.

PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE: "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default"

Typ

string

PROD_OBSERVABILITY_CLUSTER_CATEGORY

Warnung

Diese API ist nun veraltet.

This constant is exported for backward compatibility only. For new code, use RuntimeConfiguration.clusterCategory instead.

Standardclusterkategorie für Produktionsumgebungen.

PROD_OBSERVABILITY_CLUSTER_CATEGORY: "prod"

Typ

"prod"

PROD_OBSERVABILITY_SCOPE

Warnung

Diese API ist nun veraltet.

This constant is exported for backward compatibility only. For new code, use ObservabilityConfiguration.observabilityAuthenticationScopes instead.

Produktions-Observability-Authentifizierungsbereich.

PROD_OBSERVABILITY_SCOPE: "https://api.powerplatform.com/.default"

Typ

string

defaultRuntimeConfigurationProvider

Freigegebener Standardanbieter für RuntimeConfiguration. Verwendet Umgebungsvariablen ohne Außerkraftsetzungen – geeignet für Einzelmandantenbereitstellungen oder bei Verwendung dynamischer Außerkraftsetzungsfunktionen für mehrinstanzenfähig.

defaultRuntimeConfigurationProvider: DefaultConfigurationProvider<RuntimeConfiguration>

Typ