UNPKG

@openai/agents-core

Version:

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.

42 lines (41 loc) • 3.22 kB
import type { RunState } from '../../runState'; import type { Agent, AgentOutputType } from '../../agent'; import type { SandboxClient, SandboxClientOptions } from '../client'; import { Manifest } from '../manifest'; import { type SandboxSessionState, type SandboxSessionStateEnvelope } from '../session'; import { type RunStateSessionTrustedConfig } from '../internal/sessionStateTrust'; export type SerializedSandboxSessionEntry = { backendId: string; currentAgentKey: string; currentAgentName: string; sessionState: SandboxSessionStateEnvelope; preservedOwnedSession?: boolean; reuseLiveSession?: boolean; requiresFreshCreation?: boolean; }; export type SerializedSandboxState = { backendId: string; currentAgentKey: string; currentAgentName: string; sessionState: SandboxSessionStateEnvelope; sessionsByAgent: Record<string, SerializedSandboxSessionEntry>; }; export declare function getSerializedSandboxState<TContext>(runState: RunState<TContext, Agent<TContext, AgentOutputType>> | undefined): SerializedSandboxState | undefined; export declare function sanitizeSerializedSandboxState(state: SerializedSandboxState): SerializedSandboxState; export declare function toSessionStateEnvelope(backendId: string, state: SandboxSessionState, providerState: Record<string, unknown>, options?: { environmentPreparation?: 'client'; trustedManifest?: Manifest; }): SandboxSessionStateEnvelope; export declare function mergeClientPreparedManifestAuthority(providerManifest: Manifest, trustedManifest: Manifest): Manifest; export declare function clientPreparedManifestAuthoritiesMatch(providerManifest: Manifest, leftTrustedManifest: Manifest, rightTrustedManifest: Manifest): boolean; export declare function assertSessionStateEnvelope(client: SandboxClient, envelope: SandboxSessionStateEnvelope): void; export declare function deserializeSandboxSessionStateEntry(client: SandboxClient, serializedEntry: SerializedSandboxSessionEntry | undefined, trustedManifest?: Manifest, trustedConfig?: RunStateSessionTrustedConfig, options?: { trustedManifestAlreadyResolved?: boolean; }): Promise<SandboxSessionState | undefined>; export declare function resolveTrustedManifestForResume(client: SandboxClient, trustedManifest: Manifest | undefined, clientOptions?: SandboxClientOptions): Manifest | undefined; export declare function assertTrustedManifestForDockerRunState(client: SandboxClient, trustedManifest: Manifest | undefined): void; export declare function getSerializedSessionEntryForAgent(sandboxState: SerializedSandboxState | undefined, currentAgentKey: string): SerializedSandboxSessionEntry | undefined; export declare function serializedSessionEntryHasInContainerMounts(entry: SerializedSandboxSessionEntry | undefined): boolean; export declare function serializedSessionEntryRequiresFreshMountAuthority(entry: SerializedSandboxSessionEntry | undefined): boolean; export declare function getPreviousSerializedSessionsByAgent(sandboxState: SerializedSandboxState | undefined, client: SandboxClient): Record<string, SerializedSandboxSessionEntry>; export declare function hasPreservedOwnedSessions(sandboxState: SerializedSandboxState | undefined): boolean;