Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/server/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* @license
* Copyright 2025 BrowserOS
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { defineConfig } from 'drizzle-kit'

export default defineConfig({
out: './drizzle',
schema: './src/lib/db/schema/index.ts',
dialect: 'sqlite',
dbCredentials: {
url: process.env.DB_PATH || 'file:./browseros.db',
},
})
3 changes: 3 additions & 0 deletions apps/server/drizzle/.synced.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tags": ["0000_living_deathbird"]
}
234 changes: 234 additions & 0 deletions apps/server/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"version": "6",
"dialect": "sqlite",
"id": "070decca-6dde-4038-8921-dbe4ef14156e",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"conversations": {
"name": "conversations",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"browseros_id": {
"name": "browseros_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"model": {
"name": "model",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {
"idx_conversations_browseros_id": {
"name": "idx_conversations_browseros_id",
"columns": ["browseros_id"],
"isUnique": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"messages": {
"name": "messages",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"conversation_id": {
"name": "conversation_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"content": {
"name": "content",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {
"idx_messages_conversation_id": {
"name": "idx_messages_conversation_id",
"columns": ["conversation_id"],
"isUnique": false
}
},
"foreignKeys": {
"messages_conversation_id_conversations_id_fk": {
"name": "messages_conversation_id_conversations_id_fk",
"tableFrom": "messages",
"tableTo": "conversations",
"columnsFrom": ["conversation_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {
"role_check": {
"name": "role_check",
"value": "\"messages\".\"role\" IN ('user', 'assistant', 'system')"
}
}
},
"identity": {
"name": "identity",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"browseros_id": {
"name": "browseros_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {
"singleton_check": {
"name": "singleton_check",
"value": "\"identity\".\"id\" = 1"
}
}
},
"rate_limiter": {
"name": "rate_limiter",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"browseros_id": {
"name": "browseros_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {
"idx_rate_limiter_browseros_id_date": {
"name": "idx_rate_limiter_browseros_id_date",
"columns": ["browseros_id", "created_at"],
"isUnique": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}
13 changes: 13 additions & 0 deletions apps/server/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "6",
"when": 1768440681533,
"tag": "0000_living_deathbird",
"breakpoints": true
}
]
}
27 changes: 17 additions & 10 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"test:integration": "bun run test:cleanup && bun --env-file=.env.development test tests/server.integration.test.ts",
"test:sdk": "bun run test:cleanup && bun --env-file=.env.development test tests/sdk",
"test:cleanup": "./tests/__helpers__/cleanup.sh",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"db:sync": "bun scripts/db/sync-schema.ts",
"db:generate": "bunx drizzle-kit generate",
"db:studio": "bunx drizzle-kit studio",
"db:push": "bunx drizzle-kit push"
},
"exports": {
".": {
Expand All @@ -26,8 +30,6 @@
}
},
"dependencies": {
"@browseros/shared": "workspace:*",
"@browseros-ai/agent-sdk": "workspace:*",
"@ai-sdk/amazon-bedrock": "^3.0.59",
"@ai-sdk/anthropic": "^2.0.47",
"@ai-sdk/azure": "^2.0.74",
Expand All @@ -36,33 +38,38 @@
"@ai-sdk/openai-compatible": "^1.0.27",
"@ai-sdk/provider": "2.0.0",
"@ai-sdk/ui-utils": "^1.2.11",
"@browseros-ai/agent-sdk": "workspace:*",
"@browseros/shared": "workspace:*",
"@google/gemini-cli-core": "^0.16.0",
"@google/genai": "1.30.0",
"@hono/mcp": "^0.2.3",
"@hono/node-server": "^1.19.6",
"@hono/zod-validator": "^0.4.3",
"@modelcontextprotocol/sdk": "^1.25.2",
"@openrouter/ai-sdk-provider": "^1.5.2",
"@sentry/bun": "^10.31.0",
"ai": "^5.0.101",
"commander": "^14.0.1",
"core-js": "3.45.1",
"debug": "4.4.3",
"drizzle-orm": "^0.45.1",
"eventsource-parser": "^3.0.0",
"hono": "^4.6.0",
"@hono/mcp": "^0.2.3",
"@hono/zod-validator": "^0.4.3",
"pino": "^9.6.0",
"posthog-node": "^4.17.0",
"puppeteer-core": "24.23.0",
"ws": "^8.18.0",
"zod": "^3.24.2",
"pino": "^9.6.0",
"eventsource-parser": "^3.0.0"
"zod": "^3.24.2"
},
"devDependencies": {
"async-mutex": "^0.5.0",
"pino-pretty": "^13.0.0",
"@libsql/client": "^0.17.0",
"@types/bun": "1.3.5",
"@types/debug": "^4.1.12",
"@types/node": "^24.3.3",
"@types/ws": "^8.5.13",
"async-mutex": "^0.5.0",
"drizzle-kit": "^0.31.8",
"pino-pretty": "^13.0.0",
"puppeteer": "24.23.0",
"typescript": "^5.9.2"
},
Expand Down
Loading