1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { tables } from "../database/schema.ts";
3import type { Memory, UserProfile, Atom } from "../../shared/types.ts";
4import { MiniAtomSpace } from "./atomspace.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { initializeDatabase } from "./database/schema.ts";
4import { MiniAtomSpace } from "./cognitive/atomspace.ts";
5import { MemorySystem } from "./cognitive/memory.ts";
17const reasoningEngine = new ReasoningEngine(atomSpace, memorySystem, ecan);
18
19// Initialize database on startup
20await initializeDatabase();
21
22// Unwrap Hono errors to see original error details
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { tables } from "../database/schema.ts";
3import type { Atom, Link, AtomSpaceQuery } from "../../shared/types.ts";
4
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { initializeDatabase } from "./database/schema.ts";
4import { MiniAtomSpace } from "./cognitive/atomspace.ts";
5import { MemorySystem } from "./cognitive/memory.ts";
17const reasoningEngine = new ReasoningEngine(atomSpace, memorySystem, ecan);
18
19// Initialize database on startup
20await initializeDatabase();
21
22// Unwrap Hono errors to see original error details
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { tables } from "../database/schema.ts";
3import type { Memory, UserProfile, Atom } from "../../shared/types.ts";
4import { MiniAtomSpace } from "./atomspace.ts";
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { tables } from "../database/schema.ts";
3import type { Atom, Link, AtomSpaceQuery } from "../../shared/types.ts";
4
6const USERS_TABLE = 'nanocog_users_v1';
7
8export async function initializeDatabase() {
9 // Atoms table - core knowledge representation
10 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${ATOMS_TABLE} (
43โ โ โโโ memory.ts # Memory formation and retrieval
44โ โ โโโ reasoning.ts # Pattern recognition and reasoning
45โ โโโ database/
46โ โโโ schema.ts # SQLite schema for persistence
47โโโ shared/
1import { Database } from "https://esm.sh/duckdb-async";
2
3export default async function server(request: Request): Promise<Response> {
10
11 try {
12 const db = await Database.create(':memory:');
13 await db.all('LOAD httpfs');
14 const result = await db.all(`SELECT * FROM '${dataUrl}' LIMIT 5`);
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
5
6await createTables();