mirror of
https://github.com/stackblitz/bolt.new
synced 2025-06-26 18:17:50 +00:00
fix: lint and format remaining files
This commit is contained in:
parent
94737c5ade
commit
f5f67885fc
@ -2,22 +2,14 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "Fireproof",
|
||||
"keywords": [
|
||||
"fireproof",
|
||||
"fireproof db",
|
||||
"use-fireproof"
|
||||
],
|
||||
"keywords": ["fireproof", "fireproof db", "use-fireproof"],
|
||||
"docSource": "https://use-fireproof.com/llms.txt",
|
||||
"docFile": "docs/fireproof.txt",
|
||||
"lastUpdated": "2025-03-25"
|
||||
},
|
||||
{
|
||||
"name": "CallAI",
|
||||
"keywords": [
|
||||
"callai",
|
||||
"call-ai",
|
||||
"AI helper"
|
||||
],
|
||||
"keywords": ["callai", "call-ai", "AI helper"],
|
||||
"docSource": "https://use-fireproof.com/callai-llms.txt",
|
||||
"docFile": "docs/callai.txt",
|
||||
"lastUpdated": "2025-03-25"
|
||||
|
@ -22,6 +22,7 @@ const DOCS_DIR = path.join(process.cwd(), 'app', 'lib', 'common', 'llms-txt');
|
||||
function loadDocsConfig(): DocsConfig {
|
||||
const configPath = path.join(DOCS_DIR, 'docs.json');
|
||||
const configData = fs.readFileSync(configPath, 'utf8');
|
||||
|
||||
return JSON.parse(configData) as DocsConfig;
|
||||
}
|
||||
|
||||
@ -29,6 +30,7 @@ function loadDocsConfig(): DocsConfig {
|
||||
function getLibraryDocs(library: Library): string | null {
|
||||
try {
|
||||
const docPath = path.join(DOCS_DIR, library.docFile);
|
||||
|
||||
if (fs.existsSync(docPath)) {
|
||||
return fs.readFileSync(docPath, 'utf8');
|
||||
}
|
||||
@ -69,6 +71,7 @@ export function enhancePromptWithLibraryDocumentation(prompt: string, libraries:
|
||||
// add documentation for each detected library
|
||||
for (const library of libraries) {
|
||||
const docs = getLibraryDocs(library);
|
||||
|
||||
if (docs) {
|
||||
// add the documentation in a standardized format
|
||||
enhancedPrompt += `\n\n## ${library.name} Documentation\n${docs}\n`;
|
||||
|
@ -29,9 +29,11 @@ async function chatAction({ context, request }: ActionFunctionArgs) {
|
||||
console.log('[DEBUG] api.chat - Last user message before enhancement:', lastUserMessage.content);
|
||||
|
||||
const enhancedContent = enhancePromptWithLibraryDocumentation(lastUserMessage.content, detectedLibraries);
|
||||
console.log('[DEBUG] api.chat - Enhanced content includes Fireproof?',
|
||||
console.log(
|
||||
'[DEBUG] api.chat - Enhanced content includes Fireproof?',
|
||||
enhancedContent.includes('Fireproof'),
|
||||
enhancedContent.includes('<library name="Fireproof">'));
|
||||
enhancedContent.includes('<library name="Fireproof">'),
|
||||
);
|
||||
|
||||
// replace the content with enhanced content
|
||||
messages[lastUserMessageIndex] = {
|
||||
|
Loading…
Reference in New Issue
Block a user