import type { GuildMessageSearchOptions, MessagePageOptions } from "./discord-client.js"; import { normalizeChannel, normalizeSearchMessage } from "./normalize.js"; import type { ScopePolicy } from "./policy.js"; import type { DiscordChannel, DiscordMessage, DiscordMessageSearchIndexing, DiscordMessageSearchResponse, RequestOptions } from "./types.js"; type NormalizedSearchMessage = ReturnType; type NormalizedSearchThread = ReturnType; export interface MessageSearchIndexingResult { documentsIndexed: number | null; guildId: string; retryAfterMs: number; schemaVersion: number; status: "indexing"; } export interface MessageSearchOkResult { documentsIndexed: number | null; doingDeepHistoricalIndex: boolean; guildId: string; messages: NormalizedSearchMessage[]; page: { nextOffset: number | null; offset: number; requestedLimit: number; returned: number; totalResultsEstimate: number; }; schemaVersion: number; status: "ok"; threads: NormalizedSearchThread[]; } export type MessageSearchResult = MessageSearchIndexingResult | MessageSearchOkResult; export interface ConversationRecallRequest { after?: string; authorIds?: readonly string[]; before?: string; channelIds?: readonly string[]; contextRadius?: number; guildId: string; limit?: number; searchPhrases: readonly string[]; slop?: number; } export interface NormalizedConversationRecallRequest { after?: string; authorIds?: string[]; before?: string; channelIds?: string[]; contextRadius: number; guildId: string; limit: number; maxId?: string; minId?: string; searchPhrases: string[]; slop: number; } export interface ConversationRecallPrivacy { contextProfiles: "omitted"; persistence: "none"; phraseText: "input-only"; rawPayloads: "omitted"; } export interface ConversationRecallContextMessage { attachmentCount: number; authorBot: boolean; authorId: string; authorSystem: boolean; channelId: string; componentCount: number; content: string; editedTimestamp: string | null; embedCount: number; guildId: string; id: string; jumpUrl: string; replyToMessageId: string | null; timestamp: string; type: number; } export interface ConversationRecallContext { messages: ConversationRecallContextMessage[]; newestMessageId: string; oldestMessageId: string; targetOrdinal: number; } export interface ConversationRecallMatch { channelId: string; context: ConversationRecallContext; matchedPhraseIndexes: number[]; messageId: string; rank: number; } export interface ConversationRecallSearchEvidence { documentsIndexed: number | null; phraseIndex: number; returned: number; totalResultsEstimate: number; } export interface ConversationRecallIndexingResult { attemptedPhraseCount: number; documentsIndexed: number | null; guildId: string; privacy: ConversationRecallPrivacy; retryAfterMs: number; schemaVersion: number; searchedPhraseCount: number; status: "indexing"; } export interface ConversationRecallOkResult { attemptedPhraseCount: number; contextRadius: number; doingDeepHistoricalIndex: boolean; guildId: string; limitations: readonly string[]; matches: ConversationRecallMatch[]; privacy: ConversationRecallPrivacy; requestedLimit: number; schemaVersion: number; searchedPhraseCount: number; searches: ConversationRecallSearchEvidence[]; status: "ok"; } export type ConversationRecallResult = ConversationRecallIndexingResult | ConversationRecallOkResult; export interface MessageSearchServiceClient { getChannel(channelId: string, options?: RequestOptions): Promise; listMessages(channelId: string, options?: MessagePageOptions): Promise; searchGuildMessages(guildId: string, options?: GuildMessageSearchOptions): Promise; } export interface MessageSearchServiceOptions { client: MessageSearchServiceClient; policy: Pick; } export declare function conversationRecallTimestampSnowflake(value: unknown, description: string): { snowflake: string; timestamp: string; }; export declare function normalizeConversationRecallRequest(request: ConversationRecallRequest): NormalizedConversationRecallRequest; export declare class MessageSearchService { #private; constructor(options: MessageSearchServiceOptions); search(guildId: string, options?: GuildMessageSearchOptions): Promise; recall(request: ConversationRecallRequest, options?: RequestOptions): Promise; } export {}; //# sourceMappingURL=message-search-service.d.ts.map