Skip to content

Commit

Permalink
build: Fix bug causing frontend to not build correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmiscool committed Dec 15, 2024
1 parent b9e74c1 commit 36d5eec
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ Use **New Chat** to interactively modify a selected file. Before starting a conv
Use **New Plan Chat** to refine the project plan document. This plan, combined with the default system prompts, guides the LLM during regular chats.
Begin by describing your project goals. You can ask the LLM to produce a detailed outline of all the necessary classes and methods, then save this plan.

# Files
![FILE SELECTOR](./images/FILE-SELECTOR.png)

The **Files** tab lets you specify which file you want to modify. Select a target file before starting a chat or using the tools.

# Tools
![NEW TOOLS](./images/TOOLS.png)
Expand Down
2 changes: 1 addition & 1 deletion public/ChatManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export class ChatManager {


async displayPremadePromptsList() {
const customPromptsJSON = await doAjax('/readFile', { targetFile: '../.aiCoder/prompts/customPrompts.json' });
const customPromptsJSON = await doAjax('/readFile', { targetFile: '.aiCoder/prompts/customPrompts.json' });
let customPrompts = JSON.parse(customPromptsJSON.fileContent);
if (!customPrompts) customPrompts = [];
//console.log('prompts', customPrompts);
Expand Down
20 changes: 15 additions & 5 deletions src/aiCoderApiFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ export class aiCoderApiFunctions {
if (parsedBody.title) await webUIConversation.setTitle(parsedBody.title);
await webUIConversation.setTargetFile(parsedBody.targetFile);

await webUIConversation.addFileMessage("system", './.aiCoder/llmConfig/default-system-prompt.md');
await webUIConversation.addFileMessage("user", './.aiCoder/llmConfig/default-plan-prompt.md');
await webUIConversation.addFileMessage("system", './.aiCoder/prompts/default-system-prompt.md');
await webUIConversation.addFileMessage("user", './.aiCoder/prompts/default-plan-prompt.md');
await webUIConversation.addTargetFileMessage("user", "// Code file to be edited");
await webUIConversation.addFileMessage("system", './.aiCoder/llmConfig/snippet-production-prompt.md');
await webUIConversation.addFileMessage("system", './.aiCoder/prompts/snippet-production-prompt.md');
return { id: webUIConversation.id, targetFile: webUIConversation.targetFile };
}

Expand All @@ -98,8 +98,8 @@ export class aiCoderApiFunctions {
await webUIConversation.setMode('plan');
await webUIConversation.setTitle(`Plan Chat`);

await webUIConversation.addFileMessage("system", './.aiCoder/llmConfig/plan-edit-prompt.md');
await webUIConversation.addFileMessage("user", './.aiCoder/llmConfig/default-plan-prompt.md', "Plan to be edited:");
await webUIConversation.addFileMessage("system", './.aiCoder/prompts/plan-edit-prompt.md');
await webUIConversation.addFileMessage("user", './.aiCoder/prompts/default-plan-prompt.md', "Plan to be edited:");
return { id: webUIConversation.id, targetFile: webUIConversation.targetFile };
}

Expand Down Expand Up @@ -207,8 +207,18 @@ export class aiCoderApiFunctions {



const characters = [
String.fromCharCode(0xC3),
String.fromCharCode(0x05),
String.fromCharCode(0x00),
String.fromCharCode(0x01),
String.fromCharCode(0xC2),
String.fromCharCode(0x05)
];


document.getElementById("lineToSend").value = characters.join('');




Expand Down
11 changes: 9 additions & 2 deletions src/apiServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ import { execSync } from 'child_process';
export let wss;


// run "npm run build" to build the frontend
execSync('npm run buildFrontend &', { stdio: 'inherit' });





async function buildFrontend() {
console.log('Building frontend...');
const scriptPath = await getScriptFolderPath();

//execSync('npm run buildFrontend &', { stdio: 'inherit' });
execSync(`cd ${scriptPath} && npm run buildFrontend &`, { stdio: 'inherit' });
}

buildFrontend();

export function setupServer() {
// ctx variables
Expand Down

0 comments on commit 36d5eec

Please sign in to comment.