export declare const BRIDGE_PROTOCOL_VERSION = 1; export declare const DEFAULT_BRIDGE_HOST = "localhost"; export declare const DEFAULT_BRIDGE_PORT = 4017; export declare const DEFAULT_BRIDGE_WS_PATH = "/ws"; export declare const DEFAULT_BRIDGE_HTTP_URL = "https://localhost:4017"; export declare const DEFAULT_BRIDGE_WS_URL = "wss://localhost:4017/ws"; export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000; export declare const DEFAULT_EVENT_LIMIT = 200; export type BridgeApp = "excel" | "powerpoint" | "word" | (string & {}); export interface BridgeToolDefinition { name: string; label?: string; description?: string; parameters?: unknown; } export interface BridgeHostInfo { host?: string; platform?: string; officeVersion?: string; userAgent?: string; href: string; title?: string; } export interface BridgeSessionSnapshot { sessionId: string; instanceId: string; app: BridgeApp; appName?: string; appVersion?: string; metadataTag?: string; documentId: string; documentMetadata?: unknown; tools: BridgeToolDefinition[]; host: BridgeHostInfo; connectedAt: number; updatedAt: number; } export interface BridgeError { message: string; code?: string; stack?: string; } export interface BridgeHelloMessage { type: "hello"; role: "office-addin"; protocolVersion: number; snapshot: BridgeSessionSnapshot; } export interface BridgeWelcomeMessage { type: "welcome"; protocolVersion: number; serverTime: number; } export type BridgeInvokeMethod = "ping" | "get_session_snapshot" | "refresh_session" | "execute_tool" | "execute_unsafe_office_js" | "vfs_list" | "vfs_read" | "vfs_write" | "vfs_delete"; export interface BridgeInvokeMessage { type: "invoke"; requestId: string; method: BridgeInvokeMethod; params?: unknown; } export interface BridgeResponseMessage { type: "response"; requestId: string; ok: boolean; result?: unknown; error?: BridgeError; } export interface BridgeEventMessage { type: "event"; event: string; ts: number; payload?: unknown; } export type BridgeWireMessage = BridgeHelloMessage | BridgeWelcomeMessage | BridgeInvokeMessage | BridgeResponseMessage | BridgeEventMessage; export interface BridgeStoredEvent { id: string; event: string; ts: number; payload?: unknown; } export interface BridgeInvokeRequest { sessionId: string; method: BridgeInvokeMethod; params?: unknown; timeoutMs?: number; } export interface BridgeToolExecutionResult { toolCallId: string; toolName: string; isError: boolean; result: unknown; resultText: string; images: Array<{ data: string; mimeType: string; }>; error?: string; } export interface BridgeUnsafeOfficeJsParams { code: string; explanation?: string; } export interface BridgeUnsafeOfficeJsResult { mode: "unsafe"; app: string; result: unknown; } export interface BridgeVfsEntry { path: string; byteLength: number; } export interface BridgeVfsListParams { prefix?: string; } export interface BridgeVfsReadParams { path: string; encoding?: "text" | "base64"; } export interface BridgeVfsReadResult { path: string; encoding: "text" | "base64"; byteLength: number; text?: string; dataBase64?: string; } export interface BridgeVfsWriteParams { path: string; text?: string; dataBase64?: string; } export interface BridgeVfsDeleteParams { path: string; } export declare function uint8ArrayToBase64(data: Uint8Array): string; export declare function createBridgeId(prefix?: string): string; export declare function normalizeBridgeUrl(value: string | undefined, kind: "ws" | "http"): string; export declare function serializeForJson(value: unknown): unknown; export declare function toBridgeError(error: unknown): BridgeError; export declare function isBridgeHelloMessage(value: unknown): value is BridgeHelloMessage; export declare function isBridgeResponseMessage(value: unknown): value is BridgeResponseMessage; export declare function isBridgeEventMessage(value: unknown): value is BridgeEventMessage; export declare function isBridgeInvokeMessage(value: unknown): value is BridgeInvokeMessage; export declare function extractToolText(result: unknown): string; export declare function extractToolImages(result: unknown): Array<{ data: string; mimeType: string; }>; export declare function extractToolError(result: unknown): string | undefined; export declare function getDefaultRawExecutionTool(app: string): "eval_officejs" | "execute_office_js" | undefined; //# sourceMappingURL=protocol.d.ts.map