UNPKG

agents

Version:
30 lines (28 loc) 946 B
import { AsyncLocalStorage } from "node:async_hooks"; import { Connection } from "partyserver"; //#region src/internal_context.d.ts type AgentEmail = { from: string; to: string; getRaw: () => Promise<Uint8Array>; headers: Headers; rawSize: number; setReject: (reason: string) => void; forward: (rcptTo: string, headers?: Headers) => Promise<EmailSendResult>; reply: (options: { from: string; to: string; raw: string; }) => Promise<EmailSendResult>; /** @internal Indicates email was routed via createSecureReplyEmailResolver */ _secureRouted?: boolean; }; type AgentContextStore = { agent: unknown; connection: Connection | undefined; request: Request | undefined; email: AgentEmail | undefined; }; declare const agentContext: AsyncLocalStorage<AgentContextStore>; //#endregion export { AgentEmail as n, agentContext as r, AgentContextStore as t }; //# sourceMappingURL=internal_context-CEu5ji80.d.ts.map