Agent Maturity Compass API - v1.2.0
    Preparing search index...

    Type Alias StreamChunk

    StreamChunk:
        | { blockKind: SurfaceKind; index: number; type: "block-start" }
        | {
            gemini?: GeminiPartMeta;
            index: number;
            text: string;
            type: "text-delta";
        }
        | {
            gemini?: GeminiPartMeta;
            index: number;
            text: string;
            type: "thinking-delta";
        }
        | {
            argumentsDelta: string;
            gemini?: GeminiPartMeta;
            id: ToolCallId;
            index: number;
            name?: string;
            providerWireName?: string;
            type: "tool-call-delta";
        }
        | { block: ContentBlock; index: number; type: "block-end" }
        | { type: "usage"; usage: StreamTokenUsage }
        | { reason: FinishReason; type: "finish" }

    The raw streaming protocol emitted by adapters.

    A CLOSED discriminated union: every switch over type ends with assertNever, so adding a variant breaks compilation at every consumer that must handle it — including the one that signs blocks.

    The grammar these chunks must obey (usage before a successful finish, nothing after finish, deltas only into an open block of their own kind) is enforced unconditionally in streamProtocol.ts; it is not a convention adapters are asked to respect.

    Type Declaration

    • { blockKind: SurfaceKind; index: number; type: "block-start" }
    • { gemini?: GeminiPartMeta; index: number; text: string; type: "text-delta" }
    • { gemini?: GeminiPartMeta; index: number; text: string; type: "thinking-delta" }
    • {
          argumentsDelta: string;
          gemini?: GeminiPartMeta;
          id: ToolCallId;
          index: number;
          name?: string;
          providerWireName?: string;
          type: "tool-call-delta";
      }
      • ReadonlyargumentsDelta: string
      • Optional Readonlygemini?: GeminiPartMeta
      • Readonlyid: ToolCallId
      • Readonlyindex: number
      • Optional Readonlyname?: string

        Arrives once, usually on the first frame of the call.

      • Optional ReadonlyproviderWireName?: string
      • Readonlytype: "tool-call-delta"
    • { block: ContentBlock; index: number; type: "block-end" }
    • { type: "usage"; usage: StreamTokenUsage }
    • { reason: FinishReason; type: "finish" }