import type { ArkmeSessionCredentials } from './keychain-store.js'; import type { ArkmeMessageCopyLinkResult, ArkmeSourceSendResult } from './types.js'; export type MessageActionRole = 'user' | 'assistant'; interface MessageActionReferenceBase { version: 2; userId: number; messageIdentity: string; role: MessageActionRole; textContent: string; createdAtMillis: number; sortOrdinal: number; senderUserId: number; senderName: string; } export interface AgentMessageActionReference extends MessageActionReferenceBase { ownerKind: 'agent'; shareableAgentReply?: boolean; agentSessionId: number; agentMessageId: number; entryRecordUid?: string; } export interface ChatBotMessageActionReference extends MessageActionReferenceBase { ownerKind: 'bot_chat'; chatSessionUid: string; relationUid: string; recordUid: string; sequence: number; } export interface SubjectBotMessageActionReference extends MessageActionReferenceBase { ownerKind: 'bot_subject'; subjectUid: string; recordUid: string; } export type MessageActionReference = AgentMessageActionReference | ChatBotMessageActionReference | SubjectBotMessageActionReference; /** Local DSH snapshots are deliberately outside the signed MessageActionReference union. */ export interface NativeMessageSnapshot { ownerKind: 'dsh_native'; sessionId: string; messageIdentity: string; role: MessageActionRole; textContent: string; createdAtMillis: number; sortOrdinal: number; senderUserId: number; senderName: string; } export interface CodexMessageSnapshot extends Omit { ownerKind: 'codex'; taskTitle: string; } export type MessageActionSource = MessageActionReference | NativeMessageSnapshot | CodexMessageSnapshot; export interface AgentMessageActionConversation { version: 2; userId: number; sessionId: number; } export type MessageActionTarget = { kind: 'private_chat'; ownerRef: string; } | { kind: 'group_chat'; ownerRef: string; } | { kind: 'send_to_self'; ownerRef: string; } | { kind: 'default_category'; ownerRef: string; } | { kind: 'topic'; ownerRef: string; }; export interface MessageActionBotRegistryPort { openBotRef(botRef: string, expectedUserId: number): Promise<{ target: { kind: 'chat'; chatSessionUid: string; } | { kind: 'subject'; subjectUid: string; } | { kind: 'unavailable'; reason: string; }; }>; } export interface MessageActionCapabilityCodec { fingerprint(payload: unknown): string; seal(prefix: string, payload: unknown): Promise; open(prefix: string, value: string): Promise>; } export interface MessageActionGateway { requireSession(): Promise; maxTextLength(): number; openTarget(targetSourceRef: string, userId: number): Promise; createCopyLink(references: readonly MessageActionSource[], session: ArkmeSessionCredentials, signal?: AbortSignal): Promise; forwardToChat(input: { targetSourceRef: string; target: Extract | Extract; references: readonly MessageActionSource[]; requestId: string; sendAtMillis: number; commentText: string; session: ArkmeSessionCredentials; signal?: AbortSignal; }): Promise; forwardToRecord(input: { targetSourceRef: string; target: Exclude; references: readonly MessageActionSource[]; requestId: string; recordUid: string; sendAtMillis: number; session: ArkmeSessionCredentials; signal?: AbortSignal; }): Promise; createRecordTargetComment(input: { target: Exclude; recordUid: string; textContent: string; sendAtMillis: number; session: ArkmeSessionCredentials; signal?: AbortSignal; }): Promise; } export declare function messageActionCanCopyLink(reference: MessageActionReference): boolean; /** The history owner revalidates a bounded selection in one consistent read. */ export interface ArkoMessageActionReader { read(anchors: readonly { sessionId: number; messageId: number; }[], userId: number, signal?: AbortSignal): Promise; } export {}; //# sourceMappingURL=message-action-contract.d.ts.map