eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
35 lines (34 loc) • 1.67 kB
TypeScript
import type { ConnectionAuthorizationContext, ConnectionAuthProvider } from "#shared/connection-types.js";
/**
* Authorization provider passed to the tool context's `getToken` or
* `requireAuth` method. Accepts the same shapes as a connection's `auth`:
* - a `getToken`-only object (static API keys, pre-provisioned JWTs);
* `credentialOwner` may be omitted and defaults to `"app"`.
* - a full interactive OAuth definition (e.g. `connect("okta/myagent")` from
* `@vercel/connect/eve`, or `defineInteractiveAuthorization`), which keeps
* `principalType: "user"`.
*/
export type ToolAuthDefinition = ConnectionAuthProvider;
export type ToolAuthProvider = ToolAuthDefinition;
/** Controls eve runtime behavior for an inline tool auth provider. */
export interface ToolAuthOptions {
/**
* Connection metadata passed through to provider callbacks. Tool-only
* providers usually leave this unset; connection-backed helpers can use it
* to receive the upstream server URL.
*/
readonly connection?: ConnectionAuthorizationContext;
/**
* Optional human-readable provider name shown in sign-in UI. Presentation
* only; it does not affect OAuth scopes, token cache keys, or callback URLs.
*/
readonly displayName?: string;
/**
* Optional eve auth-flow key for token caches, callback URLs, pending
* authorization state, and authorization completion. This is not an OAuth
* scope. For Vercel Connect OAuth targeting such as `scopes`, `resources`,
* or `authorizationDetails`, configure the provider with
* `connect({ connector, tokenParams })`.
*/
readonly authKey?: string;
}