charlieMultiappList.ts1 match
78export async function QuestieList({ email }: QuestieListProps) {
9// Fetch quests from the database
10let quests = [];
11try {
charlieMultiappdb.ts4 matches
1import { sqlite } from "https://esm.town/v/std/sqlite";
23// Helper function to initialize an app's database
4export async function initAppDatabase(appName: string, schema: string) {
5try {
6await sqlite.execute(schema);
7console.log(`Initialized database schema for ${appName}`);
8return true;
9} catch (error) {
10console.error(`Error initializing database for ${appName}:`, error);
11return false;
12}
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {
invitationTrackerDbmain.tsx1 match
4const SCHEMA_VERSION = 1;
56// Initialize the database
7async function initDB() {
8await sqlite.execute(`
CyberMetaxmain.tsx2 matches
91},
92{
93name: "database_schema.sql",
94type: "database_schema",
95content: `
96CREATE TABLE users (
345346try {
347// Initialize database with enhanced error handling and add cache table
348await sqlite.execute(`
349CREATE TABLE IF NOT EXISTS ${KEY}_tools_${SCHEMA_VERSION} (
382`);
383384serverLog("INFO", "Database initialized successfully", {
385key: KEY,
386schemaVersion: SCHEMA_VERSION,
387});
388} catch (dbInitError) {
389serverLog("ERROR", "Database initialization failed", {
390error: dbInitError instanceof Error ? dbInitError.message : String(dbInitError),
391key: KEY,
393return new Response(
394JSON.stringify({
395error: "Database initialization failed",
396details: String(dbInitError),
397}),
730const finalTool = oracleResponse.tool || maverickResponse.tool;
731732// Store the tool in the database
733const toolId = finalTool.id || crypto.randomUUID();
734await sqlite.execute(
793const toolResponse: ToolResponse = JSON.parse(agentBContent);
794795// Store the tool request and response in the database
796const requestId = crypto.randomUUID();
797await sqlite.execute(
926const toolResponse: ToolResponse = JSON.parse(completionContent);
927928// Store the tool request and response in the database
929const requestId = toolRequest.id || crypto.randomUUID();
930await sqlite.execute(
1297}
12981299// If creating a tool, store it in the database
1300if (agentResponse.actionType === "create_tool" && agentResponse.tool) {
1301const toolId = agentResponse.tool.id || crypto.randomUUID();
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {
1import ValTown from "npm:@valtown/sdk";
2import { getProjectState, getWebhooks, updateProjectState } from "./database/queries.ts";
3import { sendWebhookNotification } from "./webhookService.ts";
4const vt = new ValTown();
38const currentFiles = await getProjectFiles(projectId);
3940// Get previous project state from our database
41const previousState = await getProjectState(projectId);
4288}
8990// Update project state in database
91await updateProjectState(projectId, currentFiles);
92} catch (error) {