Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bf9424b
chore(hidden features): add defaults to initail state.
MarcMcIntosh Jan 16, 2025
ec56c23
feat(knowledge): add workspace to initial state and event handler for…
MarcMcIntosh Jan 24, 2025
3f16623
chore(hcat-js): bump to `v2.0.6-alpha.0` for knowledge.
MarcMcIntosh Feb 11, 2025
21ac310
chore(chat): version "~v2.0.6-alpha.1, type export fixes
MarcMcIntosh Feb 11, 2025
2816d76
chore(new patches): remove code no longer used by chat
MarcMcIntosh Feb 13, 2025
0469153
feat: handle tool edit results from chat.
MarcMcIntosh Feb 14, 2025
d65357e
refactor(patch actions): remove `ideCreateNewFile.match(e)`.
MarcMcIntosh Feb 17, 2025
031b799
fix(chat): thread type update.
MarcMcIntosh Feb 17, 2025
420bf42
chore: bump chat to `v2.0.8-alpha.2` for new patch actions.
MarcMcIntosh Feb 18, 2025
2c86d62
Version bump 190225 (#189)
alashchev17 Feb 19, 2025
47cdac8
chore: version bump 6.1.5
alashchev17 Feb 24, 2025
ac34e1a
Apply accept reject (#191)
MarcMcIntosh Feb 26, 2025
0fdc6b7
6.1.6
alashchev17 Feb 26, 2025
80869a7
6.1.7
olegklimov Feb 27, 2025
e571705
6.1.8
olegklimov Feb 27, 2025
5cf222d
6.1.9
reymondzzzz Feb 27, 2025
991a54b
fix gh release flow
reymondzzzz Feb 27, 2025
43ed0dc
cicd: use refact repo chat artifacts instead npm
reymondzzzz Feb 28, 2025
9be1e64
6.1.10
olegklimov Feb 28, 2025
915a67a
6.1.11
olegklimov Feb 28, 2025
1d94514
6.1.12
alashchev17 Feb 28, 2025
0154c5c
6.1.13
alashchev17 Feb 28, 2025
77a2f86
6.1.13
alashchev17 Feb 28, 2025
5579a99
Merge branch 'dev' of https://github.com/smallcloudai/refact-vscode i…
alashchev17 Feb 28, 2025
38e6d9a
6.1.14
olegklimov Mar 3, 2025
e4837e4
6.1.15
olegklimov Mar 4, 2025
69b7d10
Merge branch 'dev' of https://github.com/smallcloudai/refact-vscode i…
alashchev17 Mar 4, 2025
6849a3d
Version bump/6.1.16 (#197)
alashchev17 Mar 4, 2025
816db19
Merge branch 'dev' of https://github.com/smallcloudai/refact-vscode i…
alashchev17 Mar 4, 2025
b35a055
6.1.17
olegklimov Mar 5, 2025
0bcb8d3
6.1.18
olegklimov Mar 5, 2025
600f7ea
6.1.19
olegklimov Mar 5, 2025
a5b6cb9
6.1.20
olegklimov Mar 6, 2025
b2f31b4
feat: keep indent for selected snippet.
MarcMcIntosh Mar 7, 2025
ea0f847
chore: remove console.log.
MarcMcIntosh Mar 7, 2025
ab71da7
remove knowledge flag.
MarcMcIntosh Mar 7, 2025
14fefa8
6.2.1
reymondzzzz Mar 12, 2025
ed5e3ef
Merge branch 'dev' of https://github.com/smallcloudai/refact-vscode i…
alashchev17 Mar 12, 2025
328989a
chore: added logs for file openings
alashchev17 Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
lsp_branch:
description: "Branch name of lsp"
default: "main"
chat_js_branch:
description: "Branch name of chat-js"
default: "main"

jobs:
dist:
Expand Down Expand Up @@ -57,23 +60,44 @@ jobs:
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Download artifact
id: download-artifact
- name: Download lsp artifacts
id: download-artifact-lsp
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build.yml
repo: smallcloudai/refact-lsp
workflow: agent_engine_build.yml
repo: smallcloudai/refact
branch: ${{ inputs.lsp_branch }}
path: ./assets
name: dist-${{ matrix.target }}

- name: Download chat artifacts
id: download-artifact-chat
uses: dawidd6/action-download-artifact@v9
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: agent_gui_build.yml
repo: smallcloudai/refact
branch: ${{ inputs.chat_js_branch }}
path: ./chat_package
name: lts-refact-chat-js-.*\.tgz
name_is_regexp: true

- name: Prepare chat package
shell: bash
run: |
mkdir -p ./chat_package_fixed
find ./chat_package -name "*.tgz" -type f -exec cp {} ./chat_package_fixed/ \;
ls -la ./chat_package_fixed

- name: Install VSCE
shell: bash
run: |
npm install
npm install ./chat_package_fixed/*.tgz
npm install -g @vscode/vsce
rm -rf ./chat_package ./chat_package_fixed

- name: Pakckage VSCE extension
- name: Package VSCE extension
run: |
chmod +x ./assets/refact-lsp*
vsce package --target ${{ matrix.code-target }}
Expand Down
43 changes: 34 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
lsp_branch:
description: "Branch name of lsp"
default: "main"
chat_js_branch:
description: "Branch name of chat-js"
default: "main"
stable_release:
description: "Publish stable release version"
default: false
Expand Down Expand Up @@ -56,21 +59,42 @@ jobs:
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Install VSCE
run: |
npm install
npm install -g @vscode/vsce

- name: Download artifact
id: download-artifact
- name: Download lsp artifacts
id: download-artifact-lsp
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build.yml
repo: smallcloudai/refact-lsp
workflow: agent_engine_build.yml
repo: smallcloudai/refact
branch: ${{ inputs.lsp_branch }}
path: ./assets
name: dist-${{ matrix.target }}

- name: Download chat artifacts
id: download-artifact-chat
uses: dawidd6/action-download-artifact@v9
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: agent_gui_build.yml
repo: smallcloudai/refact
branch: ${{ inputs.chat_js_branch }}
path: ./chat_package
name: lts-refact-chat-js-.*\.tgz
name_is_regexp: true

- name: Prepare chat package
shell: bash
run: |
mkdir -p ./chat_package_fixed
find ./chat_package -name "*.tgz" -type f -exec cp {} ./chat_package_fixed/ \;
ls -la ./chat_package_fixed

- name: Install VSCE
shell: bash
run: |
npm install ./chat_package_fixed/*.tgz
npm install -g @vscode/vsce
rm -rf ./chat_package ./chat_package_fixed

- name: Package VSCE extension
shell: bash
Expand All @@ -97,6 +121,7 @@ jobs:
prerelease: ${{ !inputs.stable_release }}
tag: v${{ steps.get_version.outputs.version }} # Use the version from previous step with 'v' prefix
overwrite: true
target_commit: ${{ github.sha }}
file_glob: true

- name: Publish VSCE extension
Expand Down
122 changes: 83 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,91 @@
[![Twitter Follow](https://img.shields.io/twitter/follow/refact_ai)](https://twitter.com/intent/follow?screen_name=refact_ai)
![License](https://img.shields.io/github/license/smallcloudai/refact-vscode)

## Refact.ai Open Source, Customizable AI Coding Assistant
Refact.ai is an open-source AI coding assistant that boosts developer's productivity. It's suitable for both individual and enterprise use, supporting 25+ programming languages including Python, Javascript, Java, Rust, Typescript, PHP, Java, C++, C#, Go and more.

Download the extension for VS Code from [here](https://marketplace.visualstudio.com/items?itemName=smallcloud.codify).

Simplify your coding experience with Refact.ai's functions:

- **Code-completion:** helps you write code faster. It looks up and down from the cursor position in the current file, as well as other files in your project for context. After fine-tuning (available in Self-Hosting and Enterprise versions) a code completion model will provide you with more relevant suggestions: it can memorize your coding style, the right way to use your internal APIs, and the tech stack you use.
- **AI Toolbox:** helps explain, refactor your code, write documentation, find bugs, you can ask in natural language to generate new code for you. The Toolbox is customizable, you can create your own commands.
- **Integrated in-IDE Chat:** It's better than switching between IDE and a browser: select a piece of code in the editor, ask a question without the need to copy-paste anything, and apply changes back as a diff. Chat can either automatically include the relevant files within the project for context, or you can use @-commands to control what context to use to answer your question.
- **Self-hosting or cloud version:** enables you to host code completion and chat models yourself. The Refact.ai self-hosting server supports many recent models, offers efficient inference, and facilitates fine-tuning.

## Refact.ai For Enterprise
Are you part of an Enterprise and want to **boost developers' efficiency by 45%**? The Refact.ai Enterprise plan offers:
- **Knows Your Code:** Refact.ai focuses on automated customization for internal codebases and improving over time.
- **Ultimate Security:** Deploy Refact.ai on-premise: on your own servers or private cloud. Your data never leaves your control. Telemetry from the plugins goes to your server and nowhere else. You can verify what the code does, it's open source.
- **Fine-Tuning:** We've solved all the complexity for you, no data engineer required. A fine-tuned code completion model will provide you with more relevant suggestions: it can memorize your coding style, the right way to use your internal APIs, and the tech stack you use. After fine-tuning, auto-completion helps our clients to write around 45% of their code.
- **User Statistics:** Keep track of how much code Refact.ai helps to write for each team member. Measure productivity gains with real numbers.
- **Efficient Inference:** The Enterprise version supports paged attention and continuous batching, supporting up to 50 engineers per GPU for code completion.
## Refact.ai - Your Customizable Open-Source AI Software Engineering Agent

Refact.ai is a free, **open-source** AI Agent that handles engineering tasks end-to-end. It deeply understands your codebases and integrates with your tools, databases, and browsers to automate complex, multi-step tasks.

- Integrate AI Agent with the tools you already use, allowing it to complete tasks for you end-to-end.
- Deploy Refact.ai on-premise and maintain **100% control over your codebase**.
- Access State-of-the-Art Models (Claude 3.5 Sonnet, GPT-4o, o3-mini, etc.)
- Bring your own key (BYOK) - Use your own API keys for external LLMs.
- Stop switching between your IDE and chat—Refact.ai has an integrated chat right in your IDE.
- Get free, unlimited, context-aware auto-completion.

Suitable for both individual and enterprise use, supporting 25+ programming languages, including Python, JavaScript, Java, Rust, TypeScript, PHP, C++, C#, Go, and more.

We can't say it better than our users: *'Refact.ai understands me better than my human coworkers. It's like working in perfect sync with an ideal partner.'*

## How does Refact.ai Agent empower developers?

- **Unlimited accurate auto-completion with context awareness for free** - Powered by Qwen2.5-Coder-1.5B, Refact.ai uses Retrieval-Augmented Generation (RAG) to provide precise, context-aware code suggestions. By retrieving relevant snippets and project-specific insights, it ensures completions that align with your coding style and architecture.![auto-completion](https://github.com/user-attachments/assets/0ffab638-c807-4863-8d62-a663b1459805)
- **Integrated in-IDE Chat** - By deeply understanding your codebases, Refact.ai provides relevant, intelligent answers to your questions—right inside your development environment.![refactor](https://github.com/user-attachments/assets/e7b2e779-85c5-46a0-99ad-ea909a69ddc7)
- **Integrated with the tools** - Refact.ai goes beyond codebases, connecting with GitHub, GitLab, databases (PostgreSQL, MySQL), Pdb, Docker, and any shell command, so AI Agent can autonomously complete tasks—from code generation to deployment.![integrations](https://github.com/user-attachments/assets/daf8d0ee-0a54-4aa8-82e5-f968fded0c7a)
- **State-of-the-Art Models** - Refact.ai supports **Claude 3.5 Sonnet, GPT-4o, and o3-mini**, allowing you to choose the best model for each task based on its complexity.
- **Bring your own key (BYOK)** - Use your own API keys for external LLMs, ensuring flexibility and control over your AI infrastructure.![BYOK](https://github.com/user-attachments/assets/44e416f7-fb4d-4846-a1e0-1b7da32c2c75)
- **Upload images**: Click the image button to add visual context to your chat.
- **Use @-commands** to control what context to use to answer your question:
- **@web** - define a webpage.
- **@file** - upload and attach a single file.
- **@definition** - find and attach a definition.
- **@references** - locate all references and attach them.
- **@tree** - display the workspace directory and files tree.
- Create your own **custom system prompt** for a more personalized workflow.![@-commands](https://github.com/user-attachments/assets/28e1db76-3490-4195-a3e0-de30496239a9)

## Refact.ai Agent For Enterprise
Deploying Refact.ai Agent is like adding a 24/7 engineer to your team—one that instantly understands your codebase, adapts to your workflows, accelerates development from day one, and becomes a shared knowledge base for your entire team.

1. **Refact.ai already understands your company's context:** AI Agent captures the unique structure, tools, and workflows of your organization, using your company's databases, documentation, and code architecture to deliver customized solutions.
2. **Gets smarter over time:** With each interaction and feedback, Refact.ai Agent adapts to your organization's needs, becoming more accurate and powerful.
3. **Organizes experience into the knowledge base:** Refact.ai Agent captures and shares knowledge from interactions with each team member. It not only streamlines workflows but also supports faster onboarding and smoother cross-functional collaboration across projects.

### Take full control of your AI Agent, tailored to your company:
- **Deploy Refact.ai on-premise:** on your own servers or private cloud. Your data never leaves your control. Telemetry from the plugins goes to your server and nowhere else. You can verify what the code does, it's open source.
- **Fine-tune a model on your codebase:** A fine-tuned code completion model will provide you with more relevant suggestions: it can memorize your coding style, the right way to use your internal APIs, and the tech stack you use.
- **Priority Support:** Our engineers are always available to assist you at every stage, from setup to fine-tuning and beyond.
- **Access to 20+ LLMs:** (including Refact/1.6B, GPT-4, Code Llama, StarCoder2, Mistral, Mixtral, etc.) some of them with the opportunity to fine-tune.

**To get a 2-Week free trial** for your team, just fill out the form on [our website](https://refact.ai/enterprise/?utm_source=vscode&utm_medium=marketplace&utm_campaign=enterprise). We'll reach out with more details!

## Check Out How Easy Refact.ai Is to Use

### Boost coding productivity with fine-tuned auto-completions
![Comp_brand](https://github.com/smallcloudai/refact-vscode/assets/15157041/59bd60e2-4680-4bf5-87c5-6f57dc96cef7)


### Get the answer to your question in the embedded Chat
![Chat_brand](https://github.com/smallcloudai/refact-vscode/assets/15157041/7e10a353-bb6f-4c79-b65e-c01a7ab6aece)

### Just highlight part of the code and ask Toolbox to explain it
![Explain_brand](https://github.com/smallcloudai/refact-vscode/assets/15157041/a5f8519f-284f-43c7-9cce-163dbac86ef7)

### Ask Toolbox to shorten your code
![Shorter_brand](https://github.com/smallcloudai/refact-vscode/assets/15157041/d3724ac7-076c-43d6-a300-2617952ebc8e)
**To get a 2-week free trial** for your team, just fill out the form on [our website](https://refact.ai/contact/?utm_source=vscode&utm_medium=marketplace&utm_campaign=enterprise). We'll reach out with more details!
\
 
\
 
## Which tasks can Refact.ai help me with?

- **Generate code from natural language prompts (even if you make typos)** - Instantly turn ideas into functional code, accelerating development and eliminating the blank-screen problem.
\
 
![gen](https://github.com/user-attachments/assets/ef4acec7-4967-400a-900e-9d3382d05b1b)
\
 
- **Refactor code** - Improve code quality, readability, and efficiency with automated refactoring that aligns with best practices.
\
 
![refactor](https://github.com/user-attachments/assets/2cae4467-f363-4033-8ecf-2854dcc74aaa)
\
 
- **Explain code** - Quickly understand complex or unfamiliar code with AI-generated explanations, making collaboration and onboarding faster.
\
 
![explain](https://github.com/user-attachments/assets/bd43d9aa-15c9-49dc-9fa9-b5ab5c4ecdfe)
\
 
- **Debug code** - Detect and fix errors faster with intelligent debugging, reducing time spent troubleshooting issues.
\
 
![ddbg](https://github.com/user-attachments/assets/45e917b5-f47b-4b84-b1f4-f4918c8a00c7)
\
 
- **Generate unit tests** - Ensure code reliability by automatically creating comprehensive unit tests.
\
 
![unit](https://github.com/user-attachments/assets/5168ee57-e35b-4484-bf19-70cc0f3a6299)
\
 

- **Code Review** - Get AI-assisted code reviews for cleaner, more secure, and more efficient code, addressing developers' top concern: accuracy.
- **Create Documentation** - Automate documentation generation to keep knowledge accessible and up to date.
- **Generate Docstrings** - Enhance maintainability with clear, structured documentation generated for functions and classes in seconds.

## Join Our Discord Community

Connect with other developers who care about AI tools in our [**Discord community**](https://www.smallcloud.ai/discord). Ask questions, share your opinion, propose new features.

Implement a feature you want, and contribute to the future of programming!
Connect with other developers in our [Discord community](https://www.smallcloud.ai/discord). Ask questions, share your opinion, propose new features.
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codify",
"displayName": "Refact",
"description": "Refact AI Assistant for Code Writing and Refactoring",
"displayName": "Refact – Open-Source AI Agent, Code Generator & Chat for JavaScript, Python, TypeScript, Java, PHP, Go, and more.",
"description": "Refact.ai is a free, open-source AI Agent that adapts to your workflow. It tracks your cursor to provide instant assistance, connects with tools, databases and browsers, works with debuggers, and runs shell commands. As your AI copilot, it handles code generation, testing, review, and refactoring.",
"publisher": "smallcloud",
"icon": "logo-small.png",
"galleryBanner": {
Expand All @@ -18,7 +18,7 @@
"url": "https://github.com/smallcloudai/refact-vscode/issues",
"email": "[email protected]"
},
"version": "6.1.0",
"version": "6.2.1",
"dependencies": {
"@types/marked": "^4.0.8",
"@types/vscode": "^1.69.0",
Expand All @@ -27,7 +27,7 @@
"fetch-h2": "^3.0.2",
"json5": "^2.2.3",
"marked": "^4.0.8",
"refact-chat-js": "~v2.0.5",
"refact-chat-js": "^2.0.10-alpha.2",
"uuid": "^9.0.1",
"vscode-languageclient": "^7.0.0"
},
Expand Down Expand Up @@ -57,7 +57,9 @@
"Machine Learning",
"Education",
"Testing",
"Data Science"
"Data Science",
"AI",
"Chat"
],
"keywords": [
"refact",
Expand Down Expand Up @@ -95,14 +97,12 @@
"react",
"swift",
"objective-c",
"objectivec",
"ai",
"method completion",
"intellicode",
"intellisense",
"snippets",
"kite",
"nodejs",
"node",
"node.js",
"jupyter",
Expand All @@ -114,7 +114,9 @@
"llm",
"test",
"security",
"coding"
"coding",
"copilot",
"cursor"
],
"activationEvents": [
"onStartupFinished"
Expand Down
1 change: 1 addition & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async function pressed_escape()
}
if (editor) {
let state = estate.state_of_editor(editor, "pressed_escape");
global.side_panel?.toolEditChange(editor.document.uri.fsPath, false);
if (state) {
state.diff_lens_pos = Number.MAX_SAFE_INTEGER;
state.completion_lens_pos = Number.MAX_SAFE_INTEGER;
Expand Down
2 changes: 2 additions & 0 deletions src/interactiveDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ export async function like_and_accept(editor: vscode.TextEditor)
// dataCollection.data_feedback_candidate_reset(state);
});
await thenable;
global.side_panel?.toolEditChange(editor.document.uri.fsPath, true);
await editor.document.save();
}


Expand Down
Loading
Loading