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) {
hello_worldfileDeleted.ts1 match
2122// You could also do additional processing here based on the event
23// For example, trigger other systems, update a database, etc.
24return Response.json({
25ok: true,
hello_worldfileCreated.ts1 match
2324// You could also do additional processing here based on the event
25// For example, trigger other systems, update a database, etc.
26return Response.json({
27ok: true,
project_updates_webhookqueries.ts2 matches
3import { createTables, projectStatesTableName, subscriptionsTableName } from "./migrations.ts";
45// This will create the database table if it doesn't exist.
6// This will run every time the app starts up. You can
7// comment out this line for a modest (30ms) perforamnce improvement
8// on cold starts. It's left in to ensure the database tables are
9// automatically set up correctly for users who fork this app.
10await createTables();
todaysGrindmain.tsx3 matches
1const NOTION_API_KEY = Deno.env.get("NOTION_API_KEY");
2const COFFEE_TABLE_DB_ID = Deno.env.get("NOTION_COFFEE_DATABASE_ID");
3const NOTION_DATABSE_API = "https://api.notion.com/v1/databases";
4const NOTION_PAGES_API = "https://api.notion.com/v1/pages";
5910if (!COFFEE_TABLE_DB_ID) {
11throw new Error("Missing NOTION_COFFEE_DATABASE_ID");
12}
13