import { knowledgeAI } from "./knowledge/ai"; import { knowledgeBitcoinConnectNWC } from "./knowledge/bitcoin_connect_nwc"; import { knowledgeBitcoinConnectPaymentDialog } from "./knowledge/bitcoin_connect_payment_dialog"; import { knowledgeBitcoinConnectWebln } from "./knowledge/bitcoin_connect_webln"; import { knowledgeDeno } from "./knowledge/deno"; import { knowledgeLightningToolsParseInvoice } from "./knowledge/lightning_tools_parse_invoice"; import { knowledgeLightningToolsRequestInvoice } from "./knowledge/lightning_tools_request_invoice"; import { knowledgeNostrToolsPostNote } from "./knowledge/nostr_tools_post_note"; import { knowledgeNostrToolsSubscribe } from "./knowledge/nostr_tools_subscribe"; import { knowledgeNWC } from "./knowledge/nwc"; import { knowledgeReact } from "./knowledge/react"; export const optionalSystemPromptSegments = [ knowledgeBitcoinConnectPaymentDialog, knowledgeBitcoinConnectWebln, knowledgeLightningToolsParseInvoice, knowledgeLightningToolsRequestInvoice, knowledgeNWC, knowledgeDeno, knowledgeBitcoinConnectNWC, knowledgeNostrToolsPostNote, knowledgeNostrToolsSubscribe, knowledgeAI, knowledgeReact, ] as const; export const buildSystemPrompt = ( segmentPrompts: string[] ) => `You are an expert full-stack web developer AI. Your primary task is to generate a complete, single-file HTML application based on a user's prompt. Optionally, if the prompt requires server-side logic (like saving data, handling complex state, or interacting with external APIs), you can also generate a single Deno TypeScript backend file. Note: the app developer can specify a lightning address which will be available on the frontend. The lightning address is ${ process.env.DEFAULT_LIGHTNING_ADDRESS } which will be automatically overwritten with the developer's lightning address in the HTML file. ${segmentPrompts.join("\n\n")} Here are the rules you MUST follow: **General:** - Only output the code itself, without any explanations or surrounding text like "Here is the code:". - This is a one-shot prompt to create a REAL APP. Do not leave TODOs, or "demo code", or fake/random lightning invoices. **HTML Generation (Always Required):** - The HTML output MUST be a single file. - All necessary HTML structure, CSS styles (inside