feat: ClawTap v0.1.0 — initial release
Multi-adapter mobile UI for AI coding assistants. Supports Claude Code, Codex CLI, and Gemini CLI through one interface. Features: - Real-time bidirectional sync via tmux + WebSocket - Cross-AI review (send one AI's output to another for review) - Multi-review tabs with minimize/expand - Push notifications (PWA) with smart session-aware filtering - Three-channel event system (hooks, file watcher, pane monitor) - Voice input, image paste, draft persistence - Terminal-native design (JetBrains Mono, dark theme, pixel art claw) - CLI with --adapter flag on every command - Zero-overhead fire-and-forget hooks
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import type { ToolStatus } from './messages.js';
|
||||
|
||||
export interface AdapterCapabilities {
|
||||
supportsPlanMode: boolean;
|
||||
supportsPermissionModes: boolean;
|
||||
supportsInterrupt: boolean;
|
||||
supportsResume: boolean;
|
||||
supportsAttach: boolean;
|
||||
supportsStatusLine: boolean;
|
||||
supportsImages: boolean;
|
||||
supportsStreaming: boolean;
|
||||
maxContextWindow: number;
|
||||
permissionModeType?: 'cycle' | 'toggle';
|
||||
}
|
||||
|
||||
export interface SessionInfo {
|
||||
sessionId: string;
|
||||
cwd: string | null;
|
||||
lastModified?: number | string;
|
||||
firstPrompt?: string | null;
|
||||
model?: string | null;
|
||||
}
|
||||
|
||||
export interface ModelInfo {
|
||||
value: string;
|
||||
label: string;
|
||||
contextWindow?: number;
|
||||
}
|
||||
|
||||
export interface PermissionModeInfo {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface EffortLevelInfo {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface AdapterInfo {
|
||||
id: string;
|
||||
displayName: string;
|
||||
available: boolean;
|
||||
capabilities?: AdapterCapabilities;
|
||||
}
|
||||
|
||||
export interface ReconnectState {
|
||||
tools: Record<string, ToolStatus>;
|
||||
pendingRequests: Array<{
|
||||
type: 'permission' | 'question';
|
||||
requestId: string;
|
||||
toolName?: string;
|
||||
input?: Record<string, unknown>;
|
||||
}>;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
export type ServerMessageType =
|
||||
| 'session-created' | 'session-state' | 'text-delta' | 'thinking'
|
||||
| 'tool-start' | 'tool-done' | 'tool-updates' | 'message-complete'
|
||||
| 'permission-request' | 'permission-dismissed' | 'history-load'
|
||||
| 'turn-complete' | 'status-update' | 'mode-updated'
|
||||
| 'compacting' | 'compact-done' | 'session-error' | 'session-ended'
|
||||
| 'client-id' | 'pending-notifications' | 'error'
|
||||
| 'review-started' | 'review-ended';
|
||||
|
||||
export interface ServerMessage {
|
||||
type: ServerMessageType;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export type ClientMessageType =
|
||||
| 'query' | 'permission-response' | 'ask-response' | 'abort'
|
||||
| 'reconnect' | 'set-permission-mode' | 'plan-response';
|
||||
|
||||
export interface ClientMessage {
|
||||
type: ClientMessageType;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface QueryOptions {
|
||||
adapter?: string;
|
||||
cwd?: string;
|
||||
model?: string;
|
||||
sessionId?: string;
|
||||
permissionMode?: string;
|
||||
effort?: string;
|
||||
images?: string[];
|
||||
clientId?: string;
|
||||
}
|
||||
|
||||
export type PermissionBehavior = 'allow' | 'allow_session' | 'deny';
|
||||
|
||||
export type PermissionMode = 'default' | 'acceptEdits' | 'plan' | 'bypassPermissions';
|
||||
|
||||
export interface ChatMessage {
|
||||
role: 'user' | 'assistant';
|
||||
content: MessageContent[];
|
||||
interrupted?: boolean;
|
||||
plan?: string;
|
||||
senderClientId?: string;
|
||||
id?: string; // unique message ID
|
||||
adapter?: string; // 'claude' | 'codex'
|
||||
timestamp?: string; // ISO 8601
|
||||
}
|
||||
|
||||
export type MessageContent =
|
||||
| { type: 'text'; text: string }
|
||||
| { type: 'tool_use'; id: string; name: string; input: Record<string, unknown> }
|
||||
| { type: 'tool_result'; tool_use_id: string; content: string };
|
||||
|
||||
export interface ToolStatus {
|
||||
name: string;
|
||||
input?: Record<string, unknown>;
|
||||
status: 'running' | 'success' | 'error' | 'interrupted';
|
||||
result?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface SessionStatus {
|
||||
contextPercent: number;
|
||||
model: string;
|
||||
cost: number;
|
||||
}
|
||||
Reference in New Issue
Block a user