import { PANERELAY_PROTOCOL_VERSION } from './constants.js'; import type { CliAdapterMode } from './cli-adapter.js'; export * from './constants.js'; export * from './browser-fetch.js'; export * from './cli-adapter.js'; export * from './cdp-bootstrap.js'; export * from './conversation-target.js'; export * from './control-activity.js'; export * from './native-transfer.js'; export * from './release-version.js'; export type BrowserFamily = 'chrome' | 'chromium' | 'edge' | 'unknown'; export interface BrowserCapabilities { cdpRelay: boolean; browserFetch?: boolean; } export interface BrowserRegistration { browserId: string; browserName: string; extensionId: string; releaseVersion: string; buildVersion: string; checkHostUpdate: boolean; browserFamily?: BrowserFamily; capabilities?: BrowserCapabilities; } export interface BrowserRegisterMessage extends BrowserRegistration { type: 'browser.register'; protocol: typeof PANERELAY_PROTOCOL_VERSION; } export interface BrowserRegisteredMessage { type: 'browser.registered'; protocol: typeof PANERELAY_PROTOCOL_VERSION; browserId: string; hostVersion: string; } export declare const HOST_UPDATE_DETAIL_MAX_LENGTH = 240; export type HostUpdateError = 'lock-timeout' | 'network' | 'package-unavailable' | 'setup-failed' | 'timeout' | 'verification-failed' | 'unknown'; interface HostUpdateStatusBase { type: 'host.update.status'; protocol: typeof PANERELAY_PROTOCOL_VERSION; hostVersion: string; } export type HostUpdateStatusMessage = (HostUpdateStatusBase & { state: 'required' | 'updating' | 'restart-pending'; targetVersion: string; retryAvailable: false; }) | (HostUpdateStatusBase & { state: 'failed'; targetVersion: string; retryAvailable: true; error: HostUpdateError; detail?: string; manualCommand: string; }) | (HostUpdateStatusBase & { state: 'incompatible'; retryAvailable: false; reason: 'invalid-extension-release' | 'newer-host'; targetVersion?: string; }); export interface HostUpdateRetryMessage { type: 'host.update.retry'; protocol: typeof PANERELAY_PROTOCOL_VERSION; } export declare function nativeHostManualUpdateCommand(targetVersion: string): string; export interface CdpTargetInfo { targetId: string; type: 'page' | 'webview'; title: string; url: string; attached: boolean; active: boolean; } export type CdpTargetOperation = { kind: 'list'; } | { kind: 'create'; url: string; active: boolean; } | { kind: 'close'; targetId: string; } | { kind: 'activate'; targetId: string; }; export interface CdpTargetRequestMessage { type: 'cdp.target.request'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; operation: CdpTargetOperation; } export interface CdpTargetResultMessage { type: 'cdp.target.result'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; success: boolean; targets?: CdpTargetInfo[]; target?: CdpTargetInfo; error?: string; } export type CdpTargetEventMessage = { type: 'cdp.target.event'; protocol: typeof PANERELAY_PROTOCOL_VERSION; event: 'created' | 'changed'; target: CdpTargetInfo; } | { type: 'cdp.target.event'; protocol: typeof PANERELAY_PROTOCOL_VERSION; event: 'destroyed'; targetId: string; }; export interface CdpAttachMessage { type: 'cdp.attach'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; targetId: string; } export interface CdpAttachedMessage { type: 'cdp.attached'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; success: boolean; target?: CdpTargetInfo; error?: string; } export type AutomationEngineId = 'agent-browser' | 'browser-use' | 'playwright'; export declare function isAutomationEngineId(value: unknown): value is AutomationEngineId; export interface CdpCommandMessage { type: 'cdp.command'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; targetId: string; method: string; engine?: AutomationEngineId; params?: Record; sessionId?: string; } export interface CdpControlUpdatedMessage { type: 'cdp.control.updated'; protocol: typeof PANERELAY_PROTOCOL_VERSION; targetId: string; engine: AutomationEngineId | null; } export declare function isCdpControlUpdatedMessage(value: unknown): value is CdpControlUpdatedMessage; export interface CdpError { code: number; message: string; data?: unknown; } export interface CdpResultMessage { type: 'cdp.result'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; result?: unknown; error?: CdpError; } export interface CdpEventMessage { type: 'cdp.event'; protocol: typeof PANERELAY_PROTOCOL_VERSION; targetId: string; method: string; params?: Record; sessionId?: string; } export interface CdpDetachMessage { type: 'cdp.detach'; protocol: typeof PANERELAY_PROTOCOL_VERSION; reason: string; targetId?: string; } export interface CdpDetachedMessage { type: 'cdp.detached'; protocol: typeof PANERELAY_PROTOCOL_VERSION; reason: string; scope: 'target' | 'lease'; targetId?: string; } export type AgentProviderStatus = 'ready' | 'unavailable' | 'error'; export interface AgentProviderSetupGuide { installCommand: string; loginCommand?: string; docsUrl?: string; } export interface AgentProviderSummary { id: string; name: string; status: AgentProviderStatus; description: string; model?: string; setup?: AgentProviderSetupGuide; setupHint?: string; version?: string; capabilities?: { approvals?: boolean; imageInput?: boolean; interrupt?: boolean; listConversations?: boolean; resume?: boolean; streaming?: boolean; }; } export type ConversationStatus = 'idle' | 'running' | 'waiting' | 'error'; export interface ConversationSummary { id: string; providerId: string; model?: string; title: string; preview: string; status: ConversationStatus; createdAt: string; updatedAt: string; } export interface ConversationMessage { id: string; role: 'user' | 'assistant'; text: string; phase?: 'commentary' | 'final'; createdAt: string; } export interface ConversationDetail { conversation: ConversationSummary; messages: ConversationMessage[]; } export interface ConversationPageContext { target?: import('./conversation-target.js').ConversationTargetHint; title?: string; url?: string; } export interface ConversationStartOptions { cwd?: string; initialPage?: ConversationPageContext; } export declare const CONVERSATION_MAX_IMAGES = 4; export declare const CONVERSATION_MAX_IMAGE_BYTES: number; export declare const CONVERSATION_MAX_TOTAL_IMAGE_BYTES: number; export declare const CONVERSATION_IMAGE_MIME_TYPES: readonly ["image/png", "image/jpeg", "image/webp", "image/gif"]; export interface ConversationImageInput { data: string; mimeType: string; name?: string; } export type ConversationApprovalDecision = 'accept' | 'acceptForSession' | 'decline' | 'declineForSession' | 'cancel'; export interface ConversationApproval { id: string; conversationId: string; turnId: string; kind: 'command' | 'file-change' | 'tool'; title: string; description?: string; command?: string; cwd?: string; decisions: ConversationApprovalDecision[]; } export type ConversationActivityKind = 'command' | 'file-change' | 'browser' | 'tool' | 'web-search' | 'other'; export interface ConversationActivity { id: string; kind: ConversationActivityKind; title: string; output?: string; detail?: string; status: 'running' | 'completed' | 'failed' | 'declined'; } export type ConversationEvent = { kind: 'turn.started'; conversationId: string; turnId: string; } | { kind: 'message.delta'; conversationId: string; turnId: string; messageId: string; delta: string; phase?: 'commentary' | 'final'; } | { kind: 'message.completed'; conversationId: string; turnId: string; message: ConversationMessage; } | { kind: 'reasoning.delta'; conversationId: string; turnId: string; itemId: string; delta: string; } | { kind: 'activity.updated'; conversationId: string; turnId: string; activity: ConversationActivity; } | { kind: 'approval.requested'; conversationId: string; turnId: string; approval: ConversationApproval; } | { kind: 'approval.resolved'; conversationId: string; turnId: string; approvalId: string; } | { kind: 'turn.completed'; conversationId: string; turnId: string; status: 'completed' | 'interrupted' | 'failed'; error?: string; } | { kind: 'usage.updated'; conversationId: string; turnId: string; contextUsed?: number; contextSize?: number; inputTokens?: number; outputTokens?: number; totalTokens?: number; } | { kind: 'error'; conversationId?: string; message: string; }; export type AgentRequest = { method: 'agent.providers'; } | { method: 'agent.prepare'; providerId: string; } | { method: 'conversation.list'; providerId: string; cwd?: string; } | { method: 'conversation.start'; providerId: string; options?: ConversationStartOptions; } | { method: 'conversation.resume'; providerId: string; conversationId: string; } | { method: 'conversation.send'; providerId: string; conversationId: string; text: string; images?: ConversationImageInput[]; } | { method: 'conversation.interrupt'; providerId: string; conversationId: string; turnId: string; } | { method: 'conversation.respond'; providerId: string; conversationId: string; approvalId: string; decision: ConversationApprovalDecision; }; export interface AgentRequestMessage { type: 'agent.request'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; request: AgentRequest; } export interface AgentResponseMessage { type: 'agent.response'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; success: boolean; result?: unknown; error?: string; } export type AutomationIntegrationId = 'agent-browser' | 'browser-use'; export type IntegrationRequest = { method: 'integration.install'; integration: AutomationIntegrationId; } | { method: 'default-provider.get'; } | { method: 'default-provider.set'; } | { method: 'default-provider.clear'; } | { method: 'browser-use-default.get'; } | { method: 'browser-use-default.set'; } | { method: 'browser-use-default.clear'; } | { method: 'browser-default.get'; } | { method: 'browser-default.set-current'; } | { method: 'browser-default.clear-current'; } | { method: 'workspace.pick-directory'; }; export interface IntegrationDefaultProviderResult { available: boolean; provider: string | null; isPanerelay: boolean; } export interface IntegrationWorkspaceDirectoryResult { path: string | null; } export interface IntegrationBrowserUseDefaultResult { available: boolean; mode: CliAdapterMode | null; isPanerelay: boolean; } export interface IntegrationInstallResult { integration: AutomationIntegrationId; installed: true; } export interface IntegrationBrowserDefaultResult { currentBrowser: { browserId: string; browserName: string; browserFamily?: BrowserFamily; } | null; defaultBrowserId: string | null; hasMultipleBrowsers: boolean; isCurrentBrowser: boolean; } export type IntegrationResult = IntegrationInstallResult | IntegrationDefaultProviderResult | IntegrationBrowserUseDefaultResult | IntegrationWorkspaceDirectoryResult | IntegrationBrowserDefaultResult; export interface IntegrationRequestMessage { type: 'integration.request'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; request: IntegrationRequest; } export interface IntegrationResponseMessage { type: 'integration.response'; protocol: typeof PANERELAY_PROTOCOL_VERSION; requestId: string; success: boolean; result?: IntegrationResult; error?: string; } export interface ConversationEventMessage { type: 'conversation.event'; protocol: typeof PANERELAY_PROTOCOL_VERSION; event: ConversationEvent; } export type HostToExtensionMessage = BrowserRegisteredMessage | HostUpdateStatusMessage | CdpTargetRequestMessage | CdpAttachMessage | CdpCommandMessage | CdpControlUpdatedMessage | CdpDetachMessage | import('./control-activity.js').ControlSessionChangedMessage | import('./control-activity.js').AutomationActivitySnapshotMessage | import('./control-activity.js').AutomationActivityUpdatedMessage | AgentResponseMessage | IntegrationResponseMessage | ConversationEventMessage | import('./browser-fetch.js').BrowserFetchCancelMessage | import('./browser-fetch.js').BrowserFetchRequestMessage | import('./browser-fetch.js').BrowserFetchPermissionCancelMessage | import('./browser-fetch.js').BrowserFetchPermissionRequestMessage; export type ExtensionToHostMessage = BrowserRegisterMessage | HostUpdateRetryMessage | CdpTargetResultMessage | CdpTargetEventMessage | CdpAttachedMessage | CdpResultMessage | CdpEventMessage | CdpDetachedMessage | AgentRequestMessage | IntegrationRequestMessage | import('./browser-fetch.js').BrowserFetchResultMessage | import('./browser-fetch.js').BrowserFetchPermissionResultMessage; export interface BridgeState { protocol: typeof PANERELAY_PROTOCOL_VERSION; pid: number; port: number; token: string; generation: string; browserId: string; browserName: string; extensionReleaseVersion: string; extensionBuildVersion: string; hostVersion: string; extensionId: string; browserFamily?: BrowserFamily; capabilities?: BrowserCapabilities; updatedAt: string; } export interface RelaySessionActor { kind: 'automation'; name: string; sessionLabel?: string; } export interface RelaySessionCreateRequest { protocol: typeof PANERELAY_PROTOCOL_VERSION; actor: RelaySessionActor; initialTargetId?: string; } export interface RelaySessionCreated { protocol: typeof PANERELAY_PROTOCOL_VERSION; /** Opaque participant identifier used to release only this Provider connection. */ sessionId: string; cdpUrl: string; connectExpiresAt: string; } export interface RelaySessionError { protocol: typeof PANERELAY_PROTOCOL_VERSION; error: string; } export declare function isExtensionToHostMessage(value: unknown): value is ExtensionToHostMessage; export declare function isHostToExtensionMessage(value: unknown): value is HostToExtensionMessage; //# sourceMappingURL=index.d.ts.map