Closed yacineMTB closed 1 year ago
probably overkill for this repo, but computers should probably embed the whole world before doing things, including voice
Incredible!
Let me get to some of the older PRs before tackling this beast 🔥
yeah big guy i'm gonna actually toy around with this and make it not hot garbage only attend once it's not in draft :) shared it early for someone else who asked for it
I was programming something else and was getting a little annoyed about how it didn't have any context. So I made it do what I want!
Now if I cast "directed heal" on this selected text, it'll have the references to all visible text. However; it won't include the actual internals of the function. It'll be replaced with ... instead.
Also; here's the new prompt.
const constructPrompt = async (text: string, filepath: string): Promise<string> => {
const defaultPrompt = `
ADDITIONAL CONTEXT:
filepath: ${filepath}
INSTRUCTIONS:
- The text under 'CODE' has come straight from my text editor.
- Your entire output MUST be valid code.
- You may communicate back, but they MUST be in comments
- The code sent to you might have some instructions under comments. Follow the instructions. Only attend to instructions contained between [[SELECTED]] & [[/SELECTED]]
- The code between [[SELECTED]] [[/SELECTED]] is code that I need you to replace. So when you start responding, only respond with code that could replace it
- MAKE SURE YOU ONLY WRITE CODE BETWEEN [[SELECTED]] AND [[/SELECTED]]. The rest of it doesnt need to be replace
- The rest of the code is provided as context. Sometimes, I'll collapse my code for you, and hide the details under '...'. Follow the style of the rest of the provided code.
- DO NOT WRITE THE ENTIRE CODE FILE. ONLY REPLACE WHAT IS NECESSARY IN SELECTED
- Prefer functional programming principles.
CODE:
${text}
NEW CODE TO REPLACE WHAT IS BETWEEN [[SELECTED]] and [/SELECTED]:
`;
const configuredPrompt = await workspace.getConfiguration().get('wolverine.prompt');
if (configuredPrompt) {
return configuredPrompt + text;
}
return defaultPrompt;
};
cc @biobootloader FYI I've been using this on my own dev I'm keeping this branch updated with whatever my patches are as I figure out what works for me vs what doesn't
The code is an awful mess, I plan to encapsulate all of the state transitions.
Just goofing around. Going to work with @biobootloader to see if we can get this merged & extend with wolverine.
I didn't have time to integrate VSCode's node runtime with a keychain. Do NOT add your keys to a json that lives raw on your filesystem. Unless you have a limit, and you don't care about potentially losing 20 bucks.
Want to pull and build?
This branch should have a vsix file that you can just use! If you want to develop, open up vscode in the extension's directory and hit F5
Demo
https://user-images.githubusercontent.com/10282244/233265760-05af619e-a536-47e9-a061-142261a4167d.mp4
Please don't share on twitter dot com bird app site yet, I'm making a goofy video