import { z } from "zod"; import { type LiveActivityAction } from "./live-activity.js"; import type { PendingPermissionSummary, SessionSummary, TerminalInfo } from "./model.js"; export declare const watchComputerSchema: z.ZodObject<{ key: z.ZodString; name: z.ZodString; online: z.ZodBoolean; selected: z.ZodBoolean; platform: z.ZodOptional>; }, z.core.$strip>; export type WatchComputer = z.infer; export declare const watchWorkspaceSchema: z.ZodObject<{ path: z.ZodString; name: z.ZodString; }, z.core.$strip>; export type WatchWorkspace = z.infer; export declare const watchConfigOptionValueSchema: z.ZodObject<{ value: z.ZodString; name: z.ZodString; description: z.ZodOptional; }, z.core.$strip>; export type WatchConfigOptionValue = z.infer; export declare const watchConfigOptionSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; category: z.ZodDefault>; current: z.ZodString; currentLabel: z.ZodOptional; values: z.ZodArray; }, z.core.$strip>>; }, z.core.$strip>; export type WatchConfigOption = z.infer; export declare const watchActionSchema: z.ZodObject<{ id: z.ZodString; label: z.ZodString; role: z.ZodEnum<{ choice: "choice"; always: "always"; stop: "stop"; reject: "reject"; allow: "allow"; }>; kind: z.ZodEnum<{ permission: "permission"; answer: "answer"; "async-answer": "async-answer"; }>; computerKey: z.ZodString; sessionId: z.ZodString; requestId: z.ZodString; optionId: z.ZodString; questionId: z.ZodOptional; }, z.core.$strip>; export type WatchAction = LiveActivityAction; export declare const watchPlanProgressSchema: z.ZodObject<{ completed: z.ZodNumber; total: z.ZodNumber; currentStep: z.ZodOptional; }, z.core.$strip>; export type WatchPlanProgress = z.infer; export declare const watchTimelineItemSchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<{ error: "error"; user: "user"; assistant: "assistant"; image: "image"; diff: "diff"; tool: "tool"; permission: "permission"; subagent: "subagent"; question: "question"; thought: "thought"; plan: "plan"; }>; title: z.ZodOptional; text: z.ZodString; detail: z.ZodOptional; status: z.ZodOptional>; filePath: z.ZodOptional; diffAdded: z.ZodOptional; diffRemoved: z.ZodOptional; subagentType: z.ZodOptional; subagentName: z.ZodOptional; subagentModel: z.ZodOptional; imageBase64: z.ZodOptional; imageMimeType: z.ZodOptional; }, z.core.$strip>; export type WatchTimelineItem = z.infer; export declare const watchSessionSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; subtitle: z.ZodString; project: z.ZodString; cwd: z.ZodOptional; branch: z.ZodOptional; agent: z.ZodString; model: z.ZodOptional; mode: z.ZodOptional; subagents: z.ZodOptional>; configOptions: z.ZodOptional>; current: z.ZodString; currentLabel: z.ZodOptional; values: z.ZodArray; }, z.core.$strip>>; }, z.core.$strip>>>; phase: z.ZodEnum<{ running: "running"; completed: "completed"; failed: "failed"; waiting_for_approval: "waiting_for_approval"; waiting_for_input: "waiting_for_input"; starting: "starting"; stale: "stale"; }>; updatedAt: z.ZodNumber; pinned: z.ZodOptional; promptTitle: z.ZodOptional; commandPreview: z.ZodOptional; detailPreview: z.ZodOptional; goal: z.ZodOptional; planProgress: z.ZodOptional; }, z.core.$strip>>; actions: z.ZodOptional; kind: z.ZodEnum<{ permission: "permission"; answer: "answer"; "async-answer": "async-answer"; }>; computerKey: z.ZodString; sessionId: z.ZodString; requestId: z.ZodString; optionId: z.ZodString; questionId: z.ZodOptional; }, z.core.$strip>>>; hasMoreActions: z.ZodOptional; hasEarlier: z.ZodOptional; items: z.ZodOptional; title: z.ZodOptional; text: z.ZodString; detail: z.ZodOptional; status: z.ZodOptional>; filePath: z.ZodOptional; diffAdded: z.ZodOptional; diffRemoved: z.ZodOptional; subagentType: z.ZodOptional; subagentName: z.ZodOptional; subagentModel: z.ZodOptional; imageBase64: z.ZodOptional; imageMimeType: z.ZodOptional; }, z.core.$strip>>>; canCancel: z.ZodBoolean; canSend: z.ZodBoolean; handoff: z.ZodEnum<{ none: "none"; can_takeover: "can_takeover"; can_release: "can_release"; }>; deepLink: z.ZodString; }, z.core.$strip>; export type WatchSession = z.infer; export declare const watchTerminalSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; subtitle: z.ZodString; project: z.ZodString; cwd: z.ZodOptional; command: z.ZodOptional; outputPreview: z.ZodOptional; phase: z.ZodEnum<{ running: "running"; completed: "completed"; failed: "failed"; stale: "stale"; }>; activeAt: z.ZodNumber; exitCode: z.ZodOptional; deepLink: z.ZodString; }, z.core.$strip>; export type WatchTerminal = z.infer; export declare const watchSnapshotSchema: z.ZodObject<{ version: z.ZodLiteral<1>; generatedAt: z.ZodNumber; computerKey: z.ZodString; computerName: z.ZodString; online: z.ZodBoolean; focusedSessionId: z.ZodOptional; statusLabel: z.ZodString; waitingCount: z.ZodNumber; runningCount: z.ZodNumber; failedCount: z.ZodNumber; completedCount: z.ZodNumber; availableAgents: z.ZodOptional>; workspaces: z.ZodOptional>>; computers: z.ZodArray>; }, z.core.$strip>>; sessions: z.ZodArray; branch: z.ZodOptional; agent: z.ZodString; model: z.ZodOptional; mode: z.ZodOptional; subagents: z.ZodOptional>; configOptions: z.ZodOptional>; current: z.ZodString; currentLabel: z.ZodOptional; values: z.ZodArray; }, z.core.$strip>>; }, z.core.$strip>>>; phase: z.ZodEnum<{ running: "running"; completed: "completed"; failed: "failed"; waiting_for_approval: "waiting_for_approval"; waiting_for_input: "waiting_for_input"; starting: "starting"; stale: "stale"; }>; updatedAt: z.ZodNumber; pinned: z.ZodOptional; promptTitle: z.ZodOptional; commandPreview: z.ZodOptional; detailPreview: z.ZodOptional; goal: z.ZodOptional; planProgress: z.ZodOptional; }, z.core.$strip>>; actions: z.ZodOptional; kind: z.ZodEnum<{ permission: "permission"; answer: "answer"; "async-answer": "async-answer"; }>; computerKey: z.ZodString; sessionId: z.ZodString; requestId: z.ZodString; optionId: z.ZodString; questionId: z.ZodOptional; }, z.core.$strip>>>; hasMoreActions: z.ZodOptional; hasEarlier: z.ZodOptional; items: z.ZodOptional; title: z.ZodOptional; text: z.ZodString; detail: z.ZodOptional; status: z.ZodOptional>; filePath: z.ZodOptional; diffAdded: z.ZodOptional; diffRemoved: z.ZodOptional; subagentType: z.ZodOptional; subagentName: z.ZodOptional; subagentModel: z.ZodOptional; imageBase64: z.ZodOptional; imageMimeType: z.ZodOptional; }, z.core.$strip>>>; canCancel: z.ZodBoolean; canSend: z.ZodBoolean; handoff: z.ZodEnum<{ none: "none"; can_takeover: "can_takeover"; can_release: "can_release"; }>; deepLink: z.ZodString; }, z.core.$strip>>; terminals: z.ZodArray; command: z.ZodOptional; outputPreview: z.ZodOptional; phase: z.ZodEnum<{ running: "running"; completed: "completed"; failed: "failed"; stale: "stale"; }>; activeAt: z.ZodNumber; exitCode: z.ZodOptional; deepLink: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; export type WatchSnapshot = z.infer; export declare const WATCH_PROMPT_MAX = 8000; /** * WCSession's applicationContext and sendMessage carry about 65 KB; the rest is * headroom for the envelope and for Swift's re-serialization of the JSON. */ export declare const WATCH_SNAPSHOT_BYTE_LIMIT = 56000; /** Snapshot sessions and terminals; the phone attaches exactly the terminals it sends. */ export declare const WATCH_SESSION_LIMIT = 10; export declare const WATCH_TERMINAL_LIMIT = 6; export declare const WATCH_FOCUSED_ITEMS = 40; export declare const WATCH_MAX_ITEMS = 60; export declare const watchCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"action">; action: z.ZodObject<{ id: z.ZodString; label: z.ZodString; role: z.ZodEnum<{ choice: "choice"; always: "always"; stop: "stop"; reject: "reject"; allow: "allow"; }>; kind: z.ZodEnum<{ permission: "permission"; answer: "answer"; "async-answer": "async-answer"; }>; computerKey: z.ZodString; sessionId: z.ZodString; requestId: z.ZodString; optionId: z.ZodString; questionId: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"prompt">; computerKey: z.ZodString; sessionId: z.ZodString; text: z.ZodString; now: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"cancel">; computerKey: z.ZodString; sessionId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"takeover">; computerKey: z.ZodString; sessionId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"release">; computerKey: z.ZodString; sessionId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"set-config">; computerKey: z.ZodString; sessionId: z.ZodString; optionId: z.ZodString; value: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"open-session">; computerKey: z.ZodString; sessionId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"load-earlier">; computerKey: z.ZodString; sessionId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"create-session">; computerKey: z.ZodString; agent: z.ZodString; cwd: z.ZodString; prompt: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"create-terminal">; computerKey: z.ZodString; cwd: z.ZodOptional; command: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"open-terminal">; computerKey: z.ZodString; terminalId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"terminal-input">; computerKey: z.ZodString; terminalId: z.ZodString; data: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"close-terminal">; computerKey: z.ZodString; terminalId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"select-computer">; computerKey: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; kind: z.ZodLiteral<"refresh">; computerKey: z.ZodOptional; }, z.core.$strip>], "kind">; export type WatchCommand = z.infer; export interface WatchQuickPrompt { id: string; label: string; icon: string; prompt: string; } export declare const DEFAULT_WATCH_QUICK_PROMPTS: readonly WatchQuickPrompt[]; /** * Cuts to a UTF-8 byte budget: the WatchConnectivity limit is in bytes, and CJK text * takes three a character, so a character count would let it overflow threefold. */ export declare function cutWatchBytes(value: string | undefined, maxBytes: number): string; /** * Message text for the watch's conversation view. Unlike plainPreview (one line, for * lists and Live Activities) it keeps line breaks and markdown: the watch renders * answers as markdown, code blocks included. Only whitespace noise is tidied. */ export declare function watchTimelineText(text: string): string; /** * Line-kept text for rows the watch shows as plain Text (thoughts): inline markup * outside code (emphasis, headings, links) is unwrapped; code lines stay as they are. */ export declare function watchPlainText(text: string): string; /** * Like cutWatchBytes, but keeps the end too: a long answer's conclusion is at the bottom. * Three quarters of the budget go to the beginning, the rest to the end. */ export declare function cutWatchBytesMiddle(value: string | undefined, maxBytes: number): string; export declare function sliceTimelinePreservingUsers(items: WatchTimelineItem[], maxItems: number): WatchTimelineItem[]; export declare function buildWatchSession(session: SessionSummary, online: boolean, computerKey?: string, options?: { pinned?: boolean; goal?: string; planProgress?: WatchPlanProgress; tier?: string; items?: WatchTimelineItem[]; hasEarlier?: boolean; maxItems?: number; mode?: string; configOptions?: WatchConfigOption[]; /** The session the watch has open: its whole recent conversation, not a glance. */ focused?: boolean; }): WatchSession; export declare function buildWatchTerminal(terminal: TerminalInfo, online: boolean, computerKey?: string, outputPreview?: string): WatchTerminal; export interface BuildWatchSnapshotOptions { computerKey?: string; computers?: WatchComputer[]; pinnedSessionIds?: string[]; goals?: Record; plans?: Record; timelines?: Record; hasEarlier?: Record; itemLimits?: Record; modes?: Record; configs?: Record; terminalOutputs?: Record; availableAgents?: string[]; workspaces?: WatchWorkspace[]; agentTiers?: Record; /** The session the watch has open; it stays in the snapshot even outside the top ten. */ focusedSessionId?: string; now?: number; } /** Failed, then busy, then most recently active: the order the watch lists terminals in. */ export declare function sortWatchTerminals(terminals: TerminalInfo[]): TerminalInfo[]; /** * Builds the structured Apple Watch companion snapshot for the selected computer. * Prioritizes sessions needing approval/input, then errors, then running, then pinned/recent. */ export declare function buildWatchSnapshot(computerName: string, sessions: SessionSummary[], terminals: TerminalInfo[], online: boolean, options?: BuildWatchSnapshotOptions): WatchSnapshot; /** * Bounds a WatchSnapshot to WATCH_SNAPSHOT_BYTE_LIMIT UTF-8 bytes, never truncating * action IDs. The session the watch has open gets the largest share: pictures and the * other sessions' items go first, and whatever their trimming frees goes back to it. */ export declare function watchSnapshotContent(snapshot: WatchSnapshot, limit?: number): WatchSnapshot; /** * Validates a command originating from Apple Watch against the connected computer * and live session state before executing any RPC on the host. */ export declare function isWatchCommandCurrent(command: WatchCommand, computerKey: string, session: SessionSummary | undefined, permissions?: PendingPermissionSummary[]): boolean;