Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/core/src/amazonq/webview/ui/apps/cwChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ export class Connector extends BaseConnector {
tabID: tabId,
})

if (!this.onChatAnswerUpdated || !['accept-code-diff', 'reject-code-diff'].includes(action.id)) {
if (
!this.onChatAnswerUpdated ||
!['accept-code-diff', 'reject-code-diff', 'confirm-tool-use'].includes(action.id)
) {
return
}
const answer: ChatItem = {
Expand Down Expand Up @@ -297,6 +300,18 @@ export class Connector extends BaseConnector {
},
]
break
case 'confirm-tool-use':
answer.buttons = [
{
keepCardAfterClick: true,
text: 'Confirmed',
id: 'confirmed-tool-use',
status: 'success',
position: 'outside',
disabled: true,
},
]
break
default:
break
}
Expand Down
16 changes: 0 additions & 16 deletions packages/core/src/codewhispererChat/clients/chat/v0/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ export class ChatSession {
private sessionId?: string
/**
* _readFiles = list of files read from the project to gather context before generating response.
* _filePath = The path helps the system locate exactly where to make the necessary changes in the project structure
* _tempFilePath = Used to show the code diff view in the editor including LLM changes.
* _showDiffOnFileWrite = Controls whether to show diff view (true) or file context view (false) to the user
*/
private _readFiles: string[] = []
private _filePath: string | undefined
private _tempFilePath: string | undefined
private _toolUse: ToolUse | undefined
private _showDiffOnFileWrite: boolean = false

Expand Down Expand Up @@ -61,24 +57,12 @@ export class ChatSession {
public get readFiles(): string[] {
return this._readFiles
}
public get filePath(): string | undefined {
return this._filePath
}
public get tempFilePath(): string | undefined {
return this._tempFilePath
}
public get showDiffOnFileWrite(): boolean {
return this._showDiffOnFileWrite
}
public setShowDiffOnFileWrite(value: boolean) {
this._showDiffOnFileWrite = value
}
public setFilePath(filePath: string | undefined) {
this._filePath = filePath
}
public setTempFilePath(tempFilePath: string | undefined) {
this._tempFilePath = tempFilePath
}
public addToReadFiles(filePath: string) {
this._readFiles.push(filePath)
}
Expand Down
Loading