diff --git a/pwa/src/api.ts b/pwa/src/api.ts index 7b5dc86..2b31bb4 100644 --- a/pwa/src/api.ts +++ b/pwa/src/api.ts @@ -52,4 +52,28 @@ export class APIClient { grantPermission(wsID: string, grant: { permission: PermissionRequest; action: string }): Promise { return this.request('POST', `workspaces/${wsID}/permissions/grant`, grant); } + + getAgentInfo(wsID: string): Promise { + return this.request('GET', `workspaces/${wsID}/agent`); + } + + setPermissionMode(wsID: string, mode: 'normal' | 'yolo' | 'super_yolo'): Promise { + return this.request('POST', `workspaces/${wsID}/permissions/mode`, { mode }); + } +} + +export interface AgentInfo { + is_busy: boolean; + is_ready: boolean; + model: { + id: string; + name: string; + can_reason: boolean; + context_window: number; + }; + model_cfg: { + model: string; + provider: string; + reasoning_effort: string; + }; } diff --git a/pwa/src/chat.ts b/pwa/src/chat.ts index 3b2c1b2..0c96626 100644 --- a/pwa/src/chat.ts +++ b/pwa/src/chat.ts @@ -1,6 +1,7 @@ import { state, escapeHTML, renderPart, deferHighlightAll } from './state'; import { handleDisconnect } from './connect'; import type { Message } from './types'; +import { updateSidebarYolo } from './palette'; declare const lucide: { createIcons: () => void } | undefined; export function initIcons() { try { lucide?.createIcons(); } catch {} } @@ -28,7 +29,11 @@ export function renderChat(): void { +