# Skill: drive.io Cloud Bridge
Manage your cloud clipboard and file transfers. 

> [!NOTE]
> This skill is fully compatible with the Model Context Protocol (MCP). You can connect this to platforms like Cursor, Windsurf, or Manus using the SSE endpoint: `https://drive.io/api/mcp`

## Authentication (API Keys)
**Authentication is mandatory for all agent-facing tools.** To use Drive.io, you must provide a valid API Key (`sk_abc123`) generated from the user dashboard. 

- **Requirement:** If unauthenticated, requests will fail with a message: *"Please tell the user to create an account at https://drive.io/dashboard to get an API key."* You should present this message clearly to the user.
- **Generate a Key:** The human user must navigate to `https://drive.io/dashboard` to generate an API Key.
- **Standard Configuration:** Set the environment variable `DRIVEIO_API_KEY` in your runtime environment.
- **Direct Usage:** Send this key in the header of every request: `Authorization: Bearer <your_api_key>`

## Zero-Knowledge Privacy Protocol (Recommended)
**For maximum privacy, agents should encrypt artifacts before they leave the local environment.** Drive.io technically supports "Zero-Knowledge" storage where the server only ever sees ciphertext.

1. **Encrypt**: Use `AES-256-GCM` to encrypt your payload.
2. **Key Transfer**: Append the key/nonce to the URL as a **fragment**: `https://drive.io/id#key=<hex_key>`.
3. **Privacy**: Fragments are never sent to our servers. We stay architecturally blind.

### Example Setup (Python)
```python
import os
# The Drive.io SDK/Client will look for this variable
os.environ["DRIVEIO_API_KEY"] = "sk_abc123"
```

## System Limits
To ensure reliable operation, please respect the following constraints:
- **Rate Limits:** There are currently no hard rate limits defined in the API, but aggressive polling or intentional abuse will result in IP bans.
- **File/Data Size Limits:** Uploads (files and clips) are strictly limited to **100MB** per request.
- **TTL (Time To Live):** By default, all assets (clips and files) are ephemeral and automatically deleted after **24 hours**. If `burnAfterReading` is set to `true`, the asset is deleted immediately after the first successful `GET` request.

## Tools

### create_clip
- **Description:** Sends text, code snippets, or logs to the user's cloud clipboard.
- **Parameters:**
  - `content`: (string) The text to save.
  - `title`: (string) Optional name for the clip.
  - `isPrivate`: (boolean) Whether the clip should be private.
  - `burnAfterReading`: (boolean) If true, the clip is deleted after 1 view. Default: false.
- **Returns:** A drive.io URL and an ID.
- **API Call:**
  - `POST /api/v1/clips`
  - Body: `{ "content": "...", "title": "...", "isPrivate": true, "burnAfterReading": false }`

### retrieve_clip (Programmatic Data Retrieval)
- **Description:** Fetches data back from Drive.io using the `id` returned from `create_clip` or file uploads.
- **Parameters:**
  - `id`: (string) The unique identifier of the clip/file.
  - `download`: (boolean, optional) If `true`, bypasses the JSON wrapper and returns the raw file/text stream directly.
- **Returns:** By default, a JSON object containing a presigned download URL. If `?download=true` is used, returns the raw data payload directly.
- **API Call:**
  - `GET /api/file/<id>` (Returns JSON metadata)
  - `GET /api/file/<id>?download=true` (Returns raw file/text directly)

### upload_file_stream
- **Description:** Uploads a file generated by the agent to the cloud. Max size: 100MB.
- **Parameters:**
  - `filePath`: (string) Local path to the file.
  - `contentType`: (string) MIME type of the file.
- **Returns:** A drive.io URL.
- **API Call:**
  - `POST /api/upload` (to get presigned URL)
  - `PUT <presigned_url>` (with file content)

### park_handoff
- **Description:** Parks context or data for another agent to pick up asynchronously.
- **Parameters:**
  - `payload`: (string | object) The data to pass.
  - `targetAgentId`: (string) The ID of the agent receiving this handoff.
  - `ttlSeconds`: (number) Optional. How long the payload lives before expiring. Default 3600.
- **Returns:** A `handoff_id` and `PENDING` status.
- **API Call:**
  - `POST /api/v1/handoff`
  - Body: `{ "payload": "...", "targetAgentId": "...", "ttlSeconds": 3600 }`

### poll_handoff
- **Description:** Checks if a handoff parked by another agent is ready to be consumed. Reading it automatically initiates the auto-burn sequence.
- **Parameters:**
  - `id`: (string) The `handoff_id` returned from `park_handoff`.
- **Returns:** The payload data and marks it as `CONSUMED`.
- **API Call:**
  - `GET /api/v1/handoff?id=<handoff_id>`
