Skip to content

Commit 27e36b7

Browse files
committed
Merge branch 'dev'
2 parents 93ef474 + c01b48e commit 27e36b7

74 files changed

Lines changed: 814 additions & 337 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Code Web Chat
22

3-
<a href="https://marketplace.visualstudio.com/items?itemName=robertpiosik.gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-VS_Code_Marketplace-blue" alt="Get from Visual Studio Code Marketplace" /></a> <a href="https://open-vsx.org/extension/robertpiosik/gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-Open_VSX_Registry-a60ee5" alt="Get from Open VSX Registry" /></a> <a href="https://github.com/robertpiosik/CodeWebChat/blob/dev/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-GPL--3.0-green.svg" alt="License: GPL-3.0" /></a>
3+
<a href="https://marketplace.visualstudio.com/items?itemName=robertpiosik.gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-VS_Code_Marketplace-blue" alt="Get from Visual Studio Code Marketplace" /></a> <a href="https://open-vsx.org/extension/robertpiosik/gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-Open_VSX_Registry-a60ee5" alt="Get from Open VSX Registry" /></a> <a href="https://github.com/robertpiosik/CodeWebChat/blob/dev/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-GPL--3.0-green.svg" alt="GPL-3.0 license" /></a>
44

5-
Unlimited AI coding in free chatbots for VS Code, Cursor and Windsurf. The best privacy, accuracy and speed.
5+
Agent-free AI pair programming for VS Code, Cursor, and other forks. Master context to guide the model to the responses you expect—without tool calls.
66

