Skip to content

Commit 79e4b42

Browse files
committed
Rename API tool configuration references to recent API configuration for consistency
1 parent 5339fa1 commit 79e4b42

22 files changed

Lines changed: 98 additions & 97 deletions

‎apps/editor/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const apply_chat_response_command = (params: {
108108
raw_instructions: args?.raw_instructions,
109109
created_at: Date.now(),
110110
url: args?.url,
111-
api_configuration: args?.api_configuration,
111+
recent_api_configuration: args?.recent_api_configuration,
112112
is_unviewed: true
113113
}
114114

@@ -361,7 +361,7 @@ export const apply_chat_response_command = (params: {
361361
lines_removed: total_lines_removed,
362362
files: files_for_history,
363363
url: args?.url,
364-
api_configuration: args?.api_configuration
364+
recent_api_configuration: args?.recent_api_configuration
365365
}
366366

367367
history.push(new_item)
@@ -385,7 +385,7 @@ export const apply_chat_response_command = (params: {
385385
raw_instructions: args?.raw_instructions,
386386
created_at: created_at_for_preview,
387387
url: args?.url,
388-
api_configuration: args?.api_configuration
388+
recent_api_configuration: args?.recent_api_configuration
389389
})
390390

391391
if (changes_accepted) {

‎apps/editor/src/commands/apply-chat-response-command/response-processor.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from 'vscode'
22
import * as fs from 'fs'
33
import * as path from 'path'
44
import { OriginalFileState } from './types/original-file-state'
5-
import { ApiConfiguration } from '@shared/types/response-history-item'
5+
import { RecentApiConfiguration } from '@shared/types/response-history-item'
66
import { handle_restore_preview } from './handlers/restore-preview-handler'
77
import {
88
FileItem,
@@ -49,7 +49,7 @@ export type ApplyChatResponseCommandArgs = {
4949
relevant_files?: RelevantFileInPreview[]
5050
created_at?: number
5151
url?: string
52-
api_configuration?: ApiConfiguration
52+
recent_api_configuration?: RecentApiConfiguration
5353
}
5454

5555
export const process_chat_response = async (params: {
@@ -182,7 +182,7 @@ export const process_chat_response = async (params: {
182182
created_at: created_at_for_preview,
183183
relevant_files: files_for_preview,
184184
url: params.args?.url,
185-
api_configuration: params.args?.api_configuration
185+
recent_api_configuration: params.args?.recent_api_configuration
186186
}
187187
history.push(new_item)
188188
} else {
@@ -208,7 +208,7 @@ export const process_chat_response = async (params: {
208208
raw_instructions: params.args?.raw_instructions,
209209
created_at: created_at_for_preview,
210210
url: params.args?.url,
211-
api_configuration: params.args?.api_configuration
211+
recent_api_configuration: params.args?.recent_api_configuration
212212
})
213213

214214
const decision = await new Promise<PreviewDecision>((resolve) => {

‎apps/editor/src/commands/apply-chat-response-command/utils/preview-handler.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as vscode from 'vscode'
22
import { Logger } from '@shared/utils/logger'
33
import { OriginalFileState } from '../types/original-file-state'
4-
import { ApiConfiguration } from '@shared/types/response-history-item'
4+
import { RecentApiConfiguration } from '@shared/types/response-history-item'
55
import { undo_files } from './file-operations'
66
import { preview } from './preview'
77
import { PanelProvider } from '@/views/panel/backend/panel-provider'
@@ -22,7 +22,7 @@ export const preview_handler = async (params: {
2222
raw_instructions?: string
2323
created_at?: number
2424
url?: string
25-
api_configuration?: ApiConfiguration
25+
recent_api_configuration?: RecentApiConfiguration
2626
}): Promise<boolean> => {
2727
let resolve_cleanup_promise: () => void
2828
ongoing_preview_cleanup_promise = new Promise((resolve) => {
@@ -38,7 +38,7 @@ export const preview_handler = async (params: {
3838
context: params.context,
3939
created_at: params.created_at,
4040
url: params.url,
41-
api_configuration: params.api_configuration
41+
recent_api_configuration: params.recent_api_configuration
4242
})
4343

4444
if (preview_result === null || preview_result.accepted_files.length == 0) {

‎apps/editor/src/commands/apply-chat-response-command/utils/preview/preview.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from 'vscode'
22
import { dictionary } from '@shared/constants/dictionary'
33
import { PanelProvider } from '@/views/panel/backend/panel-provider'
44
import { OriginalFileState } from '@/commands/apply-chat-response-command/types/original-file-state'
5-
import { ApiConfiguration } from '@shared/types/response-history-item'
5+
import { RecentApiConfiguration } from '@shared/types/response-history-item'
66
import { setup_workspace_listeners } from './workspace-listener'
77
import { prepare_files_from_original_states } from './file-preparer'
88
import { parse_response } from '../clipboard-parser/clipboard-parser'
@@ -31,7 +31,7 @@ export const preview = async (params: {
3131
context: vscode.ExtensionContext
3232
created_at?: number
3333
url?: string
34-
api_configuration?: ApiConfiguration
34+
recent_api_configuration?: RecentApiConfiguration
3535
}): Promise<{
3636
accepted_files: PreviewableFile[]
3737
rejected_states: OriginalFileState[]
@@ -147,7 +147,7 @@ export const preview = async (params: {
147147
created_at: params.created_at,
148148
fix_all_automatically,
149149
url: params.url,
150-
api_configuration: params.api_configuration
150+
recent_api_configuration: params.recent_api_configuration
151151
})
152152
}
153153

‎apps/editor/src/commands/checkpoints-command/actions/restore-checkpoint.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ export const restore_checkpoint = async (params: {
522522
files_with_content: item_to_preview.files,
523523
created_at: item_to_preview.created_at,
524524
url: item_to_preview.url,
525-
api_configuration: item_to_preview.api_configuration
525+
recent_api_configuration: item_to_preview.recent_api_configuration
526526
})
527527
}
528528
}

‎apps/editor/src/views/panel/backend/message-handlers/handle-apply-response-from-history.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const handle_apply_response_from_history = async (
1111
relevant_files: message.relevant_files,
1212
created_at: message.created_at,
1313
url: message.url,
14-
api_configuration: message.api_configuration
14+
recent_api_configuration: message.recent_api_configuration
1515
})
1616
}
17+

‎apps/editor/src/views/panel/backend/message-handlers/handle-code-at-cursor.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ export const handle_code_at_cursor = async (
387387
character: position.character
388388
}
389389
},
390-
api_configuration: {
390+
recent_api_configuration: {
391391
provider: code_completions_config.provider_name,
392392
model: code_completions_config.model,
393393
reasoning_effort: code_completions_config.reasoning_effort

‎apps/editor/src/views/panel/backend/message-handlers/handle-edit-context.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export const handle_edit_context = async (
450450
response: result.response,
451451
raw_instructions: instructions,
452452
edit_format,
453-
api_configuration: {
453+
recent_api_configuration: {
454454
provider: edit_context_config.provider_name,
455455
model: edit_context_config.model,
456456
reasoning_effort: edit_context_config.reasoning_effort

‎apps/editor/src/views/panel/backend/message-handlers/handle-find-relevant-files.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export const handle_find_relevant_files = async (
400400
vscode.commands.executeCommand('codeWebChat.applyChatResponse', {
401401
response: result.response,
402402
raw_instructions: instructions,
403-
api_configuration: {
403+
recent_api_configuration: {
404404
provider: find_relevant_files_config.provider_name,
405405
model: find_relevant_files_config.model,
406406
reasoning_effort: find_relevant_files_config.reasoning_effort

apps/editor/src/views/panel/backend/message-handlers/handle-get-api-tool-configurations.ts renamed to apps/editor/src/views/panel/backend/message-handlers/handle-get-api-configurations.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import {
33
ModelProvidersManager,
44
get_tool_config_id
55
} from '@/services/model-providers-manager'
6-
import { ApiToolConfiguration } from '@/views/panel/types/messages'
6+
import { ApiConfiguration } from '@/views/panel/types/messages'
77

8-
export const handle_get_api_tool_configurations = async (
8+
export const handle_get_api_configurations = async (
99
panel_provider: PanelProvider
1010
): Promise<void> => {
1111
const providers_manager = new ModelProvidersManager(panel_provider.context)
1212

1313
const configs = await providers_manager.get_tool_configs()
1414

15-
const configurations: ApiToolConfiguration[] = configs.map((config) => ({
15+
const configurations: ApiConfiguration[] = configs.map((config) => ({
1616
...config,
1717
id: get_tool_config_id(config)
1818
}))
1919

2020
panel_provider.send_message({
21-
command: 'API_TOOL_CONFIGURATIONS',
21+
command: 'API_CONFIGURATIONS',
2222
configurations
2323
})
24-
}
24+
}

0 commit comments

Comments
 (0)