feat: add pink-purple theme, fix image paste race condition, allow @/commands anywhere in input
- Add Pink Purple theme (hot pink/purple/magenta on dark plum background) - Fix race condition where clearPastedImages() in input-area ran before the async message handler could read the images, silently dropping them - Allow @ file picker and / command menu to trigger at any cursor position, not just when the input is empty - Update CHANGELOG and README with new changes
This commit is contained in:
@@ -4,9 +4,21 @@
|
||||
|
||||
import type { ToolCall, ToolResult } from "@/types/tools";
|
||||
|
||||
/** Why the agent loop stopped */
|
||||
export type AgentStopReason =
|
||||
| "completed" // LLM returned a final response (no more tool calls)
|
||||
| "max_iterations" // Hit the iteration limit
|
||||
| "consecutive_errors" // Repeated tool failures
|
||||
| "aborted" // User abort
|
||||
| "error" // Unrecoverable error
|
||||
| "plan_approval" // Stopped to request plan approval
|
||||
;
|
||||
|
||||
export interface AgentResult {
|
||||
success: boolean;
|
||||
finalResponse: string;
|
||||
iterations: number;
|
||||
toolCalls: { call: ToolCall; result: ToolResult }[];
|
||||
/** Why the agent stopped — helps the user understand what happened */
|
||||
stopReason?: AgentStopReason;
|
||||
}
|
||||
|
||||
@@ -7,4 +7,5 @@ import type { StreamCallbacks } from "@/types/streaming";
|
||||
export interface StreamCallbacksWithState {
|
||||
callbacks: StreamCallbacks;
|
||||
hasReceivedContent: () => boolean;
|
||||
hasReceivedUsage: () => boolean;
|
||||
}
|
||||
|
||||
36
src/interfaces/api/copilot/core.ts
Normal file
36
src/interfaces/api/copilot/core.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type {
|
||||
Message,
|
||||
MessageContent,
|
||||
ChatCompletionOptions,
|
||||
ChatCompletionResponse,
|
||||
} from "@/types/providers";
|
||||
|
||||
export interface FormattedMessage {
|
||||
role: string;
|
||||
content: MessageContent;
|
||||
tool_call_id?: string;
|
||||
tool_calls?: Message["tool_calls"];
|
||||
}
|
||||
|
||||
export interface ChatRequestBody {
|
||||
model: string;
|
||||
messages: FormattedMessage[];
|
||||
max_tokens: number;
|
||||
temperature: number;
|
||||
stream: boolean;
|
||||
tools?: ChatCompletionOptions["tools"];
|
||||
tool_choice?: string;
|
||||
}
|
||||
|
||||
export interface ChatApiResponse {
|
||||
error?: { message?: string };
|
||||
choices?: Array<{
|
||||
message?: { content?: string; tool_calls?: Message["tool_calls"] };
|
||||
finish_reason?: ChatCompletionResponse["finishReason"];
|
||||
}>;
|
||||
usage?: {
|
||||
prompt_tokens?: number;
|
||||
completion_tokens?: number;
|
||||
total_tokens?: number;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user