import { ConvosBaseCommand } from "../../baseCommand.js"; interface SendCommand { type: "send"; text: string; replyTo?: string; } interface ReactCommand { type: "react"; messageId: string; emoji: string; action?: "add" | "remove"; } interface AttachCommand { type: "attach"; file: string; mimeType?: string; replyTo?: string; } interface RemoteAttachCommand { type: "remote-attach"; url: string; contentDigest: string; secret: string; salt: string; nonce: string; contentLength: number; filename?: string; scheme?: string; } interface RenameCommand { type: "rename"; name: string; } interface LockCommand { type: "lock"; } interface UnlockCommand { type: "unlock"; } interface ExplodeCommand { type: "explode"; scheduled?: string; } interface UpdateProfileCommand { type: "update-profile"; name?: string; image?: string; metadata?: Record; } interface ReadReceiptCommand { type: "read-receipt"; } interface TypingCommand { type: "typing"; isTyping?: boolean; } interface ConnectionInvokeCommand { type: "connection-invoke"; kind: string; action: string; arguments?: Record; invocationId?: string; issuedAt?: string; } interface CapabilityRequestCommand { type: "capability-request"; subject: string; capability: string; rationale: string; requestId?: string; preferredProviders?: string[]; } interface CloudConnectionGrantRequestCommand { type: "cloud-connection-grant-request"; service: string; targetInboxId: string; reason: string; /** Defaults to the agent's own inbox ID when omitted. */ requestedByInboxId?: string; } interface ThinkingCommand { type: "thinking"; state: "start" | "stop"; targetMessageId: string; content: string; /** Optional — only meaningful on `stop`. The agent's reply that closed the thinking. */ resultMessageId?: string; } interface StopCommand { type: "stop"; } export type AgentCommand = SendCommand | ReactCommand | AttachCommand | RemoteAttachCommand | RenameCommand | UpdateProfileCommand | LockCommand | UnlockCommand | ExplodeCommand | ReadReceiptCommand | TypingCommand | ConnectionInvokeCommand | CapabilityRequestCommand | CloudConnectionGrantRequestCommand | ThinkingCommand | StopCommand; export default class AgentServe extends ConvosBaseCommand { static description: string; static examples: { command: string; description: string; }[]; static args: { id: import("@oclif/core/interfaces").Arg>; }; static flags: { name: import("@oclif/core/interfaces").OptionFlag; description: import("@oclif/core/interfaces").OptionFlag; permissions: import("@oclif/core/interfaces").OptionFlag<"all-members" | "admin-only", import("@oclif/core/interfaces").CustomOptions>; "profile-name": import("@oclif/core/interfaces").OptionFlag; "no-invite": import("@oclif/core/interfaces").BooleanFlag; heartbeat: import("@oclif/core/interfaces").OptionFlag; attestation: import("@oclif/core/interfaces").OptionFlag; "attestation-ts": import("@oclif/core/interfaces").OptionFlag; "attestation-kid": import("@oclif/core/interfaces").OptionFlag; "attestation-private-key": import("@oclif/core/interfaces").OptionFlag; "log-level": import("@oclif/core/interfaces").OptionFlag<"off" | "error" | "warn" | "info" | "debug" | "trace" | undefined, import("@oclif/core/interfaces").CustomOptions>; "structured-logging": import("@oclif/core/interfaces").BooleanFlag; "app-version": import("@oclif/core/interfaces").OptionFlag; home: import("@oclif/core/interfaces").OptionFlag; "env-file": import("@oclif/core/interfaces").OptionFlag; env: import("@oclif/core/interfaces").OptionFlag<"local" | "dev" | "production" | undefined, import("@oclif/core/interfaces").CustomOptions>; "gateway-host": import("@oclif/core/interfaces").OptionFlag; json: import("@oclif/core/interfaces").BooleanFlag; fields: import("@oclif/core/interfaces").OptionFlag; verbose: import("@oclif/core/interfaces").BooleanFlag; }; private streams; private shutdownResolve?; private heartbeatInterval?; private lastMessageTimestampNs; private lastDmTimestampNs; private recentMessageIds; private isCatchingUpMessages; private isMessagesCatchupPending; private isCatchingUpDms; private isDmsCatchupPending; private commandQueue; private resolvedProfiles; private lastProfileRefreshMs; private static readonly MAX_RECENT_IDS; private emit; private emitError; /** * Route a message carrying a `convos.org` content type that the chat * stream filters out (`shouldPush=false`) into a structured stdout * event. Returns true if the message was a known Convos content type * (handled or attempted-and-malformed); the caller should not fall * through to the generic `message` path. * * Shared between the live stream and the catchup path so reconnects * don't drop connection/capability traffic on the floor. Dedupes * across the two paths via `trackMessageId` and advances * `lastMessageTimestampNs` so a subsequent catchup query won't * re-fetch the same message. */ private routeConvosContentType; private trackMessageId; /** * Process a single DM message as a potential join request for the * conversation this agent is bound to. */ private processJoinMessage; private processPendingJoinRequests; /** * Schedule a DM catchup run. Coalesces concurrent restarts: a call during * an in-flight catchup sets a pending flag so one more pass runs after the * current one completes, picking up anything that arrived in between. */ private scheduleDmJoinRequestsCatchup; private catchUpDmJoinRequests; private startJoinRequestStream; /** * Schedule a message catchup run. Coalesces concurrent restarts: a call * during an in-flight catchup sets a pending flag so one more pass runs * after the current one completes, picking up anything that arrived in * between. */ private scheduleMessagesCatchup; private catchUpMessages; private startMessageStream; private startStdinReader; private handleCommand; private startHeartbeat; private shutdown; run(): Promise; } export {};