MINARA
リファレンスプロトコル

UI Block プロトコル

チャットストリームに markdown テキストと一緒に構造化 UI カードを送るためのプロトコル

このページは EN 版から翻訳パイプラインで自動生成されます。 最新の手動翻訳は pnpm --filter @minara/docs translate:ja で更新できます。 本文は当面 EN 版を参照してください。

The UI Block Protocol (UBP) is the wire-level contract for agent-emitted UI cards (feature recommendations today, sandboxed external connector UIs in the next phase). It piggybacks on the existing chat SSE stream : every ui_block event sits alongside the regular text_delta and tool_call_* events and renders in arrival order.

For the full specification, see the English version.

通信データ形式

type AgentEvent =
  | { type: "start"; data: { ts?: number; session_id?: string; supported_blocks?: UiBlockSupport[] } }
  | { type: "text_delta"; data: { text: string } }
  | { type: "ui_block"; data: UiBlockEvent }

interface UiBlockEvent {
  id: string;
  namespace: string;
  block_type: string;
  version: string;
  data: unknown;
  position?: "after_text" | "inline" | "before_text";
  _meta?: Record<string, unknown>;
}

機能ネゴシエーション

POST /v1/chat/stream?capabilities=minara.feature_recommendation@1

組み込みブロック:minara.feature_recommendation@1

{
  items: Array<{
    id: string;
    label: string;                    // ≤20 chars
    hint?: string;                    // ≤48 chars
    icon?: "wallet" | "deposit" | ...;
    action:
      | { kind: "route"; target: string }
      | { kind: "slash"; command: string }
      | { kind: "modal"; name: "deposit" | "withdraw" }
      | { kind: "external"; url: string };
  }>;                                 // min 1, max 2
}

external アクションは URL を新しいタブで開きます。Agent schema は https:// を検証し、renderer は host allow-list(minara.aiwww.minara.aiagent.minara.ai)を適用します。

レイヤー上限現在の適用
1 ブロックあたりitems ≤ 2はい
1 回の Agent 応答あたりui_block events ≤ 2はい
1 チャットセッションあたりui_block events ≤ 20予約済み(Phase 2)

検証、アクションの意味、Phase 2 の拡張モデルについては、英語版ページを参照してください。

目次