export interface TokenUsage { input: number; output: number; reasoning?: number; cache?: { read: number; write: number; }; } export interface ModelInfo { provider: string; model: string; contextLimit: number; maxOutput?: number; maxInput?: number; } export interface ContextStats { totalUsed: number; totalInput: number; totalOutput: number; contextLimit: number; remaining: number; usagePercent: number; overflowWarning: boolean; lastChecked?: string; } export type CompactionStrategy = "prune" | "summarize" | "auto"; export interface CompactionResult { strategy: CompactionStrategy; freedTokens: number; preservedTurns: number; compactedMessages: number; remainingTokens: number; summary?: string; timestamp: string; } export interface AgentConfig { roleName: string; agentId?: string; projectId: string; workspacePath: string; prompt: string; describe: string; modelInfo?: ModelInfo; } export interface YmlAgentProfileTemplate { name: string; path: string; project: string; describe: string; prompt: string; mcp?: { "wait-reply-timeout-ms"?: number; "timeout-default-message"?: string; [key: string]: unknown; }; } export interface ServerConfig { serverUrl: string; heartbeatInterval: number; heartbeatTimeout?: number; reconnectInterval: number; reconnectMaxInterval?: number; reconnectJitterMs?: number; maxReconnectAttempts: number; runtimeAccessToken?: string; runtimeAccessTokenExpiresAt?: string; userId?: string; runtimeBridgeBaseUrl?: string; mcpHttpUrl?: string; runtimeTokenRefreshIntervalMs?: number; mcpHttpRequestTimeoutMs?: number; mcpRetryIntervalMs?: number; mcpRetryMaxAccumulatedMs?: number; lastForceRefreshAttemptedForToken?: string; runtimeAccessTokenRefreshPromise?: Promise; runtimeAccessTokenRefreshForce?: boolean; } export interface RuntimeLaunchBinding { ok?: boolean; agentId?: string; workspacePath?: string; runtimeAccessToken?: string; runtimeAccessTokenExpiresAt?: string; userId?: string; schedulerBaseUrl?: string; serverUrl?: string; mcpHttpUrl?: string; bindingId?: string; } export interface RegisterResult { agentId: string; displayName: string; status: string; instanceName?: string; projectId?: string; workspacePath?: string; runtimeStatus?: string; runtimeSessionId?: string | null; isExisting?: boolean; } export interface OnlineUser { id: string; displayName?: string; nickname: string; onlineSince: string; } export interface OnlineAgent { id: string; displayName: string; roleId?: string; roleName: string; projectId?: string; description?: string; bridgeId?: string; bridgeName?: string; onlineSince: string; } export interface OnlineListResponse { humans: OnlineUser[]; agents: OnlineAgent[]; } export interface GroupRoomInfo { id: string; projectId: string; roomType: "project" | "inner_group" | string; scopeRefId: string; name: string; memberUserIds: string[]; } export interface GroupRoomsResponse { groups: GroupRoomInfo[]; } export interface GroupMessage { msgId: number; senderId: string; senderName: string; projectId?: string; roomId?: string; _awsServerMessage?: boolean; content: string; timestamp: string; tokens?: TokenUsage; modelInfo?: ModelInfo; compacted?: boolean; compactionSummary?: string; } export interface GroupMessagesResponse { messages: GroupMessage[]; currentReadPos: number; hasMore: boolean; } export type BoundFileStatus = 'no_change' | 'content_changed' | 'not_found' | 'no_baseline'; export interface BoundFileStatusEntry { path: string; status: BoundFileStatus; } export interface DirectMessage { msgId: string; _msgId?: string; _requireAck?: boolean; channel?: string; _awsServerMessage?: boolean; callId?: string; senderId: string; senderName: string; receiverId?: string; content: string; requireReply: boolean; force?: boolean; prompt?: string; role?: 'system' | 'user' | 'assistant'; timestamp: string; tokens?: TokenUsage; modelInfo?: ModelInfo; compacted?: boolean; compactionSummary?: string; _acodeAutoDelegate?: { type: 'memory_expiration' | 'memory_file_change' | 'memory_cleanup'; uris: string[]; fileChanges?: Array<{ uri: string; boundFiles?: string[]; changedFiles?: string[]; fileStatuses?: BoundFileStatusEntry[]; }>; }; } export interface DirectMessagesResponse { messages: DirectMessage[]; } export interface DmHistoryResponse { messages: DirectMessage[]; count: number; } export interface GroupHistoryResponse { messages: GroupMessage[]; count: number; } export interface UnreadMessagesResult { directMessages: DirectMessage[]; groupMessages: GroupMessage[]; } export interface FetchUnreadMessagesOptions { since?: string; blockIfEmpty?: boolean; blockTimeoutMs?: number; includePipelineTasks?: boolean; pollMessageTimeoutMs?: number; skipGroupMessages?: boolean; preemptiveJoinWaitMs?: number; propagatePollTimeout?: boolean; } export interface BrowserListenerEvent { listenerId: string; prompt: string; triggeredAt: number; url: string; browserId: string; text?: string; selector?: string; changeType?: "added" | "removed" | "changed" | "exists"; } export interface BrowserListenerEventsResponse { ok: boolean; agentId: string; events: BrowserListenerEvent[]; } export interface SendMessageResult { msgId: string | number; timestamp: string; } export interface SendDmResult { msgId?: string; timestamp?: string; reply?: DirectMessage; } export interface WebSocketMessage { type: "GROUP_MSG" | "DM_MSG" | "MEETING_MSG" | "ONLINE_CHANGE" | "DM_REPLY" | "HEARTBEAT" | "PROFILE_INFO" | "AGENT_CONFIG" | "AGENT_STATUS" | "MCP_NODE_LOG" | "MCP_NODE_LOG_BATCH" | "LOG_ACK" | "MESSAGE_ACK" | "TERMINAL_OUTPUT" | "TERMINAL_STATUS" | "GROUP_READ_RECEIPT" | "DM_READ_RECEIPT" | "AGENT_EVENTS_DELTA" | "SYSTEM_NOTIFY"; data: T; timestamp: string; } export declare const TYPE_PROFILE_INFO = "PROFILE_INFO"; export type MessageHandler = (message: DirectMessage | GroupMessage) => Promise; export interface AgentState { agentId: string | null; displayName: string | null; isConnected: boolean; isRegistered: boolean; } export interface ProfileInfo { id: string; displayName: string; roleName: string; instanceName?: string; projectId?: string; workspacePath?: string; prompt: string; bridgeId?: string; bridgeName?: string; globalAgentPrompt?: string; defaultCli?: string; currentCli?: string; runtimeMode?: string; runtimeCliCommand?: string | null; describe?: string; isOnline: boolean; runtimeStatus?: string; runtimeSessionId?: string | null; onlineSince: string | null; createdAt: string; } export interface HireColleagueSingleArgs { projectId?: string; roleName?: string; newRoleName?: string; displayName?: string; prompt?: string; workspacePath?: string; myYmlPath?: string; myYmlContent?: string; runtimeSkillEnabled?: boolean; runtimeMcpEnabled?: boolean; runtimeCcSwitchEnabledTools?: string; } export type HireColleagueBatchItem = HireColleagueSingleArgs; export type HireColleagueArgs = (HireColleagueSingleArgs & { items?: never; }) | (HireColleagueSingleArgs & { items: HireColleagueBatchItem[]; }); export interface StartTaskRollbackArgs { rollbackTaskId: string; } export interface FinishTaskRollbackArgs { rollbackTaskId: string; resultMessage?: string; } export interface HiredColleagueResult { id: string; nickname?: string; displayName: string; roleName: string; projectId?: string; workspacePath?: string; runtimeBridgeBaseUrl?: string; prompt?: string; isOnline?: boolean; runtimeStatus?: string; runtimeSessionId?: string | null; runtimeCliCommand?: string; runtimeIdleInputAutoCommand?: string; runtimeNonInputAutoCommand?: string; myYmlPath?: string; myYmlContent?: string; runtimeSkillEnabled?: boolean; runtimeMcpEnabled?: boolean; runtimeCcSwitchEnabledTools?: string; } export type HireBatchDecisionStatus = "APPROVED" | "REJECTED"; export type HireBatchItemStatus = "CREATED" | "REJECTED" | "CREATE_FAILED"; export interface HireBatchDecision { itemId: string; approved: boolean; reason?: string; } export interface HireBatchSummary { total: number; approved: number; rejected: number; created: number; failed: number; } export interface HireBatchItemResult { itemId: string; decision: HireBatchDecisionStatus; status: HireBatchItemStatus; reason?: string; createdAgent?: HiredColleagueResult; } export interface HireBatchResult { batchId: string; projectId?: string; summary: HireBatchSummary; results: HireBatchItemResult[]; } export type McpToolName = "get_colleague" | "get_group_rooms" | "get_profile" | "hire_colleague" | "send_group" | "send_private" | "poll_message" | "get_message" | "get_dm_history" | "get_group_history" | "start_listening" | "stop_listening"; export type CardType = "pencil" | "draw"; export interface Card { type: CardType; docId: string; title?: string; description?: string; } export interface SendPrivateArgs { targetId: string; content: string; waitReply?: boolean; replyToCallId?: string; timeoutMs?: number; attachments?: string[]; card?: Card; } export interface SendGroupArgs { content: string; projectId?: string; roomId?: string; attachments?: string[]; card?: Card; } export interface GetDmHistoryArgs { targetUserId?: string; limit?: number; since?: string; } export interface GetGroupHistoryArgs { roomId?: string; limit?: number; since?: string; } export interface TaskInstanceCommentArgs { taskInstanceId: string; content: string; } export interface PluginCatalogTool { name: string; description: string; requiredParams?: string[]; } export interface PluginCatalogEntry { plugin: string; version?: string; description?: string; status: "enabled" | "disabled" | "error"; tools: PluginCatalogTool[]; } export interface PluginCatalogSnapshot { revision: number; plugins: PluginCatalogEntry[]; } export interface PollMessageResult { systemMessages?: DirectMessage[]; directMessages: DirectMessage[]; groupMessages: GroupMessage[]; fromBuffer: boolean; pluginCatalog?: PluginCatalogSnapshot; } export type AgentActionType = "skill" | "mcp" | "idle" | "edit_file" | "write_file" | "read_file" | "bash" | "search" | "web" | "thinking" | "tool_using"; export interface AgentStatusUpdate { agentId: string; status: "running" | "starting" | "waiting_input" | "thinking" | "tool_using" | "stopped" | "error"; actionType?: AgentActionType; actionLabel?: string; actionDetail?: string; actionInput?: string; actionResult?: string; actionId?: string; timestamp: string; } export interface BridgeToolManifest { name: string; description?: string; inputSchema?: unknown; }