import type { TeamRepresentationSendOptions, TeamRepresentationSnapshot } from './team-group-contract.js'; import type { ArkmeHostPolicy } from './host-policy.js'; import type { ArkmeTeamAvatar } from './team-profile-contract.js'; import type { RecordOwnerId } from './record-owner-id.js'; export type { ArkmeLinkMetadata } from './link-metadata.js'; export type ArkmeEnvironment = 'test' | 'prod'; export declare const ARKME_PROVIDER_CONTRACT_VERSION: 1; export declare const ARKME_DEFAULT_SHARE_WEBSITE = "https://app.arkme.ai"; export type ArkmeAuthStatus = 'logged-out' | 'cancellation-pending' | 'pending' | 'binding-required' | 'authenticated' | 'expired'; export interface ArkmeLogoutFeedback { status: 'idle' | 'pending' | 'failed'; id?: string; message?: string; } export interface ArkmeAuthSnapshot { status: ArkmeAuthStatus; environment: ArkmeEnvironment; userId?: number; attemptId?: string; qrContent?: string; expiresAtMillis?: number; restDaysCancel?: number; cancellationNotice?: 'done' | 'waiting'; } export interface ArkmeCancellationSnapshot { mode: 'immediate' | 'waiting'; status: 'eligible' | 'waiting' | 'done'; cancel_at: number; has_phone: boolean; changed?: boolean; } export interface ArkmeCaptchaResult { lot_number: string; captcha_output: string; pass_token: string; gen_time: string; } export interface ArkmeClientConfig { hostPolicy?: Pick; captchaId: string; /** Public Baidu JavaScript API browser key, never a server secret. */ baiduMapBrowserAk?: string; environment: ArkmeEnvironment; testLoginEnabled: boolean; jiwoScanLoginEnabled: boolean; callAssetBasePath: string; voiceprintEnrollmentPath: string; recordingImportPath: string; mediaPath: string; shareWebsite: string; recordingWorkbenchEnabled: boolean; } export type ArkmeBillingPaymentMethod = 'alipay_pc_web' | 'wechat_native'; export type ArkmeBillingPaymentProvider = 'alipay' | 'wechat'; export type ArkmeBillingPaymentActionType = 'open_url' | 'display_qr'; export interface ArkmeBillingPaymentMethodOption { id: ArkmeBillingPaymentMethod; provider: ArkmeBillingPaymentProvider; actionType: ArkmeBillingPaymentActionType; } export type ArkmeBillingPaymentAction = { type: 'open_url'; url: string; } | { type: 'display_qr'; qrContent: string; }; export type ArkmeBillingOrderStatus = 'pending' | 'crediting' | 'paid' | 'expired' | 'closed' | 'failed'; export interface ArkmeQuotaSnapshot { availableNanoCny: string; totalNanoCny: string; reservedNanoCny: string; currency: 'CNY'; } export interface ArkmeBillingProduct { productId: string; title: string; description?: string; creditNanoCny: string; priceMinor: number; currency: 'CNY'; paymentMethods: ArkmeBillingPaymentMethodOption[]; enabled: boolean; } export interface ArkmeMembership { userId: number; memberType: 0 | 1 | 2; expireAtMillis: number | null; gifted: boolean; lifetime: boolean; } export interface ArkmeMembershipProduct { id: string; memberType: 1 | 2; name: string; priceMinor: number; currency: 'CNY'; recurring: boolean; monthCount: number; } export interface ArkmeMembershipCatalog { userId: number; products: ArkmeMembershipProduct[]; checkout: 'mobile-app-only'; } export interface ArkmeBillingProductList { items: ArkmeBillingProduct[]; } export interface ArkmeBillingOrderCreateInput { productId: string; paymentMethod: ArkmeBillingPaymentMethod; clientRequestId: string; } export interface ArkmeBillingOrderSnapshot { orderId: string; paymentProvider: ArkmeBillingPaymentProvider; paymentMethod: ArkmeBillingPaymentMethod; status: ArkmeBillingOrderStatus; amountMinor: number; currency: 'CNY'; creditNanoCny: string; expiresAtMillis: number; paymentAction?: ArkmeBillingPaymentAction; pollIntervalMillis?: number; paidAtMillis?: number; creditedAtMillis?: number; } export type ArkmeContactIdentifierKind = 'phone' | 'arkme_id'; /** Browser/model-safe projection returned by contact lookup. */ export interface ArkmeContactTeamSearchResult { name: string; jotmoId: string; avatar: import('./team-profile-contract.js').ArkmeTeamAvatar; state: string; requiresApproval: boolean; } export interface ArkmeContactSearchResult { team?: ArkmeContactTeamSearchResult; contactRef: string; identifierKind: ArkmeContactIdentifierKind; displayName: string; arkmeId?: string; avatarRef?: string; registered: boolean; inviteBySms: boolean; canAdd: boolean; isSelf: boolean; } export interface ArkmeContactAddResult { state: 'ready' | 'pending'; source: ArkmeSourceItem; } export type ArkmeDirectorySectionKind = 'groups' | 'bots' | 'unmarked-speakers' | 'manual-speakers' | 'teams' | 'contacts'; /** Browser-safe directory row. Provider-private identifiers never cross this boundary. */ export type ArkmeDirectoryItem = { kind: 'group'; sourceRef: string; displayName: string; avatarRef?: string; groupAvatar?: ArkmeGroupAvatarPresentation; } | { kind: 'bot'; bot: ArkmeBotSummary; } | { kind: 'unmarked-speaker'; candidateRef: string; /** Stable read-only identity, not a mutation credential. */ identityKey?: string; speakerToken?: string; displayName: string; subtitle: string; appearanceDays?: number; latestAtMillis?: number; } | { kind: 'manual-speaker'; speakerKey: string; speakerRef: string; displayName: string; } | { kind: 'team'; teamRef: string; displayName: string; publicId: string; role: ArkmeTeamRole; avatar?: ArkmeTeamAvatar; } | { kind: 'contact'; contactRef: string; displayName: string; nickname: string; remark: string; accountName?: string; avatarRef?: string; avatarFallback?: ArkmeGroupAvatarFallback; letter: string; }; export interface ArkmeDirectoryPage { section: ArkmeDirectorySectionKind; items: ArkmeDirectoryItem[]; total: number; hasMore: boolean; nextCursor?: string; projectionState?: 'fresh' | 'stale' | 'building' | 'failed'; coverage?: 'complete' | 'partial'; retryAfterMillis?: number; cursorStale?: boolean; } export type ArkmeTeamRole = 'owner' | 'admin' | 'member'; export type ArkmeTeamIdentityState = 'ready' | 'incomplete' | 'unavailable'; export type ArkmeTeamCreateRejectReason = 'jotmo_id_unavailable' | 'idempotency_conflict'; export type ArkmeTeamJoinRejectReason = 'team_not_found'; export type ArkmeTeamMembershipState = 'joined' | 'already_member' | 'owner'; export interface ArkmeTeam { key?: string; profileRevision?: number; canEditProfile?: boolean; avatar?: ArkmeTeamAvatar; teamRef: string; name: string; jotmoId: string; currentUserRole: ArkmeTeamRole; createdAtMillis: number; updatedAtMillis: number; } export interface ArkmeTeamPage { items: ArkmeTeam[]; totalCount: number; hasMore: boolean; nextPageCursor?: string; } export interface ArkmeTeamResolveItem { itemId: string; query: string; limit?: number; pageCursor?: string; } export interface ArkmeTeamResolution { itemId: string; candidates: ArkmeTeam[]; hasMore: boolean; nextPageCursor?: string; } export interface ArkmeTeamMember { userRef: string; displayName: string; jotmoId?: string; /** Browser-safe profile image reference resolved by the host presentation layer. */ avatarRef?: string; avatarFallback?: ArkmeGroupAvatarFallback; identityState: ArkmeTeamIdentityState; role: ArkmeTeamRole; joinedAtMillis: number; } export interface ArkmeTeamMemberPage { team: ArkmeTeam; items: ArkmeTeamMember[]; totalCount: number; hasMore: boolean; nextPageCursor?: string; } export interface ArkmeTeamCreateItem { itemId: string; idempotencyKey: string; name: string; jotmoId: string; } export interface ArkmeTeamJoinItem { itemId: string; jotmoId: string; } export type ArkmeTeamCreateResult = { itemId: string; status: 'succeeded'; team: ArkmeTeam; } | { itemId: string; status: 'rejected'; reason: ArkmeTeamCreateRejectReason; }; export type ArkmeTeamJoinResult = { itemId: string; status: 'succeeded'; membershipState: ArkmeTeamMembershipState; team: ArkmeTeam; } | { itemId: string; status: 'rejected'; reason: ArkmeTeamJoinRejectReason; }; export interface ArkmeDirectoryContactProfile { contactRef: string; /** Public World/catalog identity, matching the marketplace author navigation target. */ worldUserId?: number; displayName: string; nickname: string; remark: string; accountName?: string; avatarRef?: string; avatarFallback?: ArkmeGroupAvatarFallback; } export type ArkmeUnmarkedSpeakerInferenceState = 'pending' | 'ready' | 'failed' | 'unavailable'; export interface ArkmeUnmarkedSpeakerInference { state: ArkmeUnmarkedSpeakerInferenceState; recommendedSpeakerRef?: string; recommendedDisplayName?: string; retryable?: boolean; } export interface ArkmeUnmarkedSpeakerChoice { speakerRef: string; displayName: string; source: 'recommended' | 'manual'; } /** Browser-safe detail projection for one opaque unmarked-speaker candidate ref. */ export interface ArkmeUnmarkedSpeakerOptions { candidateRef: string; candidateVersion: string; speakerToken?: string; appearanceDays: number; validAudioDurationMillis: number; segmentCount: number; latestAtMillis: number; conversationSummaryState?: 'ready' | 'pending' | 'unavailable'; conversationSummary?: string; inference: ArkmeUnmarkedSpeakerInference; speakerChoices: ArkmeUnmarkedSpeakerChoice[]; } export interface ArkmeUnmarkedSpeakerInferenceRetry { candidateRef: string; inference: ArkmeUnmarkedSpeakerInference; } export interface ArkmeUnmarkedSpeakerSegment { segmentRef: string; date: string; sessionLabel: string; timeRange: string; durationMillis: number; transcript: string; mediaRef?: string; } export interface ArkmeUnmarkedSpeakerSegmentPage { items: ArkmeUnmarkedSpeakerSegment[]; total: number; hasMore: boolean; nextCursor?: string; cursorStale?: boolean; } export type ArkmeUnmarkedSpeakerMarkOutcome = 'marked' | 'stale' | 'conflict' | 'candidate_not_found' | 'speaker_not_found'; export interface ArkmeUnmarkedSpeakerMarkResult { outcome: ArkmeUnmarkedSpeakerMarkOutcome; } export interface ArkmeMyVoiceprint { hasVoiceprint: boolean; nickname: string; updatedAtMillis: number; canIdentify: boolean; canPlay: boolean; canRestorePlayback: boolean; enrollmentStatus: 'none' | 'processing' | 'ready'; enrollmentPending: boolean; } export interface ArkmeVoiceprintGrantItem { grantRef: string; displayName: string; avatarRef?: string; identifyEnabled: boolean; playEnabled: boolean; grantedAtMillis: number; updatedAtMillis: number; } export interface ArkmeVoiceprintGrantPage { items: ArkmeVoiceprintGrantItem[]; nextCursor: string; hasMore: boolean; } export type ArkmeRecognizedPersonIdentityKind = 'speaker' | 'authorized_user'; export interface ArkmeRecognizedPersonItem { personRef: string; identityKind: ArkmeRecognizedPersonIdentityKind; displayName: string; avatarRef?: string; playGranted: boolean; previewAvailable: boolean; canInvite: boolean; inviteTargetSelectionRequired: boolean; } export type ArkmeRecognizedPersonDetail = ArkmeRecognizedPersonItem; export interface ArkmeRecognizedPersonPage { items: ArkmeRecognizedPersonItem[]; nextCursor: string; hasMore: boolean; } export type ArkmeRecognizedVoiceprintKind = 'local' | 'legacy' | 'authorized'; export interface ArkmeRecognizedVoiceprintItem { kind: ArkmeRecognizedVoiceprintKind; hitCount: number; createdAtMillis?: number; } export interface ArkmeRecognizedVoiceprintLibrary { items: ArkmeRecognizedVoiceprintItem[]; } export interface ArkmeVoiceprintInvitation { inviteUrl: string; expiresAtMillis: number; } export interface ArkmeVoiceprintGrantRevocation { revoked: true; } export interface ArkmeVoiceprintPlaybackRestore { canPlay: boolean; restored: boolean; updatedAtMillis: number; } export declare const ARKME_VOICEPRINT_ENROLLMENT_MIN_DURATION_MS = 3000; export declare const ARKME_VOICEPRINT_ENROLLMENT_MAX_DURATION_MS = 60000; export declare const ARKME_VOICEPRINT_ENROLLMENT_MAX_AUDIO_BYTES: number; export interface ArkmeVoiceprintEnrollmentResult { status: 'processing'; cloneReady: boolean; updatedAtMillis: number; } export interface ArkmeRecordCursor { sendAtMillis: number; recordUid: string; } export interface ArkmeSelfRecordItem { selfRole?: ArkmeSelfRoleSnapshot; /** Immutable sender presentation stored with this record. */ avatarRef?: string; senderName?: string; /** A nickname was actually recorded with this item, even if its literal value is 我. */ senderNameSnapshot?: boolean; hasManualEdit?: boolean | undefined; /** Frozen long-recording selection returned by the Record owner. */ forwardRecords?: ArkmeForwardRecordsPreview; recordUid: string; sendAtMillis: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; templateKind: number; status: number; version: number; creationSource?: number; localState?: 'synced' | 'pending' | 'failed'; lastError?: string; displayKind?: number; contentBlocks?: ArkmeContentBlock[]; /** Durable extension edge restored from record/home/topic projections. */ extensionParentRecordUid?: string; /** Inline parent snapshot returned with a persisted record extension. */ extensionParent?: ArkmeTimelineExtensionParent; /** Record owner reported media refs, but their delivery projection was temporarily unavailable. */ mediaUnavailable?: boolean; } /** A local presentation identity for speaking to yourself. The account remains the author. */ export interface ArkmeSelfRole { roleId: string; name: string; avatarRef?: string; createdAtMillis: number; updatedAtMillis: number; } /** Frozen at send time so later edits or deletion do not change old messages. */ export interface ArkmeSelfRoleSnapshot { roleId: string; name: string; avatarRef?: string; } export interface ArkmeSelfRecordList { items: ArkmeSelfRecordItem[]; hasMore: boolean; nextCursor?: ArkmeRecordCursor; } export interface ArkmeSelfSummary { recordCount: number; wordsCount: number; totalSec: number; } export type ArkmeCalendarScopeKind = 'self' | 'send_to_self' | 'topic' | 'uncategorized' | 'private_chat' | 'group_chat'; export interface ArkmeCalendarAnchor { recordUid: string; sendAtMillis: number; recordOwnerUserId?: RecordOwnerId; } /** Client-projected interaction target; contextAnchor is always a private-chat record, never a group record. */ export interface ArkmeCalendarMomentAnchor { momentId: string; occurredAtMillis: number; contextAnchor?: ArkmeCalendarAnchor; } export interface ArkmeCalendarBucketDay { bucketDate: string; count: number; protectedCount: number; hasRecords: boolean; firstSendAtMillis?: number; anchor?: ArkmeCalendarAnchor; momentAnchor?: ArkmeCalendarMomentAnchor; conversationCounts?: { messages: number; interactions: number; }; /** Source-presence markers used by the multi-source personal day calendar. */ activityMarkers?: { chat?: boolean; call?: boolean; recording?: boolean; arko?: boolean; bot?: boolean; }; } export interface ArkmeCalendarBucketPage { scope: ArkmeCalendarScopeKind; startDate: string; endDate: string; timezone: string; refreshedAtMillis: number; days: ArkmeCalendarBucketDay[]; /** Present only when the server supplied the complete conversation date index. */ totalDayCount?: number; } export type ArkmeCalendarContentAccessState = 'available' | 'protected' | 'unknown'; export interface ArkmeCalendarRecordCursor { sendAtMillis: number; recordUid: string; } export interface ArkmeCalendarRecordItem extends ArkmeCalendarAnchor { locationSummary?: { label?: string; capturedAtMillis?: number; }; /** Device-captured observation, never a shared place or an inferred stay. */ locationObservation?: ArkmeRecordLocationObservation; /** Short-lived, account-bound capability for an explicit location detail read. */ locationRef?: string; /** Viewer-authorized source presentation shared with conversation navigation. */ source?: ArkmeSourceItem; /** Authorized rich projection shared by calendar UI, SDK and Tools; no storage URLs. */ content?: ArkmeTimelineItem; recordUid: string; sendAtMillis: number; accessState: ArkmeCalendarContentAccessState; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; preview: string; topicTitle?: string; sourceKind: 'self' | 'topic' | 'chat' | 'team' | 'unknown'; /** Team origin identity; optional label/navigation is resolved by Team under current authority. */ teamConversationUid?: string; creationSource: number; templateKind: number; displayKind: number; protected: boolean; isUncategorized?: boolean; hasManualEdit?: boolean; hasPolish?: boolean; } export interface ArkmeCalendarDayRecordPage { scope: ArkmeCalendarScopeKind; bucketDate: string; timezone: string; refreshedAtMillis: number; items: ArkmeCalendarRecordItem[]; hasMore: boolean; nextCursor?: ArkmeCalendarRecordCursor; } export interface ArkmePendingWrite { recordUid: string; textContent: string; textFormat?: 'plain' | 'markdown'; createdAtMillis: number; sendAtMillis: number; attempts: number; /** Composer time that must survive the durable outbox retry path. */ recordDurationMillis?: number; /** Browser capture data that must survive the durable outbox retry path. */ captureContext?: ArkmeRecordCaptureContext; lastError?: string; } export interface ArkmeRecordTagItem { normalizedTag: string; tagText: string; recordCount: number; latestRecordUid: string; latestSendAtMillis: number; } export interface ArkmeRecordTagList { items: ArkmeRecordTagItem[]; hasMore?: boolean; nextCursor?: string; } export interface ArkmeCreateTextResult { recordUid: string; status: number; } /** Result of creating a canonical Record backed by uploaded file assets. */ export interface ArkmeCreateFileAssetRecordResult { recordUid: string; status: number; } export type ArkmeBotProvider = 'openclaw' | 'webhook'; export type ArkmeBotStatus = 'online' | 'offline' | 'unknown'; export type ArkmeBotConversationProjection = 'record' | 'chat' | 'none'; export interface ArkmeBotSummary { botRef: string; /** Stable, account-scoped opaque key for plugin-local directory preferences. */ directoryKey?: string; name: string; provider: ArkmeBotProvider; description: string; status: ArkmeBotStatus; directChatAvailable: boolean; /** Whether this Bot accepts outbound private-chat messages from Arkme. */ privateChatOutboundEnabled?: boolean; /** Whether canonical Record changes can update this Bot conversation. */ refreshOnRecordChanges?: boolean; /** Owner-neutral projection channel used to refresh the current conversation. */ conversationProjection?: ArkmeBotConversationProjection; /** Account-bound opaque key matching the canonical Chat directory item, when Chat owns the conversation. */ chatSourceKey?: string; /** Creation time supplied by the Bot service, when available. */ createdAtMillis?: number; /** Latest private-chat message time, when the conversation directory has been hydrated. */ latestMessageAtMillis?: number; /** Latest Bot-owner activity used for ordering and direct-Bot visibility restoration. */ conversationListActivityAtMillis?: number; /** Safe preview of the latest private-chat message. */ latestMessagePreview?: string; /** Unread count projected from the canonical Chat conversation, when Chat owns the Bot conversation. */ unreadCount?: number; /** Attention count after applying the canonical Chat notification policy. */ badgeUnreadCount?: number; /** Whether new-message notifications are allowed by the canonical Chat policy. */ notificationAllowed?: boolean; /** Notification mute projection from the canonical Chat conversation, when available. */ isMuted?: boolean; /** Account-bound opaque reference resolved through image.read. */ avatarRef?: string; } export interface ArkmeBotList { items: ArkmeBotSummary[]; } /** Browser-safe projection of one Bot private-chat message. */ export interface ArkmeBotConversationMessage { /** Owner-local immutable occurrence identity. Subject message IDs and Chat relation IDs are never compared across owners. */ messageId: string; /** Optional Record content identity; this is not the Chat relation identity. */ recordUid?: string; role: 'user' | 'assistant'; content: string; status: string; createdAtMillis: number; attachments: ArkmeBotConversationAttachment[]; /** Account-, owner- and conversation-bound capability; absent for unstable or owner-incomplete messages. */ messageActionRef?: string; messageActionCapabilities?: ArkmeMessageActionCapabilities; } export interface ArkmeMessageActionCapabilities { copyLink: boolean; forward: boolean; } /** Safe attachment metadata; source file identifiers and remote URLs remain Host-owned. */ export interface ArkmeBotConversationAttachment { kind: string; fileName: string; mimeType: string; size: number; durationMillis: number; width: number; height: number; sortOrder: number; } export interface ArkmeBotConversation { messages: ArkmeBotConversationMessage[]; latestSequence?: number; } export interface ArkmeBotConversationDirectory { items: ArkmeBotSummary[]; } /** Browser-safe projection of the Flutter desktop Bot settings profile. */ export interface ArkmeBotManageProfile extends ArkmeBotSummary { mentionEntryEnabled: boolean; tokenPreview: string; canRevealToken: boolean; tokenRevealEnabled: boolean; gatewayUrl: string; webhookUrl: string; recordCount: number; webhookSecurity: ArkmeBotWebhookSecurity; joinedGroups: ArkmeBotJoinedGroup[]; } export interface ArkmeBotWebhookSecurity { keywordEnabled: boolean; keyword: string; tokenEnabled: boolean; ipWhitelistEnabled: boolean; ipWhitelist: string[]; } export interface ArkmeBotJoinedGroup { title: string; installedAtMillis: number; } export interface ArkmeBotNotificationPreference { /** `true` means the current Bot direct chat will not receive push notifications. */ muted: boolean; } export interface ArkmeBotConversationSendResult { userMessage: ArkmeBotConversationMessage; botMessages: ArkmeBotConversationMessage[]; status: string; } export interface ArkmeBotConversationReadResult { effectiveReadSequence: number; unreadCount: number; } export interface ArkmeConversationWriteResult { recordUid: string; status: number; localState: 'synced' | 'failed'; error?: string; } export interface ArkmeWorldRecordItem { authorName: string; headline: string; textContent: string; textFormat?: 'plain' | 'markdown'; tags: string[]; templateKind: number; createdAtMillis: number; publishedAtMillis: number; imageCount: number; videoCount: number; voiceCount: number; extendCount: number; } export interface ArkmeWorldRecordList { items: ArkmeWorldRecordItem[]; total: number; hasMore: boolean; nextOffset?: number; } /** Browser-safe public World card. Stable IDs and signed media URLs stay inside the Provider. */ export interface ArkmeWorldAvatarFallback { kind: 'phone_default'; colorIndex: number; label: string; } export interface ArkmeWorldExtensionShare { ref: string; url: string; } /** Immutable display snapshot emitted after one extension version becomes public. */ export interface ArkmeWorldExtensionPublication { extensionId: string; version: string; name: string; description: string; share?: ArkmeWorldExtensionShare; iconRef?: string; previewRefs: string[]; visibility: 'public'; runtimeDshRange?: string; desktopRequired: boolean; publishedAtMillis: number; } export interface ArkmeWorldFeedItem { memberType?: ArkmeSourceItem['peerMemberType']; /** Account-bound private annotation target; never a public reaction/share capability. */ localReactionTarget?: import('./reaction-contract.js').ReactionTargetRef; recordRef: string; /** Opaque, viewer-bound reference for opening this non-self author's card. */ authorRef?: string; authorName: string; avatarRef?: string; avatarFallback?: ArkmeWorldAvatarFallback; headline: string; textContent: string; textFormat?: 'plain' | 'markdown'; tags: string[]; templateKind: number; createdAtMillis: number; publishedAtMillis: number; imageRefs: string[]; imageCount: number; videoCount: number; voiceCount: number; extendCount: number; recordType?: 'extension_publication'; extensionPublication?: ArkmeWorldExtensionPublication; } export interface ArkmeWorldShareResult { url: string; title: string; previewText: string; } export interface ArkmeWorldFeedPage { items: ArkmeWorldFeedItem[]; total: number; hasMore: boolean; nextOffset?: number; } /** Viewer-specific display label for one opaque World author reference. */ export interface ArkmeWorldAuthorLabel { authorRef: string; authorName: string; memberType?: ArkmeSourceItem['peerMemberType']; } export interface ArkmeWorldVoiceprintAvailabilityItem { recordRef: string; playable: boolean; } export interface ArkmeWorldVoiceprintAvailability { items: ArkmeWorldVoiceprintAvailabilityItem[]; } export type ArkmeWorldVoiceprintSocialRelationType = 'reciprocal_expectation' | 'call' | 'world_interaction' | 'group_interaction' | 'private_chat'; /** Browser-safe relationship evidence used by the World voiceprint reminder dialog. */ export interface ArkmeWorldVoiceprintSocialRelation { type: ArkmeWorldVoiceprintSocialRelationType; displayLine: string; reasonCode: string; reasonLabel: string; } export interface ArkmeWorldVoiceprintSocialContext { relations: ArkmeWorldVoiceprintSocialRelation[]; } /** Browser-safe generated World voice chunk. The signed Audio URL stays inside the Provider. */ export interface ArkmeWorldVoiceprintPlaybackChunk { mediaRef: string; mimeType: string; durationMillis: number; cacheHit: boolean; chunkIndex: number; chunkCount: number; chunkStartRune: number; chunkEndRune: number; } export interface ArkmeWorldVoiceprintInviteResult { sent: true; peerDisplayName: string; messageItemUid?: string; expiresAtMillis: number; } /** Browser-safe World comment or reply. Stable record IDs stay inside the Provider. */ export interface ArkmeWorldInteractionItem { memberType?: ArkmeSourceItem['peerMemberType']; isSelf?: boolean; interactionRef: string; parentRef: string; /** Opaque, viewer-bound reference for opening this non-self author's card. */ authorRef?: string; authorName: string; avatarRef?: string; avatarFallback?: ArkmeWorldAvatarFallback; textContent: string; textFormat?: 'plain' | 'markdown'; createdAtMillis: number; publishedAtMillis: number; imageCount: number; videoCount: number; voiceCount: number; } export interface ArkmeWorldInteractionPage { items: ArkmeWorldInteractionItem[]; total: number; hasMore: boolean; nextOffset?: number; } /** Existing World owner records, including comments made in another person's World. */ export interface ArkmeWorldNotificationSourcePage { items: Array<{ recordRef: string; isComment: boolean; }>; hasMore: boolean; nextOffset?: number; } export interface ArkmeWorldNotificationTarget { root: ArkmeWorldFeedItem; interactionRef: string; } /** Server-owned aggregate read state for the current account's World interactions. */ export interface ArkmeWorldInteractionSummary { unreadCount: number; seenThroughSequence: number; authoritative: boolean; } export interface ArkmeWorldInteractionCreateResult { interaction: ArkmeWorldInteractionItem; } /** Browser-safe AI letter projection used by the unified notification inbox. */ export interface ArkmeAiLetterItem { letterId: string; title: string; summary: string; createdAtMillis: number; unread: boolean; } export interface ArkmeAiLetterPage { items: ArkmeAiLetterItem[]; nextCursor: number; } export interface ArkmeAiLetterUnread { unreadCount: number; latestUnread?: ArkmeAiLetterItem; } export type ArkmeArrangementStatus = 'identified' | 'following' | 'completed' | 'unknown'; export type ArkmeArrangementListStatus = Exclude | 'all'; export interface ArkmeArrangementDateContext { /** Calendar fallback only. Explicit dates in the user's text take precedence. */ defaultDate: string; timezone: string; } export interface ArkmeArrangementCreateInput { requestId: string; texts: string[]; dateContext?: ArkmeArrangementDateContext; } /** Browser-safe Arrangement projection. Stable owner UIDs stay inside the Provider. */ export interface ArkmeArrangementCreationSource { kind: 'quick-note' | 'input' | 'none'; items: { text: string; createdAtMillis?: number; }[]; unavailableCount: number; } /** Only explicit recording provenance can provide a return link. */ export type ArkmeArrangementRecordingSource = { kind: 'daily-summary'; state: 'unavailable'; } | { kind: 'daily-summary'; state: 'ready'; dateStamp: number; tzOffsetMillis: number; summaryVersionId?: string; }; export interface ArkmeRecordingArrangementQuery { dateStamp: number; tzOffsetMillis: number; limit?: number; offset?: number; snapshotVersion?: string; } export type ArkmeRecordingArrangementPage = { state: 'unavailable'; items: []; total: null; hasMore: false; } | { state: 'ready' | 'processing' | 'partial'; items: ArkmeArrangementItem[]; total: number; hasMore: boolean; nextOffset?: number; snapshotVersion: string; }; export interface ArkmeArrangementEvidence { id: string; kind: 'record' | 'audio_summary' | 'call' | 'input' | 'voice_input' | 'agent' | 'manual'; role: 'initial' | 'supplement' | 'related'; text: string; canOpen: boolean; /** Read protected source text only while the arrangement detail is expanded. */ readOnExpand?: boolean; sourceDate?: string; createdAtMillis?: number; unavailableReason?: string; } export type ArkmeArrangementSourceRead = { evidenceId: string; state: 'ready'; text: string; } | { evidenceId: string; state: 'unavailable'; reason: string; }; export type ArkmeArrangementSourceTarget = { kind: 'document'; title: string; text: string; } | { kind: 'record'; item: ArkmeTimelineItem; } | { kind: 'conversation'; source: ArkmeSourceItem; itemUid: string; sendAtMillis: number; } | { kind: 'call'; detail: ArkmeCallDetail; startMillis?: number; quote: string; } | { kind: 'audio_summary'; dateStamp: number; tzOffsetMillis: number; summaryId: string; }; export interface ArkmeArrangementItem { provenance?: ArkmeArrangementEvidence[]; sourceType?: number; recognitionState?: string; creationSource?: ArkmeArrangementCreationSource; recordingSource?: ArkmeArrangementRecordingSource; arrangementRef: string; title: string; description: string; status: ArkmeArrangementStatus; reminderEnabled: boolean; reminderState: string; createdAtMillis: number; updatedAtMillis: number; dueAtMillis?: number; remindAtMillis?: number; } export interface ArkmeArrangementBoardVersion { supported: boolean; version: string; } export interface ArkmeArrangementReorderInput { arrangementRef: string; status: Exclude; /** Insert immediately before this project (the next neighbour). */ beforeRef?: string; /** Insert immediately after this project (the previous neighbour). */ afterRef?: string; boardVersion: string; requestId: string; } export interface ArkmeArrangementReorderResult { board: ArkmeArrangementBoardVersion; } export interface ArkmeArrangementPage { board?: ArkmeArrangementBoardVersion; items: ArkmeArrangementItem[]; total: number; hasMore: boolean; nextOffset?: number; } export type ArkmeArrangementDetail = ArkmeArrangementItem; /** Read-only deleted owner projection; deliberately excluded from live mutations. */ export type ArkmeDeletedArrangementItem = Omit & { status: 'deleted'; }; export type ArkmeDeletedArrangementPage = Omit & { items: ArkmeDeletedArrangementItem[]; }; /** Reminder-event identity is intentionally separate from Arrangement identity. */ export interface ArkmeArrangementReminderEvent { eventRef: string; arrangementRef: string; title: string; description: string; eventKind: string; eventAtMillis: number; dueAtMillis?: number; remindAtMillis?: number; read: boolean; readAtMillis?: number; reminderState: string; createdAtMillis: number; updatedAtMillis: number; } export interface ArkmeArrangementReminderPage { items: ArkmeArrangementReminderEvent[]; total: number; hasMore: boolean; nextOffset?: number; } export interface ArkmeArrangementReminderSummary { unreadCount: number; latestUnread?: ArkmeArrangementReminderEvent; latestEvent?: ArkmeArrangementReminderEvent; nextReminder?: ArkmeArrangementReminderEvent; } export type ArkmeArrangementMutationIntent = 'start-follow' | 'cancel-follow' | 'complete' | 'cancel-complete' | 'delete'; export type ArkmeArrangementMutationOutcome = 'confirmed' | 'reconciled' | 'unknown'; export interface ArkmeArrangementMutationResult { arrangementRef: string; intent: ArkmeArrangementMutationIntent; outcome: ArkmeArrangementMutationOutcome; item?: ArkmeArrangementItem; deleted?: boolean; } export interface ArkmeArrangementReminderToggleResult { arrangementRef: string; enabled: boolean; outcome: ArkmeArrangementMutationOutcome; item?: ArkmeArrangementItem; } export interface ArkmeArrangementReminderWriteResult { outcome: ArkmeArrangementMutationOutcome; updatedCount?: number; } export type ArkmeWorldVisibility = 'visible' | 'pending_review' | 'rejected' | 'unknown' | 'not_published'; export declare const ARKME_WORLD_PUBLISH_MAX_IMAGES = 27; export declare const ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES: number; export interface ArkmeWorldPublishResult { recordSaved: boolean; recordState: 'synced' | 'pending' | 'not_saved'; worldPublished: boolean; visibility: ArkmeWorldVisibility; checkStatus: number; retryable: boolean; error?: string; } /** Media upload output accepted by the World image-publish boundary. */ export interface ArkmeWorldPublishFileAsset { fileAssetUid: string; fileName: string; mimeType: string; size: number; fileKind: 1; } export interface ArkmeWorldPublishTextInput { clientMutationId: string; textContent: string; textFormat?: 'plain' | 'markdown'; } export interface ArkmeWorldPublishFileAssetsInput extends ArkmeWorldPublishTextInput { fileAssets: ArkmeWorldPublishFileAsset[]; } export interface ArkmeCachedSnapshot { items: ArkmeSelfRecordItem[]; hasMore: boolean; nextCursor?: ArkmeRecordCursor; summary?: ArkmeSelfSummary; cachedAtMillis: number; revision: number; } export interface ArkmeCachedQueryResult { items: ArkmeSelfRecordItem[]; cacheComplete: boolean; cachedAtMillis: number; revision: number; } export type ArkmeSearchSceneKind = 'audio' | 'link' | 'image_video' | 'file' | 'long_article'; export type ArkmeLongArticleBrowseScope = 'recent' | 'shared_by_me' | 'shared_with_me'; export interface ArkmeSearchQueryGuard { state: string; reason?: string; } export interface ArkmeSearchHistoryItem { searchHistoryUid: string; keyword: string; searchedAtMillis: number; } export interface ArkmeSearchHistoryResult { items: ArkmeSearchHistoryItem[]; hasMore: boolean; nextCursor?: string; } export interface ArkmeSearchAssetItem { fileAssetUid: string; /** Opaque browser-safe reference for streaming this search asset through the plugin media proxy. */ mediaRef?: string; fileUid?: string; fileName?: string; mimeType?: string; fileKind?: number; size?: number; durationMillis?: number; } /** Browser-safe image projection used by the desktop search image library. */ export interface ArkmeImageSearchItem { itemKey: string; mediaRef: string; recordUid: string; sendAtMillis: number; fileName: string; mimeType: string; size: number; recordTitle: string; sourceTitle?: string; } export interface ArkmeImageSearchResult { items: ArkmeImageSearchItem[]; hasMore: boolean; nextCursor?: string; queryGuard: ArkmeSearchQueryGuard; } export interface ArkmeDshInputOrigin { sessionId: string; eventSeq: number; } export interface ArkmeSearchRecordItem { messageActionRef?: string; selfRole?: ArkmeSelfRoleSnapshot; /** DSH input identity resolved from local public session events; never persisted by record sync. */ dshOrigin?: ArkmeDshInputOrigin; /** Local lookup could not inspect every session; never proof of absence. */ dshOriginUnverified?: true; recordUid: string; /** Record owner required by Chat's exact timeline locator; never the current viewer. */ recordOwnerUserId?: RecordOwnerId; recordCreatorUserId?: RecordOwnerId; sourceKind: number; sourceUid?: string; routeTargetKind: string; routeTargetUid?: string; sendAtMillis: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; snippet: string; nickname?: string; templateKind?: number; displayKind?: number; creationSource?: number; sourceTitle?: string; media: ArkmeSearchAssetItem[]; files: ArkmeSearchAssetItem[]; voice?: ArkmeSearchAssetItem; linkUrl?: string; /** Deduplicated safe links extracted before the search text excerpt is clipped. */ linkUrls?: string[]; recordDurationMillis?: number; sceneItemCount?: number; sceneItemSize?: number; /** Current-account navigation target for opening this hit in its owning Arkme conversation. */ targetSource?: ArkmeSourceItem; } export interface ArkmeSearchSourceMatch { sourceKind: number; sourceUid: string; title: string; nickname?: string; targetSource?: ArkmeSourceItem; } export interface ArkmeConversationNameSearchResult { items: ArkmeSearchSourceMatch[]; hasMore: boolean; nextCursor?: string; } export interface ArkmeSearchSourceAggregate extends ArkmeSearchSourceMatch { routeTargetKind: string; routeTargetUid?: string; matchedRecordCount: number; matchedRecordCountExact: boolean; } export interface ArkmeRecordSearchResult { appliedArticleScope?: ArkmeLongArticleBrowseScope; items: ArkmeSearchRecordItem[]; sourceAggregates: ArkmeSearchSourceAggregate[]; hasMore: boolean; nextCursor?: string; queryGuard: ArkmeSearchQueryGuard; itemCount?: number; itemSize?: number; } export interface ArkmeRecordingSearchIdentity { sessionId: string; childId: string; itemIndex: number; transcriptSource: 'system'; transcriptVersion: string; } export interface ArkmeRecordingSearchSegment extends ArkmeRecordingSearchIdentity { startAtMillis: number; endAtMillis: number; text: string; speaker?: { speakerId: string; userId?: number; label: string; avatarRef?: string; colorIndex?: number; }; } export interface ArkmeRecordingWindow { dateStamp: number; endStamp: number; timeZone: string; date: string; } export interface ArkmeRecordingTarget { window?: ArkmeRecordingWindow; revision?: number; dateStamp: number; startAtMillis: number; segment?: ArkmeRecordingSearchIdentity; summary?: { versionId?: string; }; timeline?: { versionId?: string; }; } export interface ArkmeRecordingSearchItem { match: ArkmeRecordingSearchSegment; previous?: ArkmeRecordingSearchSegment; next?: ArkmeRecordingSearchSegment; highlightRanges: Array<{ start: number; length: number; }>; sessionId: string; recordUid?: string; dateStamp: number; startAtMillis: number; snippet: string; score: number; } export interface ArkmeRecordingSearchResult { items: ArkmeRecordingSearchItem[]; hasMore: boolean; nextCursor?: string; queryGuard: ArkmeSearchQueryGuard; } export type ArkmeCallMediaType = 'audio' | 'video' | 'unknown'; export type ArkmeCallSummaryStatus = 'idle' | 'pending' | 'done' | 'failed'; export interface ArkmeCallHistoryOptions { limit?: number; cursor?: string; includeRecentContacts?: boolean; } export interface ArkmeCallHistoryItem { callRef: string; stableId: string; peerDisplayName: string; peerUserId?: number; peerAvatarRef?: string; mediaType: ArkmeCallMediaType; startedAtMillis: number; acceptedAtMillis: number; endedAtMillis: number; durationSeconds: number; callResult: string; resultLabel: string; summaryStatus: ArkmeCallSummaryStatus; summaryPreview?: string; /** The aggregate omitted speaker identities; visible rows resolve the detail summary. */ summaryNeedsDetail?: boolean; summaryUpdatedAtMillis?: number; canOpenDetail: boolean; canRedial: boolean; chatSessionUid?: string; sharedTopicId?: number; } export interface ArkmeCallRecentContact { userId: number; displayName: string; avatarRef?: string; sharedTopicId?: number; } export interface ArkmeCallHistoryPage { items: ArkmeCallHistoryItem[]; recentContacts?: ArkmeCallRecentContact[]; hasMore: boolean; nextCursor?: string; } export interface ArkmeCallParticipant { userId?: number; displayName: string; isCurrentUser?: boolean; avatarRef?: string; } export interface ArkmeCallTranscriptSegment { segmentId: string; /** Standalone recording of this segment; playback starts at zero, not startMillis. */ audioUrl?: string; speakerDisplayName: string; speakerUserId?: number; text: string; startMillis: number; endMillis: number; /** Absolute speech timestamp, when supplied by the call transcript service. */ spokenAtMillis?: number; } export interface ArkmeCallVideoRecord { available: boolean; source: 'real' | 'sample'; videoUrl?: string; posterUrl?: string; perspectives?: ArkmeCallVideoPerspective[]; } export interface ArkmeCallVideoPerspective { userId?: number; perspective: 'self' | 'peer' | 'main' | 'unknown'; label?: string; videoUrl?: string; posterUrl?: string; } /** A share is a public capability plus login, never the account-bound callRef. */ export interface ArkmeCallShareLink { url: string; } export interface ArkmeCallShareViewer { viewId: string; userId: number; displayName: string; avatarRef?: string; viewedAtMillis: number; } export interface ArkmeCallShareViewers { items: ArkmeCallShareViewer[]; nextCursor: string; } export interface ArkmeCallDetail { /** Stable occurrence identity; callRef is renewable and must not be used for equality. */ stableId?: string; callRef: string; title: string; mediaType: ArkmeCallMediaType; startedAtMillis: number; acceptedAtMillis: number; endedAtMillis: number; durationSeconds: number; callResult: string; resultLabel: string; summaryStatus: ArkmeCallSummaryStatus; summaryText?: string; summaryUpdatedAtMillis?: number; transcriptPending: boolean; transcriptFailed: boolean; videoRecord?: ArkmeCallVideoRecord; participants: ArkmeCallParticipant[]; transcriptSegments: ArkmeCallTranscriptSegment[]; /** Actual final hangup event, not inferred from the caller or peer. */ hangupParticipant?: ArkmeCallParticipant; } export interface ArkmeCallSummaryRetryResult { status: 'submitted'; detail: ArkmeCallDetail; } export interface ArkmeProviderCapabilities { contractVersion: typeof ARKME_PROVIDER_CONTRACT_VERSION; provider: '@senguoyun/dsh-arkme'; sdk: '@senguoyun/dsh-arkme/sdk'; environment: ArkmeEnvironment; features: { authStatus: true; realtimeDictationV1?: true; /** Interactive preset-account login; passwords must never enter model tools. */ passwordLogin?: true; cachedSnapshot: true; remoteRefresh: true; search: true; createText: true; retryOutbox: true; revisionPolling: true; userProfile: true; /** Current-account profile settings support Arkme ID, personal QR, and phone binding flows. */ accountSettings?: true; calendarDayReview?: true; calendarDayReviewHumanConfirmation?: true; analyticsV1?: true; arkoImagesV1?: true; aiPoints?: true; automaticCapabilitiesV1?: true; imageRead: true; /** Record-calendar bucket and day-record reads backed by the Arkme record service. */ recordCalendar?: true; /** Authorized image-library listing with opaque, account-bound media references is available. */ imageLibrary?: true; sourceDirectory: true; localFirstDirectory?: true; /** Topic home preference uses the record-owned policy without changing topic contents. */ topicHomeVisibility?: true; arkoLifecycleV1?: true; recordExportV1?: true; arkoHistoryReadsV1?: true; officialNotificationsV1?: true; entityArchive?: true; /** Paged five-section directory, including coverage and Host-owned recovery. */ teamMessageExtensions?: 1; teamMessageInteractions?: 1; teamPersonMentions?: 1; teamNotificationPoliciesV1?: true; teamOutboundReception?: 1; teamGroupRepresentation?: 1; teamProfiles?: true; teamExternalChats?: true; groupSelfNickname?: true; commonGroups?: true; dshAccountSessions?: true; remoteRecordSearch?: true; contactDirectoryReads?: true; personRecordsV1?: true; articleLibraryV1?: true; relationPages?: true; recordingPersonReferences?: true; recordingEntities?: true; recordingEntityStart?: true; speakerPresence?: true; recordingWorkflowV2?: true; recordingStrategiesV1?: true; recordingStrategyRecordingsV1?: true; recordingProcessingPreferenceV1?: true; offlineContextV1?: true; unifiedChatTimeline?: true; durableChatTimeline?: true; accountMessageSync?: true; sourceTimeline: true; /** Forward snapshots include typed transcripts and account-bound attachment references. */ forwardContent?: true; sourceTextSend: true; /** Recipient read/unread summaries and group member detail for current-user-sent messages. */ messageReadReceipts?: true; /** Peer group-chat messages expose an account-bound report action. */ messageReport?: true; /** Employee-only, source-bound private-chat user ban inspection and mutation are available. */ userBanManagement?: true; imageCacheRead?: true; selfRoles?: true; directMessageAdmission?: true; messageTextAnchorsV1?: true; reactionsV1?: true; /** Group owners can withdraw peer messages, remove members, and manage future join restrictions. */ groupOwnerGovernance?: true; markdownQuickNotes?: true; markdownLongArticles?: true; richContentRead: boolean; richContentSend: boolean; /** Explicit text background-sound descriptors are supported by direct and durable rich sends. */ backgroundSound?: true; fileUpload: boolean; outgoingCall: true; /** Browser-safe call-history list/detail and explicit summary retry are available. */ callHistory?: true; groupMembers: true; /** Progressive member pages, explicit membership verification and advisory disk cache. */ memberDirectoryPaging?: true; groupMemberAdd?: true; userCard: true; openPrivateChat: true; /** Search accounts and idempotently add/open a contact conversation. */ contactTeamDiscovery?: true; contactAdd?: true; /** Built-in quick-add surface plus SDK/Host support for contacts, groups, and Bots. */ conversationQuickAdd?: true; groupSettings: true; /** Group AI expression-polish settings, rule previews, and confirmation-based mutations. */ groupAiPolish?: true; /** Installed-extension inspection and desired enable/disable state are available. */ extensionManagement?: true; /** Owner-authorized extension name, description, and private/public visibility editing is available. */ extensionMetadataEdit?: true; /** OpenAPI-backed current-account Team directory is available. */ teamDirectory?: true; /** Team member pages can be read with opaque team and user references. */ teamMembers?: true; /** Explicit create and join-by-Jotmo-ID Team governance is available. */ teamGovernance?: true; /** Private, local-only Codex task activity journal. */ teamCodexLocal?: true; /** Extension-level icon upload and same-origin rendering are available. */ extensionIcons?: true; /** Extension-level preview gallery SDK and Tool mutations are available. */ extensionPreviews?: true; /** Staged, account-bound recording import with resumable task status. */ recordingFileImport?: true; recordingTranscriptPages?: true; relatedRecordings?: true; /** Optional additive capability so older Providers remain detectable by consumer plugins. */ worldFeed?: true; worldRecordRead?: true; /** Optional additive capability for reading and writing World comments and replies. */ worldInteractions?: true; /** Optional additive capability for publishing text and file-asset World records. */ worldPublish?: true; /** Optional additive capability for author-voice playback of public World text. */ worldVoiceprintPlayback?: true; /** Optional additive capability for sending a voiceprint invite reminder to a World author. */ worldVoiceprintInvite?: true; /** Optional additive capability for mobile-aligned relationship context in the voiceprint reminder dialog. */ worldVoiceprintSocialContext?: true; /** Optional additive capability for current-account voiceprint management in the built-in UI. */ voiceprintManagement?: true; /** Optional additive capability for the independent Arrangement consumer. */ arrangements?: true; /** Optional additive current-account Cordis/Profile/cloud extension inventory. */ myExtensions?: true; /** Optional additive publication of an exact owned live Cordis Package. */ extensionPublish?: true; /** Query and explicitly resume current-account immutable publish sessions. */ extensionPublishRecovery?: true; /** Optional additive capability for extension reviews, replies, and rating summaries. */ extensionReviews?: true; }; limits: { maxTextLength: number; maxSearchResults: number; maxSyncPages: number; maxImageBytes: number; maxRelatedRecordingPageSize?: number; maxRelatedRecordingCursorLength?: number; maxMessageReadReceiptItems?: number; maxUploadBytes: number; }; } export type ArkmeImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif'; export interface ArkmeImageBytes { mediaType: ArkmeImageMediaType; bytes: number; data: Uint8Array; } /** Browser-safe image payload. Signed OSS URLs and credentials never cross the Provider boundary. */ export interface ArkmeImagePayload { mediaType: ArkmeImageMediaType; bytes: number; dataBase64: string; } export interface ArkmeUserProfile { userId: number; displayName: string; nickname: string; avatarRef: string; /** Backing file-asset reference for the signed-in user's avatar when the profile endpoint has not returned a public URL. */ avatarAssetRef?: string; avatarUrl?: string; arkmeId: string; /** Whether this account can still use its one-time Arkme ID change. Omitted for legacy cached profiles. */ canUpdateArkmeId?: boolean; /** Fresh account-service login decision; not persisted across process restarts. */ phoneBindingRequired?: boolean; accountType: number; createdAt: number; bindings: { apple: boolean; wechat: boolean; google: boolean; /** Older profile responses do not report Huawei binding state. */ huawei?: boolean; }; bindingNames?: { wechat?: string; apple?: string; google?: string; }; contact: { phoneMasked?: string; emailMasked?: string; }; } export interface ArkmeUserProfileSnapshot { profile: ArkmeUserProfile | null; cachedAtMillis: number; revision: number; } /** Only one field may be changed per explicit profile action. */ export type ArkmeProfileUpdate = { field: 'nickname' | 'avatar'; value: string; expectedAccountScope: string; }; export interface ArkmeInvitationRewards { accountScope: string; code: string; invitedCount: number; alreadyClaimed: boolean; registrationExpired: boolean; } export type ArkmeUserBanStatus = 'banned' | 'unbanned'; /** Browser-safe current fact for the peer bound to one private-chat source. */ export interface ArkmeUserBanRecord { sourceRef: string; displayName: string; status: ArkmeUserBanStatus; remark: string; bannedAtMillis: number; unbannedAtMillis: number; updatedAtMillis: number; } export interface ArkmeUserBanSnapshot { sourceRef: string; displayName: string; exists: boolean; banned: boolean; record?: ArkmeUserBanRecord; } /** Host-only owner fact used to bind confirmation to the same resolved peer. Never serialize directly. */ export interface ArkmeUserBanOwnerRecord extends ArkmeUserBanRecord { targetUserId: number; operatorUserId: number; } /** Host-only lookup result. UI, Browser SDK and model output receive ArkmeUserBanSnapshot instead. */ export interface ArkmeUserBanOwnerSnapshot extends Omit { targetUserId: number; record?: ArkmeUserBanOwnerRecord; } export type ArkmeIdAvailabilityReason = '' | 'invalid' | 'taken' | 'modify_limited' | 'server_busy'; export interface ArkmeIdAvailabilitySnapshot { available: boolean; reason: ArkmeIdAvailabilityReason; arkmeId: string; } export interface ArkmeIdMutationResult { arkmeId: string; changed: boolean; canUpdate: boolean; revision: number; } export type ArkmeSourceKind = 'send_to_self' | 'default_category' | 'topic' | 'private_chat' | 'group_chat'; export type ArkmeSourceDirectory = 'root' | 'send_to_self'; export type ArkmeGroupAvatarFallback = { kind: 'phone_default'; colorIndex: number; label: string; } | { kind: 'default'; }; export interface ArkmeGroupAvatarSlot { /** Opaque Provider image reference. Missing images keep their slot and use fallback instead. */ avatarRef?: string; fallback?: ArkmeGroupAvatarFallback; } /** Additive presentation data for the desktop-compatible, ordered group avatar. */ export interface ArkmeGroupAvatarPresentation { memberCount: number; strategy: string; computedAtMillis: number; /** Server-selected member order, capped at five slots. */ slots: ArkmeGroupAvatarSlot[]; } export interface ArkmeSourceItem { /** Viewer-visible private counterpart nickname, independent of the preferred remark. */ privateNickname?: string; /** Record-owned topic container kind; never a chat kind or creation source. */ topicKind?: number; sourceRef: string; /** Account-signed conversation binding; unaffected by directory activity/sequence changes. */ conversationRef?: string; /** Established human Direct session, never PendingPrivate or Bot direct. */ directMessageAdmissionApplicable?: boolean; /** Stable Host-projected directory identity. Consumers must treat it as opaque when present. */ sourceKey?: string; /** Private-chat peer identity when this source is a one-to-one chat. */ peerUserId?: number; /** Private-chat counterpart membership from Chat; never the viewer's membership. */ peerMemberType?: 'free' | 'vip' | 'svip' | 'unknown'; /** Opaque reference to this topic's parent when both topic labels are available in the same response. */ parentSourceRef?: string; /** Opaque topic identity for reconciling hierarchy across paginated directory responses. */ topicHierarchyKey?: string; /** Opaque parent topic identity. A child stays hidden until this key is present in the loaded tree. */ parentTopicHierarchyKey?: string; /** Some direct child topics are still on later pages of the personal-topic directory. */ hasPendingChildren?: boolean; /** Server-persisted order within this topic's sibling group. */ siblingOrder?: number; kind: ArkmeSourceKind; displayName: string; /** Opaque Provider image reference; consumers resolve it through image.read. */ avatarRef?: string; /** Ordered group-avatar tiles, also resolved only through image.read. */ avatarRefs?: string[]; /** Preferred group-avatar projection. Consumers that do not understand it may keep using avatarRefs. */ groupAvatar?: ArkmeGroupAvatarPresentation; latestPreview?: string; /** Server-selected activity freshness, independent of the message/read sequence. No participant IDs. */ latestActivityAtMillis?: number; latestActivityKind?: 'member_joined' | 'record'; /** Server mutation time when a lifecycle change reselects an earlier activity. */ latestPreviewUpdatedAtMillis?: number; activeAtMillis: number; unreadCount: number; /** Attention count after applying mute/notification policy; raw unreadCount remains authoritative. */ badgeUnreadCount?: number; /** Whether new-message notifications are allowed for this conversation. */ notificationAllowed?: boolean; hasUnreadMention?: boolean; /** Effective chat notification state. True when mute is on or push notifications are disabled. */ isMuted?: boolean; /** Server-persisted conversation pin state for private and group chats. */ isPinned?: boolean; /** Chat policy.update_at for ordering pin projections; independent of message sequence. */ chatPolicyUpdatedAtMillis?: number; /** Policy version proving mute/notify projection; pin-only events cannot advance it. */ chatNotificationPolicyUpdatedAtMillis?: number; latestSequence?: number; /** Current viewer's confirmed Chat read cursor; distinct from the last message sequence. */ readSequence?: number; recordCount?: number; /** * Account-bound projection of Chat-owned group @ activity for this private * contact. It is deliberately separate from direct-message unreadCount so * the global conversation badge and private-chat read cursor are unchanged. */ privateInteraction?: { latest: ArkmePrivateInteraction; unreadCount: number; attentionCount: number; version: string; }; } /** Account-bound pin snapshot; does not describe directory membership or message state. */ export interface ArkmeChatPinProjection { sourceKey: string; pinned: boolean; policyUpdatedAtMillis: number; } /** Result of the existing Chat pin mutation; sidebar visibility is a separate capability. */ export interface ArkmeSourceDirectoryPinResult { sourceRef: string; pinned: boolean; policyUpdatedAtMillis: number; } export interface ArkmeConversationDirectoryVisibilityItem { entryKind: 'source' | 'bot'; entryRef: string; hidden: boolean; } /** Browser-safe view of the Chat-owned sidebar visibility facts. */ export interface ArkmeConversationDirectoryVisibility { items: ArkmeConversationDirectoryVisibilityItem[]; } /** Account-scoped directory progress. Cache availability never proves remote completeness. */ export interface ArkmeDirectoryProjection { removedSourceKeys?: string[]; removedBotRefs?: string[]; botPinnedKeys?: string[]; sendToSelf?: ArkmeSourceItem; arkoProfile?: ArkmeArkoProfile; arkoPreview?: { text: string; createdAtMillis: number; }; avatarRefs?: string[]; revision: number; phase: 'cached' | 'loading' | 'syncing' | 'complete' | 'failed'; cachedAtMillis: number; visibility: ArkmeConversationDirectoryVisibilityItem[]; bots: ArkmeBotSummary[]; error?: string; } export interface ArkmeSourceList { projection?: ArkmeDirectoryProjection; directory: ArkmeSourceDirectory; items: ArkmeSourceItem[]; total?: number; hasMore: boolean; nextCursor?: string; } /** Built-in UI result for creating a personal topic without exposing its server UID. */ export interface ArkmeTopicCreateResult { source: ArkmeSourceItem; /** Present only when the requested parent relation and the automatic orphan cleanup both failed. */ warning?: string; } /** Result of moving a personal topic to a different hierarchy parent. */ export interface ArkmeTopicHierarchyMoveResult { sourceRef: string; parentSourceRef?: string; siblingOrder: number; } /** Result of renaming one personal topic. The opaque reference changes with the title. */ export interface ArkmeTopicRenameResult { sourceRef: string; displayName: string; } /** Result of dissolving one personal topic while retaining its child topics. */ export interface ArkmeTopicDissolveResult { sourceRef: string; movedChildSourceRefs: string[]; movedRecordCount: number; /** Undefined means the records returned to the default category. */ recordTargetSourceRef?: string; } /** Live status for a long-running topic dissolve operation. */ export interface ArkmeTopicDissolveProgress { requestId: string; stage: 'reading' | 'migrating' | 'promoting' | 'dissolving' | 'completed' | 'failed'; completedRecordCount: number; totalRecordCount: number; error?: string; } /** A viewer-bound dissolve task that can be restored after the page reloads. */ export interface ArkmeTopicDissolveTask extends ArkmeTopicDissolveProgress { sourceRef: string; parentSourceRef?: string; } export interface ArkmeTimelineCursor { unified?: import('./unified-chat-timeline.js').ArkmeUnifiedTimelineQuery; sendAtMillis?: number; itemUid?: string; beforeSequence?: number; afterSequence?: number; } /** A browser-safe topic projection attached to an item in a personal aggregate or topic-subtree feed. */ export interface ArkmeTimelineSelfTopic { /** Browser-safe stable key for resolving the current topic from the self topic tree. */ topicHierarchyKey: string; /** Available immediately when the feed includes the topic title. */ sourceRef?: string; title?: string; } /** Static environment data captured when a user creates a chat record. */ export interface ArkmeRecordCaptureContext { clientName?: string; networkName?: string; electric?: number; charge?: number; } /** Browser-safe device location saved for one record after an explicit user grant. */ export interface ArkmeRecordLocationCapture { latitude: number; longitude: number; /** Horizontal accuracy reported by the browser, in metres. */ accuracyMeters?: number; altitudeMeters?: number; speedMetersPerSecond?: number; capturedAtMillis: number; } /** Historical read model: missing capture time must remain unknown. */ export interface ArkmeRecordLocationObservation { source: 'device'; latitude: number; longitude: number; label?: string; capturedAtMillis?: number; deviceLabel?: string; accuracyMeters?: number; } export interface ArkmeCalendarRecordLocation { recordUid: string; access: 'available' | 'restricted'; location?: ArkmeRecordLocationObservation; } /** Browser-safe playback projection for every segment of one background recording. */ export interface ArkmeMessageSnapshotBackgroundSoundPlayback { mediaRefs: string[]; amplitudes: number[]; durationSeconds?: number; } export interface ArkmeMessageSnapshotDetail { /** Included only when explicitly requesting the full attachment snapshot. */ contentBlocks?: ArkmeContentBlock[]; mediaUnavailable?: boolean; title?: string; sourceUrl?: string; itemUid: string; textContent: string; textFormat?: 'plain' | 'markdown'; recordDurationMillis?: number; editDurationMillis?: number; viewTimes?: number; shareTimes?: number; captureContext?: ArkmeRecordCaptureContext; backgroundSound: 'available' | 'not-recorded' | 'disabled' | 'unknown'; backgroundSoundPlayback?: ArkmeMessageSnapshotBackgroundSoundPlayback; locationCapture?: ArkmeRecordLocationCapture; locationLabel?: string; weather?: string; altitudeMeters?: number; movement?: string; belongDate?: string; startAtMillis?: number; completeAtMillis?: number; syncedAtMillis?: number; syncState?: 'synced' | 'syncing' | 'failed' | 'not-synced'; } export interface ArkmeTimelineMentionTarget { kind: 'member' | 'all' | 'bot'; startIndex: number; length: number; displayName: string; /** Browser-safe account-and-session scoped member identity for opening the profile card. */ memberRef?: string; botRef?: string; /** Opaque account-scoped Bot identity, for exact matching within loaded chat messages. */ botDirectoryKey?: string; } export interface ArkmeTimelineItem { representation?: TeamRepresentationSnapshot; originRepresentation?: TeamRepresentationSnapshot; /** Local presentation of an explicitly saved personal quotation; cloud text remains complete. */ localSelfQuote?: import('./selected-text-note.js').SelectedTextNotePresentation; offlineContextMessageRef?: string; timelineEventId?: string; /** Chat's native-message tie order, shared by confirmed tail and unified pages. */ timelineOrderTie?: string; /** Authoritative Chat relation owner for re-establishing an expired reading window. */ recordOwnerUserId?: RecordOwnerId; /** Local display role for a self-authored record; isMe remains the real author. */ selfRole?: ArkmeSelfRoleSnapshot; /** Original media refs were not fully projected, even when rich-media rendering is disabled. */ attachmentSnapshotUnavailable?: boolean; /** Even an absent snapshot must not fall back to today's account avatar. */ avatarSnapshot?: boolean; /** A historical sender nickname exists; otherwise the display name is only a fallback. */ senderNameSnapshot?: boolean; /** Record owner manual-edit fact; independent of AI polish and content version. */ hasManualEdit?: boolean | undefined; /** Display-only call status; room, participant and call identifiers stay host-side. */ callRecord?: { stableId?: string; mediaType: 'audio' | 'video'; text: string; /** Account-bound encrypted reference accepted by calls.history.detail. */ callRef?: string; direction?: 'outgoing' | 'incoming'; startedAtMillis?: number; durationSeconds?: number; summaryText?: string; summaryStatus?: ArkmeCallSummaryStatus; }; /** Signed Record owner and observed content version for user soft deletion. */ recordDeletionRef?: string; /** Signed observed personal-topic membership; distinct from forwarding snapshots. */ recordTopicAssignmentRef?: string; /** Stable topic identity from assignment membership evidence, not the display card. */ recordTopicAssignmentTopicKey?: string; itemUid: string; /** Account- and conversation-bound stable key used only for realtime timeline invalidation. */ timelineItemKey?: string; /** Account-bound opaque reference for reporting this concrete group-chat message. */ messageRef?: string; /** Account-bound opaque reference for owner withdrawal of this concrete group-chat message. */ messageWithdrawalRef?: string; /** Account- and conversation-bound opaque reference for copy-link and forward actions. */ messageActionRef?: string; /** False when the source actor cannot own related quick notes or chat extensions. Omitted defaults to supported for legacy and user messages. */ quickNoteDetailsSupported?: boolean; /** Account- and conversation-bound opaque reference for actions on the sender. */ memberRef?: string; senderKind?: 'human' | 'bot'; /** Account-scoped opaque Bot identity for matching a sender to existing Bot directory entries. */ senderBotDirectoryKey?: string; senderName: string; agentSource?: ArkmeTimelineAgentSource; /** Opaque Provider image reference for the concrete message sender. */ avatarRef?: string; isMe: boolean; /** Browser-safe projection of whether this incoming message mentions the current viewer. */ mentionsViewer?: boolean; /** Browser-safe mention ranges projected from provider metadata; used for exact highlight and member cards. */ mentions?: ArkmeTimelineMentionTarget[]; sendAtMillis: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; /** Safe rich preview retained from raw Chat metadata even when media delivery URLs are unavailable. */ conversationPreview?: string; status: number; sequence?: number; recordVersion?: number; aiPolish?: ArkmeTimelineAiPolish; templateKind?: number; displayKind?: number; version?: number; updateAtMillis?: number; recordDurationMillis?: number; editDurationMillis?: number; /** Snapshot metadata returned with the record when the originating client captured it. */ captureContext?: ArkmeRecordCaptureContext; /** Explicitly user-authorized location captured by this client for the record. */ locationCapture?: ArkmeRecordLocationCapture; contentBlocks?: ArkmeContentBlock[]; /** Record owner reported media refs, but their delivery projection was temporarily unavailable. */ mediaUnavailable?: boolean; /** Present for a categorized record in the aggregate or a topic-subtree “发给自己” feed. */ selfTopic?: ArkmeTimelineSelfTopic; /** Browser-safe Chat forward or Record-owned long-recording selection snapshot. */ forwardRecords?: ArkmeForwardRecordsPreview; /** Browser-safe shared recording snapshot. It is present only for explicit `render_kind=shared_recording_memory` payloads. */ sharedRecording?: ArkmeSharedRecordingPreview; /** Record uid of the message this chat extension continues. */ extensionParentRecordUid?: string; /** Browser-safe desktop-style preview rendered above an extension child message. */ extensionParent?: ArkmeTimelineExtensionParent; /** Successful local send waiting for the authoritative chat timeline projection. */ awaitingTimelineProjection?: true; } export interface ArkmeTimelineExtensionParent { /** Immutable selected text, only from the validated quote_reply protocol. */ quote?: import('./message-quote.js').ArkmeMessageQuote; quoteState?: 'available' | 'edited' | 'unavailable'; itemUid: string; senderName: string; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; /** Authoritative record owner required by Chat's exact around lookup. */ recordOwnerUserId?: RecordOwnerId; sequence?: number; sendAtMillis?: number; contentBlocks?: ArkmeContentBlock[]; } /** Browser-safe summary of one quick note related to the current message or moment. */ export interface ArkmeRelatedQuickNoteItem { /** Viewer- and source-bound opaque reference used to open the related note. */ relatedRef: string; senderName: string; /** Opaque Provider image reference for the related note author. */ senderAvatarRef?: string; sendAtMillis: number; title: string; textPreview: string; sourceLabel?: string; } export interface ArkmeRelatedQuickNoteList { recallMode: 'embedding' | 'search_fallback' | 'unavailable'; retryable: boolean; retryAfterMillis: number; items: ArkmeRelatedQuickNoteItem[]; total: number; } /** Allowlisted presentation fields for one related note; routing identifiers stay host-side. */ export interface ArkmeRelatedQuickNoteDetail { relatedRef: string; senderName: string; /** Opaque Provider image reference for the related note author. */ avatarRef?: string; isMe: boolean; sendAtMillis: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; status: number; recordVersion?: number; aiPolish?: ArkmeTimelineAiPolish; templateKind?: number; displayKind?: number; version?: number; updateAtMillis?: number; recordDurationMillis?: number; editDurationMillis?: number; contentBlocks?: ArkmeContentBlock[]; mediaUnavailable?: boolean; forwardRecords?: ArkmeForwardRecordsPreview; } /** Identity of one message returned by an Arkme private/group timeline. */ export interface ArkmeMessageReadReceiptQueryItem { itemUid: string; sequence: number; } export declare const ARKME_MESSAGE_READ_RECEIPT_MAX_ITEMS: 50; export type ArkmeMessageReadReceiptStatus = 'read' | 'partially_read' | 'unread'; /** Read/unread aggregate for one current-user-sent private/group message. */ export interface ArkmeMessageReadReceiptSummary extends ArkmeMessageReadReceiptQueryItem { readCount: number; unreadCount: number; /** Active human recipients, excluding the sender. */ totalMemberCount: number; status: ArkmeMessageReadReceiptStatus; } export interface ArkmeMessageReadReceiptSummaryList { sourceRef: string; conversationKind: 'private_chat' | 'group_chat'; items: ArkmeMessageReadReceiptSummary[]; } export interface ArkmeMessageReadReceiptMember { /** False when the displayed name came only from a local cache. */ displayNameIsCurrent?: boolean; /** Account- and conversation-bound member reference. */ memberRef: string; displayName: string; avatarRef?: string; readStatus: 'read' | 'unread'; /** Present only when this member has read the message. */ readAtMillis?: number; } /** Member-level receipt detail for one current-user-sent group message. */ export interface ArkmeMessageReadReceiptDetail extends ArkmeMessageReadReceiptQueryItem { /** False means member presentation is advisory; receipt membership and read status remain authoritative. */ presentationComplete?: boolean; sourceRef: string; readCount: number; unreadCount: number; totalMemberCount: number; items: ArkmeMessageReadReceiptMember[]; } export interface ArkmeForwardRecordsPreview { title: string; createdAtMillis: number; summaryLines: string[]; items: ArkmeForwardRecordPreviewItem[]; /** The bounded snapshot omitted additional records or nested content. */ truncated?: true; } export interface ArkmeForwardTranscriptSegment { /** Recording-local speaker number, never an account identity. */ speakerNumber?: number; speakerName: string; textContent: string; textFormat?: 'plain' | 'markdown'; /** Offsets in the forwarded recording, not wall-clock timestamps. */ startMillis: number; endMillis: number; contentBlocks?: ArkmeContentBlock[]; mediaUnavailable?: true; } export interface ArkmeForwardRecordPreviewItem { sourceTeam?: { name: string; jotmoId: string; }; originTeam?: { name: string; jotmoId: string; }; /** Built-in AI presentation asset; never a user identity. */ avatarKind?: 'deepseek'; templateKind?: number; displayKind?: number; senderName: string; /** Opaque Provider image reference for the snapshotted sender. */ avatarRef?: string; /** * Account id of the snapshotted sender, present only when the Provider * resolved a real account and it is not the viewer, so the snapshot can offer * a private chat. Transcript speaker labels are never identities and never * populate this field. */ senderUserId?: number; sendAtMillis: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; contentLabel?: string; sourceType?: 'team_message' | 'record' | 'chat_record' | 'long_recording_segments' | 'agent' | 'ai_letter' | 'unknown'; segments?: ArkmeForwardTranscriptSegment[]; contentBlocks?: ArkmeContentBlock[]; mediaUnavailable?: true; truncated?: true; } export interface ArkmeSharedRecordingParticipant { refUserId?: number; displayName: string; role: number; } export interface ArkmeSharedRecordingPreview { /** Backend record digest for opening the shared recording snapshot. */ sourceDigest: string; /** Browser-safe Host-bound detail reference for loading the full transcript on demand. */ detailRef?: string; sharedByUserId: number; sharedAtMillis: number; displayAtMillis: number; endAtMillis: number; timeRangeText: string; title: string; summary: string; transcript?: string; transcriptAvailable: boolean; participants: ArkmeSharedRecordingParticipant[]; } export interface ArkmeTimelineAgentSource { kind: 'agent' | 'dsh_agent_input'; displayName: string; label: string; } export type ArkmeAiPolishSendState = 'none' | 'polishing' | 'polished' | 'kept_original' | 'failed'; export interface ArkmeTimelineAiPolish { state: ArkmeAiPolishSendState; originalText?: string; polishedText?: string; failureMessage?: string; /** Host-bound retry reference. Present only for the current sender's transient failed attempt. */ retryRef?: string; } export interface ArkmeGroupAiPolishRule { ruleRef: string; name: string; ruleText: string; isActive: boolean; /** Browser-safe conversation history persisted with the rule for mobile/desktop continuity. */ threadMessages?: ArkmeGroupAiPolishThreadMessage[]; } export interface ArkmeGroupAiPolishThreadMessage { id: string; role: 'ai' | 'user'; text: string; isRule?: boolean; ruleRef?: string; } export interface ArkmeGroupAiPolishSnapshot { sourceRef: string; groupName: string; enabled: boolean; canManage: boolean; viewerRole: number; activeRuleName: string; rules: ArkmeGroupAiPolishRule[]; updatedAtMillis: number; } export interface ArkmeGroupAiPolishRuleCandidate { groupName: string; ruleName: string; ruleText: string; confirmationRef: string; threadMessages?: ArkmeGroupAiPolishThreadMessage[]; } export interface ArkmeGroupAiPolishMutationResult { groupName: string; enabled: boolean; ruleName: string; changed: boolean; } export interface ArkmeGroupAiPolishNotice { noticeUid: string; sourceKey: string; message: string; createdAtMillis: number; } export type ArkmeContentKind = 'image' | 'video' | 'audio' | 'file'; /** Browser-safe media metadata. `mediaRef` is opaque and resolves only through the local Provider route. */ export interface ArkmeContentBlock { kind: ArkmeContentKind; mediaRef: string; fileAssetUid?: string; fileName: string; mimeType: string; size: number; durationSec?: number; sortOrder: number; /** Backend media render role. 3 means a standalone chat sticker. */ renderRole?: 1 | 3; /** Original bytes, distinct from an image preview. */ originalRef?: string; localFileRef?: string; uploadProgress?: import('./file-transfer-contract.js').ArkmeFileProgress; /** One logical photo; the companion is not a second visible attachment. */ dynamicPhoto?: { logicalUid: string; motionFileAssetUid?: string; motion?: Omit & { kind: 'video'; }; }; } export interface ArkmeUploadedAsset { fileAssetUid: string; fileName: string; mimeType: string; size: number; fileKind: 1 | 2 | 3 | 4; } /** Explicit background-audio role. Ordinary `audio/*` assets never acquire this role implicitly. */ export interface ArkmeRichBackgroundSoundInput { assets: ArkmeUploadedAsset[]; amplitudes: number[]; } export type ArkmeBackgroundSoundEligibilityReason = 'eligible' | 'membership-required' | 'membership-unavailable'; /** Current-account server projection for the text background-sound switch. */ export interface ArkmeBackgroundSoundPreference { userId: number; found: boolean; enabled: boolean; eligible: boolean; memberType?: number; eligibilityReason: ArkmeBackgroundSoundEligibilityReason; sourceVersion?: number; updatedAtMillis?: number; } export interface ArkmeFavoriteSticker { fileAssetUid: string; fileName: string; mimeType: string; size: number; fileKind: 1; isAnimated: boolean; isAvailable: boolean; mediaRef?: string; unavailableReason?: string; } export interface ArkmeFavoriteStickerList { items: ArkmeFavoriteSticker[]; itemCount: number; updatedAtMillis: number; } export interface ArkmeFavoriteStickerAddInput { fileAssetUid: string; fileName: string; mimeType: string; size: number; fileKind: 1; isAnimated?: boolean; } export type ArkmeFavoriteStickerManageAction = 'move-to-front' | 'delete'; export interface ArkmeRichSendInput extends TeamRepresentationSendOptions { title?: string; textContent?: string; textFormat?: 'plain' | 'markdown'; displayKind?: 0 | 1; thinkingDurationMillis?: number; /** Time spent composing this record before it was sent. */ recordDurationMillis?: number; /** Browser/device data captured at send time, when available. */ captureContext?: ArkmeRecordCaptureContext; assets?: ArkmeUploadedAsset[]; backgroundSound?: ArkmeRichBackgroundSoundInput; humanMentions?: ArkmeHumanMentionInput[]; botMentions?: ArkmeBotMentionInput[]; } interface ArkmeHumanMentionRange { startIndex: number; length: number; } export type ArkmeHumanMentionInput = (ArkmeHumanMentionRange & { mentionRef: string; memberRef?: never; all?: never; }) | (ArkmeHumanMentionRange & { all: true; mentionRef?: never; memberRef?: never; }); export interface ArkmeBotMentionInput { botRef: string; startIndex: number; length: number; } export interface ArkmeLongArticleImage { fileRef?: string; fileAssetUid?: string; } export interface ArkmeLongArticlePublishInput extends TeamRepresentationSendOptions { expectedUserId?: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; images?: ArkmeLongArticleImage[]; recordUid: string; relationUid: string; recordDurationMillis?: number; captureContext?: ArkmeRecordCaptureContext; } export interface ArkmeLongArticleUpdateInput { title: string; textContent: string; textFormat?: 'plain' | 'markdown'; images?: ArkmeLongArticleImage[]; version: number; editDurationMillis: number; } export interface ArkmeLongArticleDetail { /** Verified current record and account-bound action capabilities; never inferred by the reader. */ actionItem?: ArkmeTimelineItem; createdAtMillis?: number; contentBlocks?: ArkmeContentBlock[]; sourceRef: string; itemUid: string; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; mentions?: ArkmeTimelineMentionTarget[]; sendAtMillis: number; updateAtMillis: number; recordDurationMillis: number; editDurationMillis: number; thinkingDurationMillis: number; version: number; editable: boolean; } export interface ArkmeLongArticleDraft { sendAtMillis?: number; draftScope?: string; /** Pending automatic publication; composer attachment drafts never set this. */ autoPublish?: boolean; baseVersion?: number; document?: Record; images?: ArkmeLongArticleImage[]; recordUid?: string; relationUid?: string; sourceRef: string; itemUid?: string; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; durationMillis: number; updatedAtMillis: number; } /** Host-owned durable candidate for editing one existing Record. */ export interface ArkmeRecordReeditDraft { schemaVersion: 1; draftRevision: number; sourceIdentityKey: string; lastSourceRef: string; itemUid: string; title: string; textContent: string; mentions?: import('./record-reedit-contract.js').ArkmeRecordReeditMention[]; attachments?: import('./record-reedit-contract.js').ArkmeRecordReeditAttachmentSelection[]; baseVersion: number; baseContentFingerprint: string; editDurationMillis: number; updatedAtMillis: number; } export type ArkmeMessageReportType = 1 | 2 | 3 | 4; export interface ArkmeMessageReportResult { messageRef: string; reportUid: string; status: number; } export interface ArkmeMessageWithdrawalResult { messageWithdrawalRef: string; timelineItemKey: string; withdrawnAtMillis: number; alreadyWithdrawn: boolean; } export interface ArkmeMessageCopyLinkResult { sid: string; url: string; } export interface ArkmeMessageCopyLinkExtendResult { sid: string; recordUid: string; parentRecordUid: string; status: number; localState: 'synced'; extension?: ArkmeMessageCopyLinkExtensionItem; } /** Extension state for a message authorized by its source-scoped action reference. */ export interface ArkmeSourceMessageExtensionContext extends ArkmeMessageCopyLinkRecordContext { parentRecordUid: string; /** Immediate source of the opened note, independent of its current topic. */ extensionParent?: ArkmeTimelineExtensionParent; } export interface ArkmeSourceMessageExtendResult { recordUid: string; parentRecordUid: string; relationUid?: string; sequence?: number; status: number; localState: 'synced'; extension: ArkmeMessageCopyLinkExtensionItem; } export type ArkmeMessageCopyLinkAccessMode = 'normal' | 'link_read_only'; export interface ArkmeMessageCopyLinkMediaItem { fileKind: number; fileName: string; size: number; } export interface ArkmeMessageCopyLinkStructuredContent { structuredKind: number; durationMillis: number; /** Only the server-authorized selection snapshot; never the full source session. */ longRecordingSegments?: ArkmeForwardTranscriptSegment[]; } export interface ArkmeMessageCopyLinkSnapshotItem { recordUid?: string; sourceKind?: string; senderDisplayName: string; senderAvatarUrl?: string; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; mentions?: ArkmeTimelineMentionTarget[]; sendAtMillis: number; templateKind: number; displayKind: number; officialMark: number; mediaItems: ArkmeMessageCopyLinkMediaItem[]; /** Browser-safe rich media resolved by the Host for detail rendering. */ contentBlocks?: ArkmeContentBlock[]; /** Media metadata exists but its authorized display projection is unavailable. */ mediaUnavailable?: boolean; structuredContent?: ArkmeMessageCopyLinkStructuredContent; } export type ArkmeMessageCopyLinkPresentationNode = { kind: 'item'; itemIndex: number; } | { kind: 'forward_bundle'; title: string; commentText: string; createdAtMillis: number; senderDisplayName: string; children: ArkmeMessageCopyLinkPresentationNode[]; }; export interface ArkmeMessageCopyLinkSourceAnchor { relationUid: string; recordUid: string; recordOwnerUserId: RecordOwnerId; sequence: number; } export interface ArkmeMessageCopyLinkExtensionItem extends ArkmeMessageCopyLinkSnapshotItem { /** Protected shells must never receive locally cached presentation metadata. */ protectedContent?: true; recordUid: string; /** Opaque current-conversation member identity for chat reply presentation. */ senderMemberRef?: string; /** Whether this chat reply was sent by the signed-in viewer. */ senderIsMe?: boolean; /** Locally frozen speaking role for an owned "send to self" extension. */ selfRole?: ArkmeSelfRoleSnapshot; /** Whether the author's display name came from the record's creation-time snapshot. */ senderNameSnapshot?: boolean; /** Record this extension directly continues; used to render the desktop two-level tree. */ parentRecordUid?: string; /** Owner required by the durable chat extension endpoint when this item becomes the next target. */ recordOwnerUserId?: RecordOwnerId; level: number; } export interface ArkmeMessageCopyLinkRecordContext { extensionCount: number; extensions: ArkmeMessageCopyLinkExtensionItem[]; } export interface ArkmeMessageCopyLinkResolveResult { sid: string; displayTitle: string; generatedAtMillis: number; accessMode: ArkmeMessageCopyLinkAccessMode; items: ArkmeMessageCopyLinkSnapshotItem[]; presentation: ArkmeMessageCopyLinkPresentationNode[]; sourceSessionUid?: string; sourceAnchors?: ArkmeMessageCopyLinkSourceAnchor[]; recordContext?: ArkmeMessageCopyLinkRecordContext; } export interface ArkmeTimelinePage { /** Cache state is independent of source completeness and never a server sync/ack cursor. */ cache?: { origin: 'local' | 'network'; persistence: 'committed' | 'unavailable' | 'deferred'; revision?: number; stale: boolean; }; unified?: import('./unified-chat-timeline.js').ArkmeUnifiedTimelineWindow; source: ArkmeSourceItem; items: ArkmeTimelineItem[]; aiPolishNotices?: ArkmeGroupAiPolishNotice[]; aiPolishSettings?: ArkmeGroupAiPolishSnapshot; hasMore: boolean; nextCursor?: ArkmeTimelineCursor; } /** A continuous chat timeline window centered on an exact record. */ export interface ArkmeTimelineAroundPage { unified?: import('./unified-chat-timeline.js').ArkmeUnifiedTimelineWindow; source: ArkmeSourceItem; items: ArkmeTimelineItem[]; anchorItemUid: string; anchorSequence: number; anchorIndex: number; olderHasMore: boolean; newerHasMore: boolean; olderCursor?: ArkmeTimelineCursor; newerCursor?: ArkmeTimelineCursor; latestKnownSequence?: number; } /** Built-in UI projection of private-chat group mention moments. References stay opaque to the Browser. */ export type ArkmeInterwovenState = 'disabled' | 'empty' | 'partial' | 'success'; export interface ArkmeInterwovenMention { momentId: string; momentRef: string; occurredAtMillis: number; groupName: string; senderName: string; senderIsMe: boolean; senderAvatarRef?: string; summary: string; degraded: boolean; } export interface ArkmeInterwovenBootstrap { state: ArkmeInterwovenState; moments: ArkmeInterwovenMention[]; preparedAtMillis: number; message?: string; } /** Receipt of the original group message, never of its private-chat projection. */ export interface ArkmeInterwovenReadReceipt { momentId: string; reader: 'self' | 'peer'; status: 'read' | 'unread' | 'unknown'; readAtMillis?: number; } export interface ArkmeInterwovenReadReceiptList { items: ArkmeInterwovenReadReceipt[]; } export interface ArkmeInterwovenDetail { momentId: string; groupName: string; senderName: string; senderIsMe: boolean; senderAvatarRef?: string; occurredAtMillis: number; title: string; textContent: string; textFormat?: 'plain' | 'markdown'; status: number; degraded: boolean; } export interface ArkmeSourceSendResult { sourceRef: string; itemUid: string; /** Host-signed reference for immediate actions before timeline convergence. */ messageActionRef?: string; /** Observed membership for a confirmed personal Record creation. */ recordTopicAssignmentRef?: string; status: number; sequence?: number; localState: 'synced' | 'failed'; error?: string; warningText?: string; aiPolish?: ArkmeTimelineAiPolish; } export type ArkmeRelatedRecordingPageState = 'empty' | 'generating' | 'success' | 'partial' | 'error'; export interface ArkmeRelatedRecordingEligibility { allowed: boolean; } export interface ArkmeRelatedRecordingSpeaker { speakerId: string; refUserId?: number; nickname?: string; } export interface ArkmeRelatedRecordingParticipant { speakerId: string; refUserId?: number; nickname?: string; displayName: string; role: number; } export interface ArkmeRelatedRecordingItem { /** Account-bound opaque identity. Browser and Agent consumers must not parse it. */ recordingRef: string; /** Account-bound reference for UI and Agent reads of an authorized shared transcript. */ sharedRecordingDetailRef?: string; /** Owner-only, account/chat-bound capability. Do not parse in the browser. */ shareActionRef?: string; shareStateKnown?: boolean; isShared?: boolean; startAtMillis: number; endAtMillis: number; dateStamp?: number; timezoneOffsetMillis?: number; timeRangeText: string; title: string; summary: string; summaryStatus: number; transcript?: string; transcriptAvailable: boolean; speakers: ArkmeRelatedRecordingSpeaker[]; participants: ArkmeRelatedRecordingParticipant[]; isSharedByOther: boolean; sharedByUserId?: number; } export interface ArkmeRelatedRecordingMonthBucket { monthKey: string; itemCount: number; } export interface ArkmeRelatedRecordingShareResult { recordingRef: string; shareActionRef: string; shareStateKnown: true; isShared: boolean; timelineItemKey: string; sequence: number; } export interface ArkmeRelatedRecordingPage { state: ArkmeRelatedRecordingPageState; stateCode: number; stateMessage: string; hasEntry: boolean; items: ArkmeRelatedRecordingItem[]; hasMore: boolean; nextCursor?: string; partial: boolean; monthBuckets?: ArkmeRelatedRecordingMonthBucket[]; timeIndexComplete: boolean; legacyTimeIndexFallback: boolean; } export interface ArkmeRelatedRecordingPageOptions { limit?: number; cursor?: string; monthKey?: string; timezoneOffsetMillis?: number; includeTimeIndex?: boolean; /** Host-side diagnostic classification only; browser SDK does not forward this field. */ consumer?: 'ui' | 'tool'; signal?: AbortSignal; } export interface ArkmeDirectTextSendResult { recipientArkmeId: string; chatSessionUid: string; recordUid: string; relationUid: string; sequence: number; targetKind: 'direct'; } export interface ArkmeSourceReadResult { sourceRef: string; effectiveReadSequence: number; unreadCount: number; /** Server frontier at which unreadCount was computed; optional for older Hosts. */ latestSequence?: number; } export type ArkmeGroupMemberRole = 'owner' | 'admin' | 'member' | 'unknown'; export type ArkmeGroupMemberStatus = 'active' | 'left' | 'removed' | 'unknown'; export interface ArkmeGroupMemberItem { userId: number; displayName: string; memberName?: string; secondaryName?: string; avatarRef?: string; role: ArkmeGroupMemberRole; status: ArkmeGroupMemberStatus; isSelf: boolean; isOwner: boolean; joinedAtMillis: number; recordCount: number; mentionCount?: number; } export interface ArkmeGroupMemberList { source: ArkmeSourceItem; items: ArkmeGroupMemberItem[]; total: number; activeCount: number; selfRole: ArkmeGroupMemberRole; selfStatus: ArkmeGroupMemberStatus; } export interface ArkmeConversationMemberItem { /** False while member statistics have not been retrieved. */ statsKnown?: boolean; /** Stable account-and-session-scoped identity for member actions. */ memberRef: string; /** Present only when this active non-self group member can be selected for a new human mention. */ mentionRef?: string; /** Public/group-safe name bound to mentionRef; never contains the viewer's private contact label. */ mentionDisplayName?: string; /** Viewer-private label shown only as supporting text in a mention candidate. */ mentionSecondaryName?: string; /** Viewer-facing label; it may be the current viewer's private contact remark. */ displayName: string; memberName?: string; secondaryName?: string; avatarRef?: string; role: ArkmeGroupMemberRole; status: ArkmeGroupMemberStatus; isSelf: boolean; isOwner: boolean; joinedAtMillis: number; recordCount: number; mentionCount: number; } export interface ArkmeGroupSelfNickname { sourceRef: string; memberRef: string; nickname: string; } export interface ArkmeGroupMemberRemoveResult { sourceRef: string; memberRef: string; status: 'removed'; joinRestricted: boolean; } export interface ArkmeGroupJoinRestrictionItem { memberRef: string; displayName: string; memberName?: string; secondaryName?: string; avatarRef?: string; restrictedAtMillis: number; } export interface ArkmeGroupJoinRestrictionPage { sourceRef: string; items: ArkmeGroupJoinRestrictionItem[]; nextCursor?: string; } export interface ArkmeGroupJoinRestrictionMutationResult { sourceRef: string; memberRef: string; restricted: boolean; updatedAtMillis?: number; } export type ArkmeConversationMemberJoinAction = 'invite' | 'direct_add'; export interface ArkmeConversationMemberJoinPerson { memberRef?: string; displayName: string; isSelf: boolean; } export interface ArkmeConversationMemberJoinEvent { eventId: string; action: ArkmeConversationMemberJoinAction; occurredAtMillis: number; inviter: ArkmeConversationMemberJoinPerson; invitees: ArkmeConversationMemberJoinPerson[]; } export interface ArkmeConversationMemberList { source: ArkmeSourceItem; items: ArkmeConversationMemberItem[]; total: number; activeCount: number; joinEvents?: ArkmeConversationMemberJoinEvent[]; } export type ArkmeConversationMemberFacts = Pick; export interface ArkmeConversationMemberPage { kind: 'membership'; selfRole: ArkmeGroupMemberRole; source: ArkmeSourceItem; items: ArkmeConversationMemberFacts[]; removedMemberRefs: string[]; hasMore: boolean; nextCursor?: string; joinEvents?: ArkmeConversationMemberJoinEvent[]; } export interface ArkmeConversationMemberPresentation { kind: 'presentation'; source: ArkmeSourceItem; items: ArkmeConversationMemberItem[]; removedMemberRefs: string[]; unavailableProfileMemberRefs: string[]; } export type ArkmeConversationMemberUpdate = ArkmeConversationMemberPage | ArkmeConversationMemberPresentation; export interface ArkmeConversationMemberCache { items: ArkmeConversationMemberItem[]; joinEvents: ArkmeConversationMemberJoinEvent[]; cachedAtMillis: number; } export interface ArkmeMemberEvent { eventId: string; type: 'left'; occurredAtMillis: number; displayName: string; } export interface ArkmeMemberEventQuery { fromAtMillis: number; toAtMillis: number; cursor?: string; limit?: number; } export interface ArkmeMemberEventPage { items: ArkmeMemberEvent[]; hasMore: boolean; nextCursor?: string; } export interface ArkmeMemberEventProfile { displayName: string; memberName?: string; avatarRef?: string; } export type ArkmeConversationMemberRecordMode = 'owner' | 'mentioned'; export interface ArkmeConversationMemberRecordPage { source: ArkmeSourceItem; member: ArkmeConversationMemberItem; mode: ArkmeConversationMemberRecordMode; items: ArkmeTimelineItem[]; hasMore: boolean; nextCursor?: ArkmeTimelineCursor; } export interface ArkmeGroupMemberCandidate { candidateRef: string; displayName: string; avatarRef?: string; origin: 'private_chat' | 'group_chat'; relation: 'contact' | 'stranger' | 'group'; disabled?: boolean; alreadyMember?: boolean; statusText?: string; } export interface ArkmeGroupMemberCandidateGroup { group: ArkmeSourceItem; items: ArkmeGroupMemberCandidate[]; total: number; error?: string; } export interface ArkmeGroupBotCandidate { botRef: string; name: string; description: string; installed: boolean; avatarRef?: string; } export interface ArkmeGroupBotCandidateList { groupSourceRef: string; displayName: string; canAddBots: boolean; items: ArkmeGroupBotCandidate[]; } export interface ArkmeGroupBotAddResult { botRef: string; groupSourceRef: string; installed: boolean; } export interface ArkmeGroupMemberCandidateList { source: ArkmeSourceItem; items: ArkmeGroupMemberCandidate[]; total: number; hasMore: boolean; mode: 'direct_add' | 'approval_invite'; groups: ArkmeSourceItem[]; groupCandidates: ArkmeGroupMemberCandidateGroup[]; contactCount: number; strangerCount: number; } export interface ArkmeGroupInvitePreview { source: ArkmeSourceItem; title: string; inviterDisplayName: string; inviteLink: string; expireAtMillis: number; mode: 'direct_add' | 'approval_invite'; } export type ArkmeGroupMemberAddStatus = 'added' | 'reactivated' | 'already_member' | 'invite_sent' | 'failed'; export interface ArkmeGroupMemberAddItemResult { candidateRef: string; displayName: string; status: ArkmeGroupMemberAddStatus; error?: string; } export interface ArkmeGroupMemberAddResult { source: ArkmeSourceItem; results: ArkmeGroupMemberAddItemResult[]; succeededCount: number; failedCount: number; } export interface ArkmeUserCardSnapshot { displayName: string; avatarRef?: string; } export interface ArkmeOfficialAuthorProfile { userId: number; displayName: string; avatarRef?: string; } export interface ArkmeOpenPrivateChatResult { source: ArkmeSourceItem; } export interface ArkmeGroupActionTarget { sourceRef: string; sourceKey?: string; kind: 'group_chat'; displayName: string; } export interface ArkmeGroupSettingsSnapshot { target: ArkmeGroupActionTarget; selfRole: ArkmeGroupMemberRole; selfStatus: ArkmeGroupMemberStatus; canRename: boolean; canDissolve: boolean; canLeave: boolean; messageDnd: boolean; chatNotificationPolicyUpdatedAtMillis: number; } export interface ArkmeChatNotificationResult { messageDnd: boolean; chatNotificationPolicyUpdatedAtMillis: number; } /** Group menus keep the same shared conversation-policy contract. */ export type ArkmeGroupNotificationResult = ArkmeChatNotificationResult; export interface ArkmeGroupProjectionResult { source: ArkmeSourceItem; status: 'ok'; } export interface ArkmeGroupCommandResult { status: 'ok'; } export interface ArkmeRecordingCalendarDay { dateStamp: number; durationMillis: number; hasRecording: boolean; unreviewedCount: number; } export interface ArkmeRecordingCalendarMonth { fromStamp: number; toStamp: number; days: ArkmeRecordingCalendarDay[]; totals?: import('./recording-total-metrics.js').RecordingTotalMetrics; } export type ArkmeRecordingProjectionKind = 'summary' | 'timeline'; export type ArkmeRecordingTranscriptSource = 'system' | 'doubao'; export interface ArkmeRecordingSummaryModelRouteOption { routeKey: string; provider: string; modelKey: string; displayName: string; } /** Audio-owner model configuration; intentionally distinct from the Arko model catalog. */ export interface ArkmeRecordingSummaryModelConfig { defaultRouteKey: string; effectiveRouteKey: string; personalRouteKey?: string; options: ArkmeRecordingSummaryModelRouteOption[]; } export interface ArkmeRecordingSummaryModelRouteUpdate { effectiveRouteKey: string; } export interface ArkmeRecordingTranscriptItem { /** Confirmed acoustic source, independent of who the voice belongs to. */ soundSource?: ArkmeRecordingSoundSource; /** Includes a confirmed playback subrange after provider resegmentation. */ containsPlayback?: boolean; itemId: string; sessionId: string; childId: string; asrItemIndex: number; transcriptSource: ArkmeRecordingTranscriptSource; startAtMillis: number; endAtMillis: number; speakerNumber: number; speakerColorIndex: number; speakerLabel: string; /** Opaque image reference for a speaker already associated with an Arkme user. */ speakerAvatarRef?: string; isSelf: boolean; isBackground: boolean; text: string; } /** Browser-safe day projection. Audio owner ids remain sealed in itemRef. */ export interface ArkmeRecordingWorkbenchItem { /** Available only for complete projections; paged reads obtain counts when editing. */ sameSpeakerItemCount?: number; /** User-confirmed source, independent of the speaker identity. */ soundSource?: ArkmeRecordingSoundSource; /** Includes a confirmed playback subrange after provider resegmentation. */ containsPlayback?: boolean; /** Read-only precise search locator; never an authorization reference. */ searchIdentityHash?: string; searchVersion?: string; itemId: string; itemRef: string; transcriptSource: ArkmeRecordingTranscriptSource; sessionKey: string; startAtMillis: number; endAtMillis: number; speakerNumber: number; speakerKey: string; /** Candidate identity of the assignment in this transcript snapshot. */ assignedSpeakerOptionKey?: string; speakerColorIndex: number; speakerLabel: string; speakerAvatarRef?: string; canBindSpeaker: boolean; isSelf: boolean; /** Explicit recording attribution, independent of isSelf (speaker identity). Optional for legacy payloads. */ recordingBelongsToViewer?: boolean; isBackground: boolean; text: string; /** Unicode code-point coordinates within the exact owner utterance. */ textStartOffset: number; textEndOffset: number; textTotalLength: number; } export interface ArkmeRecordingPlayback { playbackRef: string; mimeType: string; startOffsetMillis: number; endOffsetMillis: number; } export interface ArkmeRecordingSpeakerCandidate { /** Stable candidate identity; never an authorization or mutation reference. */ optionKey: string; /** Opaque person identity for grouping multiple speaker records bound to one account. */ personKey?: string; speakerRef: string; label: string; avatarRef?: string; kind: 'arkme-user' | 'speaker'; isCurrentUser: boolean; } export interface ArkmeRecordingSpeakerPresence { state: 'building' | 'fresh' | 'stale' | 'failed'; scope: 'all-history'; version?: string; items: Array<{ optionKey: string; dayCount: number; lastSeenAt: number; }>; updatedAt?: number; retryAfterMs?: number; } export interface ArkmeRecordingSpeakerMembers { state: ArkmeRecordingSpeakerPresence['state']; scope: 'all-history'; version?: string; retryAfterMs?: number; dayCount: number; lastSeenAt: number; items: Array<{ identityKey: string; token: string; dayCount: number; lastSeenAt: number; }>; } export interface ArkmeRecordingSpeakerRecommendation { groupItemCount?: number; optionKey?: string; } /** Read-only, interval-bound evidence. Distances are never recognition probabilities. */ export interface ArkmeRecordingSpeakerEvidenceInput { itemRefs: string[]; referenceA: string[]; referenceB: string[]; } export interface ArkmeRecordingSpeakerConsistencyInput { anchorRefs: string[]; /** Optional current-page intervals; allowed only with one group anchor. */ itemRefs: string[]; } export interface ArkmeRecordingSpeakerConsistencyGroup { anchorRef: string; version: string; modelVersion: string; scoreDefinition: string; referenceMethod: string; state: 'ready' | 'partial' | 'building' | 'insufficient'; score: number | null; analyzedCount: number; totalCount: number; reviewCount: number | null; suspectedVoices?: number; items: Array<{ itemRef: string; deviation: number | null; status: 'ready' | 'insufficient'; reason?: string; }>; } export type ArkmeRecordingSpeakerConsistency = { supported: false; } | { supported: true; groups: ArkmeRecordingSpeakerConsistencyGroup[]; }; export type ArkmeRecordingSpeakerEvidence = { supported: false; } | { supported: true; version: string; modelVersion: string; metric: 'cosine_distance'; aggregation: 'nearest_reference' | 'mean_reference' | 'centroid'; state: 'ready' | 'building'; reviewThreshold?: number; ambiguityMargin?: number; items: Array<{ itemRef: string; status: 'ready' | 'insufficient'; distanceA: number | null; distanceB: number | null; effectiveSpeechMillis: number; reason?: string; }>; }; export interface ArkmeRecordingSpeakerOption extends ArkmeRecordingSpeakerCandidate { currentAssignment: boolean; recommended: boolean; } export interface ArkmeRecordingSpeakerMutationResult { scope: 'item' | 'speaker'; changedClusters: number; changedItems: number; day: ArkmeRecordingDay; warning?: string; } export type ArkmeRecordingSoundSource = 'unknown' | 'in_person' | 'playback'; export type ArkmeRecordingSpeakerCorrectionContext = { supported: false; } | { supported: true; version: string; maxItems: number; soundSource: ArkmeRecordingSoundSource; /** optionKey is empty for an excluded person no longer present in the directory. */ excludedSpeakers: Array<{ optionKey: string; label: string; }>; undoRef?: string; }; export interface ArkmeRecordingSpeakerCorrectionPreview { affectedCount: number; intentToken: string; expiresAt: number; selectionVersion: string; evidenceVersion: string; } export interface ArkmeRecordingSpeakerCorrectionInput { intentToken?: string; /** Offsets within the explicitly selected parent rows; Host resolves storage coordinates. */ selections?: import('./recording-evidence-contract.js').RecordingEvidenceSelection[]; target?: { kind: 'unknown'; } | { kind: 'existing'; speakerRef: string; } | { kind: 'new'; name: string; }; itemRef: string; itemRefs: string[]; expectedVersion: string; idempotencyKey: string; rejectedSpeakerRef?: string; rejectCurrent?: boolean; soundSource?: ArkmeRecordingSoundSource; /** Clear the assignment; must be false when assigning an existing or new target. */ detach: boolean; } export interface ArkmeRecordingSpeakerCorrectionUndoInput { itemRef: string; undoRef: string; expectedVersion: string; idempotencyKey: string; } export interface ArkmeRecordingSpeakerCorrectionResult { learningStateAtCommit?: 'not_requested' | 'ineligible' | 'awaiting_evidence' | 'reference_ready' | 'reconciled'; affectedCount: number; version: string; undoRef?: string; day?: ArkmeRecordingDay; /** Fresh transcript from the corrected source; day remains the system day. */ transcript?: ArkmeRecordingDay['transcript']; warning?: string; } export interface ArkmeRecordingSpeakerCorrectionResultQuery { itemRef: string; action: 'apply' | 'undo'; idempotencyKey: string; } export interface ArkmeRecordingTimelineDialoguePoint { speakerName: string; summary: string; quote: string; roleDescription: string; isSelf: boolean; } export interface ArkmeRecordingTimelineDetailItem { label: string; value: string; } export interface ArkmeRecordingTimelineEvent { eventId: string; startAt: string; endAt: string; timeRange: string; title: string; description: string; scene: string; emotion: string; todo: string; tags: string[]; participants: string[]; rawText: string; periodLabel?: string; durationText?: string; relatedToMe?: boolean; positionNote?: string; environmentNote?: string; praise?: string; praisePoint?: number; speakerNote?: string; dialoguePoints?: ArkmeRecordingTimelineDialoguePoint[]; otherInfo?: ArkmeRecordingTimelineDetailItem[]; } export type ArkmeRecordingVersionStatus = 'processing' | 'done' | 'failed'; export type ArkmeRecordingSectionState = 'ready' | 'empty' | 'processing' | 'failed' | 'error'; export interface ArkmeRecordingVersion { id: string; status: ArkmeRecordingVersionStatus; selectable: boolean; generationStage: number; generatedAtMillis: number; modelDisplayName: string; content: string; timelineEvents: ArkmeRecordingTimelineEvent[]; error: string; } export interface ArkmeRecordingSection { state: ArkmeRecordingSectionState; items: T[]; message: string; } export interface ArkmeRecordingStorageMetrics { /** Recorded VAD archive + playback clip bytes, not live OSS retained-object inventory. */ bytes: number; archiveBytes: number; clipBytes: number; state: 'ready' | 'partial' | 'processing' | 'unavailable'; confirmedCount: number; pendingCount: number; unknownCount: number; } export interface ArkmeRecordingDailyMetrics { /** New upload-scoped storage contract; old hosts cannot supply it. */ storage?: ArkmeRecordingStorageMetrics; /** System ASR input in uploaded recordings, clipped to the day; includes recorded retries. */ asrInputDurationMillis: number; asrInputState: 'ready' | 'partial' | 'processing' | 'unavailable'; asrInputEstimatedCount: number; asrInputConfirmedCount: number; asrInputPendingCount: number; asrInputUnknownCount: number; /** Completed children whose API explicitly lacks historical input telemetry. */ asrInputMissingHistoryCount?: number; /** Confirmed retained speech bytes: accepted playback packs or historical VAD archives, never upload/temporary ASR input size. */ archiveBytes: number; archiveState: 'ready' | 'partial' | 'processing' | 'unavailable'; confirmedCount: number; pendingCount: number; unknownCount: number; /** Unicode code points in this transcript payload, excluding whitespace; paged consumers aggregate before showing whole-day totals. */ textCount: number; } export interface ArkmeRecordingTranscriptSection extends ArkmeRecordingSection { dailyMetrics?: ArkmeRecordingDailyMetrics; identityCoverage?: 'complete' | 'partial'; totalDurationMillis: number; processingCount: number; /** Present when the day contains device captures. Independent of ASR work. */ captureCoverage?: { receiving: number; interrupted: number; }; } export interface ArkmeRecordingTranscriptPage extends ArkmeRecordingTranscriptSection { /** Original civil-day window of import notifications; retained on refresh. */ window?: ArkmeRecordingWindow; dateStamp: number; transcriptSource: ArkmeRecordingTranscriptSource; /** Opaque identity of all recording revisions in this read snapshot. */ viewRef: string; /** Empty only when this snapshot has been read completely. */ nextCursor: string; } export interface ArkmeRecordingTranscriptPageOptions { window?: ArkmeRecordingWindow; source?: ArkmeRecordingTranscriptSource; cursor?: string; signal?: AbortSignal | undefined; } /** Recording coverage is independent of ASR: silence and pending ASR still have audio. */ export interface ArkmeRecordingCoverageInterval { startAtMillis: number; endAtMillis: number; sourceLabel: string; status: 'saved' | 'processing' | 'local' | 'submitted' | 'recording'; } export interface ArkmeRecordingCoverage { state: 'ready' | 'partial' | 'error'; intervals: ArkmeRecordingCoverageInterval[]; } export interface ArkmeRecordingDay { dateStamp: number; totalDurationMillis: number; coverage?: ArkmeRecordingCoverage; transcript: ArkmeRecordingTranscriptPage; summary: ArkmeRecordingSection; timeline: ArkmeRecordingSection; } export interface ArkmeRecordingComparison { dateStamp: number; system: ArkmeRecordingTranscriptPage; doubao: ArkmeRecordingTranscriptPage; candidateCount: number; failedCount: number; silentCount: number; } export type ArkmeWechatMessageFilter = 'all' | 'image' | 'voice' | 'video' | 'emoji' | 'location' | 'location_share' | 'call' | 'chat_record' | 'reply'; export type ArkmeWechatCallFilter = 'all' | 'audio' | 'video'; export interface ArkmeWechatConversation { /** Account-bound opaque reference used by the other WeChat tools. */ conversationRef: string; name: string; remark?: string; nickname?: string; isGroup: boolean; messageCount: number; lastSendAtMillis: number; isBound: boolean; } export interface ArkmeWechatConversationPage { conversations: ArkmeWechatConversation[]; total: number; hasMore: boolean; nextCursor?: string; } export interface ArkmeWechatMessage { content: string; senderName: string; isMe: boolean; sentAtMillis: number; messageType: string; hasMedia: boolean; mediaDuration?: number; mimeType?: string; } export interface ArkmeWechatMessagePage { conversationRef: string; messages: ArkmeWechatMessage[]; total: number; hasMore: boolean; nextCursor?: string; } export interface ArkmeWechatConversationDetail { conversationRef: string; name: string; remark?: string; nickname?: string; isGroup: boolean; wechatAlias?: string; wechatId?: string; messageCount: number; voiceCount: number; imageCount: number; emojiCount: number; videoCount: number; firstSendAtMillis?: number; lastSendAtMillis?: number; importedAtMillis?: number; commonGroupCount?: number; groupOwnerName?: string; groupMemberCount?: number; groupCommonFriendCount?: number; } export interface ArkmeWechatGroupMember { name: string; messageCount: number; lastSendAtMillis?: number; isOwner: boolean; isFriend: boolean; isMe: boolean; isInGroup: boolean; } export interface ArkmeWechatGroupMemberPage { conversationRef: string; members: ArkmeWechatGroupMember[]; total: number; hasMore: boolean; nextCursor?: string; } export interface ArkmeWechatPhoneEvidence { why?: string; content?: string; sentAtMillis?: number; } export interface ArkmeWechatPhone { phone: string; likelyOwner?: string; confidence?: number; reason?: string; occurrenceCount: number; lastSeenAtMillis: number; evidence: ArkmeWechatPhoneEvidence[]; isRegistered: boolean; registeredNickname?: string; location?: string; taskStatus?: string; } export interface ArkmeWechatPhonePage { phones: ArkmeWechatPhone[]; total: number; hasMore: boolean; nextCursor?: string; } export interface ArkmeWechatCommonGroupFriend { name: string; commonGroupCount: number; lastSendAtMillis?: number; sampleConversationRefs: string[]; } export interface ArkmeWechatCommonGroupPage { friends: ArkmeWechatCommonGroupFriend[]; total: number; hasMore: boolean; nextCursor?: string; } export interface ArkmeWechatMoneyFlow { conversationRef?: string; content: string; senderName: string; isMe: boolean; sentAtMillis: number; } export interface ArkmeWechatMoneyFlowPage { moneyFlows: ArkmeWechatMoneyFlow[]; total: number; hasMore: boolean; nextCursor?: string; } export interface ArkmeWechatLocation { conversationRef?: string; conversationName: string; entryType: string; latitude: number; longitude: number; poiName?: string; address?: string; senderName?: string; isMe: boolean; sentAtMillis?: number; } export interface ArkmeWechatLocationPage { locations: ArkmeWechatLocation[]; total: number; hasMore: boolean; nextCursor?: string; } export type ArkmeAiVideoTranscriptSource = 'system' | 'doubao'; export interface ArkmeRecordingMaterialUtterance { startOffsetMillis: number; endOffsetMillis: number; text: string; } export interface ArkmeAiVideoSegmentSelector { childId: string; asrItemIndex: number; transcriptSource: ArkmeAiVideoTranscriptSource; } export interface ArkmeAiVideoPreflightResult { allowed: boolean; message: string; selectedDurationMillis: number; minimumDurationMillis: number; selectedSegmentCount: number; selectedTextCount?: number; retryable: boolean; reasonCode?: string; proof?: string; } export type ArkmeAiVideoJobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled'; export interface ArkmeAiVideoJob { jobId: string; status: ArkmeAiVideoJobStatus; stage: string; progress: number; selectedSegmentCount: number; selectedTextCount?: number; retryable: boolean; videoAssetUid?: string; coverAssetUid?: string; videoDurationMillis?: number; errorCode?: string; errorMessage?: string; failureStage?: string; } export interface ArkmeAiVideoListItem { jobId: string; sessionId: string; status: ArkmeAiVideoJobStatus; stage: string; progress: number; title: string; sourceStartedAtMillis: number; selectedDurationMillis: number; selectedSegmentCount: number; retryable: boolean; createdAtMillis: number; updatedAtMillis: number; coverAssetUid?: string; videoAssetUid?: string; videoDurationMillis?: number; errorCode?: string; errorMessage?: string; } export interface ArkmeAiVideoListResult { items: ArkmeAiVideoListItem[]; hasMore: boolean; nextCursor?: string; } export interface ArkmeFileAssetDisplayItem { fileAssetUid: string; fileKind?: number; size?: number; fileName?: string; mimeType?: string; previewUrl?: string; downloadUrl?: string; status: string; } export interface ArkmeArkoProfile { displayName: string; version: number; } export interface ArkmeArkoSession { sessionId: number; created: boolean; name: string; } export interface ArkmeArkoImageInput { protocolVersion: 1; maxImages: number; maxImageBytes: number; maxTotalBytes: number; mimeTypes: readonly string[]; } export interface ArkmeArkoModelOption { routeKey: string; displayName: string; provider: string; description: string; costDescription?: string; recommended: boolean; selected: boolean; imageInput?: ArkmeArkoImageInput; } export interface ArkmeArkoModelCatalog { defaultRouteKey: string; effectiveRouteKey: string; selectionSource: 'default' | 'personal' | 'unavailable'; options: ArkmeArkoModelOption[]; } export type ArkmeArkoMessageRole = 'user' | 'assistant'; export interface ArkmeArkoHistoryItem { lifecycleVersion?: number; messageRef?: string; orderAtMillis?: number; sourceType?: number; messageType?: number; /** Account-bound authority for private, persisted marks on completed text. */ localMarkRef?: string; messageId: number; sessionId: number; role: ArkmeArkoMessageRole; text: string; contentBlocks?: ArkmeContentBlock[]; reasoning: string; createdAtMillis: number; status: number; runUid?: string; runStatus?: string; retryable?: boolean; errorCode?: string; retryOfRunUid?: string; createdRecordUids: string[]; /** Original user input Record identity. This is distinct from Agent-created side effects. */ entryRecordUid?: string; /** Host-signed message action capability for one stable persisted message. */ messageActionRef?: string; /** Session-bound conversation capability paired with this historical Agent message. */ messageActionConversationRef?: string; messageActionCapabilities?: ArkmeMessageActionCapabilities; } export interface ArkmeArkoHistoryPage { items: ArkmeArkoHistoryItem[]; hasMore: boolean; nextOffset?: number; } export interface ArkmeArkoRunProjection { runUid: string; status: string; retryable: boolean; errorCode?: string; retryOfRunUid?: string; clientAction?: Record; } export interface ArkmeArkoAskResult { sessionId: number; userMsgId: number; assistantMsgId: number; runUid?: string; text: string; reasoning: string; status: string; terminal: boolean; timedOut: boolean; errorMessage?: string; createdRecordUids: string[]; profile?: ArkmeArkoProfile; run?: ArkmeArkoRunProjection; } export interface ArkmeArkoRunStatus { imageInputSupported?: boolean; sessionId: number; runUid: string; status: string; sequence: number; surfaceAssistantMsgId: number; retryable: boolean; errorCode?: string; retryOfRunUid?: string; clientAction?: Record; } export interface ArkmeArkoCancelResult { sessionId: number; assistantMsgId: number; runUid: string; status: string; } export interface ArkmeProviderState { contractVersion: typeof ARKME_PROVIDER_CONTRACT_VERSION; environment: ArkmeEnvironment; authStatus: ArkmeAuthStatus; userId?: number; revision: number; } export type ArkmePluginUpdateAvailability = 'unknown' | 'current' | 'available' | 'ahead'; export type ArkmePluginUpdateLevel = 'normal' | 'important' | 'critical'; export interface ArkmePluginUpdateNotice { schemaVersion: 1; level: ArkmePluginUpdateLevel; title?: string; summary?: string; publishedAt?: string; releaseNotesUrl?: string; } /** Browser-safe projection of the Host-owned plugin update state. */ export interface ArkmePluginUpdateStatus { enabled: boolean; installedVersion: string; latestVersion?: string; availability: ArkmePluginUpdateAvailability; level: ArkmePluginUpdateLevel; title?: string; summary?: string; releaseNotesUrl?: string; checkedAtMillis?: number; lastSuccessfulCheckAtMillis?: number; stale: boolean; checkFailed: boolean; checking: boolean; acknowledged: boolean; snoozedUntilMillis?: number; updateCommand: string; canInstallInApp: boolean; installBlockedReason?: 'update-disabled' | 'local-install' | 'profile-unavailable' | 'runtime-unavailable'; restartRequired: true; } export type ArkmePluginUpdateInstallPhase = 'idle' | 'preparing' | 'downloading' | 'verifying' | 'installing' | 'restarting' | 'succeeded' | 'failed' | 'rolled-back'; export interface ArkmePluginUpdateInstallSnapshot { schemaVersion: 1; jobId: string; phase: ArkmePluginUpdateInstallPhase; previousVersion: string; targetVersion: string; targetArtifactPath?: string; targetArtifactSha512?: string; appVersion?: string; dshVersion?: string; message: string; updatedAtMillis: number; } export interface ArkmeChatRealtimeState { revision: number; connected: boolean; connectionGeneration: number; lastEventAtMillis?: number; } /** Server-owned unread attention summary across every visible conversation. */ export interface ArkmeChatAttentionSummary { /** Last visible directory snapshot is usable while its background refresh recovers. */ stale?: boolean; badgeCount: number; mutedUnreadCount: number; sessionCountWithUnread: number; hasAttention: boolean; summaryVersion: number; updatedAtMillis: number; } export type ArkmeChatClientEvent = { /** Local Host epoch; revisions are comparable only within this instance. */ providerInstanceId?: string; } & ({ type: 'message-sync-progress'; revision: number; progress: import('./chat-message-sync.js').ArkmeMessageSyncProgress; /** Bounded committed-body hints; no read positions or complete window coverage. */ sourceKeys?: string[]; } | { type: 'team-invalidated'; revision: number; receiptOnly?: boolean; } | { type: 'directory-update'; revision: number; page: ArkmeSourceList; } | { type: 'reconcile'; revision: number; connected: boolean; refresh?: 'none' | 'if-stale' | 'force'; connectionGeneration: number; /** Latest server-owned full attention summary for Browser SSE reconnects. */ attentionSummary?: ArkmeChatAttentionSummary; } | { type: 'sessions-delta'; revision: number; updates: Array<{ sourceKey?: string; source: ArkmeSourceItem; timelineItems: ArkmeTimelineItem[]; }>; } | { /** Confirmed bodies only; does not publish directory/unread facts or durable coverage. */ type: 'timeline-items'; revision: number; source: Pick; items: ArkmeTimelineItem[]; } | { type: 'timeline-changed'; revision: number; sourceKey: string; timelineItemKey: string; changeKind: 'deleted' | 'recovered' | 'reedited' | 'extended'; changeVersion: number; relationTerminal: boolean; throughSequence: number; } | { type: 'message-preparing'; revision: number; sourceKey: string; actorKey: string; avatarRef?: string; prepareAtMillis: number; expireAtMillis: number; preparingState: 1 | 2; stateVersion: number; eventAtMillis: number; /** Chat SSE connection identity; distinct from the Browser delivery revision. */ chatConnectionGeneration: number; /** Ordered observation within the Chat SSE runtime; not a preparing state version. */ chatRevision: number; } | { type: 'message-arrived'; revision: number; sourceKey: string; actorKey: string; eventAtMillis: number; chatConnectionGeneration: number; chatRevision: number; } | { type: 'attention-summary'; revision: number; summary: ArkmeChatAttentionSummary; } | { type: 'projection-invalidated'; revision: number; projection: 'message_annotations' | 'dsh_annotations' | 'offline_context' | 'official_notification' | 'record' | 'self_role' | 'topic-directory' | 'chat.direct_message_admission'; /** Confirmed content-only writes may retain visible topic counts while revalidating. */ retainTopicCounts?: boolean; } | { type: 'team-message-notification'; revision: number; notification: { eventUid: string; sourceRef: string; sourceKey: string; sourceKind: 'team_conversation'; title: string; body: string; eventAtMillis: number; expiresAtMillis: number; }; } | { type: 'message-notification'; revision: number; notification: { eventUid: string; sourceRef: string; sourceKey: string; sourceKind: 'private_chat' | 'group_chat'; title: string; body: string; eventAtMillis: number; }; } | { type: 'read-ack'; revision: number; sourceRef: string; sourceKey?: string; effectiveReadSequence: number; unreadCount: number; latestSequence?: number; } | { type: 'read-receipts-invalidated'; revision: number; /** Account-bound conversation identity; raw Chat session and reader identities stay in Host memory. */ sourceKey: string; throughSequence: number; } | { type: 'chat-pins-reconciled'; revision: number; pins: ArkmeChatPinProjection[]; } | { type: 'chat-policy-invalidated'; revision: number; /** Host owns the targeted refresh; consumers wait for directory-update. */ refresh?: 'none'; } | { type: 'conversation-list-preference-invalidated'; revision: number; /** Host owns the targeted refresh; consumers wait for directory-update. */ refresh?: 'none'; } | { type: 'members-invalidated'; revision: number; sourceKey: string; } | { type: 'member-events-invalidated'; revision: number; sourceKey: string; eventId: string; occurredAtMillis: number; }); export type ArkmePluginOperation = 'team.app.outbound.open' | 'team.app.group.context' | 'team.app.public-card' | 'recordings.strategies' | 'recordings.strategies.start' | 'recordings.strategies.preference.set' | 'recordings.transcript.page' | 'source.person-records.page' | 'articles.list' | 'native-chat.annotations' | 'arko.models' | 'arko.ask' | 'arko.history' | 'arko.pending.read' | 'arko.run.status' | 'explore.settings' | 'explore.settings.save' | 'relations.list' | 'relations.records' | 'people.list' | 'people.open-chat' | 'explore.list' | 'explore.detail' | 'explore.enrich' | 'explore.mutate' | 'explore.source' | 'recordings.entities.start' | 'recordings.entities' | 'recordings.entities.occurrences' | 'recordings.person-references' | 'offline-context' | 'recordings.workflow' | 'recordings.playback.open' | 'recordings.speaker.options' | 'recordings.speaker.evidence.query' | 'recordings.speaker.correction.preview' | 'recordings.speaker.correction.items' | 'recordings.speaker.correction.context' | 'recordings.speaker.correction.result' | 'recordings.speaker.correction.apply' | 'recordings.speaker.correction.undo' | 'speaker-directory.summary' | 'speaker-directory.list' | 'speaker-directory.seen' | 'speaker-directory.open' | 'speaker-directory.avatars' | 'speaker-directory.similar' | 'speaker-directory.voice-samples' | 'recordings.speaker.presence' | 'recordings.speaker.members' | 'self-roles.list' | 'self-roles.create' | 'self-roles.update' | 'self-roles.delete' | 'self-roles.bind' | 'self-roles.unbind' | 'self-roles.rebind' | 'topic.dissolve.active' | 'topic.rename' | 'topic.dissolve' | 'provider.capabilities' | 'source.message-extension.capabilities' | 'transcript.local.read' | 'transcript.local.change' | 'source.local-message-mark.capabilities' | 'source.local-message-mark.list' | 'source.local-message-mark.change' | 'source.message-anchor.capture' | 'source.message-underline.capabilities' | 'source.message-underline.list' | 'source.message-underline.change' | 'provider.state' | 'chat.realtime.state' | 'dictation.realtime' | 'dictation.transcribe' | 'auth.status' | 'auth.config' | 'auth.begin' | 'auth.poll' | 'auth.app.begin' | 'auth.app.poll' | 'auth.app.cancel' | 'auth.test.login' | 'auth.password.login' | 'auth.email.send' | 'auth.email.bind' | 'auth.phone.send' | 'auth.phone.verify' | 'auth.phone.unbind.check' | 'auth.phone.unbind.send' | 'auth.phone.unbind' | 'auth.cancellation.preview' | 'auth.cancellation.submit' | 'auth.cancellation.login.resolve' | 'device.lock.status' | 'device.lock.lock' | 'device.lock.unlock' | 'auth.logout' | 'auth.logout.feedback' | 'user-ban.status' | 'chat.direct-message-admission' | 'chat.direct-message-refusal.set' | 'user-ban.ban' | 'user-ban.unban' | 'openapi.mcp.status' | 'openapi.mcp.retry' | 'team.external' | 'team.messages.forward' | 'team.messages.copy-link' | 'team.messages.report' | 'team.messages.preflight' | 'team.messages.marks-read' | 'team.messages.marks-change' | 'team.messages.extensions' | 'team.messages.conversations' | 'team.messages.read' | 'team.messages.send' | 'team.messages.tasks' | 'team.messages.task-update' | 'team.notifications.list' | 'team.notifications.get' | 'team.notifications.set' | 'team.profile.get' | 'team.profile.update' | 'team.profile.avatar.upload' | 'team.profile.avatar.abort' | 'team.list' | 'team.resolve' | 'team.members.list' | 'team.codex.state' | 'team.codex.entry-availability' | 'team.codex.invite' | 'team.codex.events' | 'team.codex.image' | 'team.codex.change' | 'team.create' | 'team.join-by-jotmo-id' | 'remote.sessions.list' | 'remote.session.read' | 'remote.session.native' | 'remote.session.command' | 'remote.session.observe' | 'remote.currentSession' | 'remote.reportCurrentSession' | 'remote.getStatus' | 'remote.renameDesktop' | 'billing.quota' | 'billing.products' | 'membership.current' | 'membership.catalog' | 'account.capabilities.query' | 'account.capabilities.update' | 'account.points.query' | 'account.points.consumption' | 'account.usage.tokens' | 'account.usage.storage' | 'account.usage.voice' | 'account.usage.recording' | 'account.usage.token.summary' | 'account.usage.token.operations' | 'account.usage.token.calls' | 'data.deleted' | 'data.export.preflight' | 'data.export' | 'data.recover' | 'billing.order.create' | 'billing.order.status' | 'contacts.search' | 'directory.list' | 'private-interaction.summary' | 'private-interaction.query' | 'private-interaction.directory' | 'contacts.add' | 'contacts.team-join' | 'chat.private.open-from-contact' | 'group.create' | 'bots.list' | 'bots.create' | 'bots.manage.profile' | 'bots.manage.update' | 'bots.manage.reveal-token' | 'bots.manage.delete' | 'bots.private-chat.notification.status' | 'bots.private-chat.notification.update' | 'bots.private-chat.directory' | 'bots.private-chat.open' | 'bots.private-chat.refresh' | 'bots.private-chat.history.read' | 'bots.private-chat.send' | 'bots.private-chat.mark-read' | 'records.summary' | 'records.cache' | 'records.refresh' | 'records.search' | 'search.records' | 'search.conversations' | 'records.list' | 'records.tags.list' | 'records.tags.query' | 'records.create' | 'records.outbox' | 'records.retry' | 'calendar.buckets' | 'calendar.chat-statistics' | 'calendar.records' | 'calendar.activity' | 'calendar.day-recap' | 'calendar.day-review.reconcile' | 'calendar.day-review.resume' | 'calendar.day-review.evidence' | 'statistics.keywords' | 'statistics.keyword-records' | 'statistics.detail' | 'statistics.active' | 'statistics.long' | 'chat.activity.read' | 'chat.activity.participants' | 'chat.activity.messages' | 'chat.activity.source' | 'chat.word-frequency.state' | 'chat.word-frequency.create' | 'chat.word-frequency.participants' | 'chat.word-frequency.messages' | 'chat.word-frequency.source' | 'recordings.speech-statistics.state' | 'recordings.speech-statistics.create' | 'recordings.speech-statistics.occurrences' | 'recordings.speech-statistics.source' | 'calendar.day-review.state' | 'calendar.day-review.confirmation' | 'calendar.day-review.create' | 'calendar.day-review.result' | 'calendar.day-review.source' | 'calendar.day-review.models' | 'calendar.day-review.prompts' | 'calendar.record-location' | 'user.profile' | 'user.profile.refresh' | 'user.profile.update' | 'account.invitation.get' | 'settings.background-sound.get' | 'settings.background-sound.update' | 'user.arkme-id.check' | 'user.arkme-id.set' | 'image.read' | 'images.list' | 'world.record.read' | 'world.share' | 'world.forward' | 'world.feed' | 'world.mine' | 'world.user' | 'world.author-labels' | 'chat.world.private.open' | 'chat.official-author.profile' | 'chat.official-author.private.open' | 'world.voiceprint.availability' | 'world.reactions.prepare' | 'world.reactions' | 'world.reactions.local' | 'world.voiceprint.playback.generate' | 'world.voiceprint.social-context' | 'world.voiceprint.invite' | 'world.interactions.list' | 'world.notification-sources' | 'world.notification-target' | 'world.interactions.summary' | 'world.interactions.mark-viewed' | 'world.interactions.create-text' | 'ai-letter.list' | 'ai-letter.unread' | 'ai-letter.mark-read' | 'world.image.read' | 'world.publish-text' | 'world.publish-file-assets' | 'arrangements.board-cache' | 'arrangements.list' | 'arrangements.deleted.list' | 'arrangements.deleted.detail' | 'arrangements.recording-day' | 'arrangements.detail' | 'arrangements.source.open' | 'arrangements.source.read' | 'arrangements.mutate' | 'arrangements.create' | 'arrangements.recognition' | 'arrangements.reorder' | 'arrangements.reminder-enabled' | 'arrangements.reminders.summary' | 'arrangements.reminders.list' | 'arrangements.reminders.mark-read' | 'arrangements.reminders.mark-all-read' | 'arrangements.reminders.clear' | 'extensions.reviews.list' | 'extensions.reviews.create' | 'extensions.audit.check' | 'sources.list' | 'sources.self-target' | 'directory.preferences.read' | 'directory.preferences.set' | 'directory.preferences.migrate' | 'conversation.directory.bot-pin' | 'conversation.directory.visibility.query' | 'conversation.directory.visibility.set' | 'source.directory.policy.set' | 'chat.sync.status' | 'chat.sync.retry' | 'source.timeline' | 'source.timeline-around' | 'source.members' | 'source.members.page' | 'source.members.presentation' | 'source.members.cached' | 'source.member-events' | 'source.member-event.profile' | 'source.member-event.private.open' | 'source.member-records' | 'source.person-records.sources' | 'source.person-records.capabilities' | 'source.mark-read' | 'source.message-preparing.report' | 'source.message-preparing.cancel' | 'source.read-receipts.summary-list' | 'source.read-receipts.detail' | 'source.message-report' | 'source.message-withdraw' | 'source.message-copy-link' | 'source.message-copy-link.resolve' | 'source.message-copy-link.extend' | 'source.message-extension.context' | 'source.message-extension.parent' | 'source.message-extension.extend' | 'source.message-snapshot.detail' | 'source.message-location.set' | 'source.link-metadata.resolve' | 'source.forward-messages' | 'source.send-text' | 'self-note.quote.send' | 'selected-text.forward' | 'related-recordings.eligibility' | 'related-recordings.page' | 'related-recordings.share' | 'related-recordings.withdraw' | 'source.ai-polish.settings' | 'source.ai-polish.notices' | 'source.ai-polish.generate-rule' | 'source.ai-polish.prepare-enable' | 'source.ai-polish.confirm-enable' | 'source.ai-polish.prepare-disable' | 'source.ai-polish.confirm-disable' | 'source.ai-polish.retry' | 'group.members' | 'group.common.list' | 'group.common.sync' | 'group.member-candidates' | 'group.invite-preview' | 'group.members.add' | 'group.self-nickname' | 'group.self-nickname.set' | 'group.member-remove' | 'group.join-restrictions' | 'group.join-restriction.set' | 'group.bots' | 'group.bot.add' | 'group.bot.remove' | 'group.settings' | 'chat.notification.get' | 'chat.notification.set' | 'group.notification.set' | 'group.rename' | 'group.leave' | 'group.dissolve' | 'group.report' | 'user.card' | 'chat.private.open' | 'chat.member.private.open' | 'chat.member.world-target' | 'source.send-rich' | 'favorite-stickers.list' | 'reactions' | 'favorite-stickers.add' | 'favorite-stickers.send' | 'favorite-stickers.manage' | 'files.capabilities' | 'desktop.screenshot.capability' | 'desktop.screenshot.capture' | 'files.search' | 'files.stage-bytes' | 'files.send.discard' | 'files.send.reconcile' | 'files.local.list' | 'files.local.open' | 'files.local.open-folder' | 'files.local.remove' | 'files.send' | 'files.send.tasks' | 'files.send.retry' | 'files.receive' | 'source.long-article.publish' | 'source.long-article.own' | 'source.long-article.detail' | 'source.long-article.update' | 'source.long-article.draft.get' | 'source.long-article.draft.put' | 'source.long-article.draft.delete' | 'world.source-draft' | 'world.arko-source-draft' | 'world.message-source-draft' | 'source.record-reedit.detail' | 'source.record-reedit.draft.put' | 'source.record-reedit.draft.delete' | 'source.record-reedit.update' | 'source.record-reedit.submit' | 'source.record-reedit.submissions' | 'source.record-reedit.resume' | 'source.record-reedit.acknowledge' | 'calls.outgoing.intent.claim' | 'calls.outgoing.intent.resolve' | 'calls.outgoing.prepare' | 'calls.invite.create' | 'calls.receiver.prepare' | 'calls.receiver.claim' | 'calls.outgoing.heartbeat' | 'calls.outgoing.release' | 'calls.outgoing.diag' | 'calls.history.list' | 'calls.history.detail' | 'calls.share.ensure' | 'calls.share.viewers' | 'calls.history.summary.retry' | 'extensions.mine.list' | 'extensions.mine.publish' | 'extensions.publish.list' | 'extensions.publish.status' | 'extensions.publish.resume' | 'extensions.catalog.list' | 'extensions.catalog.detail' | 'extensions.install.preview' | 'extensions.delete' | 'extensions.metadata.update' | 'extensions.share.rotate' | 'extensions.share.detail' | 'extensions.share.resolve' | 'extensions.installed-list' | 'extensions.quarantine.status' | 'extensions.quarantine.dismiss' | 'extensions.quarantine.reenable' | 'extensions.quarantine.health' | 'extensions.enabled-state' | 'extensions.persistent.client-state' | 'extensions.enabled.set' | 'extensions.preview.delete' | 'extensions.preview.reorder' | 'extensions.catalog.list' | 'extensions.classification.tree' | 'extensions.classification.items' | 'topic.hierarchy.move' | 'topic.rename' | 'topic.home-visibility' | 'official-notifications.list' | 'official-notifications.summary' | 'official-notifications.detail' | 'official-notifications.read' | 'archives.list' | 'archives.state' | 'archives.set' | 'topic.dissolve' | 'topic.dissolve.status' | 'topic.dissolve.active' | 'recordings.import.file' | 'recordings.import.status' | 'recordings.import.retry' | 'arko.lifecycle.query' | 'arko.lifecycle.change' | 'arko.deleted' | 'arko.messages' | 'arko.search' | 'arko.context' | 'arko.export'; export type ArkmeHostOperation = ArkmePluginOperation | 'emoji.recent.list' | 'conversation.viewport.read' | 'conversation.viewport.write' | 'emoji.recent.record' | 'topic.candidates' | 'source.record-delete' | 'source.record-topic.assign' | 'provider.instance' | 'link.metadata' | 'share.preview' | 'directory.contact.profile' | 'directory.contact.remark.update' | 'directory.contact.world' | 'directory.contact.open-chat' | 'directory.group.open-chat' | 'directory.bot.open-chat' | 'unmarked-speakers.options' | 'unmarked-speakers.retry-inference' | 'unmarked-speakers.segments' | 'unmarked-speakers.mark' | 'voiceprint.status' | 'voiceprint.grants' | 'voiceprint.people' | 'voiceprint.person' | 'voiceprint.person.voiceprints' | 'voiceprint.person.invite' | 'voiceprint.invite' | 'voiceprint.revoke' | 'voiceprint.restore' | 'dsh-beta-community.entry-state' | 'dsh-beta-community.join' | 'recordings.history' | 'recordings.presence' | 'recordings.presence.capture' | 'recordings.calendar' | 'recordings.totals.index' | 'recordings.totals.bucket' | 'recordings.day' | 'recordings.compare' | 'recordings.compare.start' | 'recordings.strategies' | 'recordings.strategies.start' | 'recordings.strategies.preference.set' | 'recordings.forward.capabilities' | 'recordings.copy-link' | 'recordings.forward' | 'recordings.summary-model-config' | 'recordings.summary-model-config.set' | 'recordings.generate' | 'recordings.import.preflight' | 'recordings.import.list' | 'recordings.import.history' | 'recordings.import.cancel' | 'recordings.import.session.update-start' | 'recordings.import.session.update-ownership' | 'recordings.import.session.delete' | 'recordings.import.transcription.retry' | 'recordings.playback.open' | 'recordings.speaker.cached-options' | 'recordings.speaker.recommendation' | 'recordings.speaker.evidence' | 'recordings.speaker.consistency' | 'recordings.speaker.assign-item' | 'recordings.speaker.unassign-item' | 'recordings.entities.feedback' | 'recordings.entities.feedback.undo' | 'recordings.speaker.correction.items' | 'recordings.speaker.correction.context' | 'recordings.speaker.correction.result' | 'recordings.speaker.correction.apply' | 'recordings.speaker.correction.undo' | 'search.locations' | 'search.scene' | 'search.recordings' | 'search.history' | 'search.history.create' | 'ai-video.list' | 'files.assets' | 'topic.create' | 'topic.hierarchy.move' | 'topic.rename' | 'topic.dissolve' | 'topic.dissolve.status' | 'topic.dissolve.active' | 'arko.profile' | 'arko.local-mark.capabilities' | 'arko.local-mark.list' | 'arko.local-mark.change' | 'arko.session' | 'arko.new-session' | 'arko.models' | 'arko.model.activate' | 'arko.history' | 'arko.pending.read' | 'arko.pending.prepare' | 'arko.pending.acknowledge' | 'arko.ask' | 'arko.run.status' | 'arko.cancel' | 'message-actions.copy-link' | 'message-actions.forward' | 'app.migration.status' | 'app.migration.check' | 'app.migration.download' | 'app.migration.cancel' | 'app.migration.install' | 'app.migration.reveal' | 'app.migration.dismiss' | 'codex.forward' | 'codex.local-mark.capabilities' | 'codex.local-mark.list' | 'codex.local-mark.change' | 'native-chat.forward' | 'native-chat.copy-link' | 'native-chat.annotations' | 'native-chat.local-mark.capabilities' | 'native-chat.local-mark.list' | 'native-chat.local-mark.change' | 'plugin.update.status' | 'plugin.update.check' | 'plugin.update.acknowledge' | 'plugin.update.install' | 'plugin.update.install-status' | 'source.interwoven-moments' | 'source.interwoven-detail' | 'source.interwoven-read-receipts' | 'source.shared-recording-detail' | 'source.related-quick-notes.from-message' | 'source.related-quick-notes.from-moment' | 'source.related-quick-note.detail' | 'source.record-edit-history' | 'extensions.catalog.list' | 'extensions.classification.tree' | 'extensions.classification.items' | 'extensions.catalog.detail' | 'extensions.audit.check' | 'extensions.my-list' | 'extensions.delete' | 'extensions.updates' | 'extensions.install.preview' | 'extensions.install.start' | 'extensions.install.status' | 'extensions.install.pause' | 'extensions.install.resume' | 'extensions.uninstall' | 'extensions.restart' | 'extensions.client.failure' | 'extensions.bundle.client-state' | 'extensions.persistent.invoke' | 'extensions.bundle.invoke'; export interface ArkmePluginRequest { operation: ArkmeHostOperation; params?: Record; } export interface ArkmeLongArticleImageFailure { fileRef?: string; fileAssetUid?: string; fileName: string; phase: 'validation' | 'upload'; } export interface ArkmePluginErrorBody { publishReceipt?: import('./extensions/types.js').ArkmeExtensionPublishResult; imageFailures?: ArkmeLongArticleImageFailure[]; code: string; message: string; retryable: boolean; failureKind?: 'rate_limited' | 'concurrency_limited' | 'service_unavailable'; retryAfterMillis?: number; retryScope?: 'request' | 'route'; recovery?: { owner: 'host'; attempts: number; exhausted: true; }; /** Sanitized Chat Handler result, not a global error-code taxonomy. */ directMessageAdmission?: import('./direct-message-admission.js').ArkmeDirectMessageAdmission; } export type ArkmePluginResponse = { ok: true; value: T; } | { ok: false; error: ArkmePluginErrorBody; }; /** Chat-owned directed human mentions. Never add these counts to the global badge. */ export interface ArkmePrivateInteraction { interactionRef: string; privateSourceRef: string; /** Stable opaque chat identity, independent of reference labels/activity. */ privateSourceKey?: string; peerName: string; groupSourceRef: string; groupName: string; sequence: number; occurredAtMillis: number; senderIsMe: boolean; summary: string; unread: boolean; attention: boolean; } export interface ArkmePrivateInteractionCoverage { contractVersion: 1; version: string; sourceScope: 'chat_group_mentions'; scopeComplete: true; uncoveredSources: string[]; } export interface ArkmePrivateInteractionSummary extends ArkmePrivateInteractionCoverage { latest?: ArkmePrivateInteraction; unreadCount: number; attentionCount: number; } export interface ArkmePrivateInteractionPage extends ArkmePrivateInteractionCoverage { items: ArkmePrivateInteraction[]; hasMore: boolean; nextCursor?: string; } export interface ArkmePrivateInteractionDirectoryPage extends ArkmePrivateInteractionCoverage { items: ArkmeSourceItem[]; hasMore: boolean; nextCursor?: string; } export interface ArkmePrivateInteractionQueryOptions { /** Passive directory revalidation shares the bounded background read lane. */ background?: boolean; sourceRef?: string; unreadOnly?: boolean; limit?: number; cursor?: string; expectedVersion?: string; signal?: AbortSignal; } //# sourceMappingURL=types.d.ts.map