Move OpenCode UI into Electron shell

This commit is contained in:
2026-05-11 23:31:09 +00:00
parent 6f32a206b4
commit 08ed394737
40 changed files with 901 additions and 881 deletions
+14
View File
@@ -53,6 +53,13 @@ export interface IOpenCodeEvent {
raw: string;
}
export interface IRendererOpenCodeEvent {
type: string;
id?: string;
retry?: number;
data?: unknown;
}
export class OpenCodeHttpError extends Error {
constructor(
message: string,
@@ -476,6 +483,13 @@ export const parseServerSentEvent = (raw: string): IOpenCodeEvent | undefined =>
return { type, id, retry, data, raw };
};
export const sanitizeOpenCodeEventForRenderer = (event: IOpenCodeEvent): IRendererOpenCodeEvent => ({
type: event.type,
id: event.id,
retry: event.retry,
data: event.data,
});
const parseJsonIfPossible = (value: string) => {
if (!value) {
return undefined;