/** * ConnectionInvocationResult content type for ConvosConnections (device → * agent write outcomes). * * Mirrors the iOS `ConnectionInvocationResultCodec` (PR #767): * - Content type: convos.org/connection_invocation_result:1.0 * - Payload: JSON-encoded `ConnectionInvocationResult` * - Fallback: `": "` * - shouldPush: false * * Always emitted by the device, even on failure. `invocationId` echoes * the request so the agent can correlate. */ import type { ContentTypeId, EncodedContent } from "@xmtp/node-bindings"; import type { ContentCodec } from "@xmtp/content-type-primitives"; import type { DecodedMessage } from "@xmtp/node-sdk"; import type { ArgumentValue, ConnectionKind, InvocationStatus } from "./connectionTypes.js"; export declare const ContentTypeConnectionInvocationResult: ContentTypeId; export declare const CONNECTION_INVOCATION_RESULT_CURRENT_SCHEMA_VERSION = 1; export interface ConnectionInvocationResult { /** Uppercase UUID (Swift's default UUID encoding). */ id: string; schemaVersion: number; /** Echoes the request's `invocationId` for correlation. */ invocationId: string; kind: ConnectionKind; actionName: string; status: InvocationStatus; /** Populated only on `status == "success"`. Keys match `ActionSchema.outputs`. */ result: Record; /** Human-readable failure description, when surfaced by the framework. */ errorMessage?: string; /** Swift `Date` wire value: seconds since 2001-01-01 reference date. */ completedAt: number; } export declare class ConnectionInvocationResultCodec implements ContentCodec { get contentType(): ContentTypeId; encode(content: ConnectionInvocationResult): EncodedContent; decode(content: EncodedContent): ConnectionInvocationResult; fallback(content: ConnectionInvocationResult): string | undefined; shouldPush(_content: ConnectionInvocationResult): boolean; } export declare function isConnectionInvocationResultMessage(message: DecodedMessage): boolean; export declare function getConnectionInvocationResultContent(message: DecodedMessage): ConnectionInvocationResult | undefined;