UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

38 lines (37 loc) • 2.05 kB
import type { ChannelFrom, ChannelResolveSession, ChannelRespondOptions, ChannelSendOptions, ChannelSource } from "#channel/channel-operations.js"; import type { SessionAuthContext } from "#channel/types.js"; import type { InputResponse, StrictInputResponses } from "#shared/input.js"; import type { UserContent } from "ai"; import type { SlackChannelState } from "#public/channels/slack/slackChannel.js"; type SlackSource = ChannelSource<SlackChannelState>; /** Options for a message send already bound to one Slack thread. */ export type SlackSendOptions = Omit<ChannelSendOptions<SlackChannelState>, "auth" | "state"> & { readonly auth?: SessionAuthContext | null; }; /** Options for an input response already bound to one Slack thread. */ export type SlackRespondOptions = Omit<ChannelRespondOptions<SlackChannelState>, "auth"> & { readonly auth?: SessionAuthContext | null; }; /** Current-owner operations already bound to one Slack thread. */ export interface SlackSessionOperations { send(message: string | UserContent, options?: SlackSendOptions): ReturnType<SlackSource["send"]>; respond<const TResponses extends readonly InputResponse[]>(inputResponses: StrictInputResponses<TResponses>, options?: SlackRespondOptions): ReturnType<SlackSource["respond"]>; cancel(options?: { readonly turnId?: string; }): ReturnType<SlackSource["cancel"]>; compact(): ReturnType<SlackSource["compact"]>; clear(): ReturnType<SlackSource["clear"]>; reset(options?: { readonly reason?: string; }): ReturnType<SlackSource["reset"]>; resolveSession(): ReturnType<ChannelResolveSession>; } /** Binds Slack state and default auth needed only when a message creates a session. */ export declare function bindSlackSessionOperations(input: { readonly address: string; readonly defaultAuth: SessionAuthContext | null; readonly from: ChannelFrom<SlackChannelState>; readonly resolveSession: ChannelResolveSession; readonly state: SlackChannelState; }): SlackSessionOperations; export {};