chore: sync current workspace changes
Desktop CI Build / Build macOS ARM64 DMG (push) Has been cancelled
Desktop CI Build / Build Windows x64 (push) Has been cancelled

This commit is contained in:
boos
2026-07-14 03:21:10 +08:00
parent 1512fa23ce
commit 557914fea8
745 changed files with 124917 additions and 11222 deletions
+28 -2
View File
@@ -1,6 +1,6 @@
export type AgentPermissionMode = 'default' | 'accept_edits' | 'full_access';
export type AgentRuntimeStatus = 'idle' | 'running' | 'waiting_approval' | 'completed' | 'error';
export type ApprovalStatus = 'pending' | 'approved' | 'denied';
export type AgentRuntimeStatus = 'idle' | 'active' | 'interrupted';
export type ApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired';
export interface AgentSession {
id: string;
@@ -8,14 +8,27 @@ export interface AgentSession {
cwd?: string;
permission_mode: AgentPermissionMode;
runtime_status: AgentRuntimeStatus;
current_run_id?: string | null;
host_access_enabled: boolean;
revision: number;
context_version: number;
last_provider_id?: string | null;
last_model_id?: string | null;
total_tokens: number;
total_cost_usd: number;
}
// --- Event payload types (all tool-related events carry assistantMessageId anchor) ---
export interface AgentRunStartedEvent {
conversationId: string;
sessionId: string;
runId: string;
}
export interface ToolUseEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
toolUseId: string;
toolName: string;
@@ -25,6 +38,7 @@ export interface ToolUseEvent {
export interface ToolStartEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
toolUseId: string;
toolName: string;
@@ -33,6 +47,7 @@ export interface ToolStartEvent {
export interface ToolResultEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
toolUseId: string;
toolName: string;
@@ -42,6 +57,7 @@ export interface ToolResultEvent {
export interface PermissionRequestEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
toolUseId: string;
toolName: string;
@@ -51,6 +67,7 @@ export interface PermissionRequestEvent {
export interface AskUserEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
askId: string;
question: string;
@@ -59,6 +76,7 @@ export interface AskUserEvent {
export interface AgentDoneEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
text: string;
usage?: { input_tokens: number; output_tokens: number };
@@ -68,35 +86,41 @@ export interface AgentDoneEvent {
export interface AgentErrorEvent {
conversationId: string;
runId?: string;
assistantMessageId?: string;
message: string;
}
export interface AgentCancelledEvent {
conversationId: string;
runId?: string;
assistantMessageId?: string;
reason: string;
}
export interface AgentStatusEvent {
conversationId: string;
runId?: string;
message: string;
}
export interface AgentRateLimitEvent {
conversationId: string;
runId?: string;
retryAfterMs: number;
message: string;
}
export interface AgentStreamTextEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
text: string;
}
export interface AgentStreamThinkingEvent {
conversationId: string;
runId?: string;
assistantMessageId: string;
thinking: string;
}
@@ -104,6 +128,8 @@ export interface AgentStreamThinkingEvent {
// --- Frontend runtime state ---
export interface ToolCallState {
conversationId: string;
runId: string;
toolUseId: string;
toolName: string;
input: Record<string, unknown>;