feat: switched to opencode

This commit is contained in:
2026-02-11 19:07:06 +01:00
parent 870bec4dcd
commit 49f2b620db
15 changed files with 1343 additions and 1351 deletions

View File

@@ -173,10 +173,8 @@ export interface SyncTagsResult {
// Chat/AI types
export interface ChatConversation {
id: string;
projectId: string;
title: string;
model?: string;
copilotSessionId?: string;
createdAt: string;
updatedAt: string;
}
@@ -194,16 +192,18 @@ export interface ChatMessage {
export interface ChatModel {
id: string;
name: string;
}
export interface ChatAuthStatus {
authenticated: boolean;
username?: string;
provider?: string;
}
export interface ChatReadyStatus {
ready: boolean;
authenticated: boolean;
error?: string;
backend?: string;
}
export interface ChatApiKeyStatus {
hasKey: boolean;
maskedKey: string;
}
export interface ChatStreamDelta {
@@ -229,11 +229,6 @@ export interface ChatTitleUpdate {
title: string;
}
export interface ChatDeviceCode {
verificationUri: string;
userCode: string;
}
export interface ElectronAPI {
projects: {
create: (data: { name: string; description?: string; slug?: string }) => Promise<ProjectData>;
@@ -339,38 +334,37 @@ export interface ElectronAPI {
syncFromPosts: () => Promise<SyncTagsResult>;
};
chat: {
// Authentication
// API Key Management
checkReady: () => Promise<ChatReadyStatus>;
copilotAuthStatus: () => Promise<ChatAuthStatus>;
copilotLogin: () => Promise<{ success: boolean; error?: string; login?: string }>;
copilotLogout: () => Promise<void>;
validateApiKey: (apiKey: string) => Promise<{ isValid: boolean; models: ChatModel[] }>;
setApiKey: (apiKey: string) => Promise<{ success: boolean; error?: string }>;
getApiKey: () => Promise<ChatApiKeyStatus>;
// Settings
getAvailableModels: () => Promise<ChatModel[]>;
setDefaultModel: (modelId: string) => Promise<void>;
getSystemPrompt: () => Promise<string | null>;
setSystemPrompt: (prompt: string) => Promise<void>;
// Conversations
getConversations: () => Promise<ChatConversation[]>;
createConversation: (title?: string, model?: string) => Promise<ChatConversation>;
getConversation: (id: string) => Promise<ChatConversation | null>;
updateConversation: (id: string, updates: { title?: string; model?: string }) => Promise<ChatConversation | null>;
deleteConversation: (id: string) => Promise<boolean>;
// Messaging
sendMessage: (conversationId: string, message: string) => Promise<string>;
abortMessage: (conversationId: string) => Promise<void>;
getHistory: (conversationId: string) => Promise<ChatMessage[]>;
clearMessages: (conversationId: string) => Promise<void>;
setConversationModel: (conversationId: string, modelId: string) => Promise<void>;
// Event listeners for streaming/progress
onStreamDelta: (callback: (data: ChatStreamDelta) => void) => () => void;
onToolCall: (callback: (data: ChatToolCall) => void) => () => void;
onToolResult: (callback: (data: ChatToolResult) => void) => () => void;
onTitleUpdated: (callback: (data: ChatTitleUpdate) => void) => () => void;
onDeviceCode: (callback: (data: ChatDeviceCode) => void) => () => void;
};
on: (channel: string, callback: (...args: unknown[]) => void) => () => void;
once: (channel: string, callback: (...args: unknown[]) => void) => void;