@pouchy_ai/companion-sdk - v0.63.0
    Preparing search index...

    Interface CompanionView

    interface CompanionView {
        client: CompanionClient;
        confirmAction(
            confirmId: string,
            approve: boolean,
            opts?: { signal?: AbortSignal },
        ): Promise<ConfirmActionResult>;
        dispose(): void;
        getSnapshot(): CompanionViewSnapshot;
        sendText(
            text: string,
            opts?: {
                awaitReply?: boolean;
                images?: string[];
                instructions?: string;
                replyTimeoutMs?: number;
                signal?: AbortSignal;
                stream?: boolean;
            },
        ): Promise<{ queued?: boolean; seq: number | null; turnId?: string }>;
        subscribe(listener: () => void): () => void;
    }
    Index

    The underlying client, for everything the view doesn't wrap.

    • confirmAction that also removes the confirm from pendingConfirms (on approve AND deny — both resolve the card server-side).

      Parameters

      • confirmId: string
      • approve: boolean
      • Optionalopts: { signal?: AbortSignal }

      Returns Promise<ConfirmActionResult>

    • Detach every client subscription. The view goes inert (snapshot frozen, listeners dropped); the client itself is NOT closed — it belongs to the host. Idempotent.

      Returns void

    • sendText that also appends the user turn to the transcript.

      Parameters

      • text: string
      • Optionalopts: {
            awaitReply?: boolean;
            images?: string[];
            instructions?: string;
            replyTimeoutMs?: number;
            signal?: AbortSignal;
            stream?: boolean;
        }

      Returns Promise<{ queued?: boolean; seq: number | null; turnId?: string }>

    • Subscribe to snapshot changes. Returns unsubscribe.

      Parameters

      • listener: () => void

      Returns () => void