@nanocollective/nanocoder
Version:
A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter
108 lines • 2.95 kB
TypeScript
/**
* Protocol types for communication between VS Code extension and Nanocoder CLI
* This file should be kept in sync with plugins/vscode/src/protocol.ts
*/
export declare const PROTOCOL_VERSION = "1.0.0";
export declare const DEFAULT_PORT = 51820;
export type ServerMessage = FileChangeMessage | ToolCallMessage | AssistantMessage | StatusMessage | ConnectionAckMessage | DiagnosticsRequestMessage | CloseDiffMessage | OpenFileMessage;
export type ClientMessage = SendPromptMessage | ApplyChangeMessage | RejectChangeMessage | GetStatusMessage | ContextMessage | DiagnosticsResponseMessage;
export interface FileChangeMessage {
type: 'file_change';
id: string;
filePath: string;
originalContent: string;
newContent: string;
toolName: string;
toolArgs: Record<string, unknown>;
}
export interface ToolCallMessage {
type: 'tool_call';
id: string;
toolName: string;
toolArgs: Record<string, unknown>;
status: 'pending' | 'executing' | 'completed' | 'rejected';
result?: string;
}
export interface AssistantMessage {
type: 'assistant_message';
content: string;
isGenerating: boolean;
}
export interface StatusMessage {
type: 'status';
connected: boolean;
model?: string;
provider?: string;
workingDirectory?: string;
}
export interface ConnectionAckMessage {
type: 'connection_ack';
protocolVersion: string;
cliVersion: string;
}
export interface DiagnosticsRequestMessage {
type: 'diagnostics_request';
filePath?: string;
}
export interface CloseDiffMessage {
type: 'close_diff';
id: string;
}
export interface OpenFileMessage {
type: 'open_file';
filePath: string;
}
export interface SendPromptMessage {
type: 'send_prompt';
prompt: string;
context?: {
filePath?: string;
selection?: string;
fileName?: string;
startLine?: number;
endLine?: number;
cursorPosition?: {
line: number;
character: number;
};
};
}
export interface ApplyChangeMessage {
type: 'apply_change';
id: string;
}
export interface RejectChangeMessage {
type: 'reject_change';
id: string;
}
export interface GetStatusMessage {
type: 'get_status';
}
export interface ContextMessage {
type: 'context';
workspaceFolder?: string;
openFiles?: string[];
activeFile?: string;
diagnostics?: DiagnosticInfo[];
}
export interface DiagnosticsResponseMessage {
type: 'diagnostics_response';
diagnostics: DiagnosticInfo[];
}
export interface DiagnosticInfo {
filePath: string;
line: number;
character: number;
message: string;
severity: 'error' | 'warning' | 'info' | 'hint';
source?: string;
}
export interface PendingChange {
id: string;
filePath: string;
originalContent: string;
newContent: string;
toolName: string;
timestamp: number;
}
//# sourceMappingURL=protocol.d.ts.map