|
3 | 3 | * SPDX-License-Identifier: Apache-2.0 |
4 | 4 | */ |
5 | 5 |
|
6 | | -import * as vscode from 'vscode' |
7 | | -import { VirtualFileSystem } from '../../shared/virtualFilesystem' |
8 | | -import type { CancellationTokenSource } from 'vscode' |
9 | | -import { CodeReference, UploadHistory } from '../webview/ui/connector' |
10 | | -import { DiffTreeFileInfo } from '../webview/ui/diffTree/types' |
11 | | -import { Messenger } from './connector/baseMessenger' |
12 | | -import { FeatureClient } from '../client/client' |
13 | | -import { TelemetryHelper } from '../util/telemetryHelper' |
14 | | - |
15 | 6 | export enum FollowUpTypes { |
16 | 7 | // UnitTestGeneration |
17 | 8 | ViewDiff = 'ViewDiff', |
@@ -48,119 +39,3 @@ export enum FollowUpTypes { |
48 | 39 | ProceedFolderSelection = 'ProceedFolderSelection', |
49 | 40 | CancelFolderSelection = 'CancelFolderSelection', |
50 | 41 | } |
51 | | - |
52 | | -export type Interaction = { |
53 | | - // content to be sent back to the chat UI |
54 | | - content?: string |
55 | | - responseType?: LLMResponseType |
56 | | -} |
57 | | - |
58 | | -export interface SessionStateInteraction { |
59 | | - nextState: SessionState | Omit<SessionState, 'uploadId'> | undefined |
60 | | - interaction: Interaction |
61 | | - currentCodeGenerationId?: string |
62 | | -} |
63 | | - |
64 | | -export enum Intent { |
65 | | - DEV = 'DEV', |
66 | | - DOC = 'DOC', |
67 | | -} |
68 | | - |
69 | | -export enum DevPhase { |
70 | | - INIT = 'Init', |
71 | | - APPROACH = 'Approach', |
72 | | - CODEGEN = 'Codegen', |
73 | | -} |
74 | | - |
75 | | -export enum CodeGenerationStatus { |
76 | | - COMPLETE = 'Complete', |
77 | | - PREDICT_READY = 'predict-ready', |
78 | | - IN_PROGRESS = 'InProgress', |
79 | | - PREDICT_FAILED = 'predict-failed', |
80 | | - DEBATE_FAILED = 'debate-failed', |
81 | | - FAILED = 'Failed', |
82 | | -} |
83 | | - |
84 | | -export type SessionStatePhase = DevPhase.INIT | DevPhase.CODEGEN |
85 | | - |
86 | | -export type CurrentWsFolders = [vscode.WorkspaceFolder, ...vscode.WorkspaceFolder[]] |
87 | | - |
88 | | -export interface SessionState { |
89 | | - readonly filePaths?: NewFileInfo[] |
90 | | - readonly deletedFiles?: DeletedFileInfo[] |
91 | | - readonly references?: CodeReference[] |
92 | | - readonly phase?: SessionStatePhase |
93 | | - readonly uploadId: string |
94 | | - readonly currentIteration?: number |
95 | | - currentCodeGenerationId?: string |
96 | | - tokenSource?: CancellationTokenSource |
97 | | - readonly codeGenerationId?: string |
98 | | - readonly tabID: string |
99 | | - interact(action: SessionStateAction): Promise<SessionStateInteraction> |
100 | | - updateWorkspaceRoot?: (workspaceRoot: string) => void |
101 | | - codeGenerationRemainingIterationCount?: number |
102 | | - codeGenerationTotalIterationCount?: number |
103 | | - uploadHistory?: UploadHistory |
104 | | -} |
105 | | - |
106 | | -export interface SessionStateConfig { |
107 | | - workspaceRoots: string[] |
108 | | - workspaceFolders: CurrentWsFolders |
109 | | - conversationId: string |
110 | | - proxyClient: FeatureClient |
111 | | - uploadId: string |
112 | | - currentCodeGenerationId?: string |
113 | | -} |
114 | | - |
115 | | -export interface SessionStateAction { |
116 | | - task: string |
117 | | - msg: string |
118 | | - messenger: Messenger |
119 | | - fs: VirtualFileSystem |
120 | | - telemetry: TelemetryHelper |
121 | | - uploadHistory?: UploadHistory |
122 | | - tokenSource?: CancellationTokenSource |
123 | | -} |
124 | | - |
125 | | -export type NewFileZipContents = { zipFilePath: string; fileContent: string } |
126 | | -export type NewFileInfo = DiffTreeFileInfo & |
127 | | - NewFileZipContents & { |
128 | | - virtualMemoryUri: vscode.Uri |
129 | | - workspaceFolder: vscode.WorkspaceFolder |
130 | | - } |
131 | | - |
132 | | -export type DeletedFileInfo = DiffTreeFileInfo & { |
133 | | - workspaceFolder: vscode.WorkspaceFolder |
134 | | -} |
135 | | - |
136 | | -export interface SessionInfo { |
137 | | - // TODO, if it had a summarized name that was better for the UI |
138 | | - name?: string |
139 | | - history: string[] |
140 | | -} |
141 | | - |
142 | | -export interface SessionStorage { |
143 | | - [key: string]: SessionInfo |
144 | | -} |
145 | | - |
146 | | -export type LLMResponseType = 'EMPTY' | 'INVALID_STATE' | 'VALID' |
147 | | - |
148 | | -export interface UpdateFilesPathsParams { |
149 | | - tabID: string |
150 | | - filePaths: NewFileInfo[] |
151 | | - deletedFiles: DeletedFileInfo[] |
152 | | - messageId: string |
153 | | - disableFileActions?: boolean |
154 | | -} |
155 | | - |
156 | | -export enum MetricDataOperationName { |
157 | | - StartCodeGeneration = 'StartCodeGeneration', |
158 | | - EndCodeGeneration = 'EndCodeGeneration', |
159 | | -} |
160 | | - |
161 | | -export enum MetricDataResult { |
162 | | - Success = 'Success', |
163 | | - Fault = 'Fault', |
164 | | - Error = 'Error', |
165 | | - LlmFailure = 'LLMFailure', |
166 | | -} |
0 commit comments