import type { SessionContextUsage } from "../types.js"; export declare function cloneContextUsage(contextUsage?: SessionContextUsage): SessionContextUsage | undefined; import type { DurableSessionRuntime } from "./state.js"; import type { MessageSender } from "../message-sender.js"; /** * The one-shot system preamble issued when a session becomes multi-writer. * Establishes owner priority: behavioral prioritization, not access control * (unauthorized messages never reach the queue in the first place). */ export declare function buildSharedSessionPreamble(ownerDisplay?: string): string; /** * Update multi-writer tracking state from a sender-carrying message. * Returns the normalized sender (or undefined for junk/absent senders). */ export declare function noteMessageSender(runtime: DurableSessionRuntime, rawSender: unknown): MessageSender | undefined; /** Prefix message text with its [FROM: …] attribution once the session is multi-writer. */ export declare function applySenderAttribution(runtime: DurableSessionRuntime, sender: MessageSender | undefined, text: string): string; /** Queue the one-shot [SHARED SESSION] preamble for the next turn when multi-writer flips on. */ export declare function maybeQueueSharedPreamble(runtime: DurableSessionRuntime): void; export declare function mergePrompt(existingPrompt?: string, nextPrompt?: string): string | undefined; export declare function extractPromptSystemContext(rawPrompt?: string): { prompt?: string; systemPrompt?: string; }; export declare function appendSystemContext(rawPrompt: string | undefined, extraSystemPrompt?: string): string | undefined; export declare function validClientMessageIds(value: unknown): string[]; export declare function updateContextUsageFromEvents(previous: SessionContextUsage | undefined, events: Array<{ eventType?: string; data?: any; }> | undefined, observedAt: number): SessionContextUsage | undefined; export declare const COPILOT_CONNECTION_CLOSED_MAX_RETRIES = 3; export declare const COPILOT_CONNECTION_CLOSED_RETRY_DELAY_SECONDS = 15; export declare function isCopilotConnectionClosedError(message?: string): boolean; export declare function isAuthFailureError(message?: string): boolean; export declare const AUTH_FAILURE_USER_HINT: string; export declare function buildConnectionClosedRetryDetail(retryAttempt: number): string; export declare function buildLossyHandoffSummary(errorMessage: string): string; export declare function buildLossyHandoffRehydrationMessage(errorMessage: string): string; //# sourceMappingURL=utils.d.ts.map