Makelore 2.0 initial clean snapshot
This commit is contained in:
87
src/types/chat.ts
Normal file
87
src/types/chat.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
export interface AttachedFileMeta {
|
||||
fileName: string;
|
||||
mimeType: string;
|
||||
fileSize: number;
|
||||
preview: string | null;
|
||||
filePath?: string;
|
||||
source?: 'user-upload' | 'tool-result' | 'message-ref' | 'runtime-media';
|
||||
runtimeUrl?: string;
|
||||
}
|
||||
|
||||
export type MessageDeliveryStatus = 'queued' | 'sending';
|
||||
|
||||
export interface RuntimeMessageContext {
|
||||
agent?: string;
|
||||
model?: string;
|
||||
variant?: string;
|
||||
}
|
||||
|
||||
export interface RawMessage {
|
||||
role: 'user' | 'assistant' | 'system' | 'toolresult';
|
||||
content: unknown;
|
||||
timestamp?: number;
|
||||
id?: string;
|
||||
toolCallId?: string;
|
||||
toolName?: string;
|
||||
details?: unknown;
|
||||
isError?: boolean;
|
||||
stopReason?: string;
|
||||
stop_reason?: string;
|
||||
errorMessage?: string;
|
||||
error_message?: string;
|
||||
_attachedFiles?: AttachedFileMeta[];
|
||||
_toolEvidence?: RuntimeToolEvidence[];
|
||||
_deliveryStatus?: MessageDeliveryStatus;
|
||||
_runtimeContext?: RuntimeMessageContext;
|
||||
}
|
||||
|
||||
export interface RuntimeToolEvidence {
|
||||
id?: string;
|
||||
toolCallId?: string;
|
||||
name: string;
|
||||
status: 'running' | 'completed' | 'error';
|
||||
inputSummary?: string;
|
||||
outputExcerpt?: string;
|
||||
exitCode?: number;
|
||||
startedAt?: number;
|
||||
endedAt?: number;
|
||||
}
|
||||
|
||||
export interface ContentBlock {
|
||||
type: 'text' | 'image' | 'thinking' | 'tool_use' | 'tool_result' | 'toolCall' | 'toolResult';
|
||||
text?: string;
|
||||
thinking?: string;
|
||||
source?: { type: string; media_type?: string; data?: string; url?: string };
|
||||
data?: string;
|
||||
mimeType?: string;
|
||||
url?: string;
|
||||
openUrl?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
alt?: string;
|
||||
id?: string;
|
||||
name?: string;
|
||||
input?: unknown;
|
||||
arguments?: unknown;
|
||||
content?: unknown;
|
||||
synthetic?: true;
|
||||
}
|
||||
|
||||
export interface ChatSession {
|
||||
key: string;
|
||||
label?: string;
|
||||
displayName?: string;
|
||||
thinkingLevel?: string;
|
||||
model?: string;
|
||||
updatedAt?: number;
|
||||
}
|
||||
|
||||
export interface ToolStatus {
|
||||
id?: string;
|
||||
toolCallId?: string;
|
||||
name: string;
|
||||
status: 'running' | 'completed' | 'error';
|
||||
durationMs?: number;
|
||||
summary?: string;
|
||||
updatedAt: number;
|
||||
}
|
||||
27
src/types/electron.d.ts
vendored
Normal file
27
src/types/electron.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Electron API Type Declarations
|
||||
* Types for the APIs exposed via contextBridge
|
||||
*/
|
||||
|
||||
export interface IpcRenderer {
|
||||
invoke(channel: string, ...args: unknown[]): Promise<unknown>;
|
||||
on(channel: string, callback: (...args: unknown[]) => void): (() => void) | void;
|
||||
once(channel: string, callback: (...args: unknown[]) => void): void;
|
||||
off(channel: string, callback?: (...args: unknown[]) => void): void;
|
||||
}
|
||||
|
||||
export interface ElectronAPI {
|
||||
ipcRenderer: IpcRenderer;
|
||||
openExternal: (url: string) => Promise<void>;
|
||||
platform: NodeJS.Platform;
|
||||
isDev: boolean;
|
||||
imageWorkspaceLocalDevelopment: boolean;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electron: ElectronAPI;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
218
src/types/opencode.ts
Normal file
218
src/types/opencode.ts
Normal file
@@ -0,0 +1,218 @@
|
||||
export type OpencodeLifecycleState = 'stopped' | 'starting' | 'running' | 'error';
|
||||
|
||||
export interface OpencodeStatus {
|
||||
state: OpencodeLifecycleState;
|
||||
port: number;
|
||||
url?: string;
|
||||
pid?: number;
|
||||
error?: string;
|
||||
startedAt?: number;
|
||||
}
|
||||
|
||||
export interface OpencodeHealth {
|
||||
ok: boolean;
|
||||
status: OpencodeStatus;
|
||||
}
|
||||
|
||||
export interface OpencodeRuntimeConfigSummary {
|
||||
model: string | null;
|
||||
smallModel: string | null;
|
||||
providerIds: string[];
|
||||
enabledProviderIds?: string[];
|
||||
providerCount: number;
|
||||
providers?: OpencodeProviderSummary[];
|
||||
mcpServerIds?: string[];
|
||||
mcpServerCount?: number;
|
||||
mcpServers?: OpencodeMcpServerSummary[];
|
||||
}
|
||||
|
||||
export interface OpencodeModelLimit {
|
||||
context: number;
|
||||
output: number;
|
||||
}
|
||||
|
||||
export interface OpencodeProviderSummary {
|
||||
id: string;
|
||||
name?: string;
|
||||
npm?: string;
|
||||
modelIds: string[];
|
||||
imageInputModelIds?: string[];
|
||||
modelLimits?: Record<string, OpencodeModelLimit>;
|
||||
hasApiKey: boolean;
|
||||
apiKeyEnv?: string;
|
||||
headerNames: string[];
|
||||
}
|
||||
|
||||
export interface OpencodeMcpServerSummary {
|
||||
id: string;
|
||||
type: string;
|
||||
enabled: boolean;
|
||||
command: string[];
|
||||
envKeys: string[];
|
||||
}
|
||||
|
||||
export interface OpencodeProject {
|
||||
id: string;
|
||||
path: string;
|
||||
name: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastOpenedAt: string;
|
||||
}
|
||||
|
||||
export interface OpencodeProjectSnapshot {
|
||||
projects: OpencodeProject[];
|
||||
activeProject: OpencodeProject | null;
|
||||
}
|
||||
|
||||
export interface OpencodeProjectActionResponse extends OpencodeProjectSnapshot {
|
||||
success: boolean;
|
||||
project?: OpencodeProject;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export type OpencodeContextFileType = 'file' | 'directory';
|
||||
|
||||
export interface OpencodeContextFileEntry {
|
||||
path: string;
|
||||
name: string;
|
||||
type: OpencodeContextFileType;
|
||||
status?: string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
export interface OpencodeContextFileContent {
|
||||
path: string;
|
||||
content: string;
|
||||
truncated?: boolean;
|
||||
}
|
||||
|
||||
export interface OpencodeSessionDiff {
|
||||
path: string;
|
||||
name: string;
|
||||
status?: string;
|
||||
additions: number | null;
|
||||
deletions: number | null;
|
||||
before: string | null;
|
||||
after: string;
|
||||
patch: string | null;
|
||||
}
|
||||
|
||||
export interface OpencodeSessionTodo {
|
||||
id: string;
|
||||
content: string;
|
||||
status: string;
|
||||
priority?: string;
|
||||
}
|
||||
|
||||
export interface OpencodeTextSearchSubmatch {
|
||||
text: string;
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
export interface OpencodeTextSearchResult {
|
||||
path: string;
|
||||
name: string;
|
||||
lineNumber: number | null;
|
||||
lineText: string;
|
||||
submatches: OpencodeTextSearchSubmatch[];
|
||||
}
|
||||
|
||||
export interface OpencodeSession extends Record<string, unknown> {
|
||||
id?: string;
|
||||
sessionID?: string;
|
||||
agent?: string | null;
|
||||
title?: string;
|
||||
name?: string;
|
||||
summary?: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
share?: { url?: string };
|
||||
revert?: { messageID?: string; partID?: string };
|
||||
}
|
||||
|
||||
export interface OpencodeProjectCommand {
|
||||
name: string;
|
||||
description?: string;
|
||||
agent?: string;
|
||||
model?: string;
|
||||
source?: 'command' | 'mcp' | 'skill';
|
||||
subtask?: boolean;
|
||||
hints: string[];
|
||||
}
|
||||
|
||||
export interface OpencodeCommandTextPartInput {
|
||||
type: 'text';
|
||||
text: string;
|
||||
synthetic: true;
|
||||
}
|
||||
|
||||
export interface OpencodeCommandFilePartInput {
|
||||
type: 'file';
|
||||
mime: string;
|
||||
filename?: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type OpencodeCommandPartInput =
|
||||
| OpencodeCommandTextPartInput
|
||||
| OpencodeCommandFilePartInput;
|
||||
|
||||
export type OpencodeSessionExecutionState = 'idle' | 'busy' | 'retry';
|
||||
|
||||
export interface OpencodeSessionStatus extends Record<string, unknown> {
|
||||
type: OpencodeSessionExecutionState;
|
||||
attempt?: number;
|
||||
message?: string;
|
||||
next?: number;
|
||||
}
|
||||
|
||||
export type OpencodeSessionStatusMap = Record<string, OpencodeSessionStatus>;
|
||||
|
||||
export interface OpencodeSessionMessage extends Record<string, unknown> {
|
||||
id?: string;
|
||||
role?: string;
|
||||
content?: unknown;
|
||||
text?: string;
|
||||
message?: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface OpencodeQuestionOption {
|
||||
label: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface OpencodeQuestionInfo {
|
||||
question: string;
|
||||
header?: string;
|
||||
options: OpencodeQuestionOption[];
|
||||
multiple?: boolean;
|
||||
custom?: boolean;
|
||||
}
|
||||
|
||||
export interface OpencodeQuestionRequest {
|
||||
id: string;
|
||||
requestID?: string;
|
||||
sessionID: string;
|
||||
questions: OpencodeQuestionInfo[];
|
||||
tool?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export type OpencodePermissionReply = 'once' | 'always' | 'reject';
|
||||
|
||||
export interface OpencodePermissionRequest {
|
||||
id: string;
|
||||
requestID?: string;
|
||||
sessionID: string;
|
||||
title?: string;
|
||||
action?: string;
|
||||
permission?: string;
|
||||
path?: string;
|
||||
patterns?: string[];
|
||||
always?: string[];
|
||||
tool?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
Reference in New Issue
Block a user