77
❤️ **Free and open-source.** _Join our [discord server](https://discord.gg/KJySXsrSX5) and get involed!_
88

9-
✅ **Initializes chatbots**—ChatGPT, Claude, Gemini, AI Studio, Qwen, and 10+ more \
9+
✅ **Initializes free chatbots**—ChatGPT, Claude, Gemini, AI Studio, Qwen, and 10+ more \
10+
✅ **Calls model providers**—bring your own key or use local model via Ollama \
1011
✅ **Applies responses**—multi-file changes integration with easy rollback \
1112
✅ **Batteries included**—code completions, commit messages, and more
1213

@@ -16,14 +17,14 @@ Unlimited AI coding in free chatbots for VS Code, Cursor and Windsurf. The best
1617

1718
## Introduction
1819

19-
👨‍⚖️ **Is it legal?**
20+
👨‍⚖️ **In respect to Terms of Use**
2021

21-
Code Web Chat only starts new conversations. This idea is borrowed from [Firefox](https://support.mozilla.org/en-US/kb/ai-chatbot) and is not against any of the supported chatbots terms of use. Contributors should not submit pull requests implementing further chat automations of any kind, as these will be rejected.
22+
Code Web Chat only starts new conversations. This idea is borrowed from [Firefox](https://support.mozilla.org/en-US/kb/ai-chatbot) and is not against any of the supported chatbots Terms of Use. Contributors should not submit pull requests implementing further chat automations of any kind, as these will be rejected.
2223

2324
> [!NOTE]
2425
> The _Apply response_ button placed under responses is not a means of automatic output extraction, it's an alias for the original _copy to clipboard_ button.
2526
26-
🧑‍💻 **Guide the model through context ownership**
27+
🧑‍💻 **Control the context, guide the model**
2728

2829
Large language models (LLMs) are trained on vast datasets targeting many use cases. For code generation, a model's training involves analyzing millions of simulated problem-solving flows, such as arriving at the accepted answer from a given StackOverflow question. For the purpose of agentic coding, models are trained on an additional layer of data that simulates gathering context and planning its next steps.
2930

‎packages/ui/src/components/editor/panel/modals/StageFilesModal/StageFilesModal.module.scss‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
.files {
22
display: flex;
33
flex-direction: column;
4-
gap: var(--padding-4px);
4+
margin: 0 -12px;
55

66
&__item {
77
display: flex;
88
align-items: center;
99
gap: var(--padding-6px);
1010
cursor: pointer;
11+
padding: 0 12px;
12+
height: var(--list-item-height);
13+
14+
&:hover {
15+
background-color: var(--vscode-list-hoverBackground);
16+
17+
.files__item__actions {
18+
display: flex;
19+
}
20+
}
21+
22+
&--select-all {
23+
&:hover {
24+
background-color: transparent;
25+
}
26+
27+
strong:hover {
28+
text-decoration: underline;
29+
}
30+
}
1131

1232
&__details {
33+
flex: 1;
1334
overflow: hidden;
1435
white-space: nowrap;
1536
text-overflow: ellipsis;
@@ -24,5 +45,9 @@
2445
font-size: var(--font-size-12px);
2546
color: var(--vscode-descriptionForeground);
2647
}
48+
49+
&__actions {
50+
display: none;
51+
}
2752
}
2853
}

‎packages/ui/src/components/editor/panel/modals/StageFilesModal/StageFilesModal.stories.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ export const Default = () => {
2525
set_visible(false)
2626
}
2727

28+
const handle_go_to_file = (file: string) => {
29+
alert(`Go to file: ${file}`)
30+
}
31+
2832
return visible ? (
2933
<StageFilesModal
3034
files={mock_files}
3135
on_stage={handle_stage}
3236
on_cancel={handle_cancel}
37+
on_go_to_file={handle_go_to_file}
3338
/>
3439
) : null
3540
}

‎packages/ui/src/components/editor/panel/modals/StageFilesModal/StageFilesModal.tsx‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import styles from './StageFilesModal.module.scss'
33
import { Button } from '../../Button'
44
import { Modal } from '../Modal'
55
import { Checkbox } from '../../../common/Checkbox'
6+
import { IconButton } from '../../IconButton/IconButton'
7+
import cn from 'classnames'
68

79
type Props = {
810
files: string[]
911
on_stage: (files_to_stage: string[]) => void
1012
on_cancel: () => void
13+
on_go_to_file: (file: string) => void
1114
}
1215

1316
export const StageFilesModal: React.FC<Props> = (props) => {
@@ -42,7 +45,12 @@ export const StageFilesModal: React.FC<Props> = (props) => {
4245
content_max_height="calc(100vh - 150px)"
4346
content_slot={
4447
<div className={styles.files}>
45-
<label className={styles.files__item}>
48+
<label
49+
className={cn(
50+
styles.files__item,
51+
styles['files__item--select-all']
52+
)}
53+
>
4654
<Checkbox
4755
checked={all_selected}
4856
on_change={handle_toggle_select_all}
@@ -74,6 +82,16 @@ export const StageFilesModal: React.FC<Props> = (props) => {
7482
<span className={styles.files__item__path}>{dir_path}</span>
7583
)}
7684
</div>
85+
<div className={styles.files__item__actions}>
86+
<IconButton
87+
codicon_icon="go-to-file"
88+
title="Go To File"
89+
on_click={(e) => {
90+
e.stopPropagation()
91+
props.on_go_to_file(file)
92+
}}
93+
/>
94+
</div>
7795
</label>
7896
)
7997
})}

‎packages/vscode/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
4-
"description": "Unlimited AI coding in free chatbots (CWC)",
5-
"version": "1.488.0",
4+
"description": "Agent-free AI pair programming (CWC)",
5+
"version": "1.489.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

