import type { ChannelActivityRegistry } from '../channels/activity-registry.js'; import type { Companion, PartnerState } from '../domain.js'; import type { SessionEvent } from '@deepseek-ai/dsh-session'; export interface IdleContactPolicy { enabled: boolean; routeId: string; idleMinutes: number; habitsEnabled?: boolean; /** Legacy switch, migrated to habits; never grants identity editing. */ selfRefinement?: boolean; } export interface IdleContactState { kind?: 'post-reply' | 'thought' | 'autonomous' | 'continuous'; continuousTaskId?: string; continuousRevision?: number; planId?: string; planSnapshot?: import('./activity-plan.js').ActivityPlan; cancelled?: boolean; thoughtId?: string; depth?: number; continuationChecked?: boolean; timeZone: string; policyRevision: number; userMessageId: string; messageId: string; attemptedAt: number; day: string; count: number; } export declare const DEFAULT_IDLE_CONTACT: IdleContactPolicy; export declare const IDLE_CONTACT_NOTICE = "\u4F19\u4F34\u95F2\u65F6\u4E3B\u52A8\u8054\u7CFB"; export declare function normalizeIdleContact(value: unknown): IdleContactPolicy; export declare function idleContactDay(now: number, timeZone: string): string; /** Legacy exported helper: fixed quiet hours were replaced by autonomous sleep. */ export declare function idleContactQuiet(_policy: IdleContactPolicy, _now: number, _timeZone: string): boolean; export declare function idleContactRouteAllowed(state: PartnerState, companion: Companion, routeId: string): boolean; export declare function lastIdleContactUser(events: readonly SessionEvent[]): { id: string; at: number; } | undefined; /** Compatibility export: a due signal, no probability draw or affection multiplier. */ export declare function idleActivityProbability(state: PartnerState, companion: Companion, user: { id: string; at: number; } | undefined, now: number): number; export declare function idleContactDue(state: PartnerState, companion: Companion, user: { id: string; at: number; } | undefined, now: number, _timeZone: string, routeId?: string | undefined): boolean; export declare const ACTIVITY_PROTOCOL_PROMPT: string; export declare const IDLE_ACTIVITY_PROMPT: string; interface ActivityMedia { kind: 'emoji' | 'image'; label: string; provider?: string; id?: string; } interface ActivityConversationEntry { role: string; text: string; at?: number; media?: ActivityMedia[]; origin?: 'reply' | 'autonomous'; } /** A small reminder also covers media pushed outside the latest text excerpt. */ export declare function activityRecentMedia(events: readonly SessionEvent[]): ActivityConversationEntry[]; /** Keep a few user/reply anchors even after several autonomous messages. */ export declare function activityConversation(events: readonly SessionEvent[]): ActivityConversationEntry[]; /** Unanswered autonomous turns are not evidence that the recipient shares this interest. */ export declare function activityConversationPosition(events: readonly SessionEvent[]): { lastUserAt?: number; unansweredAutonomousTurns: number; }; export declare const ACTIVITY_CONVERSATION_GUIDANCE: string; /** A configuration snapshot for discovery, never an authorization grant or tool schema. */ export declare function idleActivityPrompt(state: PartnerState, companion: Companion, events?: readonly SessionEvent[], opening?: string, activities?: ChannelActivityRegistry, routeId?: string | undefined): string; export declare function isIdleContactNotice(event: SessionEvent): boolean; export {}; //# sourceMappingURL=idle-contact.d.ts.map