Skip to content

Commit 73dfcd0

Browse files
committed
Refactor codebase to rename ToolType to ApiFeature and update edit context references to edit files
- rename 'last used edit context...' to 'last used edit files...' - rename 'edit context instructions' to 'edit files instructions' - `apps/editor/src/views/settings/types/tools.ts`should be moved to `apps/editor/src/views/shared/types` - rename 'tool type' to 'api feature' - creating 'api configuratin' should be 'api feature' agnostic (don't verify handling audio)
1 parent e79ac26 commit 73dfcd0

33 files changed

Lines changed: 107 additions & 129 deletions

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ In the world of AI coding, agents like Codex or Claude Code rely on "tool callin
4444

4545
CWC flips this!
4646

47-
Here, selected in the explorer view files are sent to the model with every prompt so it has everything it needs to do the task without a single tool call.
47+
Here, selected in the explorer view files are sent to the model with your instructions so it has everything it needs to do the task. Get accurate multi-file edits in record time!
4848

4949
> [!TIP]
5050
> **Not sure what files to select?** Search files using phrase, keywords and **natural language**.

‎apps/editor/src/constants/state-keys.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const LAST_USED_CODE_AT_CURSOR_CONFIG_ID_STATE_KEY =
6262
'last-used-code-at-cursor-config-id'
6363
export const LAST_USED_FIND_RELEVANT_FILES_CONFIG_ID_STATE_KEY =
6464
'last-used-find-relevant-files-config-id'
65-
export const LAST_USED_EDIT_CONTEXT_CONFIG_ID_STATE_KEY =
65+
export const LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY =
6666
'last-used-edit-files-config-id'
6767
export const LAST_USED_COMMIT_MESSAGES_CONFIG_ID_STATE_KEY =
6868
'last-used-commit-messages-config-id'

‎apps/editor/src/views/panel/backend/message-handlers/handle-create-api-configuration.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const handle_create_api_configuration = async (
99
): Promise<void> => {
1010
const result = await create({
1111
context: provider.context,
12-
tool_type: message.tool_type,
1312
create_on_top: message.create_on_top,
1413
insertion_index: message.insertion_index
1514
})
@@ -22,7 +21,7 @@ export const handle_create_api_configuration = async (
2221
id: get_api_configuration_id(result.config)
2322
},
2423
insertion_index: result.insertion_index,
25-
tool_type: message.tool_type
24+
api_feature: message.api_feature
2625
})
2726
}
2827
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import axios from 'axios'
1010
import {
1111
API_EDIT_FORMAT_STATE_KEY,
12-
LAST_USED_EDIT_CONTEXT_CONFIG_ID_STATE_KEY
12+
LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY
1313
} from '@/constants/state-keys'
1414
import { EditFormat } from '@shared/types/edit-format'
1515
import { ApiConfiguration } from '@/services/model-providers-manager'
@@ -62,7 +62,7 @@ const get_edit_files_api_configuration = async (params: {
6262
) || null
6363
if (selected_api_configuration) {
6464
params.context.workspaceState.update(
65-
LAST_USED_EDIT_CONTEXT_CONFIG_ID_STATE_KEY,
65+
LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY,
6666
params.api_configuration_id
6767
)
6868

@@ -76,7 +76,7 @@ const get_edit_files_api_configuration = async (params: {
7676
}
7777
} else if (!params.show_quick_pick) {
7878
const last_selected_id = params.context.workspaceState.get<string>(
79-
LAST_USED_EDIT_CONTEXT_CONFIG_ID_STATE_KEY
79+
LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY
8080
)
8181

8282
if (last_selected_id) {
@@ -89,7 +89,7 @@ const get_edit_files_api_configuration = async (params: {
8989

9090
if (!selected_api_configuration || params.show_quick_pick) {
9191
const last_selected_id = params.context.workspaceState.get<string>(
92-
LAST_USED_EDIT_CONTEXT_CONFIG_ID_STATE_KEY
92+
LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY
9393
)
9494

9595
const result = await show_configuration_quick_pick({
@@ -111,7 +111,7 @@ const get_edit_files_api_configuration = async (params: {
111111
const { item: api_configuration, id } = result
112112

113113
params.context.workspaceState.update(
114-
LAST_USED_EDIT_CONTEXT_CONFIG_ID_STATE_KEY,
114+
LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY,
115115
id
116116
)
117117

@@ -163,7 +163,7 @@ export const handle_edit_files = async (
163163
open_editors_provider: panel_provider.open_editors_provider
164164
})
165165

166-
const instructions = panel_provider.current_edit_context_instruction
166+
const instructions = panel_provider.current_edit_files_instruction
167167

168168
if (!instructions) {
169169
panel_provider.send_message({

‎apps/editor/src/views/panel/backend/message-handlers/handle-get-instructions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const handle_get_instructions = (panel_provider: PanelProvider) => {
44
panel_provider.send_message({
55
command: 'INSTRUCTIONS',
66
ask_about_context: panel_provider.ask_about_context_instructions,
7-
edit_files: panel_provider.edit_context_instructions,
7+
edit_files: panel_provider.edit_files_instructions,
88
no_context: panel_provider.no_context_instructions,
99
code_at_cursor: panel_provider.code_at_cursor_instructions,
1010
find_relevant_files: panel_provider.find_relevant_files_instructions

‎apps/editor/src/views/panel/backend/message-handlers/handle-pick-api-model.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export const handle_pick_api_model = async (
2020
const new_model = await edit_model_for_api_configuration({
2121
api_configuration: temp_api_configuration,
2222
providers_manager,
23-
model_fetcher,
24-
tool_type: message.tool_type
23+
model_fetcher
2524
})
2625

2726
if (new_model !== undefined) {

‎apps/editor/src/views/panel/backend/message-handlers/handle-pick-model-provider.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export const handle_pick_model_provider = async (
2727
const new_model = await edit_model_for_api_configuration({
2828
api_configuration: temp_api_configuration,
2929
providers_manager,
30-
model_fetcher,
31-
tool_type: message.tool_type
30+
model_fetcher
3231
})
3332

3433
if (new_model !== undefined) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const handle_save_instructions = async (
2525
instruction_state
2626
)
2727
} else if (prompt_type == 'edit-files') {
28-
panel_provider.edit_context_instructions = instruction_state
28+
panel_provider.edit_files_instructions = instruction_state
2929
await panel_provider.context.workspaceState.update(
3030
INSTRUCTIONS_EDIT_FILES_STATE_KEY,
3131
instruction_state

‎apps/editor/src/views/panel/backend/message-handlers/handle-send-to-browser.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ const resolve_web_configuration = async (params: {
333333
] || ''
334334
} else if (params.panel_provider.web_prompt_type == 'edit-files') {
335335
current_instructions =
336-
params.panel_provider.edit_context_instructions.instructions[
337-
params.panel_provider.edit_context_instructions.active_index
336+
params.panel_provider.edit_files_instructions.instructions[
337+
params.panel_provider.edit_files_instructions.active_index
338338
] || ''
339339
} else if (params.panel_provider.web_prompt_type == 'without-files') {
340340
current_instructions =

‎apps/editor/src/views/panel/backend/message-handlers/handle-update-api-configuration.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const handle_update_api_configuration = async (
1212
origin: message.origin,
1313
is_new: message.is_new,
1414
insertion_index: message.insertion_index,
15-
tool_type: message.tool_type
15+
api_feature: message.api_feature
1616
})
1717

1818
if (result.success) {
@@ -21,7 +21,7 @@ export const handle_update_api_configuration = async (
2121
if (message.is_new && message.origin === 'save' && result.new_id) {
2222
provider.send_message({
2323
command: 'SELECTED_API_CONFIGURATION_CHANGED',
24-
prompt_type: message.tool_type,
24+
prompt_type: message.api_feature,
2525
id: result.new_id
2626
})
2727
}

0 commit comments

Comments
 (0)