Skip to content

Commit 7e6958e

Browse files
committed
Rename prompt type values from 'edit-files'/'ask-about-files' to 'edit'/'ask'
- rename prompt types: 'ask about files' to 'ask', 'edit files' to 'edit' ├── apps │ └── editor │ └── src │ ├── constants │ │ └── state-keys.ts │ └── views │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ ├── handle-autofill.ts │ │ │ ├── handle-copy-prompt.ts │ │ │ ├── handle-invoke-agentic-cli.ts │ │ │ ├── handle-make-api-call.ts │ │ │ ├── handle-preview-prompt.ts │ │ │ ├── handle-preview-web-configuration.ts │ │ │ ├── handle-save-history.ts │ │ │ ├── handle-save-instructions.ts │ │ │ ├── handle-template-quick-pick.ts │ │ │ └── utils │ │ │ └── build-cli-prompt.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ ├── Home │ │ │ └── Home.tsx │ │ ├── Main │ │ │ ├── Main.tsx │ │ │ └── MainView │ │ │ ├── MainView.tsx │ │ │ ├── components │ │ │ │ └── Header │ │ │ │ └── Header.tsx │ │ │ ├── hooks │ │ │ │ └── use-keyboard-shortcuts.ts │ │ │ └── prompt-type-labels.ts │ │ ├── Prompt.tsx │ │ └── hooks │ │ └── use-prompt │ │ ├── hooks │ │ │ └── use-instructions.ts │ │ └── use-prompt.ts │ └── types │ └── messages.ts └── packages └── shared └── src └── types └── prompt-types.ts
1 parent bf41c3c commit 7e6958e

22 files changed

Lines changed: 115 additions & 134 deletions

‎apps/editor/src/views/prompt/backend/message-handlers/handle-autofill.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const handle_autofill = async (params: {
6969
})
7070

