eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
24 lines (23 loc) • 1.28 kB
TypeScript
import type { SessionAuthContext } from "#channel/types.js";
import type { ApprovalResponseAuth } from "#approval/definition.js";
import type { ToolContext, ToolExecuteOptions } from "#tools/definition.js";
import type { TaskExec } from "#tools/task.js";
type ToolExecuteWithAuthInput<TInput> = {
readonly scope: string;
} & ({
readonly execution: "background";
readonly execute: (toolInput: TInput, ctx: ToolContext, task: TaskExec) => unknown;
} | {
readonly execution?: never;
readonly execute: (toolInput: TInput, ctx: ToolContext, task?: TaskExec) => unknown;
});
/** Supplies the shared auth capability to one authored tool execution. */
export declare function createToolExecuteWithAuth<TInput>(input: ToolExecuteWithAuthInput<TInput>): (toolInput: TInput, options: ToolExecuteOptions, task?: TaskExec) => AsyncIterable<unknown> | Promise<unknown>;
/** Binds the same capability to the person responding to an approval. */
export declare function buildApprovalResponseAuth(input: {
readonly responder: SessionAuthContext;
readonly scope: string;
}): ApprovalResponseAuth;
/** Starts authorization requested by an approval response authorizer. */
export declare function handleApprovalResponsePolicyError(error: unknown): Promise<unknown>;
export {};