Chat modes

This commit is contained in:
Matt Rubens
2025-01-03 22:39:52 -08:00
parent ae9a35b7b1
commit 344c796f2e
52 changed files with 6273 additions and 1500 deletions

View File

@@ -4,6 +4,7 @@ import { ApiConfiguration, ApiProvider, ModelInfo } from "./api"
import { HistoryItem } from "./HistoryItem"
import { McpServer } from "./mcp"
import { GitCommit } from "../utils/git"
import { Mode } from "../core/prompts/types"
// webview will hold state
export interface ExtensionMessage {
@@ -47,6 +48,7 @@ export interface ExtensionMessage {
}
export interface ApiConfigMeta {
id: string
name: string
apiProvider?: ApiProvider
}
@@ -79,6 +81,8 @@ export interface ExtensionState {
writeDelayMs: number
terminalOutputLineLimit?: number
mcpEnabled: boolean
mode: Mode
modeApiConfigs?: Record<Mode, string>;
}
export interface ClineMessage {

View File

@@ -61,6 +61,7 @@ export interface WebviewMessage {
| "alwaysApproveResubmit"
| "requestDelaySeconds"
| "setApiConfigPassword"
| "mode"
text?: string
disabled?: boolean
askResponse?: ClineAskResponse

View File

@@ -51,6 +51,7 @@ export interface ApiHandlerOptions {
export type ApiConfiguration = ApiHandlerOptions & {
apiProvider?: ApiProvider
id?: string // stable unique identifier
}
// Models

5
src/shared/modes.ts Normal file
View File

@@ -0,0 +1,5 @@
export const codeMode = 'code' as const;
export const architectMode = 'architect' as const;
export const askMode = 'ask' as const;
export type Mode = typeof codeMode | typeof architectMode | typeof askMode;