Skip to content

Commit d8db948

Browse files
committed
Merge branch 'dev'
2 parents 1266112 + 21e836c commit d8db948

19 files changed

Lines changed: 274 additions & 138 deletions

File tree

‎README.md‎

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@
22

33
<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>
44

5-
Unlimited AI coding in free chatbots for VS Code, Cursor and Windsurf.
5+
Unlimited AI coding in free chatbots for VS Code, Cursor and Windsurf. The best privacy, accuracy and speed.
66

7-
CWC is community driven. Join our [discord server](https://discord.gg/KJySXsrSX5) and get involved!
7+
Free and open-source. Join our [discord server](https://discord.gg/KJySXsrSX5) and get involed!
88

9-
🌐 **Initializes web chats**—ChatGPT, Claude, Gemini, AI Studio, DeepSeek, and more \
10-
🪄 **Applies responses**—multi-file changes integration with easy rollback \
11-
🔋 **Batteries included**—code completions, commit messages, and more \
12-
🧑‍💻 **Non-agentic approach**—zero endless and costly tool calling \
13-
❤️ **Free and open-source**—released under the GPL-3.0 license
9+
✅ **Initializes chatbots**—ChatGPT, Claude, Gemini, AI Studio, and 10+ more \
10+
✅ **Applies responses**—multi-file changes integration with easy rollback \
11+
✅ **Batteries included**—code completions, commit messages, and more
1412

1513
<p>
1614
<img src="https://github.com/robertpiosik/CodeWebChat/raw/HEAD/packages/shared/src/media/demo.gif" alt="Walkthrough" />
1715
</p>
1816

19-
**Guiding principles**
17+
## Introduction
2018

21-
- Respect chatbot's TOS
22-
- Respect user privacy
23-
- Operate 100% locally
24-
- Stay free forever
19+
🤔 **Is this legal?**
2520

26-
**Motivation behind non-agentic design**
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.
2722

28-
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 an accepted answer from a StackOverflow question. For the purpose of agentic coding, models are trained on an additional layer of data that simulates gathering context and planning next steps.
23+
> [!NOTE]
24+
> 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.
25+
26+
🤓 **Control over "agency"**
2927

30-
Because the model is only as smart as examples it has seen in its pre-training, the possible coverage of real-world coding scenarios when approached at a high level is fundamentally limited.
28+
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.
29+
30+
Because the model is only as smart as examples it has seen in its pre-training stage, the possible coverage of real-world scenarios when approached at a high level is fundamentally limited.
3131

3232
Therefore, CWC is designed to align with LLMs' true capabilities—that is, code generation in a controlled signal-to-noise ratio environment. Controlled by you, the engineer.
3333

34-
**The workflow**
34+
🤝 **Meet non-agentic workflow**
3535

36-
Select folders and files for context, enter prompt, pick edit format and send message via...
36+
Select folders and files for context, enter instructions, and send message via...
3737

3838
- new chat—to continue in the connected browser
3939
- API call—to use a model provider of choice
@@ -61,7 +61,7 @@ Whenever proposing a new or updated file use the Markdown Code Block syntax. Eac
6161
> [!NOTE]
6262
> The prompt and edit format instructions are repeated after the context [for better accuracy](https://cookbook.openai.com/examples/gpt4-1_prompting_guide#:~:text=If%20you%20have%20long%20context%20in%20your%20prompt%2C%20ideally%20place%20your%20instructions%20at%20both%20the%20beginning%20and%20end%20of%20the%20provided%20context%2C%20as%20we%20found%20this%20to%20perform%20better%20than%20only%20above%20or%20below.).
6363
64-
Once the response is generated, a built-in parser extracts code blocks with suggested edits for one-click multi-file changes integration.
64+
Once the response is generated, CWC's built-in parser extracts code blocks with suggested edits for one-click multi-file changes integration.
6565

6666
## Chatbot initialization
6767

@@ -83,6 +83,7 @@ Install the [open-source](https://github.com/robertpiosik/CodeWebChat/blob/dev/p
8383
- Grok
8484
- HuggingChat
8585
- Kimi
86+
- Minimax
8687
- Mistral
8788
- Open WebUI
8889
- OpenRouter
@@ -98,9 +99,6 @@ Install the [open-source](https://github.com/robertpiosik/CodeWebChat/blob/dev/p
9899
> [!TIP]
99100
> With the browser extension you can include markdown-parsed websites in context! Go to target website, click the extension's icon in the browser's toolbar and click _Enable for context_. The website will appear in the context panel immediately, ready for selection like any other folder or file in the workspace.
100101
101-
> [!IMPORTANT]
102-
> Legal disclaimer: The placed _Apply response_ button is not a means of automatic output extraction, it's an alias for the original _copy to clipboard_ button. The extension's sole purpose of chat initialization is complete once the first message is submitted.
103-
104102
## API Tools
105103

106104
Anything CWC can do in chatbots, it can do calling model providers directly from the editor.

‎packages/browser/src/content-scripts/send-prompt-content-script/chatbots/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from './gemini'
77
export * from './grok'
88
export * from './github-copilot'
99
export * from './hugging-chat'
10+
export * from './minimax'
1011
export * from './meta'
1112
export * from './mistral'
1213
export * from './open-webui'
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { Chatbot } from '../types/chatbot'
2+
import {
3+
add_apply_response_button,
4+
observe_for_responses
5+
} from '../utils/add-apply-response-button'
6+
import {
7+
InitializationError,
8+
report_initialization_error
9+
} from '../utils/report-initialization-error'
10+
11+
export const minimax: Chatbot = {
12+
wait_until_ready: async () => {
13+
await new Promise((resolve) => {
14+
const check_for_element = () => {
15+
if (document.querySelector('textarea')) {
16+
resolve(null)
17+
} else {
18+
setTimeout(check_for_element, 100)
19+
}
20+
}
21+
check_for_element()
22+
})
23+
},
24+
inject_apply_response_button: (
25+
client_id: number,
26+
raw_instructions?: string,
27+
edit_format?: string
28+
) => {
29+
const add_buttons = (footer: Element) => {
30+
add_apply_response_button({
31+
client_id,
32+
raw_instructions,
33+
edit_format,
34+
footer,
35+
get_chat_turn: (f) =>
36+
f.parentElement!.parentElement!.querySelector('.message'),
37+
perform_copy: (f) => {
38+
const copy_button = f.querySelector('div:first-child') as HTMLElement
39+
if (!copy_button) {
40+
report_initialization_error({
41+
function_name: 'minimax.perform_copy',
42+
log_message: 'Copy button not found',
43+
alert_message: InitializationError.UNABLE_TO_COPY_RESPONSE
44+
})
45+
return
46+
}
47+
copy_button.click()
48+
},
49+
insert_button: (f, b) =>
50+
f.insertBefore(b, f.children[f.children.length])
51+
})
52+
}
53+
54+
observe_for_responses({
55+
chatbot_name: 'Minimax',
56+
is_generating: () =>
57+
!!document.querySelector(
58+
'path[d="M0 3C0 1.34315 1.34315 0 3 0H9C10.6569 0 12 1.34315 12 3V9C12 10.6569 10.6569 12 9 12H3C1.34315 12 0 10.6569 0 9V3Z"]'
59+
) ||
60+
!document.querySelector(
61+
'.message.received + div > div > div:last-child'
62+
),
63+
footer_selector: '.message.received + div > div',
64+
add_buttons
65+
})
66+
}
67+
}

‎packages/browser/src/content-scripts/send-prompt-content-script/chatbots/z-ai.ts‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,7 @@ export const z_ai: Chatbot = {
5555
raw_instructions,
5656
edit_format,
5757
footer,
58-
get_chat_turn: (f) => {
59-
const chat_turn = f.parentElement?.querySelector('.chat-assistant')
60-
if (!chat_turn) {
61-
report_initialization_error({
62-
function_name: 'z_ai.get_chat_turn',
63-
log_message: 'Chat turn container not found for footer',
64-
alert_message: InitializationError.UNABLE_TO_COPY_RESPONSE
65-
})
66-
return null
67-
}
68-
return chat_turn as HTMLElement
69-
},
58+
get_chat_turn: (f) => f.parentElement!.querySelector('.chat-assistant'),
7059
get_code_from_block: (b) => b.querySelector('.cm-line')?.textContent,
7160
perform_copy: (f) => {
7261
const copy_button = f.querySelector('button.copy-response-button')

‎packages/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
together,
2222
github_copilot,
2323
hugging_chat,
24+
minimax,
2425
perplexity,
2526
z_ai
2627
} from './chatbots'
@@ -70,6 +71,9 @@ const is_yuanbao = current_url.startsWith(yuanbao_url)
7071
const hugging_chat_url = 'https://huggingface.co/chat/'
7172
const is_hugging_chat = current_url.startsWith(hugging_chat_url)
7273

74+
const minimax_url = 'https://agent.minimax.io/'
75+
const is_minimax = current_url.startsWith(minimax_url)
76+
7377
const meta_url = 'https://www.meta.ai/'
7478
const is_meta = current_url.startsWith(meta_url)
7579

@@ -109,6 +113,8 @@ if (is_ai_studio) {
109113
chatbot = claude
110114
} else if (is_hugging_chat) {
111115
chatbot = hugging_chat
116+
} else if (is_minimax) {
117+
chatbot = minimax
112118
} else if (is_mistral) {
113119
chatbot = mistral
114120
} else if (is_open_webui) {
@@ -152,7 +158,8 @@ export const get_textarea_element = () => {
152158
[together_url]: 'textarea',
153159
[z_ai_url]: 'textarea',
154160
[github_copilot_url]: 'textarea',
155-
[hugging_chat_url]: 'textarea'
161+
[hugging_chat_url]: 'textarea',
162+
[minimax_url]: 'textarea'
156163
} as any
157164

158165
// Find the appropriate selector based on the URL without the hash

‎packages/browser/src/content-scripts/send-prompt-content-script/utils/add-apply-response-button.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function add_apply_response_button(params: {
3030
if (!chat_turn) {
3131
Logger.error({
3232
function_name: 'add_apply_response_button',
33-
message: 'Chat turn container not found for footer',
33+
message: 'Chat turn container not found',
3434
data: params.footer
3535
})
3636
return

‎packages/browser/src/manifest.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"https://grok.com/",
3737
"https://huggingface.co/chat/",
3838
"https://www.kimi.com/",
39+
"https://agent.minimax.io/",
3940
"https://chat.mistral.ai/chat",
4041
"http://openwebui/",
4142
"https://openrouter.ai/chat*",

‎packages/shared/src/constants/chatbots.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,20 @@ export const CHATBOTS = {
239239
default_top_p: 0,
240240
models: {}
241241
},
242+
Minimax: {
243+
url: 'https://agent.minimax.io/',
244+
supports_custom_temperature: false,
245+
supports_custom_top_p: false,
246+
supports_system_instructions: false,
247+
supports_user_provided_model: false,
248+
supports_user_provided_port: false,
249+
supports_reasoning_effort: false,
250+
supports_thinking_budget: false,
251+
default_system_instructions: '',
252+
supported_options: {},
253+
default_top_p: 0,
254+
models: {}
255+
},
242256
Mistral: {
243257
url: 'https://chat.mistral.ai/chat',
244258
supports_custom_temperature: false,

‎packages/shared/src/constants/dictionary.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ export const dictionary = {
4848
'Another response review is currently ongoing. Would you like to switch to the new one?',
4949
SKIPPING_INVALID_PATH: (file_path: string) =>
5050
`Skipping applying change to invalid path: ${file_path}`,
51-
NO_VALID_CODE_BLOCKS_IN_CLIPBOARD:
52-
'Unable to find valid code blocks in the clipboard.',
5351
CODE_COMPLETIONS_NO_SELECTION:
5452
'Code completions are not supported with active text selection.',
5553
CANNOT_REFERENCE_FILE_OUTSIDE_WORKSPACE:
Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)