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: null | string; conversationId: string; executionId: null | string; status: "detached" | "starting" | "streaming" | MatrxRuntimeExecutionStatus; } interface MatrxContentTransferDbRow { id: string; content?: unknown; metadata?: unknown; iteration?: null | number; } interface MatrxContentTransferDbResponse { data: MatrxContentTransferDbRow[] | null; error: null | { message?: null | string; }; } 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: "message" | "request"): { select(columns: string): MatrxContentTransferQuery; }; }; } interface MatrxContentTransferAdapterOptions { transport: (() => MatrxTransport) | MatrxTransport; supabase: MatrxContentTransferSupabase; organizationId: (() => string) | string; sourceApp: "dashboard" | "matrx-frontend"; /** * 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?: "auto" | "user"; /** The original NDJSON stream, exposed without consuming it twice. */ onStreamEvent?: (event: MatrxStreamEnvelope) => void; /** Durable runtime lifecycle events emitted during recovery. */ onRuntimeEvent?: (event: MatrxRuntimeOperationEvent, seq: null | number) => 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 };