7171
if (
72-
params.prompt_view_provider.web_prompt_type == 'edit-files' &&
72+
params.prompt_view_provider.web_prompt_type == 'edit' &&
7373
!collected_files
7474
) {
7575
vscode.window.showWarningMessage(
@@ -80,7 +80,7 @@ export const handle_autofill = async (params: {
8080

8181
let output_formatting: string | undefined = undefined
8282
const user_instructions = processed_instructions
83-
if (params.prompt_view_provider.web_prompt_type == 'edit-files') {
83+
if (params.prompt_view_provider.web_prompt_type == 'edit') {
8484
output_formatting = {
8585
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,
8686
truncated: EDIT_FORMAT_INSTRUCTIONS_TRUNCATED,
@@ -98,7 +98,7 @@ export const handle_autofill = async (params: {
9898
})
9999

100100
const prompt_type = params.prompt_view_provider.web_prompt_type
101-
const inject_apply_response_button = prompt_type == 'edit-files'
101+
const inject_apply_response_button = prompt_type == 'edit'
102102

103103
sent =
104104
await params.prompt_view_provider.websocket_server_instance.initialize_chat(

‎apps/editor/src/views/prompt/backend/message-handlers/handle-copy-prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const handle_copy_prompt = async (params: {
3434
let output_formatting: string | undefined = undefined
3535
const user_instructions = processed_instructions
3636

37-
if (params.prompt_view_provider.prompt_type == 'edit-files') {
37+
if (params.prompt_view_provider.prompt_type == 'edit') {
3838
const edit_format = params.prompt_view_provider.edit_format
3939
output_formatting = {
4040
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,

‎apps/editor/src/views/prompt/backend/message-handlers/handle-invoke-agentic-cli.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const handle_invoke_agentic_cli = async (
2323
}
2424

2525
if (
26-
prompt_view_provider.cli_prompt_type == 'edit-files' &&
26+
prompt_view_provider.cli_prompt_type == 'edit' &&
2727
!prompt_view_provider.workspace_provider.get_selected_files().length
2828
) {
2929
vscode.window.showWarningMessage(
@@ -45,10 +45,9 @@ export const handle_invoke_agentic_cli = async (
4545
last_selected_workspace_state_key:
4646
LAST_SELECTED_WORKSPACE_IN_AGENTIC_CLI_STATE_KEY,
4747
isolate_in_temp_dir: true,
48-
copy_selected_files: prompt_type == 'edit-files',
49-
generate_diff_for_temp_dir: prompt_type == 'edit-files',
50-
execution_mode:
51-
prompt_type == 'edit-files' ? 'headless' : 'interactive-terminal',
48+
copy_selected_files: prompt_type == 'edit',
49+
generate_diff_for_temp_dir: prompt_type == 'edit',
50+
execution_mode: prompt_type == 'edit' ? 'headless' : 'interactive-terminal',
5251
cli_configuration_name: message.cli_configuration_name,
5352
use_quick_pick: message.use_quick_pick,
5453
on_agent_selected: (name: string) => {
@@ -72,7 +71,7 @@ export const handle_invoke_agentic_cli = async (
7271

7372
const { agent_output } = result
7473

75-
if (agent_output && prompt_view_provider.cli_prompt_type == 'edit-files') {
74+
if (agent_output && prompt_view_provider.cli_prompt_type == 'edit') {
7675
vscode.commands.executeCommand('codeWebChat.applyResponse', {
7776
response: agent_output,
7877
raw_instructions: current_instructions

‎apps/editor/src/views/prompt/backend/message-handlers/handle-make-api-call.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const handle_make_api_call = async (
9393
let system_instructions = ''
9494
let user_content = ''
9595

96-
if (prompt_type == 'edit-files') {
96+
if (prompt_type == 'edit') {
9797
edit_format = prompt_view_provider.edit_format
9898
const output_formatting = {
9999
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,
@@ -170,7 +170,7 @@ export const handle_make_api_call = async (
170170
reasoning_effort: api_configuration.reasoning_effort
171171
}
172172

173-
if (prompt_type == 'edit-files') {
173+
if (prompt_type == 'edit') {
174174
vscode.commands.executeCommand('codeWebChat.applyResponse', {
175175
response: result.response,
176176
raw_instructions: current_instructions,

‎apps/editor/src/views/prompt/backend/message-handlers/handle-preview-prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const handle_preview_prompt = async (params: {
5353
let output_formatting: string | undefined = undefined
5454
const user_instructions = processed_instructions
5555

56-
if (params.prompt_view_provider.prompt_type == 'edit-files') {
56+
if (params.prompt_view_provider.prompt_type == 'edit') {
5757
const edit_format = params.prompt_view_provider.edit_format
5858
output_formatting = {
5959
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,

‎apps/editor/src/views/prompt/backend/message-handlers/handle-preview-web-configuration.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const handle_preview_web_configuration = async (
3232

3333
let output_formatting: string | undefined = undefined
3434
const user_instructions = processed_instructions
35-
if (prompt_view_provider.web_prompt_type == 'edit-files') {
35+
if (prompt_view_provider.web_prompt_type == 'edit') {
3636
output_formatting = {
3737
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,
3838
truncated: EDIT_FORMAT_INSTRUCTIONS_TRUNCATED,
@@ -67,7 +67,7 @@ export const handle_preview_web_configuration = async (
6767
instruction: text_to_send,
6868
web_configuration: web_configuration_for_preview,
6969
inject_apply_response_button:
70-
prompt_view_provider.web_prompt_type == 'edit-files',
70+
prompt_view_provider.web_prompt_type == 'edit',
7171
raw_instructions: current_instructions
7272
}
7373
)

‎apps/editor/src/views/prompt/backend/message-handlers/handle-save-history.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export const handle_save_history = async (
1313
let key: string | undefined
1414

1515
switch (message.prompt_type) {
16-
case 'ask-about-files':
16+
case 'ask':
1717
key = HISTORY_ASK_ABOUT_FILES_STATE_KEY
1818
break
19-
case 'edit-files':
19+
case 'edit':
2020
key = HISTORY_EDIT_FILES_STATE_KEY
2121
break
2222
}

‎apps/editor/src/views/prompt/backend/message-handlers/handle-save-instructions.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export const handle_save_instructions = async (
1515
const { prompt_type, instruction } = message as any
1616
const instruction_state = instruction as InstructionsState
1717

18-
if (prompt_type == 'ask-about-files') {
18+
if (prompt_type == 'ask') {
1919
prompt_view_provider.ask_about_context_instructions = instruction_state
2020
await prompt_view_provider.extension_context.workspaceState.update(
2121
INSTRUCTIONS_ASK_STATE_KEY,
2222
instruction_state
2323
)
24-
} else if (prompt_type == 'edit-files') {
24+
} else if (prompt_type == 'edit') {
2525
prompt_view_provider.edit_files_instructions = instruction_state
2626
await prompt_view_provider.extension_context.workspaceState.update(
2727
INSTRUCTIONS_EDIT_FILES_STATE_KEY,

‎apps/editor/src/views/prompt/backend/message-handlers/handle-template-quick-pick.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export const handle_template_quick_pick = async (
2424

2525
let templates_key: string | undefined
2626
switch (prompt_type) {
27-
case 'ask-about-files':
27+
case 'ask':
2828
templates_key = 'templatesForAskAboutFiles'
2929
break
30-
case 'edit-files':
30+
case 'edit':
3131
templates_key = 'templatesForEditFiles'
3232
break
3333
}

‎apps/editor/src/views/prompt/backend/message-handlers/utils/build-cli-prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const build_cli_prompt = async (params: {
7777
const requirements_list = [cli_edit_ask_requirements.preloaded_context]
7878
requirements_list.push(cli_edit_ask_requirements.disable_tool_calling)
7979

80-
if (prompt_view_provider.cli_prompt_type == 'edit-files') {
80+
if (prompt_view_provider.cli_prompt_type == 'edit') {
8181
requirements_list.push(cli_edit_ask_requirements.exception_read_images)
8282
requirements_list.push(
8383
cli_edit_ask_requirements.exception_allow_file_system_operations

0 commit comments

Comments
 (0)