MINARA
참조프로토콜

UI Block 프로토콜

채팅 스트림 안에서 markdown 텍스트와 함께 구조화된 UI 카드를 전달하는 프로토콜

이 페이지는 EN 버전에서 번역 파이프라인으로 자동 생성됩니다. 최신 수동 번역은 pnpm --filter @minara/docs translate:ko 로 갱신할 수 있습니다. 당분간 본문은 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
Agent 응답 1회당ui_block events ≤ 2
채팅 세션 1개당ui_block events ≤ 20예약됨 (Phase 2)

검증, 동작 의미, Phase 2 확장 모델에 관한 자세한 내용은 영어 문서를 참조하세요.

목차