@vibes.diy/prompts 0.0.0-dev-fresh-data
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +232 -0
- package/README.md +29 -0
- package/catalog.d.ts +1 -0
- package/catalog.js +4 -0
- package/catalog.js.map +1 -0
- package/chat.d.ts +144 -0
- package/chat.js +2 -0
- package/chat.js.map +1 -0
- package/component-export-transforms.d.ts +12 -0
- package/component-export-transforms.js +32 -0
- package/component-export-transforms.js.map +1 -0
- package/component-transforms.d.ts +3 -0
- package/component-transforms.js +327 -0
- package/component-transforms.js.map +1 -0
- package/index.d.ts +11 -0
- package/index.js +12 -0
- package/index.js.map +1 -0
- package/json-docs.d.ts +21 -0
- package/json-docs.js +25 -0
- package/json-docs.js.map +1 -0
- package/llms/callai.d.ts +2 -0
- package/llms/callai.js +10 -0
- package/llms/callai.js.map +1 -0
- package/llms/callai.txt +455 -0
- package/llms/d3.d.ts +2 -0
- package/llms/d3.js +10 -0
- package/llms/d3.js.map +1 -0
- package/llms/d3.md +679 -0
- package/llms/fireproof.d.ts +2 -0
- package/llms/fireproof.js +10 -0
- package/llms/fireproof.js.map +1 -0
- package/llms/fireproof.txt +451 -0
- package/llms/image-gen.d.ts +2 -0
- package/llms/image-gen.js +10 -0
- package/llms/image-gen.js.map +1 -0
- package/llms/image-gen.txt +128 -0
- package/llms/index.d.ts +8 -0
- package/llms/index.js +21 -0
- package/llms/index.js.map +1 -0
- package/llms/three-js.d.ts +2 -0
- package/llms/three-js.js +10 -0
- package/llms/three-js.js.map +1 -0
- package/llms/three-js.md +2232 -0
- package/llms/types.d.ts +10 -0
- package/llms/types.js +2 -0
- package/llms/types.js.map +1 -0
- package/llms/web-audio.d.ts +2 -0
- package/llms/web-audio.js +9 -0
- package/llms/web-audio.js.map +1 -0
- package/llms/web-audio.txt +220 -0
- package/load-docs.d.ts +2 -0
- package/load-docs.js +17 -0
- package/load-docs.js.map +1 -0
- package/package.json +39 -0
- package/prompts.d.ts +43 -0
- package/prompts.js +315 -0
- package/prompts.js.map +1 -0
- package/segment-parser.d.ts +4 -0
- package/segment-parser.js +135 -0
- package/segment-parser.js.map +1 -0
- package/settings.d.ts +16 -0
- package/settings.js +2 -0
- package/settings.js.map +1 -0
- package/style-prompts.d.ts +7 -0
- package/style-prompts.js +63 -0
- package/style-prompts.js.map +1 -0
- package/tsconfig.json +21 -0
- package/txt-docs.d.ts +15 -0
- package/txt-docs.js +53 -0
- package/txt-docs.js.map +1 -0
- package/view-state.d.ts +17 -0
- package/view-state.js +2 -0
- package/view-state.js.map +1 -0
package/prompts.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { callAI } from "call-ai";
|
|
2
|
+
import { Lazy, runtimeFn, URI } from "@adviser/cement";
|
|
3
|
+
import { getJsonDocs, getLlmCatalog, getLlmCatalogNames, } from "./json-docs.js";
|
|
4
|
+
import { getDefaultDependencies } from "./catalog.js";
|
|
5
|
+
import { getTexts } from "./txt-docs.js";
|
|
6
|
+
import { defaultStylePrompt } from "./style-prompts.js";
|
|
7
|
+
export const DEFAULT_CODING_MODEL = "anthropic/claude-sonnet-4.5";
|
|
8
|
+
export const RAG_DECISION_MODEL = "openai/gpt-4o";
|
|
9
|
+
export async function defaultCodingModel() {
|
|
10
|
+
return DEFAULT_CODING_MODEL;
|
|
11
|
+
}
|
|
12
|
+
function normalizeModelIdInternal(id) {
|
|
13
|
+
if (typeof id !== "string")
|
|
14
|
+
return undefined;
|
|
15
|
+
const trimmed = id.trim();
|
|
16
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
17
|
+
}
|
|
18
|
+
export function normalizeModelId(id) {
|
|
19
|
+
return normalizeModelIdInternal(id);
|
|
20
|
+
}
|
|
21
|
+
export function isPermittedModelId(id) {
|
|
22
|
+
return typeof normalizeModelIdInternal(id) === "string";
|
|
23
|
+
}
|
|
24
|
+
export async function resolveEffectiveModel(settingsDoc, vibeDoc) {
|
|
25
|
+
const sessionChoice = normalizeModelIdInternal(vibeDoc?.selectedModel);
|
|
26
|
+
if (sessionChoice)
|
|
27
|
+
return sessionChoice;
|
|
28
|
+
const globalChoice = normalizeModelIdInternal(settingsDoc?.model);
|
|
29
|
+
if (globalChoice)
|
|
30
|
+
return globalChoice;
|
|
31
|
+
return defaultCodingModel();
|
|
32
|
+
}
|
|
33
|
+
function escapeRegExp(str) {
|
|
34
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
35
|
+
}
|
|
36
|
+
const llmImportRegexes = Lazy((fallBackUrl) => {
|
|
37
|
+
return getJsonDocs(fallBackUrl).then((docs) => Object.values(docs)
|
|
38
|
+
.map((d) => d.obj)
|
|
39
|
+
.filter((l) => l.importModule && l.importName)
|
|
40
|
+
.map((l) => {
|
|
41
|
+
const mod = escapeRegExp(l.importModule);
|
|
42
|
+
const name = escapeRegExp(l.importName);
|
|
43
|
+
const importType = l.importType || "named";
|
|
44
|
+
return {
|
|
45
|
+
name: l.name,
|
|
46
|
+
named: new RegExp(`import\\s*\\{[^}]*\\b${name}\\b[^}]*\\}\\s*from\\s*['\\"]${mod}['\\"]`),
|
|
47
|
+
def: new RegExp(`import\\s+${name}\\s+from\\s*['\\"]${mod}['\\"]`),
|
|
48
|
+
namespace: new RegExp(`import\\s*\\*\\s*as\\s+${name}\\s+from\\s*['\\"]${mod}['\\"]`),
|
|
49
|
+
importType,
|
|
50
|
+
};
|
|
51
|
+
}));
|
|
52
|
+
});
|
|
53
|
+
async function detectModulesInHistory(history, opts) {
|
|
54
|
+
const detected = new Set();
|
|
55
|
+
if (!Array.isArray(history))
|
|
56
|
+
return detected;
|
|
57
|
+
for (const msg of history) {
|
|
58
|
+
const content = msg?.content || "";
|
|
59
|
+
if (!content || typeof content !== "string")
|
|
60
|
+
continue;
|
|
61
|
+
for (const { name, named, def, namespace } of await llmImportRegexes(opts.fallBackUrl)) {
|
|
62
|
+
if (named.test(content) || def.test(content) || namespace.test(content)) {
|
|
63
|
+
detected.add(name);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return detected;
|
|
68
|
+
}
|
|
69
|
+
const warnOnce = Lazy(() => console.warn("auth_token is not support on node"));
|
|
70
|
+
function defaultGetAuthToken(fn) {
|
|
71
|
+
if (typeof fn === "function") {
|
|
72
|
+
return () => fn();
|
|
73
|
+
}
|
|
74
|
+
const rn = runtimeFn();
|
|
75
|
+
if (rn.isBrowser) {
|
|
76
|
+
return () => Promise.resolve(localStorage.getItem("auth_token") || "");
|
|
77
|
+
}
|
|
78
|
+
return () => {
|
|
79
|
+
warnOnce();
|
|
80
|
+
return Promise.resolve("Unsupported.JWT-Token");
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async function sleepReject(ms) {
|
|
84
|
+
return new Promise((_, rj) => setTimeout(rj, ms));
|
|
85
|
+
}
|
|
86
|
+
export async function selectLlmsAndOptions(model, userPrompt, history, iopts) {
|
|
87
|
+
const opts = {
|
|
88
|
+
appMode: "production",
|
|
89
|
+
...iopts,
|
|
90
|
+
callAiEndpoint: iopts.callAiEndpoint ? iopts.callAiEndpoint : undefined,
|
|
91
|
+
fallBackUrl: URI.from(iopts.fallBackUrl ?? "https://esm.sh/use-vibes/prompt-catalog/llms").toString(),
|
|
92
|
+
getAuthToken: defaultGetAuthToken(iopts.getAuthToken),
|
|
93
|
+
};
|
|
94
|
+
const llmsCatalog = await getLlmCatalog(opts.fallBackUrl);
|
|
95
|
+
const catalog = llmsCatalog.map((l) => ({
|
|
96
|
+
name: l.name,
|
|
97
|
+
description: l.description || "",
|
|
98
|
+
}));
|
|
99
|
+
const payload = {
|
|
100
|
+
catalog,
|
|
101
|
+
userPrompt: userPrompt || "",
|
|
102
|
+
history: history || [],
|
|
103
|
+
};
|
|
104
|
+
const messages = [
|
|
105
|
+
{
|
|
106
|
+
role: "system",
|
|
107
|
+
content: 'You select which library modules from a catalog should be included AND whether to include instructional UI text and a demo-data button. First analyze if the user prompt describes specific look & feel requirements. For instructional text and demo data: include them only when asked for. Read the JSON payload and return JSON with properties: "selected" (array of catalog "name" strings), "instructionalText" (boolean), and "demoData" (boolean). Only choose modules from the catalog. Include any libraries already used in history. Respond with JSON only.',
|
|
108
|
+
},
|
|
109
|
+
{ role: "user", content: JSON.stringify(payload) },
|
|
110
|
+
];
|
|
111
|
+
const options = {
|
|
112
|
+
chatUrl: opts.callAiEndpoint
|
|
113
|
+
? opts.callAiEndpoint.toString().replace(/\/+$/, "")
|
|
114
|
+
: undefined,
|
|
115
|
+
apiKey: "sk-vibes-proxy-managed",
|
|
116
|
+
model,
|
|
117
|
+
schema: {
|
|
118
|
+
name: "module_and_options_selection",
|
|
119
|
+
properties: {
|
|
120
|
+
selected: { type: "array", items: { type: "string" } },
|
|
121
|
+
instructionalText: { type: "boolean" },
|
|
122
|
+
demoData: { type: "boolean" },
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
max_tokens: 2000,
|
|
126
|
+
headers: {
|
|
127
|
+
"HTTP-Referer": "https://vibes.diy",
|
|
128
|
+
"X-Title": "Vibes DIY",
|
|
129
|
+
"X-VIBES-Token": await opts.getAuthToken?.(),
|
|
130
|
+
},
|
|
131
|
+
mock: opts.mock,
|
|
132
|
+
};
|
|
133
|
+
try {
|
|
134
|
+
const withTimeout = (p, ms = 4000) => Promise.race([
|
|
135
|
+
sleepReject(ms).then((val) => {
|
|
136
|
+
console.warn("Module/options selection: API call timed out after", ms, "ms");
|
|
137
|
+
return val;
|
|
138
|
+
}),
|
|
139
|
+
p
|
|
140
|
+
.then((val) => {
|
|
141
|
+
return val;
|
|
142
|
+
})
|
|
143
|
+
.catch((err) => {
|
|
144
|
+
console.warn("Module/options selection: API call failed with error:", err);
|
|
145
|
+
throw err;
|
|
146
|
+
}),
|
|
147
|
+
]);
|
|
148
|
+
const raw = (await withTimeout(callCallAI(options)(messages, options)));
|
|
149
|
+
if (raw === undefined || raw === null) {
|
|
150
|
+
console.warn("Module/options selection: call-ai returned undefined with schema present");
|
|
151
|
+
console.warn("This is a known issue in the prompts package environment");
|
|
152
|
+
return { selected: [], instructionalText: true, demoData: true };
|
|
153
|
+
}
|
|
154
|
+
const parsed = JSON.parse(raw) ?? {};
|
|
155
|
+
const selected = Array.isArray(parsed?.selected)
|
|
156
|
+
? parsed.selected.filter((v) => typeof v === "string")
|
|
157
|
+
: [];
|
|
158
|
+
const instructionalText = typeof parsed?.instructionalText === "boolean"
|
|
159
|
+
? parsed.instructionalText
|
|
160
|
+
: true;
|
|
161
|
+
const demoData = typeof parsed?.demoData === "boolean" ? parsed.demoData : true;
|
|
162
|
+
return { selected, instructionalText, demoData };
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
console.warn("Module/options selection call failed:", err);
|
|
166
|
+
return { selected: [], instructionalText: true, demoData: true };
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function callCallAI(option) {
|
|
170
|
+
return option.mock?.callAI || callAI;
|
|
171
|
+
}
|
|
172
|
+
export function generateImportStatements(llms) {
|
|
173
|
+
const seen = new Set();
|
|
174
|
+
return llms
|
|
175
|
+
.slice()
|
|
176
|
+
.sort((a, b) => a.importModule.localeCompare(b.importModule))
|
|
177
|
+
.filter((l) => l.importModule && l.importName)
|
|
178
|
+
.filter((l) => {
|
|
179
|
+
const key = `${l.importModule}:${l.importName}`;
|
|
180
|
+
if (seen.has(key))
|
|
181
|
+
return false;
|
|
182
|
+
seen.add(key);
|
|
183
|
+
return true;
|
|
184
|
+
})
|
|
185
|
+
.map((l) => {
|
|
186
|
+
const importType = l.importType || "named";
|
|
187
|
+
switch (importType) {
|
|
188
|
+
case "namespace":
|
|
189
|
+
return `\nimport * as ${l.importName} from "${l.importModule}"`;
|
|
190
|
+
case "default":
|
|
191
|
+
return `\nimport ${l.importName} from "${l.importModule}"`;
|
|
192
|
+
case "named":
|
|
193
|
+
default:
|
|
194
|
+
return `\nimport { ${l.importName} } from "${l.importModule}"`;
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
.join("");
|
|
198
|
+
}
|
|
199
|
+
export async function makeBaseSystemPrompt(model, sessionDoc) {
|
|
200
|
+
const userPrompt = sessionDoc?.userPrompt || "";
|
|
201
|
+
const history = Array.isArray(sessionDoc?.history)
|
|
202
|
+
? sessionDoc.history
|
|
203
|
+
: [];
|
|
204
|
+
const useOverride = !!sessionDoc?.dependenciesUserOverride;
|
|
205
|
+
let selectedNames = [];
|
|
206
|
+
let includeInstructional = true;
|
|
207
|
+
let includeDemoData = true;
|
|
208
|
+
const llmsCatalog = await getLlmCatalog(sessionDoc.fallBackUrl);
|
|
209
|
+
const llmsCatalogNames = await getLlmCatalogNames(sessionDoc.fallBackUrl);
|
|
210
|
+
if (useOverride && Array.isArray(sessionDoc?.dependencies)) {
|
|
211
|
+
selectedNames = sessionDoc.dependencies
|
|
212
|
+
.filter((v) => typeof v === "string")
|
|
213
|
+
.filter((name) => llmsCatalogNames.has(name));
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
const decisions = await selectLlmsAndOptions(RAG_DECISION_MODEL, userPrompt, history, sessionDoc);
|
|
217
|
+
includeInstructional = decisions.instructionalText;
|
|
218
|
+
includeDemoData = decisions.demoData;
|
|
219
|
+
const detected = await detectModulesInHistory(history, sessionDoc);
|
|
220
|
+
const finalNames = new Set([...decisions.selected, ...detected]);
|
|
221
|
+
selectedNames = Array.from(finalNames);
|
|
222
|
+
if (selectedNames.length === 0)
|
|
223
|
+
selectedNames = [...(await getDefaultDependencies())];
|
|
224
|
+
}
|
|
225
|
+
if (typeof sessionDoc?.instructionalTextOverride === "boolean") {
|
|
226
|
+
includeInstructional = sessionDoc.instructionalTextOverride;
|
|
227
|
+
}
|
|
228
|
+
if (typeof sessionDoc?.demoDataOverride === "boolean") {
|
|
229
|
+
includeDemoData = sessionDoc.demoDataOverride;
|
|
230
|
+
}
|
|
231
|
+
const chosenLlms = llmsCatalog.filter((l) => selectedNames.includes(l.name));
|
|
232
|
+
let concatenatedLlmsTxt = "";
|
|
233
|
+
for (const llm of chosenLlms) {
|
|
234
|
+
const text = await getTexts(llm.name, sessionDoc.fallBackUrl);
|
|
235
|
+
if (!text) {
|
|
236
|
+
console.warn("Failed to load raw LLM text for:", llm.name, sessionDoc.fallBackUrl);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
concatenatedLlmsTxt += `
|
|
240
|
+
<${llm.label}-docs>
|
|
241
|
+
${text || ""}
|
|
242
|
+
</${llm.label}-docs>
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
const stylePrompt = sessionDoc?.stylePrompt || defaultStylePrompt;
|
|
246
|
+
const instructionalLine = includeInstructional
|
|
247
|
+
? "- In the UI, include a vivid description of the app's purpose and detailed instructions how to use it, in italic text.\n"
|
|
248
|
+
: "";
|
|
249
|
+
const demoDataLines = includeDemoData
|
|
250
|
+
? `- If your app has a function that uses callAI with a schema to save data, include a Demo Data button that calls that function with an example prompt. Don't write an extra function, use real app code so the data illustrates what it looks like to use the app.\n- Never have have an instance of callAI that is only used to generate demo data, always use the same calls that are triggered by user actions in the app.\n`
|
|
251
|
+
: "";
|
|
252
|
+
const systemPrompt = `
|
|
253
|
+
You are an AI assistant tasked with creating React components. You should create components that:
|
|
254
|
+
- Use modern React practices and follow the rules of hooks
|
|
255
|
+
- Don't use any TypeScript, just use JavaScript
|
|
256
|
+
- Use Tailwind CSS for mobile-first accessible styling
|
|
257
|
+
- Don't use words from the style prompt in your copy: ${stylePrompt}
|
|
258
|
+
- For dynamic components, like autocomplete, don't use external libraries, implement your own
|
|
259
|
+
- Avoid using external libraries unless they are essential for the component to function
|
|
260
|
+
- Always import the libraries you need at the top of the file
|
|
261
|
+
- Use Fireproof for data persistence
|
|
262
|
+
- Use \`callAI\` to fetch AI (set \`stream: true\` to enable streaming), use Structured JSON Outputs like this: \`callAI(prompt, { schema: { properties: { todos: { type: 'array', items: { type: 'string' } } } } })\` and save final responses as individual Fireproof documents.
|
|
263
|
+
- For file uploads use drag and drop and store using the \`doc._files\` API
|
|
264
|
+
- Don't try to generate png or base64 data, use placeholder image APIs instead, like https://picsum.photos/400 where 400 is the square size
|
|
265
|
+
- Consider and potentially reuse/extend code from previous responses if relevant
|
|
266
|
+
- Always output the full component code, keep the explanation short and concise
|
|
267
|
+
- Never also output a small snippet to change, just the full component code
|
|
268
|
+
- Keep your component file as short as possible for fast updates
|
|
269
|
+
- Keep the database name stable as you edit the code
|
|
270
|
+
- The system can send you crash reports, fix them by simplifying the affected code
|
|
271
|
+
- If you get missing block errors, change the database name to a new name
|
|
272
|
+
- List data items on the main page of your app so users don't have to hunt for them
|
|
273
|
+
- If you save data, make sure it is browseable in the app, eg lists should be clickable for more details
|
|
274
|
+
${instructionalLine}${demoDataLines}
|
|
275
|
+
|
|
276
|
+
${concatenatedLlmsTxt}
|
|
277
|
+
|
|
278
|
+
## ImgGen Component
|
|
279
|
+
|
|
280
|
+
You should use this component in all cases where you need to generate or edit images. It is a React component that provides a UI for image generation and editing. Make sure to pass the database prop to the component. If you generate images, use a live query to list them (with type 'image') in the UI. The best usage is to save a document with a string field called \`prompt\` (which is sent to the generator) and an optional \`doc._files.original\` image and pass the \`doc._id\` to the component via the \`_id\` prop. It will handle the rest.
|
|
281
|
+
|
|
282
|
+
${userPrompt
|
|
283
|
+
? `${userPrompt}
|
|
284
|
+
|
|
285
|
+
`
|
|
286
|
+
: ""}IMPORTANT: You are working in one JavaScript file, use tailwind classes for styling. Remember to use brackets like bg-[#242424] for custom colors.
|
|
287
|
+
|
|
288
|
+
Provide a title and brief explanation followed by the component code. The component should demonstrate proper Fireproof integration with real-time updates and proper data persistence. Follow it with a short description of the app's purpose and instructions how to use it (with occasional bold or italic for emphasis). Then suggest some additional features that could be added to the app.
|
|
289
|
+
|
|
290
|
+
Begin the component with the import statements. Use react and the following libraries:
|
|
291
|
+
|
|
292
|
+
\`\`\`js
|
|
293
|
+
import React, { ... } from "react"${generateImportStatements(chosenLlms)}
|
|
294
|
+
|
|
295
|
+
// other imports only when requested
|
|
296
|
+
\`\`\`
|
|
297
|
+
|
|
298
|
+
`;
|
|
299
|
+
return {
|
|
300
|
+
systemPrompt,
|
|
301
|
+
dependencies: selectedNames,
|
|
302
|
+
instructionalText: includeInstructional,
|
|
303
|
+
demoData: includeDemoData,
|
|
304
|
+
model,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
export const RESPONSE_FORMAT = {
|
|
308
|
+
structure: [
|
|
309
|
+
"Brief explanation",
|
|
310
|
+
"Component code with proper Fireproof integration",
|
|
311
|
+
"Real-time updates",
|
|
312
|
+
"Data persistence",
|
|
313
|
+
],
|
|
314
|
+
};
|
|
315
|
+
//# sourceMappingURL=prompts.js.map
|
package/prompts.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../jsr/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2C,MAAM,SAAS,CAAC;AAG1E,OAAO,EAAa,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,GAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,6BAAsC,CAAC;AAG3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAwB,CAAC;AAE3D,MAAM,CAAC,KAAK,UAAU,kBAAkB,GAAG;IACzC,OAAO,oBAAoB,CAAC;AAAA,CAC7B;AAED,SAAS,wBAAwB,CAAC,EAAW,EAAsB;IACjE,IAAI,OAAO,EAAE,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC7C,MAAM,OAAO,GAAG,EAAE,CAAC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mB;QACnB,kDAAkD;QAClD,mBAAmB;QACnB,kBAAkB;KACnB;CACF,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export function parseContent(text) {
|
|
2
|
+
const segments = [];
|
|
3
|
+
const depsFormat1 = text.match(/^({"dependencies":\s*{}})/);
|
|
4
|
+
const depsFormat2 = text.match(/^({(?:"[^"]+"\s*:\s*"[^"]+"(?:,\s*)?)+}})/);
|
|
5
|
+
const depsFormat3 = text.match(/^({"dependencies":\s*{(?:"[^"]+"\s*:\s*"[^"]+"(?:,\s*)?)+}})/);
|
|
6
|
+
const depsFormat4 = text.match(/^({"dependencies":\s*{[\s\S]*?^}})/m);
|
|
7
|
+
if (depsFormat1 && depsFormat1[1]) {
|
|
8
|
+
text = text
|
|
9
|
+
.substring(text.indexOf(depsFormat1[1]) + depsFormat1[1].length)
|
|
10
|
+
.trim();
|
|
11
|
+
}
|
|
12
|
+
else if (depsFormat2 && depsFormat2[1]) {
|
|
13
|
+
text = text
|
|
14
|
+
.substring(text.indexOf(depsFormat2[1]) + depsFormat2[1].length)
|
|
15
|
+
.trim();
|
|
16
|
+
}
|
|
17
|
+
else if (depsFormat3 && depsFormat3[1]) {
|
|
18
|
+
text = text
|
|
19
|
+
.substring(text.indexOf(depsFormat3[1]) + depsFormat3[1].length)
|
|
20
|
+
.trim();
|
|
21
|
+
}
|
|
22
|
+
else if (depsFormat4 && depsFormat4[1]) {
|
|
23
|
+
text = text
|
|
24
|
+
.substring(text.indexOf(depsFormat4[1]) + depsFormat4[1].length)
|
|
25
|
+
.trim();
|
|
26
|
+
}
|
|
27
|
+
const codeBlockRegex = /(?:^|\n)[ \t]*```(?:js|jsx|javascript|)[ \t]*\n([\s\S]*?)(?:^|\n)[ \t]*```[ \t]*(?:\n|$)/g;
|
|
28
|
+
const codeBlocks = [];
|
|
29
|
+
let match;
|
|
30
|
+
while ((match = codeBlockRegex.exec(text)) !== null) {
|
|
31
|
+
const fullMatch = match[0];
|
|
32
|
+
const codeContent = match[1]?.trim() || "";
|
|
33
|
+
const startIdx = match.index;
|
|
34
|
+
const endIdx = startIdx + fullMatch.length;
|
|
35
|
+
codeBlocks.push({
|
|
36
|
+
fullBlock: fullMatch,
|
|
37
|
+
content: codeContent,
|
|
38
|
+
startIdx,
|
|
39
|
+
endIdx,
|
|
40
|
+
length: codeContent.length,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const incompleteCodeBlockMatch = text.match(/(?:^|\n)[ \t]*```(?:js|jsx|javascript|)[ \t]*\n([\s\S]*)$/s);
|
|
44
|
+
if (incompleteCodeBlockMatch &&
|
|
45
|
+
incompleteCodeBlockMatch.index !== undefined) {
|
|
46
|
+
const startIdx = incompleteCodeBlockMatch.index;
|
|
47
|
+
const isDuplicate = codeBlocks.some((block) => block.startIdx === startIdx);
|
|
48
|
+
if (!isDuplicate) {
|
|
49
|
+
const fullMatch = incompleteCodeBlockMatch[0];
|
|
50
|
+
const codeContent = incompleteCodeBlockMatch[1]?.trim() || "";
|
|
51
|
+
const endIdx = text.length;
|
|
52
|
+
codeBlocks.push({
|
|
53
|
+
fullBlock: fullMatch,
|
|
54
|
+
content: codeContent,
|
|
55
|
+
startIdx,
|
|
56
|
+
endIdx,
|
|
57
|
+
length: codeContent.length,
|
|
58
|
+
incomplete: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (codeBlocks.length === 0) {
|
|
63
|
+
segments.push({
|
|
64
|
+
type: "markdown",
|
|
65
|
+
content: text,
|
|
66
|
+
});
|
|
67
|
+
return { segments };
|
|
68
|
+
}
|
|
69
|
+
let longestBlockIndex = 0;
|
|
70
|
+
let maxLength = 0;
|
|
71
|
+
for (let i = 0; i < codeBlocks.length; i++) {
|
|
72
|
+
if (codeBlocks[i].length > maxLength) {
|
|
73
|
+
maxLength = codeBlocks[i].length;
|
|
74
|
+
longestBlockIndex = i;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
codeBlocks.sort((a, b) => a.startIdx - b.startIdx);
|
|
78
|
+
const longestBlock = codeBlocks[longestBlockIndex];
|
|
79
|
+
let beforeContent = "";
|
|
80
|
+
if (longestBlock.startIdx > 0) {
|
|
81
|
+
let currentPos = 0;
|
|
82
|
+
for (const block of codeBlocks) {
|
|
83
|
+
if (block === longestBlock) {
|
|
84
|
+
beforeContent += text.substring(currentPos, block.startIdx);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
else if (block.startIdx >= currentPos &&
|
|
88
|
+
block.endIdx <= longestBlock.startIdx) {
|
|
89
|
+
beforeContent += text.substring(currentPos, block.startIdx);
|
|
90
|
+
beforeContent += block.fullBlock;
|
|
91
|
+
currentPos = block.endIdx;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (beforeContent === "") {
|
|
95
|
+
beforeContent = text.substring(0, longestBlock.startIdx);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (beforeContent.trim().length > 0) {
|
|
99
|
+
segments.push({
|
|
100
|
+
type: "markdown",
|
|
101
|
+
content: beforeContent.trim(),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
segments.push({
|
|
105
|
+
type: "code",
|
|
106
|
+
content: longestBlock.content,
|
|
107
|
+
});
|
|
108
|
+
let afterContent = "";
|
|
109
|
+
if (longestBlock.endIdx < text.length) {
|
|
110
|
+
let currentPos = longestBlock.endIdx;
|
|
111
|
+
let processedBlocks = false;
|
|
112
|
+
for (const block of codeBlocks) {
|
|
113
|
+
if (block !== longestBlock && block.startIdx >= longestBlock.endIdx) {
|
|
114
|
+
afterContent += text.substring(currentPos, block.startIdx);
|
|
115
|
+
afterContent += block.fullBlock;
|
|
116
|
+
currentPos = block.endIdx;
|
|
117
|
+
processedBlocks = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (currentPos < text.length) {
|
|
121
|
+
afterContent += text.substring(currentPos);
|
|
122
|
+
}
|
|
123
|
+
if (!processedBlocks) {
|
|
124
|
+
afterContent = text.substring(longestBlock.endIdx);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (afterContent.trim().length > 0) {
|
|
128
|
+
segments.push({
|
|
129
|
+
type: "markdown",
|
|
130
|
+
content: afterContent.trim(),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return { segments };
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=segment-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment-parser.js","sourceRoot":"","sources":["../jsr/segment-parser.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,YAAY,CAAC,IAAY,EAEvC;IACA,MAAM,QAAQ,GAAc,EAAE,CAAC;IAO/B,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC5E,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,8DAA8D,CAC/D,CAAC;IAEF,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAEtE,IAAI,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAElC,IAAI,GAAG,IAAI;aACR,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;aAC/D,IAAI,EAAE,CAAC;IACZ,CAAC;SAAM,IAAI,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzC,IAAI,GAAG,IAAI;aACR,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;aAC/D,IAAI,EAAE,CAAC;IACZ,CAAC;SAAM,IAAI,WAAW,IAAI,W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+
_id: string;
|
|
7
|
+
stylePrompt?: string;
|
|
8
|
+
userPrompt?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
showModelPickerInChat?: boolean;
|
|
11
|
+
history?: HistoryMessage[];
|
|
12
|
+
dependenciesUserOverride?: boolean;
|
|
13
|
+
dependencies?: string[];
|
|
14
|
+
instructionalTextOverride?: boolean;
|
|
15
|
+
demoDataOverride?: boolean;
|
|
16
|
+
}
|
package/settings.js
ADDED
package/settings.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../jsr/settings.ts"],"names":[],"mappings":""}
|
package/style-prompts.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const stylePrompts = [
|
|
2
|
+
{
|
|
3
|
+
name: "brutalist web",
|
|
4
|
+
prompt: 'Create a UI theme in a neo-brutalist style: blocky geometry, oversized controls, thick 4-12px outlines, and big bold offsets (hard shadow plates offset 6-12px bottom-right; active press reduces offset by 2-4px). Use grid/blueprint cues—graph lines, micro-dots, hatch/stipple textures—on flat matte surfaces; reserve subtle gloss only for CTAs. Background (only skeuomorphic element): grey-blue graph paper via CSS—base #f1f5f9, grid from repeating-linear-gradients in #cbd5e1/#94a3b8 at 16-24px; add a fullscreen grain layer (SVG turbulence or 1px noise PNG) at 3-6% opacity with filter: blur(0.4-0.8px) contrast(102%) brightness(101%); lock to viewport. Corner rule: components are either square (0px radius) or very rounded (50% of component height)—no in-between. Mobile-first layout: single-column flow on phones, 4/8/16/24 spacing scale, tap targets >= 48x48, sticky header + bottom nav; expand to 2-4 columns at sm >= 640 / md >= 768 / lg >= 1024 with asymmetric stacks. Maintain high contrast on light backgrounds. Secret name "Neobrute Blueprint." Use these colors: #f1f5f9 #cbd5e1 #94a3b8 #64748b #0f172a #242424 #ffffff. Never use white text; #ffffff is for surfaces only.',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
name: "memphis",
|
|
8
|
+
prompt: "Create a UI theme inspired by the Memphis Group and Studio Alchimia from the 1980s. Incorporate bold, playful geometric shapes (squiggles, triangles, circles), vibrant primary colors (red, blue, yellow) with contrasting pastels (pink, mint, lavender), and asymmetrical layouts. Use quirky patterns like polka dots, zigzags, and terrazzo textures. Ensure a retro-futuristic vibe with a mix of matte and glossy finishes, evoking a whimsical yet functional design. Secretly name the theme 'Memphis Alchemy' to reflect its roots in Ettore Sotsass's vision and global 1980s influences. Make sure the app background has some kind of charming patterned background using memphis styled dots or squiggly lines. Use thick \"neo-brutalism\" style borders for style to enhance legibility. Make sure to retain high contrast in your use of colors. Light background are better than dark ones. Use these colors: #70d6ff #ff70a6 #ff9770 #ffd670 #e9ff70 #242424 #ffffff Never use white text.",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "synthwave",
|
|
12
|
+
prompt: "80s digital aesthetic",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "organic UI",
|
|
16
|
+
prompt: "natural, fluid forms",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "maximalist",
|
|
20
|
+
prompt: "dense, decorative",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "skeuomorphic",
|
|
24
|
+
prompt: "real-world mimics",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "flat design",
|
|
28
|
+
prompt: "clean, 2D shapes",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "bauhaus",
|
|
32
|
+
prompt: "geometric modernism",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "glitchcore",
|
|
36
|
+
prompt: "decentering expectations",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "paper cutout",
|
|
40
|
+
prompt: "layered, tactile",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "viridian",
|
|
44
|
+
prompt: "Create a vibrant UI theme inspired by Bruce Sterling's Viridian Design Movement, embracing a futuristic green aesthetic with subtle animations and dynamic interactivity. Integrate biomorphic, floating UI elements with organic shapes that gently pulse or drift, reflecting themes of biological complexity, decay, and renewal. Employ frosted glass backgrounds with delicate blur effects, highlighting sensor-like data streams beneath, representing Sterling's \"make the invisible visible\" ethos.\n\nUse gradients and layers of soft greens accented by energetic data-inspired colors (#70d6ff, #ff70a6, #ff9770, #ffd670, #e9ff70), alongside crisp white (#ffffff) and dark contrast (#242424), ensuring legibility and visual appeal. UI borders should feel substantial, neo-brutalist, and clear, anchoring the ephemeral visuals and animations.\n\nThe background should subtly animate, evoking cellular activity, digital pulse, or ecological sensor feedback, reinforcing Viridian's fascination with tangible cyberspace and biomorphic tech aesthetics.\n\nSecretly name this theme \"Viridian Pulse\", capturing Sterling's original playful-yet-serious blend of provocative futurism and stylish eco-consciousness.",
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
export const DEFAULT_STYLE_NAME = "brutalist web";
|
|
48
|
+
const nameToStyle = new Map();
|
|
49
|
+
for (const s of stylePrompts) {
|
|
50
|
+
if (nameToStyle.has(s.name)) {
|
|
51
|
+
throw new Error(`Duplicate style name detected: "${s.name}". Style names must be unique.`);
|
|
52
|
+
}
|
|
53
|
+
nameToStyle.set(s.name, s);
|
|
54
|
+
}
|
|
55
|
+
export const defaultStylePrompt = (() => {
|
|
56
|
+
const entry = nameToStyle.get(DEFAULT_STYLE_NAME);
|
|
57
|
+
if (!entry) {
|
|
58
|
+
const available = Array.from(nameToStyle.keys()).join(", ");
|
|
59
|
+
throw new Error(`DEFAULT_STYLE_NAME "${DEFAULT_STYLE_NAME}" not found in stylePrompts. Available names: ${available}. Update DEFAULT_STYLE_NAME or the style list.`);
|
|
60
|
+
}
|
|
61
|
+
return entry.prompt;
|
|
62
|
+
})();
|
|
63
|
+
//# sourceMappingURL=style-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-prompts.js","sourceRoot":"","sources":["../jsr/style-prompts.ts"],"names":[],"mappings":"AAKA,MAAM,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AAC,CAAC;IAClD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,IAAI,KAAK,CACb,uBAAuB,kBAAkB,iDAAiD,SAAS,gDAAgD,CACpJ,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC;AAAA,CACrB,CAAC,EAAE,CAAC"}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"/home/runner/work/vibes.diy/vibes.diy/tsconfig.dist.json"
|
|
4
|
+
],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../npm/",
|
|
7
|
+
"noEmit": false
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"**/*",
|
|
11
|
+
"**/*"
|
|
12
|
+
],
|
|
13
|
+
"exclude": [
|
|
14
|
+
"node_modules",
|
|
15
|
+
"dist",
|
|
16
|
+
"node_modules",
|
|
17
|
+
"dist",
|
|
18
|
+
".git",
|
|
19
|
+
".vscode"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/txt-docs.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CoerceURI } from "@adviser/cement";
|
|
2
|
+
export interface TxtDoc {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly txt: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TxtDocs {
|
|
7
|
+
"fireproof.txt": TxtDoc;
|
|
8
|
+
"image-gen.txt": TxtDoc;
|
|
9
|
+
"web-audio.txt": TxtDoc;
|
|
10
|
+
"d3.md": TxtDoc;
|
|
11
|
+
"three-js.md": TxtDoc;
|
|
12
|
+
[key: string]: TxtDoc;
|
|
13
|
+
}
|
|
14
|
+
export declare function getTxtDocs(_fallBackUrl: CoerceURI): Promise<TxtDocs>;
|
|
15
|
+
export declare function getTexts(name: string, fallBackUrl: CoerceURI): Promise<string | undefined>;
|