Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Shared chat lib #85

Merged
merged 169 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
0550656
wip: add chat events to chat tab
MarcMcIntosh Jan 10, 2024
163a1ac
wip(shared chat library): host the docker chat in vscode
MarcMcIntosh Jan 17, 2024
04cb914
wip: add handlers for shared chat events
MarcMcIntosh Jan 22, 2024
766dbbb
feat: open chat from toolbar
MarcMcIntosh Jan 23, 2024
478f729
feat: use imported types from linked refact-chat-js library
MarcMcIntosh Jan 24, 2024
1f847ec
refactor(chat): remove uncalled javascript code
MarcMcIntosh Jan 24, 2024
f1af291
fix: small bug when a file is already attached in a message
MarcMcIntosh Jan 25, 2024
590e2c3
fix: ensure line1 and line2 are provided when attaching a file
MarcMcIntosh Jan 25, 2024
b2239fd
install refact-chat-js 🎉
MarcMcIntosh Jan 25, 2024
afc7dca
ui: start themeing the chat
MarcMcIntosh Jan 25, 2024
49d5b40
ui(chat): use vscode's css variables for panel and input backgrounds
MarcMcIntosh Jan 26, 2024
01a579c
ui(chat): use diffrent background colors for chat when tabbed or in t…
MarcMcIntosh Jan 26, 2024
0632cc8
ui(chat): change user chat box background when tabbed
MarcMcIntosh Jan 26, 2024
0d6f03c
Moving towards Luke's command (1)
olegklimov Jan 29, 2024
8ca00ae
fix(chat): send selected code snippet to chat
MarcMcIntosh Feb 12, 2024
f654254
Merge branch 'v1.2' into shared-chat-lib
MarcMcIntosh Feb 13, 2024
f95a2e5
fix: syntax error in chat tab
MarcMcIntosh Feb 13, 2024
04d612f
feat(at commands): add at commands in chat
MarcMcIntosh Feb 19, 2024
bf7f03c
fix(chat): dedupe user messages
MarcMcIntosh Feb 19, 2024
1c1a2af
fix(chat): sent wrong type for dedupe message
MarcMcIntosh Feb 20, 2024
2754355
refactor(chat): remove last user message only if the response contain…
MarcMcIntosh Feb 20, 2024
56a4329
fix(chat): add missing import for isUserMessage
MarcMcIntosh Feb 20, 2024
02cce90
update(command completion): handle the trigger or the full query when…
MarcMcIntosh Feb 20, 2024
23b8ed0
refactor(command completion): update payload type definition
MarcMcIntosh Feb 20, 2024
176b628
refactor(command completion): remove last user message before getting…
MarcMcIntosh Feb 21, 2024
a35366e
chat: allow the chat to decide when to remove user messages
MarcMcIntosh Feb 21, 2024
15c4ae6
fix(chat-tab): remove unused import
MarcMcIntosh Feb 22, 2024
f709bfa
config(chat): add esModuleInterop to tsconfig
MarcMcIntosh Feb 22, 2024
ef4d5aa
fix(command-preview): send empty previews to chat when there's no com…
MarcMcIntosh Feb 22, 2024
aa23a8d
ui(chat-tab): limit the length of the tab title
MarcMcIntosh Feb 23, 2024
e26aeec
chat: reuse previously used model
MarcMcIntosh Feb 23, 2024
8ba6c63
fix(tab title): truncate title length
MarcMcIntosh Feb 23, 2024
eb6bc79
fix(toolbox): don't duplicate the snippet in the chat. and message wh…
MarcMcIntosh Feb 23, 2024
f055419
fix(chat): add selected text to user input when pressing "new chat", …
MarcMcIntosh Feb 23, 2024
b6f5660
fix: attach file label showing comments document name
MarcMcIntosh Feb 23, 2024
d3fd4f6
fix(chat events): sendFileToChat method is no longer needed
MarcMcIntosh Feb 26, 2024
6745121
feat(paste): let the user paste snippets form chat into the active do…
MarcMcIntosh Feb 26, 2024
abab54f
chat: send token count to chat
MarcMcIntosh Feb 27, 2024
fc5f0a2
connected statistic tab from refact-chat-js to show in sidebar
Vika28 Feb 14, 2024
8066373
formatted code, removed unused code
ViktoriiaNakoryk Feb 22, 2024
03985d3
added functionality for fetching data from endpoint
ViktoriiaNakoryk Feb 24, 2024
53676a4
fixed formatting and replaced nonce by uuid
ViktoriiaNakoryk Feb 25, 2024
460bf66
remove unneccesary code, add type for promise in statTab
ViktoriiaNakoryk Feb 27, 2024
7394f92
feat(debug-fim): add functoon to fetch the data from the lsp
MarcMcIntosh Feb 27, 2024
93e2cc4
wip(statistics fim): add handlers to request data from chat and send …
MarcMcIntosh Feb 27, 2024
6197d62
wip: fim statistics
MarcMcIntosh Feb 27, 2024
d282d8c
fix(fim): change file_name to file_uri
MarcMcIntosh Feb 27, 2024
49583ad
added functionality for fetching data from endpoint
ViktoriiaNakoryk Feb 24, 2024
c33d6bd
connected statistic tab from refact-chat-js to show in sidebar
Vika28 Feb 14, 2024
f1b618e
formatted code, removed unused code
ViktoriiaNakoryk Feb 22, 2024
1693baf
added functionality for fetching data from endpoint
ViktoriiaNakoryk Feb 24, 2024
8ad9bc7
fixed formatting and replaced nonce by uuid
ViktoriiaNakoryk Feb 25, 2024
ea74ba3
wip(statistics fim): add handlers to request data from chat and send …
MarcMcIntosh Feb 27, 2024
35e959a
wip: fim statistics
MarcMcIntosh Feb 27, 2024
2378433
fix(fim): change file_name to file_uri
MarcMcIntosh Feb 27, 2024
218f1e4
added functionality for fetching data from endpoint
ViktoriiaNakoryk Feb 24, 2024
79bd94a
replaced event name to statistic
ViktoriiaNakoryk Feb 28, 2024
77882c2
fix(shared-chat): duplicated code from rebase
MarcMcIntosh Feb 28, 2024
5ae237c
chore(shared-chat): update refact-chat-js to v0.0.1
MarcMcIntosh Feb 28, 2024
9df9c91
fix(shared chat): include @types/react and no-longer require themePro…
MarcMcIntosh Feb 28, 2024
99c31e3
chore: remove comment to re-run ci
MarcMcIntosh Feb 28, 2024
ea7ac7c
fix(dev dep): remove `@types/react` as it's nolonger imported in to `…
MarcMcIntosh Feb 28, 2024
e10cb15
refactor(JSX): add JSX name space so "skipLibCheck" can be removed
MarcMcIntosh Feb 28, 2024
b794e0b
2.0.125
reymondzzzz Feb 19, 2024
7323d59
2.0.126
reymondzzzz Feb 21, 2024
1e6bdf8
2.0.127
reymondzzzz Feb 22, 2024
83bdb6f
add default system prompt (#94)
mitya52 Feb 27, 2024
7458b6b
2.0.128
reymondzzzz Feb 27, 2024
ce70cf2
feat(toolbox): get the commands from the lsp
MarcMcIntosh Feb 29, 2024
afe9cec
feat(toolbox): add command to open customisation page
MarcMcIntosh Mar 1, 2024
73ebe0d
feat(toolbox): add item to settings page
MarcMcIntosh Mar 1, 2024
14ab05e
refactor(toolbox): put link to toolbox customisaiton in with default …
MarcMcIntosh Mar 1, 2024
29ce135
feat(toolbox): add link to customisation page to toolbox
MarcMcIntosh Mar 1, 2024
fc38b33
feat(toolbox): reload toolbox commands after saving the customisation…
MarcMcIntosh Mar 1, 2024
0ed44db
chore(toolbox): remove console.log statement
MarcMcIntosh Mar 1, 2024
940bd9d
fix(toolbox lsp commands): update replace tags in messages
MarcMcIntosh Mar 4, 2024
ae3b7d6
CURRENT_FILE_PATH_COLON_CURSOR
olegklimov Mar 5, 2024
a0f53aa
chat-controls: send information about the active snippet and file to …
MarcMcIntosh Mar 5, 2024
2a3fa08
ui(statistics button): add similar css properties to the button.
MarcMcIntosh Mar 6, 2024
7e74bb6
fim: don't request fim info, but receive it when a complete happens
MarcMcIntosh Mar 7, 2024
3ec00f0
feat(controls): pass the cursor position down
MarcMcIntosh Mar 7, 2024
d64f9a5
fix(toolbox): duplicated question and message when open chat form too…
MarcMcIntosh Mar 7, 2024
ba7b9f3
fix(paste): include can_paste in the active file data
MarcMcIntosh Mar 7, 2024
8c50a42
toolbox commands with args
olegklimov Mar 8, 2024
2614a31
chore(chat): version bump
MarcMcIntosh Mar 8, 2024
15cd8fb
completion max_tokens in settings
olegklimov Mar 8, 2024
44d0c4d
quickfix
olegklimov Mar 8, 2024
9f617e0
chore(chat): version bump to 0.0.6
MarcMcIntosh Mar 8, 2024
a9f0297
pre-release version 3.0.100
olegklimov Mar 8, 2024
59eb06a
chore(chat): bump chat version
MarcMcIntosh Mar 8, 2024
e266e33
icon color update + readme
oxyplay Mar 8, 2024
1e3594b
/help in toolbox
olegklimov Mar 10, 2024
db7bcd4
version 3.0.101
olegklimov Mar 10, 2024
73ed4a9
Refact.ai => Refact in README
olegklimov Mar 10, 2024
0b6e63f
selection needed, unwanted in toolbox
olegklimov Mar 11, 2024
3123c2f
102
olegklimov Mar 11, 2024
0944043
103
olegklimov Mar 11, 2024
de2b538
removed keywords back
olegklimov Mar 12, 2024
61ce3ca
104
olegklimov Mar 12, 2024
1be2a36
remove "Refact:"
olegklimov Mar 12, 2024
d2f9181
106
olegklimov Mar 12, 2024
253c562
107 keywords update
oxyplay Mar 12, 2024
fa6d226
text fix
oxyplay Mar 12, 2024
a2bbf3e
readme update
oxyplay Mar 12, 2024
2994732
utm link + logo update
oxyplay Mar 12, 2024
b15721a
wip(menu) : add chat + hot. key to menu, and fix an issue with the sh…
MarcMcIntosh Mar 1, 2024
b9a22d7
refactor(chat hot key): use recursion to wait for `sidebar._view` to …
MarcMcIntosh Mar 12, 2024
be83673
fix(chat hot-key): call `show` if `side_panel._view` exists but is no…
MarcMcIntosh Mar 12, 2024
fb753cc
feat(vecdb and ast): add lsp vecdb and ast configuration options
MarcMcIntosh Mar 13, 2024
36b80b6
fix(chat, restore): send snippet when restoring the chat
MarcMcIntosh Mar 13, 2024
2fcff97
README
olegklimov Mar 13, 2024
54a531c
108 sorting test
olegklimov Mar 13, 2024
8a85923
fix(chat stream end): let chat know when `fetchH2.disconnectAll();` i…
MarcMcIntosh Mar 14, 2024
a701b3b
ui(chat): add scaling property to theme if editor font size is less t…
MarcMcIntosh Mar 14, 2024
85e6398
hide previous completion to run new one
mitya52 Feb 29, 2024
874175a
0.6 temperature from second invocation
mitya52 Mar 1, 2024
2199de4
chore(chat-js): version bump
MarcMcIntosh Mar 14, 2024
909fd2b
Merge branch 'v1.2' into shared-chat-lib
MarcMcIntosh Mar 14, 2024
2fe1af0
chore(console): remove some console.log statments
MarcMcIntosh Mar 14, 2024
7b43f49
fix(chat end stream from rconsole): bind handleEndStream to chatTab c…
MarcMcIntosh Mar 14, 2024
0f6fde8
feat(refact-console): change context_file to @file command
MarcMcIntosh Mar 14, 2024
9734fd7
refactor(open chat from r-console): remove unreachable code
MarcMcIntosh Mar 14, 2024
b1a0b13
any any words fix
oxyplay Mar 14, 2024
7fa21e5
fix(r-console): add the cursor position to the `@file` command
MarcMcIntosh Mar 14, 2024
9d35666
fix(open chat): append snippet and file when using hot key to open chat
MarcMcIntosh Mar 15, 2024
13ef7c8
toolbox command works on 1 line
olegklimov Mar 15, 2024
d1cf584
109
olegklimov Mar 15, 2024
e4d9668
Fix: comment console placement after diff
MarcMcIntosh Dec 6, 2023
c0cabcc
fix(comment thread): send thread to the end of the diff
MarcMcIntosh Mar 15, 2024
676dc1f
110
olegklimov Mar 16, 2024
392950a
111, no scroll to comment thread
olegklimov Mar 16, 2024
8dc96c6
feat(chat): add handler for retrieving custom-prompt
MarcMcIntosh Mar 18, 2024
b335c85
fix: open chat from toolbar and ask question
MarcMcIntosh Mar 18, 2024
85b9dbd
112
olegklimov Mar 19, 2024
5131e46
chore(chat): update chat version
MarcMcIntosh Mar 19, 2024
89e2221
fix: new chat becomes disconnected from host
MarcMcIntosh Mar 19, 2024
2b93b58
fix: duplicated user message from toolbox
MarcMcIntosh Mar 19, 2024
c342381
fix: missing return statement on switch
MarcMcIntosh Mar 20, 2024
03c3976
fix: closing chat tab should call dispose
MarcMcIntosh Mar 20, 2024
d8542d7
fix: closing chat tab with no messages was being saved
MarcMcIntosh Mar 20, 2024
868e097
fix: duplicated messages when open chat from toolbox
MarcMcIntosh Mar 20, 2024
69be367
fix: thread being disposed after closing
MarcMcIntosh Mar 20, 2024
6b054bc
chore(chat): version bump
MarcMcIntosh Mar 20, 2024
72a1824
fix: toolbar on file that's not on the file system
MarcMcIntosh Mar 20, 2024
05ed4b3
fix: send the chat model from history if it's running in caps else us…
MarcMcIntosh Mar 20, 2024
0ea9de1
chore(chat): version bump and slightly change restore chat message
MarcMcIntosh Mar 21, 2024
f6d1b5c
chore(chat): version bump
MarcMcIntosh Mar 22, 2024
730fa1d
113
olegklimov Mar 22, 2024
f1be461
fix(toolbar): fix message duplication in chat
MarcMcIntosh Mar 22, 2024
99e1253
114
olegklimov Mar 23, 2024
d781821
fix rust launch, rename settings
olegklimov Mar 25, 2024
d1bb406
fix a couple of issues from Agzam
olegklimov Mar 25, 2024
940ed22
115
olegklimov Mar 25, 2024
8e8f64b
readme update
oxyplay Mar 25, 2024
840a3f0
Update README.md
oxyplay Mar 25, 2024
fdc1159
Update README.md screenshot
oxyplay Mar 25, 2024
ef898f1
Update README.md
oxyplay Mar 25, 2024
901e73f
Update README.md gifs
oxyplay Mar 25, 2024
a7201f1
Update README.md llms strikes back
oxyplay Mar 25, 2024
feb64a8
fix: if using the default in a chat set the last model used to the de…
MarcMcIntosh Mar 25, 2024
0aa4810
chore(chat): version bump to ^v0.1.3
MarcMcIntosh Mar 25, 2024
576ad18
chore(chat): version bump
MarcMcIntosh Mar 25, 2024
9135069
fix(chat id): use the id given in the question for the chat response
MarcMcIntosh Mar 25, 2024
113e96d
chore(chat): version bump to v0.1.5
MarcMcIntosh Mar 25, 2024
dd025b6
116
olegklimov Mar 25, 2024
c2bd4b4
117
olegklimov Mar 25, 2024
e720d8e
feat(hotkey): add chat hotkey to new chat button
MarcMcIntosh Mar 26, 2024
01fc9ae
ui(hotkey): capitalise fix letter for hotkey on windows or linux
MarcMcIntosh Mar 26, 2024
06f4a62
oops: forgot to return the key formatted for mac
MarcMcIntosh Mar 26, 2024
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
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,44 @@
[![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-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.

*Refact for VS Code is a free, open-source AI code assistant*
Simplify your coding experience with Refact.ai's functions:

- **Code suggestions and completions:** Refact suggests potential code completions based on the context of your code, looking up and down. It can suggest whole functions, classes, commonly used programming patterns, libraries, and APIs usage.
- **AI Toolbox:** Apply functions for bug detection and fixing, code refactoring, documentation assistance, code review, and more.
- **Integrated AI Chat:** Use natural language to ask code questions and get answers seamlessly.
- **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.

![image](https://github.com/smallcloudai/refact-vscode/assets/5008686/3b1d6d4e-1d2a-44ea-a8fa-1fb1b1517469)
## 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.
- **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 3-month 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!

## Getting Started
Once [installed](https://marketplace.visualstudio.com/items?itemName=smallcloud.codify), look for the Refact.ai logo in the status bar or the sidebar, click 'login', and agree to T&C. Start typing some code, and autocomplete will make suggestions automatically! Press F1 to access the AI toolbox functions. Refact has a simple, user-friendly interface that makes it easy to use, even for those new to AI tools.
If you have your own NVIDIA GPU, you can try the [self-hosted version](https://github.com/smallcloudai/refact).
## Support & Feedback
Join our Discord to get to know other community members, send us feedback or suggestions, and get support.
## Check Out How Easy Refact.ai Is to Use

### Boost coding productivity with fine-tuned auto-completions
![fine-tuned auto-completions](https://github.com/smallcloudai/refact-vscode/assets/15157041/15264b1a-df00-4e55-a4f4-be35debdea15)

### Get the answer to your question in the embedded Chat
![embedded Chat](https://github.com/smallcloudai/refact-vscode/assets/15157041/bcd7b0c0-d0aa-41e7-a6c5-ba898b0f5952)

### Just highlight part of the code and ask Toolbox to explain it
![Toolbox](https://github.com/smallcloudai/refact-vscode/assets/15157041/5c6934d7-0c62-4454-ae6c-55bf0b3d88df)

### Ask Toolbox to shorten your code
![Shorter_FT](https://github.com/smallcloudai/refact-vscode/assets/15157041/8de2f7e6-ec7a-44a3-8aa9-cf0e17c919f9)

## 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!
Loading
Loading