‎packages/vscode/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { apply_git_patch } from './handlers/diff-handler'
2121
import { PROVIDERS } from '@shared/constants/providers'
2222
import { LAST_SELECTED_INTELLIGENT_UPDATE_CONFIG_ID_STATE_KEY } from '@/constants/state-keys'
2323
import { Diff } from './utils/clipboard-parser/extract-diff-patches'
24-
import { ViewProvider } from '@/views/panel/backend/panel-provider'
24+
import { PanelProvider } from '@/views/panel/backend/panel-provider'
2525
import {
2626
review,
2727
code_review_promise_resolve,
@@ -35,6 +35,7 @@ import {
3535
promote_temporary_checkpoint
3636
} from '../checkpoints-command/actions'
3737
import { FileInReview } from '@shared/types/file-in-review'
38+
import { handle_restore_review } from './handlers/restore-review-handler'
3839

3940
let ongoing_review_cleanup_promise: Promise<void> | null = null
4041

@@ -243,7 +244,7 @@ const get_intelligent_update_config = async (
243244
const handle_code_review_and_cleanup = async (params: {
244245
original_states: OriginalFileState[]
245246
chat_response: string
246-
view_provider: ViewProvider
247+
panel_provider: PanelProvider
247248
update_undo_button_state: (
248249
states: OriginalFileState[] | null,
249250
content?: string | null,
@@ -266,7 +267,7 @@ const handle_code_review_and_cleanup = async (params: {
266267
try {
267268
const review_result = await review({
268269
original_states: params.original_states,
269-
view_provider: params.view_provider,
270+
panel_provider: params.panel_provider,
270271
raw_instructions: params.raw_instructions
271272
})
272273

@@ -336,7 +337,7 @@ const handle_code_review_and_cleanup = async (params: {
336337

337338
export const apply_chat_response_command = (
338339
context: vscode.ExtensionContext,
339-
view_provider: ViewProvider,
340+
panel_provider: PanelProvider,
340341
workspace_provider: WorkspaceProvider
341342
) => {
342343
const update_undo_button_state = (
@@ -357,7 +358,7 @@ export const apply_chat_response_command = (
357358
LAST_APPLIED_CHANGES_EDITOR_STATE_STATE_KEY,
358359
original_editor_state
359360
)
360-
view_provider.set_undo_button_state(true)
361+
panel_provider.set_undo_button_state(true)
361362
} else {
362363
context.workspaceState.update(LAST_APPLIED_CHANGES_STATE_KEY, null)
363364
context.workspaceState.update(
@@ -368,7 +369,7 @@ export const apply_chat_response_command = (
368369
LAST_APPLIED_CHANGES_EDITOR_STATE_STATE_KEY,
369370
null
370371
)
371-
view_provider.set_undo_button_state(false)
372+
panel_provider.set_undo_button_state(false)
372373
}
373374
}
374375

@@ -436,6 +437,22 @@ export const apply_chat_response_command = (
436437
}
437438

438439
const review_data = await (async (): Promise<ReviewData | null> => {
440+
if (args?.files_with_content) {
441+
const result = await handle_restore_review(args.files_with_content)
442+
if (result.success && result.original_states) {
443+
update_undo_button_state(
444+
result.original_states,
445+
chat_response,
446+
args?.original_editor_state
447+
)
448+
return {
449+
original_states: result.original_states,
450+
chat_response
451+
}
452+
}
453+
return null
454+
}
455+
439456
const is_single_root_folder_workspace =
440457
vscode.workspace.workspaceFolders?.length == 1
441458

@@ -444,16 +461,6 @@ export const apply_chat_response_command = (
444461
is_single_root_folder_workspace
445462
})
446463

447-
if (args?.files_with_content) {
448-
clipboard_content = {
449-
type: 'files',
450-
files: args.files_with_content as ClipboardFile[]
451-
}
452-
}
453-
454-
console.log('xxx', args?.files_with_content)
455-
console.log('xxx', clipboard_content)
456-
457464
if (
458465
clipboard_content.type == 'code-completion' &&
459466
clipboard_content.code_completion
@@ -669,7 +676,7 @@ export const apply_chat_response_command = (
669676
chat_response: failed_patches_as_code_blocks,
670677
context: context,
671678
is_single_root_folder_workspace,
672-
view_provider
679+
panel_provider
673680
}
674681
)
675682

@@ -793,7 +800,7 @@ export const apply_chat_response_command = (
793800
chat_response: fake_chat_response,
794801
context: context,
795802
is_single_root_folder_workspace,
796-
view_provider
803+
panel_provider
797804
})
798805

799806
if (intelligent_update_states) {
@@ -907,7 +914,7 @@ export const apply_chat_response_command = (
907914
chat_response,
908915
context: context,
909916
is_single_root_folder_workspace,
910-
view_provider
917+
panel_provider
911918
})
912919

913920
if (final_original_states) {
@@ -1024,7 +1031,7 @@ export const apply_chat_response_command = (
10241031
})
10251032
}
10261033

1027-
view_provider.send_message({
1034+
panel_provider.send_message({
10281035
command: 'NEW_RESPONSE_RECEIVED',
10291036
response: review_data.chat_response,
10301037
raw_instructions: args?.raw_instructions,
@@ -1037,7 +1044,7 @@ export const apply_chat_response_command = (
10371044
const changes_accepted = await handle_code_review_and_cleanup({
10381045
original_states: review_data.original_states,
10391046
chat_response: review_data.chat_response,
1040-
view_provider,
1047+
panel_provider,
10411048
update_undo_button_state,
10421049
original_editor_state: args?.original_editor_state,
10431050
raw_instructions: args?.raw_instructions

‎packages/vscode/src/commands/apply-chat-response-command/handlers/intelligent-update-handler.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Logger } from '@shared/utils/logger'
88
import { OriginalFileState } from '@/commands/apply-chat-response-command/types/original-file-state'
99
import { ToolConfig } from '@/services/model-providers-manager'
1010
import { create_file_if_needed } from '../utils/file-operations'
11-
import { ViewProvider } from '@/views/panel/backend/panel-provider'
11+
import { PanelProvider } from '@/views/panel/backend/panel-provider'
1212
import { dictionary } from '@shared/constants/dictionary'
1313
import { process_file } from '@/utils/intelligent-update-utils'
1414
import { FileProgress } from '@/views/panel/types/messages'
@@ -20,7 +20,7 @@ export const handle_intelligent_update = async (params: {
2020
chat_response: string
2121
context: vscode.ExtensionContext
2222
is_single_root_folder_workspace: boolean
23-
view_provider?: ViewProvider
23+
panel_provider?: PanelProvider
2424
}): Promise<OriginalFileState[] | null> => {
2525
const workspace_map = new Map<string, string>()
2626
if (vscode.workspace.workspaceFolders) {
@@ -144,8 +144,8 @@ export const handle_intelligent_update = async (params: {
144144
}))
145145

146146
const update_progress = () => {
147-
if (params.view_provider) {
148-
params.view_provider.send_message({
147+
if (params.panel_provider) {
148+
params.panel_provider.send_message({
149149
command: 'SHOW_PROGRESS',
150150
title: progress_title,
151151
files: [...file_progress_list]
@@ -164,12 +164,12 @@ export const handle_intelligent_update = async (params: {
164164
let api_calls_succeeded = false
165165
const max_concurrency = params.config.max_concurrency ?? 10
166166
const cancel_token_source = axios.CancelToken.source()
167-
if (params.view_provider) {
168-
params.view_provider.api_call_cancel_token_source = cancel_token_source
167+
if (params.panel_provider) {
168+
params.panel_provider.api_call_cancel_token_source = cancel_token_source
169169
}
170170

171171
try {
172-
if (params.view_provider) {
172+
if (params.panel_provider) {
173173
update_progress()
174174
}
175175

@@ -378,9 +378,9 @@ export const handle_intelligent_update = async (params: {
378378
)
379379
}
380380
} finally {
381-
if (params.view_provider) {
382-
params.view_provider.send_message({ command: 'HIDE_PROGRESS' })
383-
params.view_provider.api_call_cancel_token_source = null
381+
if (params.panel_provider) {
382+
params.panel_provider.send_message({ command: 'HIDE_PROGRESS' })
383+
params.panel_provider.api_call_cancel_token_source = null
384384
}
385385
}
386386

0 commit comments

Comments
 (0)