import * as React from 'react'; import { ContentTransferCapabilities } from '@ai-matrx/alchemy/react/workspace'; import { MatrxTransport, MatrxRuntimeOperationEvent, MatrxRuntimeExecutionStatus } from '@ai-matrx/api'; import { MatrxStreamEnvelope } from '@ai-matrx/api/stream'; interface MatrxContentTransferProgress { requestId: string | null; conversationId: string; executionId: string | null; status: "starting" | "streaming" | MatrxRuntimeExecutionStatus | "detached"; } interface MatrxContentTransferDbRow { id: string; content?: unknown; metadata?: unknown; iteration?: number | null; } interface MatrxContentTransferDbResponse { data: MatrxContentTransferDbRow[] | null; error: { message?: string | null; } | null; } interface MatrxContentTransferQuery extends PromiseLike { eq(column: string, value: unknown): this; is(column: string, value: null): this; not(column: string, operator: "is", value: null): this; order(column: string, options: { ascending: boolean; }): this; limit(count: number): this; } interface MatrxContentTransferSupabase { schema(schema: "chat"): { from(table: "request" | "message"): { select(columns: string): MatrxContentTransferQuery; }; }; } interface MatrxContentTransferAdapterOptions { transport: MatrxTransport | (() => MatrxTransport); supabase: MatrxContentTransferSupabase; organizationId: string | (() => string); sourceApp: "matrx-frontend" | "dashboard"; /** * Interactivity attestation for the preparation run. `launch()` is the * Alchemy door a person opens by hand, so "user" is the default and the * server classes the conversation `origin_class = 'human'`; an embedder that * fires a transfer from client code with no gesture behind it passes "auto". * Omitting the field entirely is what left these runs reading as unattested * API traffic (census 2026-09-20). */ initiation?: "user" | "auto"; /** The original NDJSON stream, exposed without consuming it twice. */ onStreamEvent?: (event: MatrxStreamEnvelope) => void; /** Durable runtime lifecycle events emitted during recovery. */ onRuntimeEvent?: (event: MatrxRuntimeOperationEvent, seq: number | null) => void; } interface MatrxContentTransferProviderProps extends MatrxContentTransferAdapterOptions { children: React.ReactNode; capabilities?: Omit; /** Persist identifiers in the host's canonical live-run window. Never persist draft content here. */ onProgress?: (progress: MatrxContentTransferProgress) => void; } /** * Composes the package-owned durable Matrx adapter into the design-system's * nearest capability context. Surface identity remains the design-system's * explicit local handle; this provider never performs global surface lookup. */ declare function MatrxContentTransferProvider({ children, capabilities, onProgress, ...options }: MatrxContentTransferProviderProps): React.JSX.Element; export { MatrxContentTransferProvider }; export type { MatrxContentTransferProviderProps };