Skip to main content

wrap<T>

Wrap a standard SDK client to enable automatic logging, interception, and rollbacks. Signature:
wrap<T extends object>(client: T, session: string | Session, options: WrapOptions): T
  • client: The standard SDK instance (e.g., octokit).
  • session: The active agent session ID or object.
  • options: A WrapOptions object including the connector identifier.
Returns:
A recursive Proxy of the original client (T), ensuring 100% type preservation.
Where WrapOptions is:
{
    connector: string;
    requiresApproval?: string[];
    pollIntervalMs?: number;
    timeoutMs?: number;
}