eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
15 lines (14 loc) • 874 B
TypeScript
import type { SessionAuthContext } from "#channel/types.js";
import type { ToolAuthOptions, ToolAuthProvider } from "#tools/definition.js";
import type { TokenResult } from "#shared/connection-types.js";
import { type ScopedAuthorization } from "#runtime/connections/scoped-authorization.js";
/** Shared getToken/requireAuth capability, independent of the executing tool or workflow. */
export declare function createAuthorizationContext(input: {
readonly scope: string;
readonly boundResponder?: SessionAuthContext;
readonly completeAuthorization?: (scoped: ScopedAuthorization) => Promise<boolean>;
}): {
getToken(provider?: ToolAuthProvider, options?: ToolAuthOptions): Promise<TokenResult>;
requireAuth(provider?: ToolAuthProvider, options?: ToolAuthOptions): never;
run: (execute: () => unknown) => Promise<unknown> | AsyncIterable<unknown>;
};