import type { FileKind } from "../file/types.js"; import type { AgentTurnTraceSummary } from "../agent/types.js"; import type { PluginMcpAppSummary, PluginResourceLinkSummary } from "../plugin/types.js"; export type ChatKind = "dm" | "public_channel" | "private_channel"; export type ChatRole = "owner" | "admin" | "member"; export type DirectMessageType = "direct" | "group"; export type NotificationLevel = "all" | "mentions" | "none"; export type ExpiryMode = "none" | "after_send" | "after_read"; export interface SyncState { protocolVersion: 1; generation: string; sequence: string; } export interface ChatSummary { id: string; kind: ChatKind; projectId?: string; parentChatId?: string; name?: string; slug?: string; topic?: string; dmType?: DirectMessageType; ownerUserId?: string; photoFileId?: string; isListed: boolean; isMain: boolean; autoJoin: boolean; defaultAgentUserId?: string; agentModelId?: string; isDefaultAgentConversation: boolean; archivedAt?: string; retentionMode: "inherit" | "forever" | "duration"; retentionSeconds?: number; defaultExpiryMode: ExpiryMode; defaultSelfDestructSeconds?: number; defaultAfterReadScope: "any_reader" | "all_readers"; lifecycleVersion: string; createdByUserId: string; pts: string; lastMessageSequence: string; membershipEpoch: string; membershipRole?: ChatRole; starred: boolean; /** * Opaque fractional index this user has arranged their sidebar by. Compare * it lexicographically, never parse it; absent until the user first reorders. */ orderKey?: string; lastReadSequence: string; unreadCount: number; mentionCount: number; notificationLevel: NotificationLevel; mutedUntil?: string; createdAt: string; updatedAt: string; } export interface UserSummary { id: string; username: string; firstName: string; lastName?: string; title?: string; photoFileId?: string; role: "member" | "admin"; kind: "human" | "agent"; agentImageId?: string; agentEffort?: string; createdByUserId?: string; agentRole?: "default"; lastSeenAt?: string; } export type AgentImageStatus = "pending" | "building" | "ready" | "failed"; export interface AgentImageSummary { id: string; name: string; definitionHash: string; dockerTag: string; builtinKey?: "daycare-full" | "daycare-minimal"; status: AgentImageStatus; buildAttempt: number; buildProgress: number; lastBuildLogLine?: string; buildLogUpdatedAt?: string; dockerImageId?: string; lastError?: string; buildRequestedAt?: string; buildStartedAt?: string; readyAt?: string; createdByUserId?: string; createdAt: string; updatedAt: string; } export interface AgentImageDetails extends AgentImageSummary { dockerfile: string; buildLog: string; buildLogTruncated: boolean; } export interface AgentSecretSummary { id: string; description: string; environmentVariables: readonly string[]; agentUserIds: string[]; channelIds: string[]; } export interface AdminUserSummary extends UserSummary { lastAccessAt?: string; } export interface FileSummary { id: string; kind: FileKind; originalName?: string; contentType: string; size: number; width?: number; height?: number; durationMs?: number; thumbhash?: string; uploadedByUserId: string; createdAt: string; } export interface ReactionSummary { key: string; emoji?: string; customEmojiId?: string; count: number; reacted: boolean; userIds: string[]; } export interface MessageSummary { id: string; chatId: string; sequence: string; changePts: string; sender?: UserSummary; senderBot?: { id: string; name: string; username: string; photoFileId?: string; }; kind: "user" | "automated"; automated: boolean; audience: "people" | "agents"; agentUserIds: string[]; text: string; service?: { type: "user_added" | "user_joined" | "user_left" | "user_kicked" | "channel_archived"; userId: string; } | { type: "agent_effort_changed"; agentUserId: string; effort: string; } | { /** A message that reached the agent mid-run, named where it landed. */ type: "agent_steered"; messageId: string; userId: string; text: string; }; generationStatus?: "streaming" | "complete" | "failed"; agentTrace?: AgentTurnTraceSummary; mcpApps?: PluginMcpAppSummary[]; resourceLinks?: PluginResourceLinkSummary[]; quotedMessage?: { id: string; senderUserId?: string; text: string; deleted: boolean; }; revision: number; mentions: Array<{ kind: "user" | "channel" | "here" | "everyone"; userId?: string; offset: number; length: number; rawText: string; }>; forwardedFrom?: { messageId: string; chatId: string; }; attachments: FileSummary[]; reactions: ReactionSummary[]; receipts: Array<{ userId: string; deliveredAt?: string; readAt?: string; }>; expiresAt?: string; expiryMode: ExpiryMode; selfDestructSeconds?: number; firstReadAt?: string; editedAt?: string; deletedAt?: string; createdAt: string; } export interface NotificationSummary { id: string; kind: "mention" | "direct_message" | "reaction" | "call" | "system" | "moderation" | "automation"; chatId?: string; messageId?: string; actorUserId?: string; readAt?: string; createdAt: string; } export interface PresenceSettingsSummary { userId: string; availability: "automatic" | "online" | "away" | "dnd"; customStatusText?: string; customStatusEmoji?: string; statusExpiresAt?: string; dndUntil?: string; updatedAt: string; } export interface CallSummary { id: string; chatId: string; createdByUserId?: string; kind: "audio" | "video"; status: "ringing" | "active" | "ended" | "cancelled" | "failed"; participants: Array<{ userId: string; status: "invited" | "ringing" | "joined" | "declined" | "left" | "missed" | "removed"; joinedAt?: string; leftAt?: string; }>; startedAt?: string; endedAt?: string; endReason?: string; createdAt: string; updatedAt: string; } export interface ChatPinSummary { id: string; chatId: string; message: MessageSummary; pinnedByUserId?: string; createdAt: string; } export interface ChatBookmarkSummary { id: string; chatId: string; title: string; kind: "link" | "message" | "file"; url?: string; messageId?: string; fileId?: string; emoji?: string; createdByUserId?: string; sortOrder: number; createdAt: string; } export interface MutationHint { sequence: string; chats: Array<{ chatId: string; pts: string; }>; areas: string[]; } export declare class CollaborationError extends Error { readonly code: "not_found" | "forbidden" | "invalid" | "conflict" | "future_state" | "generation_mismatch"; constructor(code: "not_found" | "forbidden" | "invalid" | "conflict" | "future_state" | "generation_mismatch", message: string); } //# sourceMappingURL=types.d.ts.map