export interface SynapFetchResponseLike { formatted_context?: string | null; facts?: unknown[]; preferences?: unknown[]; episodes?: unknown[]; emotions?: unknown[]; temporal_events?: unknown[]; } export interface SynapFetchArgs { conversation_id?: string | null; user_id: string; customer_id?: string | null; search_query?: string[]; max_results?: number; mode?: string; include_conversation_context?: boolean; /** * The level of a deeper scope ladder to read at. Only for an account whose * ladder has a level between customer and user; sent only when set. Needs * `@maximem/synap-js-sdk` >= the release that adds `scope_path` to * `sdk.fetch`. */ scope_path?: Record; } export interface SynapMemoryCreateArgs { document: string; user_id: string; customer_id?: string | null; metadata?: Record; /** * The level of a deeper scope ladder to write at. NOTE the name: `scope` on * `memories.create`, `scope_path` everywhere else. Sent only when set. */ scope?: Record; } export interface SynapMemoryCreateResult { ingestion_id: string; } export interface SynapRecentMessage { role: string; content: string; timestamp: string; message_id: string; } export interface SynapPromptContext { formatted_context?: string; available?: boolean; recent_messages?: SynapRecentMessage[]; recent_message_count?: number; total_message_count?: number; /** The framed compaction block; absent before the first compaction and on older SDKs. */ context_block?: string | null; /** Earlier turns the SDK found for the latest message, rendered. */ history_block?: string | null; } export interface SynapSdkLike { fetch(args: SynapFetchArgs): Promise; /** * Present on `@maximem/synap-js-sdk` >= 0.7.1, the first release that sends * `scope_path`. Not called here: its presence is how a `scopePath` on an older * SDK, which would silently ignore it, is refused at construction. */ get_scope_ladder?: (...args: never[]) => unknown; conversation: { context: { get_context_for_prompt(args: { conversation_id: string; /** Optional formatting style — structured | narrative | bullet_points. */ style?: string; }): Promise; }; }; memories: { create(args: SynapMemoryCreateArgs): Promise; }; } export interface EveAuthContextLike { readonly principalId?: string; readonly subject?: string; } export interface EveSessionLike { readonly session: { readonly id: string; readonly auth?: { readonly current?: EveAuthContextLike | null; readonly initiator?: EveAuthContextLike | null; } | null; }; } export declare class SynapIntegrationError extends Error { readonly operation: string; readonly cause?: unknown; constructor(operation: string, message: string, cause?: unknown); } /** * Resolve the Synap user scope for a turn. Prefers an explicit id, then the * turn's *current* principal. Returns `undefined` when neither is present — * callers apply the read/write policy accordingly. * * Deliberately does NOT fall back to `auth.initiator`: on a delegated or * system-initiated session `initiator` is whoever *started* the session (e.g. * an admin/service), not the end user this turn acts for — using it would scope * memory to the wrong principal. When `current` is null (unauthenticated * channel), pass an explicit `userId` instead. */ export declare function resolveUserId(explicit: string | undefined, ctx?: EveSessionLike): string | undefined; /** Resolve the conversation scope: explicit id, else the eve session id. */ export declare function resolveConversationId(explicit: string | undefined, ctx?: EveSessionLike): string | undefined; //# sourceMappingURL=types.d.ts.map