chore(vendor): import pi 1.3.0

Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
alexion committed 2026-10-15 17:58:48 -04:00
1 parent 719370c8f7
commit 6081e3e325
1743 files changed
+205459 -131704

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
export type McpFetch = (input: string | URL, init?: RequestInit) => Promise<Response>;
export interface UnauthorizedContext {
/** The 401 response, or a 403 response whose challenge reports `insufficient_scope`. */
response: Response;
serverUrl: URL;
fetch: McpFetch;
/** Access token the rejected request carried, if any. A different current token means another request already refreshed it. */
token?: string;
}
/** Supplies bearer tokens to an MCP HTTP transport and may refresh them after a 401 response. */
export interface AuthProvider {
/**
* Token for the next request. May refresh it over the network first, so the transport calls it only
* before requests whose answer it waits for. Closing a session reuses the token of the last request.
*/
token(): Promise<string | undefined>;
onUnauthorized?(context: UnauthorizedContext): Promise<void>;
}