- Add shared hasRepliedRef state between auto-reply and tool paths - Extract buildSlackThreadingContext helper in agent-runner.ts - Extract resolveThreadTsFromContext helper in slack-actions.ts - Update docs with clear replyToMode table (off/first/all) - Add tests for first mode behavior across multiple messages
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import type { TypingController } from "./reply/typing.js";
|
|
|
|
export type BlockReplyContext = {
|
|
abortSignal?: AbortSignal;
|
|
timeoutMs?: number;
|
|
};
|
|
|
|
export type GetReplyOptions = {
|
|
onReplyStart?: () => Promise<void> | void;
|
|
onTypingController?: (typing: TypingController) => void;
|
|
isHeartbeat?: boolean;
|
|
onPartialReply?: (payload: ReplyPayload) => Promise<void> | void;
|
|
onReasoningStream?: (payload: ReplyPayload) => Promise<void> | void;
|
|
onBlockReply?: (
|
|
payload: ReplyPayload,
|
|
context?: BlockReplyContext,
|
|
) => Promise<void> | void;
|
|
onToolResult?: (payload: ReplyPayload) => Promise<void> | void;
|
|
disableBlockStreaming?: boolean;
|
|
/** Timeout for block reply delivery (ms). */
|
|
blockReplyTimeoutMs?: number;
|
|
/** If provided, only load these skills for this session (empty = no skills). */
|
|
skillFilter?: string[];
|
|
/** Mutable ref to track if a reply was sent (for Slack "first" threading mode). */
|
|
hasRepliedRef?: { value: boolean };
|
|
};
|
|
|
|
export type ReplyPayload = {
|
|
text?: string;
|
|
mediaUrl?: string;
|
|
mediaUrls?: string[];
|
|
replyToId?: string;
|
|
replyToTag?: boolean;
|
|
/** Send audio as voice message (bubble) instead of audio file. Defaults to false. */
|
|
audioAsVoice?: boolean;
|
|
isError?: boolean;
|
|
};
|