リファレンスプロトコル
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.ai、www.minara.ai、agent.minara.ai)を適用します。
| レイヤー | 上限 | 現在の適用 |
|---|---|---|
| 1 ブロックあたり | items ≤ 2 | はい |
| 1 回の Agent 応答あたり | ui_block events ≤ 2 | はい |
| 1 チャットセッションあたり | ui_block events ≤ 20 | 予約済み(Phase 2) |
検証、アクションの意味、Phase 2 の拡張モデルについては、英語版ページを参照してください。