Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mock/
.DS_Store
*.orig

.expo/
# Builds
bin/
bin-unpacked/
Expand Down Expand Up @@ -53,10 +54,6 @@ logs
# Nix / Direnv
.direnv

# Mise
mise.toml
mise.local.toml

# Exclude Conport Directory (MCP server)
context_portal/

Expand All @@ -71,9 +68,11 @@ qdrant_storage/
# to make it easier to work on features in parallel
*.code-workspace

# Act Secret Files
.secrets
# Architect plans
./plans/

roo-cli-*.tar.gz*
# Ignore auto-generated mobile directories
apps/kilo-remote/android/
apps/kilo-remote/ios/
apps/kilo-remote/node_modules/

# Kilo Remote environment file
apps/kilo-remote/.env
13 changes: 13 additions & 0 deletions .kilocodemodes
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,16 @@ customModes:
- Add JSDoc comments for complex test scenarios
- Ensure mocks are properly typed
- Verify both positive and negative test cases
- slug: frontend-specialist
name: Frontend Specialist
roleDefinition: |
You are a frontend developer expert in React, TypeScript, and modern CSS. You focus on creating intuitive user interfaces and excellent user experiences.
groups:
- read
- browser
- - edit
- fileRegex: \.(tsx?|jsx?|css|scss|less)$
description: Frontend files only
customInstructions: |
Prioritize accessibility, responsive design, and performance. Use semantic HTML and follow React best practices.
source: project
285 changes: 285 additions & 0 deletions MOBILE_BRIDGE_API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
# Kilo Code Mobile Bridge API

This document outlines the API for the Kilo Code Mobile Bridge, which allows external clients to interact with the Kilo Code VS Code extension.

## Endpoints

All endpoints are available on `http://127.0.0.1:8080`.

### `POST /new-task`

Creates a new Kilo task and starts an SSE stream for that task.

**Request Body:**

```json
{
"message": "Your initial prompt here"
}
```

**cURL Command:**

```bash
curl -N -X POST -H "Content-Type: application/json" -d '{"message": "Hello, Kilo!"}' http://127.0.0.1:8080/new-task
```

**Response:**

This endpoint returns a `text/event-stream` response.

The first event will be a `taskId` event:

```
id: 1678886400000
event: taskId
data: {"taskId":"YOUR_TASK_ID"}
```

Subsequent events will be `ClineMessage` objects, streamed as they are generated by Kilo.

**`ClineMessage` Object Structure:**

```typescript
interface ClineMessage {
ts: number
type: "ask" | "say"
ask?:
| "followup"
| "command"
| "command_output"
| "completion_result"
| "tool"
| "api_req_failed"
| "resume_task"
| "resume_completed_task"
| "mistake_limit_reached"
| "browser_action_launch"
| "use_mcp_server"
| "auto_approval_max_req_reached"
| "payment_required_prompt"
| "invalid_model"
| "report_bug"
| "condense"
say?:
| "error"
| "api_req_started"
| "api_req_finished"
| "api_req_retried"
| "api_req_retry_delayed"
| "api_req_deleted"
| "text"
| "image"
| "reasoning"
| "completion_result"
| "user_feedback"
| "user_feedback_diff"
| "command_output"
| "shell_integration_warning"
| "browser_action"
| "browser_action_result"
| "mcp_server_request_started"
| "mcp_server_response"
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
| "diff_error"
| "condense_context"
| "condense_context_error"
| "codebase_search_result"
| "user_edit_todos"
text?: string
images?: string[]
partial?: boolean
reasoning?: string
conversationHistoryIndex?: number
checkpoint?: Record<string, unknown>
progressStatus?: {
icon?: string
text?: string
}
contextCondense?: {
cost: number
prevContextTokens: number
newContextTokens: number
summary: string
}
isProtected?: boolean
apiProtocol?: "openai" | "anthropic"
isAnswered?: boolean
metadata?: {
gpt5?: {
previous_response_id?: string
instructions?: string
reasoning_summary?: string
}
kiloCode?: {
// KiloCode specific metadata
}
}
}
```

### `POST /send-followup`

Sends a follow-up message to an existing task.

**Request Body:**

```json
{
"taskId": "YOUR_TASK_ID",
"message": "Your follow-up message"
}
```

**cURL Command:**

```bash
curl -X POST -H "Content-Type: application/json" -d '{"taskId": "YOUR_TASK_ID", "message": "This is a follow-up message."}' http://127.0.0.1:8080/send-followup
```

**Response:**

```json
{
"status": "ok"
}
```

The response to the follow-up message will be sent over the SSE stream for the corresponding task.

### `POST /cancel-task`

Cancels an ongoing task.

**Request Body:**

```json
{
"taskId": "YOUR_TASK_ID"
}
```

**cURL Command:**

```bash
curl -X POST -H "Content-Type: application/json" -d '{"taskId": "YOUR_TASK_ID"}' http://127.0.0.1:8080/cancel-task
```

**Response:**

```json
{
"status": "ok"
}
```

### `GET /tasks`

Returns a list of all tasks in the history.

**cURL Command:**

```bash
curl http://127.0.0.1:8080/tasks
```

**Response:**

An array of `HistoryItem` objects.

**`HistoryItem` Object Structure:**

```typescript
interface HistoryItem {
id: string
rootTaskId?: string
parentTaskId?: string
number: number
ts: number
task: string
tokensIn: number
tokensOut: number
cacheWrites?: number
cacheReads?: number
totalCost: number
size?: number
workspace?: string
isFavorited?: boolean
fileNotfound?: boolean
mode?: string
}
```

### `GET /tasks/{taskId}`

Returns the full message history for a single task.

**cURL Command:**

```bash
curl http://127.0.0.1:8080/tasks/YOUR_TASK_ID
```

**Response:**

A `Task` object, including the `historyItem` and `apiConversationHistory`.

### `GET /modes`

Returns a list of available modes.

**cURL Command:**

```bash
curl http://127.0.0.1:8080/modes
```

**Response:**

An array of mode objects, each with a `slug` and `name`.

### `POST /modes`

Changes the current mode.

**Request Body:**

```json
{
"mode": "MODE_SLUG"
}
```

**cURL Command:**

```bash
curl -X POST -H "Content-Type: application/json" -d '{"mode": "code"}' http://127.0.0.1:8080/modes
```

**Response:**

```json
{
"status": "ok"
}
```

### `GET /health`

Returns the health status of the mobile bridge and basic workspace information.

**cURL Command:**

```bash
curl http://127.0.0.1:8080/health
```

**Response:**

```json
{
"status": "ok",
"workspacePath": "/path/to/your/workspace"
}
34 changes: 34 additions & 0 deletions apps/kilo-remote/.easignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Node & Expo caches
node_modules/
.expo/
.expo-shared/
npm-debug.log
yarn-debug.log
yarn-error.log

# Version control
.git/
.gitignore

# Build outputs
dist/
build/
web-build/

# Tests & coverage
__tests__/
tests/
coverage/

# Miscellaneous
.DS_Store
Thumbs.db
*.log
*.zip
*.tar
*.rar

# Media
*.mp4
*.mov
*.avi
Loading
Loading