> ## Documentation Index
> Fetch the complete documentation index at: https://adcp-docs-ja.pier1.co.jp/llms.txt
> Use this file to discover all available pages before exploring further.

# タスクリファレンス

Sponsored Intelligence プロトコルは、会話型ブランド体験を管理するために 4 つのタスクを定義しています:

## セッションライフサイクル

```mermaid theme={null}
flowchart LR
    P[si_get_offering] -.-> A[si_initiate_session]
    A --> B[si_send_message]
    B --> B
    B --> C[si_terminate_session]
    A --> C
```

### 2 つのエントリポイント

**事前参照あり**（点線）: ホストが先に `si_get_offering` を呼び、同意前に商品を提示します。`offering_token` が提示した内容をセッションに引き継ぎます。

**直接セッション**（実線）: ホストが直接 `si_initiate_session` を呼びます。ブランドエージェントは会話の一部として商品を提示し、内部で追跡します。

どちらも有効です。ユーザーに参加を求める前に商品をプレビューしたいスポンサード検索結果では、事前参照を使用してください。

## タスク

| Task                                             | Description                | Initiator |
| ------------------------------------------------ | -------------------------- | --------- |
| [`si_get_offering`](./si_get_offering)           | オファー詳細、在庫状況、マッチする商品を取得（匿名） | Host      |
| [`si_initiate_session`](./si_initiate_session)   | ブランドエージェントとの会話を開始          | Host      |
| [`si_send_message`](./si_send_message)           | アクティブセッション内でメッセージを交換       | Host      |
| [`si_terminate_session`](./si_terminate_session) | 適切なハンドオフでセッションを終了          | Either    |

## トランスポートオプション

SI タスクは MCP と A2A の両プロトコルで動作します:

### MCP トランスポート

```json theme={null}
{
  "method": "tools/call",
  "params": {
    "name": "si_initiate_session",
    "arguments": {
      "context": "User wants to fly to Boston next Tuesday morning",
      "identity": { /* ... */ }
    }
  }
}
```

### A2A トランスポート

```json theme={null}
{
  "task": "si_initiate_session",
  "payload": {
    "context": "User wants to fly to Boston next Tuesday morning",
    "identity": { /* ... */ }
  }
}
```

## よくあるパターン

### 最小限のセッション（アイデンティティなし）

パーソナライズなしの匿名ブラウジング用:

```json theme={null}
{
  "context": "User interested in product information",
  "identity": {
    "consent_granted": false,
    "anonymous_session_id": "anon_xyz789"
  }
}
```

### フルアイデンティティのセッション

同意済み PII を使ったパーソナライズ体験用:

```json theme={null}
{
  "context": "User wants to book a flight",
  "identity": {
    "consent_granted": true,
    "consent_timestamp": "2026-01-18T10:30:00Z",
    "consent_scope": ["name", "email", "shipping_address"],
    "user": {
      "email": "jane@example.com",
      "name": "Jane Smith"
    }
  }
}
```

### キャンペーンから起動するセッション

メディアバイの一部として SI が呼び出される場合:

```json theme={null}
{
  "context": "User searching for flights to Boston",
  "media_buy_id": "media_buy_q1_promo",
  "placement": "chatgpt_search",
  "offering_id": "premium_upgrade_offer",
  "identity": {
    "consent_granted": true,
    "user": { "email": "jane@example.com" }
  }
}
```
