import { type AgentsCredential, type AgentsSession } from "./types.js"; export { agentsBaseUrl, DEFAULT_AGENTS_REGION, type AgentsCredential, type AgentsRequestInit, type AgentsSession, } from "./types.js"; /** * Build the transport-facing session handle from a stored credential. * Today every credential is a cookie; when a `kind: "bearer"` variant is * added, branch here to emit an `Authorization` header instead. */ export declare const createAgentsSession: (credential: AgentsCredential) => AgentsSession; export interface CookieSessionInput { /** `Cookie:` header value carrying a live BFF session. */ cookieHeader: string; /** Agentic Studio region — defaults to EU West. */ region?: string; /** Browser User-Agent that owns the cookie — defaults to a current Chrome UA. */ userAgent?: string; } /** * Build a session straight from a browser session cookie — no Playwright, * no keychain. The entry point for embedding contexts that already hold * the cookie: a Sitecore Marketplace app runs inside the authenticated * portal, so the BFF session is present in its browser context and can be * handed straight in. * * One of three ways to reach an `AgentsSession`, all equivalent downstream: * Playwright login (`loginAgents`, CLI), this cookie injection (embedded * UI), and — once Sitecore ships it — a bearer token. See `./types`. */ export declare const agentsSessionFromCookie: (input: CookieSessionInput) => AgentsSession; /** * Load the stored session for an environment. Throws `AUTH_REQUIRED` * (pointing at `scai agents login`) when none is present. Staleness is * detected later — by the transport, on the first 401. */ export declare const acquireAgentsSession: (envName: string) => Promise; export interface LoginAgentsOptions { envName: string; region?: string; /** Max time to wait for the interactive login (ms). */ timeoutMs?: number; } /** * Run the (temporary) interactive browser login and persist the captured * session to the keychain. Returns the stored credential's metadata. */ export declare const loginAgents: (options: LoginAgentsOptions) => Promise<{ region: string; capturedAt: string; }>; /** Forget the stored Agentic Studio session for an environment. */ export declare const logoutAgents: (envName: string) => Promise;