import { h as AgentMentionProviderQueryDiagnostic, i as AgentMentionRawGroups, n as AgentMentionTotalCounts, f as AgentMentionIssueTopicGroup, k as AgentMentionSearchDiagnosticLog, l as AgentMentionSearchListener, e as AgentMentionGroupId, c as AgentMentionFilterId, m as AgentMentionSearchState, j as AgentMentionSearchControllerOptions, g as AgentMentionLifecycleDiagnosticLog, R as RuntimeDiagnosticsDetailValue, A as AgentContextMentionItem, d as AgentMentionGroup } from './AgentMentionSearchContracts.d-BsdR0M3b.js'; export { b as AgentMentionBrowseCategory } from './AgentMentionSearchContracts.d-BsdR0M3b.js'; import { AgentContextMentionProvider } from './context-mention-provider.js'; import { ReferenceProvenanceFilter, ReferenceProvenanceCatalog } from '@tutti-os/workspace-file-reference/contracts'; import '@tiptap/core'; import '@tutti-os/ui-rich-text/at-panel'; import '@tutti-os/ui-rich-text/types'; import '@tutti-os/workspace-external-core/contracts'; interface AgentMentionBrowseFetchResult { providerDiagnostics: AgentMentionProviderQueryDiagnostic[]; rawGroups: AgentMentionRawGroups; totalCounts: AgentMentionTotalCounts; issueTopicGroups: AgentMentionIssueTopicGroup[] | null; } interface AgentMentionBrowseCacheEntry extends AgentMentionBrowseFetchResult { cachedAt: number; } type AgentMentionBrowseLoadReason = "open" | "preload"; declare const MAX_BROWSE_CACHE_ENTRIES = 64; declare function resetAgentMentionSearchBrowseCacheForTests(): void; interface AgentGuiScheduledTask { cancel(): void; } interface AgentGuiScheduler { schedule(delayMs: number, task: () => void): AgentGuiScheduledTask; } declare class AgentMentionSearchControllerBase { protected readonly contextMentionProviders: ReadonlyMap; protected readonly debounceMs: number; protected readonly fileLimit: number; protected readonly issueLimit: number; protected readonly browseCacheTtlMs: number; protected readonly providerTimeoutMs: number; protected readonly diagnosticInfoLogger: (payload: AgentMentionSearchDiagnosticLog) => void; protected readonly diagnosticNow: () => number; protected readonly diagnosticSlowThresholdMs: number; protected readonly listeners: Set; protected readonly expandedCounts: Partial>; protected readonly totalCounts: AgentMentionTotalCounts; protected readonly scheduler: AgentGuiScheduler; protected timer: AgentGuiScheduledTask | null; protected preloadCancel: (() => void) | null; protected pendingPreloadKey: string | null; protected requestId: number; protected activeRequestAbortController: AbortController | null; protected disposed: boolean; protected activeWorkspaceId: string; protected currentUserId: string; protected currentFilter: AgentMentionFilterId; protected currentQuery: string; protected currentSessionCwd: string; protected currentSectionKey: string; protected currentProvenanceFilter: ReferenceProvenanceFilter | null; protected currentProvenanceCatalog: ReferenceProvenanceCatalog | null; protected currentFileSearchLimit: number; protected currentIssueSearchLimit: number; protected agentGeneratedBrowsePath: string | null; protected workspaceFileBrowsePaths: string[]; protected rawGroups: AgentMentionRawGroups; protected issueTopicGroups: AgentMentionIssueTopicGroup[] | null; protected state: AgentMentionSearchState; constructor(options: AgentMentionSearchControllerOptions); protected startBrowseModeFetch(filter: AgentMentionFilterId): void; protected runSearch(input: { workspaceId: string; currentUserId: string; query: string; requestId: number; filter: AgentMentionFilterId; provenanceFilter: ReferenceProvenanceFilter | null; sectionKey: string; sessionCwd: string; abortSignal?: AbortSignal; }): Promise; protected runBrowseSearch(input: { workspaceId: string; currentUserId: string; requestId: number; filter: AgentMentionFilterId; sectionKey: string; sessionCwd: string; abortSignal: AbortSignal; }): Promise; protected fetchBrowseResult(input: { workspaceId: string; currentUserId: string; filter: AgentMentionFilterId; sectionKey: string; sessionCwd: string; }, provenanceFilter?: ReferenceProvenanceFilter | null, abortSignal?: AbortSignal): Promise; protected applyBrowseFetchResult(result: AgentMentionBrowseFetchResult): void; protected logBrowseCacheState(input: { cacheKey: string; cached: { entry: AgentMentionBrowseCacheEntry | null; isFresh: boolean; }; filter: AgentMentionFilterId; reason: AgentMentionBrowseLoadReason; workspaceId: string; }): void; protected logLifecycle(event: AgentMentionLifecycleDiagnosticLog["event"], details: Record): void; protected providerIdsForDiagnostics(): string; protected queryProviderMentionItemsById(input: { diagnostics: AgentMentionProviderQueryDiagnostic[]; providerId: string; workspaceId: string; currentUserId: string; query: string; limit?: number; sessionCwd?: string; sectionKey?: string; provenanceFilter: ReferenceProvenanceFilter | null; abortSignal?: AbortSignal; }): Promise; protected queryProviderMentionGroupsById(input: { diagnostics: AgentMentionProviderQueryDiagnostic[]; providerId: string; workspaceId: string; currentUserId: string; query: string; limit?: number; sessionCwd?: string; sectionKey?: string; provenanceFilter: ReferenceProvenanceFilter | null; abortSignal?: AbortSignal; }): Promise; protected logSearchDiagnostic(input: { error?: unknown; filter: AgentMentionFilterId; groups: readonly AgentMentionGroup[]; mode: "browse" | "results"; providerDiagnostics: readonly AgentMentionProviderQueryDiagnostic[]; query: string; requestId: number; startedAt: number; status: "ready" | "error"; workspaceId: string; }): void; protected emitBrowseState(status: "ready" | "loading"): void; protected canApply(requestId: number, workspaceId: string, query: string, filter: AgentMentionFilterId): boolean; protected clearTimer(): void; protected resetExpandedCounts(): void; protected resetSearchLimits(): void; protected resetRawGroups(): void; protected resetAgentGeneratedBrowsePath(): void; protected resetWorkspaceFileBrowsePaths(): void; protected resetTotalCounts(): void; protected setState(state: AgentMentionSearchState): void; protected groupsFromRawGroups(): AgentMentionGroup[]; protected browseCacheKey(input: { workspaceId: string; currentUserId: string; filter: AgentMentionFilterId; sectionKey: string; sessionCwd: string; }, provenanceFilter?: ReferenceProvenanceFilter | null): string; protected readBrowseCache(cacheKey: string): { entry: AgentMentionBrowseCacheEntry | null; isFresh: boolean; }; protected loadBrowseFetchResult(input: { workspaceId: string; currentUserId: string; filter: AgentMentionFilterId; sectionKey: string; sessionCwd: string; }, cacheKey: string, reason: AgentMentionBrowseLoadReason, provenanceFilter?: ReferenceProvenanceFilter | null, abortSignal?: AbortSignal): Promise; protected fetchFilterResult(input: { workspaceId: string; currentUserId: string; query: string; filter: AgentMentionFilterId; sectionKey: string; sessionCwd: string; includeAgentGeneratedFiles: boolean; }, provenanceFilter?: ReferenceProvenanceFilter | null, abortSignal?: AbortSignal): Promise; protected beginActiveRequest(): AbortSignal; protected abortActiveRequest(): void; } declare class AgentMentionSearchController extends AgentMentionSearchControllerBase { private readonly issueLoadMoreRequests; private readonly directoryRequestLifecycle; private readonly provenanceFilters; setProvenanceCatalog(catalog: ReferenceProvenanceCatalog | null): void; setProvenanceFilters(filters: Record): void; subscribe(listener: AgentMentionSearchListener): () => void; updateQuery(input: { workspaceId: string; currentUserId?: string | null; query: string; sectionKey?: string | null; sessionCwd?: string | null; }): void; setFilter(filter: AgentMentionFilterId): void; preloadBrowse(input: { workspaceId: string; currentUserId?: string | null; sectionKey?: string | null; sessionCwd?: string | null; filter?: AgentMentionFilterId; }): void; private runBrowsePreload; protected cancelPendingPreload(): void; enterCategory(category: AgentMentionFilterId): void; selectFileMentionNavigationItem(item: AgentContextMentionItem): boolean; exitFileMentionBrowse(): boolean; private exitWorkspaceFileBrowse; private loadWorkspaceFileDirectory; expandGroup(groupId: AgentMentionGroupId): void; close(): void; dispose(): void; private loadMoreIssueTopic; private emitIssueTopicGroupsState; private cancelIssueLoadMoreRequests; } declare function preloadAgentMentionBrowse(input: { workspaceId: string; currentUserId?: string | null; sectionKey?: string | null; sessionCwd?: string | null; contextMentionProviders?: readonly AgentContextMentionProvider[]; filter?: AgentMentionFilterId; }): void; export { AgentMentionFilterId, AgentMentionGroup, AgentMentionGroupId, AgentMentionSearchController, AgentMentionSearchState, MAX_BROWSE_CACHE_ENTRIES, preloadAgentMentionBrowse, resetAgentMentionSearchBrowseCacheForTests };