🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🗃️ feat(database): add created_by_agent_id column to documents (#22616)
Arvin Xu45206bf75a2e
diff --git a/docs/development/database-schema.dbml b/docs/development/database-schema.dbmlindex fc737ba84ce..a92d6786ded 100644--- a/docs/development/database-schema.dbml+++ b/docs/development/database-schema.dbml@@ -2164,6 +2164,7 @@ table documents {editor_data jsonbslug varchar(255)workspace_id text+ created_by_agent_id textvisibility text [not null, default: 'public']deleted_at "timestamp with time zone"is_deleted booleandiff --git a/packages/database/migrations/0211_add_documents_created_by_agent_id.sql b/packages/database/migrations/0211_add_documents_created_by_agent_id.sqlnew file mode 100644index 00000000000..6b123529a5f--- /dev/null+++ b/packages/database/migrations/0211_add_documents_created_by_agent_id.sql@@ -0,0 +1 @@+ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "created_by_agent_id" text;diff --git a/packages/database/migrations/meta/0201_snapshot.json b/packages/database/migrations/meta/0211_snapshot.jsonsimilarity index 96%rename from packages/database/migrations/meta/0201_snapshot.jsonrename to packages/database/migrations/meta/0211_snapshot.jsonindex 308a5d52783..117782ce46a 100644--- a/packages/database/migrations/meta/0201_snapshot.json+++ b/packages/database/migrations/meta/0211_snapshot.json@@ -6,9 +6,9 @@},"dialect": "postgresql","enums": {},- "id": "e8a1f357-1bc4-496e-a22d-946c48f501f6",+ "id": "45b20770-a9d5-4005-9171-07a02f3ec86d","policies": {},- "prevId": "be44ceb9-0874-47bd-9473-386a5c55c022",+ "prevId": "cde6aca7-5edb-4f76-9a5c-e9a8d7f3721e","roles": {},"schemas": {},"sequences": {@@ -1610,6 +1610,13 @@"notNull": false,"default": "'{}'::jsonb"},+ "settings": {+ "name": "settings",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'{}'::jsonb"+ },"revoked_at": {"name": "revoked_at","type": "timestamp with time zone",@@ -2755,271 +2762,128 @@"checkConstraints": {},"isRLSEnabled": false},- "public.agent_eval_benchmarks": {- "name": "agent_eval_benchmarks",+ "public.agent_eval_memories": {+ "name": "agent_eval_memories","schema": "","columns": {"id": {"name": "id",- "type": "text",+ "type": "uuid","primaryKey": true,- "notNull": true- },- "identifier": {- "name": "identifier",- "type": "text",- "primaryKey": false,- "notNull": true+ "notNull": true,+ "default": "gen_random_uuid()"},- "name": {- "name": "name",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,"notNull": true},- "description": {- "name": "description",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "rubrics": {- "name": "rubrics",- "type": "jsonb",+ "run_id": {+ "name": "run_id",+ "type": "text","primaryKey": false,"notNull": true},- "reference_url": {- "name": "reference_url",+ "topic_id": {+ "name": "topic_id","type": "text","primaryKey": false,"notNull": false},- "metadata": {- "name": "metadata",- "type": "jsonb",- "primaryKey": false,- "notNull": false- },- "user_id": {- "name": "user_id",+ "thread_id": {+ "name": "thread_id","type": "text","primaryKey": false,"notNull": false},- "workspace_id": {- "name": "workspace_id",+ "attempt_id": {+ "name": "attempt_id","type": "text","primaryKey": false,- "notNull": false- },- "is_system": {- "name": "is_system",- "type": "boolean",- "primaryKey": false,- "notNull": true,- "default": true+ "notNull": true},- "accessed_at": {- "name": "accessed_at",- "type": "timestamp with time zone",+ "layer": {+ "name": "layer",+ "type": "text","primaryKey": false,- "notNull": true,- "default": "now()"+ "notNull": true},- "created_at": {- "name": "created_at",- "type": "timestamp with time zone",+ "source": {+ "name": "source",+ "type": "text","primaryKey": false,- "notNull": true,- "default": "now()"+ "notNull": true},- "updated_at": {- "name": "updated_at",- "type": "timestamp with time zone",+ "fixture_hash": {+ "name": "fixture_hash",+ "type": "text","primaryKey": false,- "notNull": true,- "default": "now()"- }- },- "indexes": {- "agent_eval_benchmarks_identifier_user_id_unique": {- "name": "agent_eval_benchmarks_identifier_user_id_unique",- "columns": [- {- "expression": "identifier",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "user_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": true,- "where": "\"agent_eval_benchmarks\".\"workspace_id\" is null",- "concurrently": false,- "method": "btree",- "with": {}- },- "agent_eval_benchmarks_is_system_idx": {- "name": "agent_eval_benchmarks_is_system_idx",- "columns": [- {- "expression": "is_system",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "agent_eval_benchmarks_user_id_idx": {- "name": "agent_eval_benchmarks_user_id_idx",- "columns": [- {- "expression": "user_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "agent_eval_benchmarks_workspace_id_idx": {- "name": "agent_eval_benchmarks_workspace_id_idx",- "columns": [- {- "expression": "workspace_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "agent_eval_benchmarks_identifier_workspace_id_unique": {- "name": "agent_eval_benchmarks_identifier_workspace_id_unique",- "columns": [- {- "expression": "workspace_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "identifier",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": true,- "where": "\"agent_eval_benchmarks\".\"workspace_id\" is not null",- "concurrently": false,- "method": "btree",- "with": {}- }- },- "foreignKeys": {- "agent_eval_benchmarks_user_id_users_id_fk": {- "name": "agent_eval_benchmarks_user_id_users_id_fk",- "tableFrom": "agent_eval_benchmarks",- "tableTo": "users",- "columnsFrom": ["user_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"+ "notNull": false},- "agent_eval_benchmarks_workspace_id_workspaces_id_fk": {- "name": "agent_eval_benchmarks_workspace_id_workspaces_id_fk",- "tableFrom": "agent_eval_benchmarks",- "tableTo": "workspaces",- "columnsFrom": ["workspace_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- }- },- "compositePrimaryKeys": {},- "uniqueConstraints": {},- "policies": {},- "checkConstraints": {},- "isRLSEnabled": false- },- "public.agent_eval_datasets": {- "name": "agent_eval_datasets",- "schema": "",- "columns": {- "id": {- "name": "id",+ "title": {+ "name": "title","type": "text",- "primaryKey": true,- "notNull": true+ "primaryKey": false,+ "notNull": false},- "benchmark_id": {- "name": "benchmark_id",+ "summary": {+ "name": "summary","type": "text","primaryKey": false,"notNull": false},- "source_experiment_id": {- "name": "source_experiment_id",+ "details": {+ "name": "details","type": "text","primaryKey": false,"notNull": false},- "identifier": {- "name": "identifier",+ "memory_category": {+ "name": "memory_category","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "user_id": {- "name": "user_id",+ "memory_type": {+ "name": "memory_type","type": "text","primaryKey": false,"notNull": false},- "workspace_id": {- "name": "workspace_id",- "type": "text",+ "tags": {+ "name": "tags",+ "type": "jsonb","primaryKey": false,"notNull": false},- "name": {- "name": "name",- "type": "text",+ "payload": {+ "name": "payload",+ "type": "jsonb","primaryKey": false,"notNull": true},- "description": {- "name": "description",- "type": "text",+ "embedding": {+ "name": "embedding",+ "type": "vector(1024)","primaryKey": false,"notNull": false},- "eval_mode": {- "name": "eval_mode",- "type": "text",+ "captured_at": {+ "name": "captured_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true},- "eval_config": {- "name": "eval_config",- "type": "jsonb",+ "removed_reason": {+ "name": "removed_reason",+ "type": "text","primaryKey": false,"notNull": false},@@ -3052,33 +2916,26 @@}},"indexes": {- "agent_eval_datasets_identifier_user_id_unique": {- "name": "agent_eval_datasets_identifier_user_id_unique",+ "agent_eval_memories_attempt_id_idx": {+ "name": "agent_eval_memories_attempt_id_idx","columns": [{- "expression": "identifier",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "user_id",+ "expression": "attempt_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": true,- "where": "\"agent_eval_datasets\".\"workspace_id\" is null",+ "isUnique": false,"concurrently": false,"method": "btree","with": {}},- "agent_eval_datasets_benchmark_id_idx": {- "name": "agent_eval_datasets_benchmark_id_idx",+ "agent_eval_memories_run_id_idx": {+ "name": "agent_eval_memories_run_id_idx","columns": [{- "expression": "benchmark_id",+ "expression": "run_id","isExpression": false,"asc": true,"nulls": "last"@@ -3089,11 +2946,11 @@"method": "btree","with": {}},- "agent_eval_datasets_source_experiment_id_idx": {- "name": "agent_eval_datasets_source_experiment_id_idx",+ "agent_eval_memories_topic_id_idx": {+ "name": "agent_eval_memories_topic_id_idx","columns": [{- "expression": "source_experiment_id",+ "expression": "topic_id","isExpression": false,"asc": true,"nulls": "last"@@ -3104,11 +2961,11 @@"method": "btree","with": {}},- "agent_eval_datasets_user_id_idx": {- "name": "agent_eval_datasets_user_id_idx",+ "agent_eval_memories_thread_id_idx": {+ "name": "agent_eval_memories_thread_id_idx","columns": [{- "expression": "user_id",+ "expression": "thread_id","isExpression": false,"asc": true,"nulls": "last"@@ -3119,11 +2976,11 @@"method": "btree","with": {}},- "agent_eval_datasets_workspace_id_idx": {- "name": "agent_eval_datasets_workspace_id_idx",+ "agent_eval_memories_user_id_idx": {+ "name": "agent_eval_memories_user_id_idx","columns": [{- "expression": "workspace_id",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"@@ -3134,64 +2991,66 @@"method": "btree","with": {}},- "agent_eval_datasets_identifier_workspace_id_unique": {- "name": "agent_eval_datasets_identifier_workspace_id_unique",+ "agent_eval_memories_workspace_id_idx": {+ "name": "agent_eval_memories_workspace_id_idx","columns": [{"expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"- },- {- "expression": "identifier",- "isExpression": false,- "asc": true,- "nulls": "last"}],- "isUnique": true,- "where": "\"agent_eval_datasets\".\"workspace_id\" is not null",+ "isUnique": false,"concurrently": false,"method": "btree","with": {}}},"foreignKeys": {- "agent_eval_datasets_benchmark_id_agent_eval_benchmarks_id_fk": {- "name": "agent_eval_datasets_benchmark_id_agent_eval_benchmarks_id_fk",- "tableFrom": "agent_eval_datasets",- "tableTo": "agent_eval_benchmarks",- "columnsFrom": ["benchmark_id"],+ "agent_eval_memories_user_id_users_id_fk": {+ "name": "agent_eval_memories_user_id_users_id_fk",+ "tableFrom": "agent_eval_memories",+ "tableTo": "users",+ "columnsFrom": ["user_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "agent_eval_datasets_source_experiment_id_agent_eval_experiments_id_fk": {- "name": "agent_eval_datasets_source_experiment_id_agent_eval_experiments_id_fk",- "tableFrom": "agent_eval_datasets",- "tableTo": "agent_eval_experiments",- "columnsFrom": ["source_experiment_id"],+ "agent_eval_memories_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_memories_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_memories",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],"columnsTo": ["id"],- "onDelete": "set null",+ "onDelete": "cascade","onUpdate": "no action"},- "agent_eval_datasets_user_id_users_id_fk": {- "name": "agent_eval_datasets_user_id_users_id_fk",- "tableFrom": "agent_eval_datasets",- "tableTo": "users",- "columnsFrom": ["user_id"],+ "agent_eval_memories_run_id_agent_eval_runs_id_fk": {+ "name": "agent_eval_memories_run_id_agent_eval_runs_id_fk",+ "tableFrom": "agent_eval_memories",+ "tableTo": "agent_eval_runs",+ "columnsFrom": ["run_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "agent_eval_datasets_workspace_id_workspaces_id_fk": {- "name": "agent_eval_datasets_workspace_id_workspaces_id_fk",- "tableFrom": "agent_eval_datasets",- "tableTo": "workspaces",- "columnsFrom": ["workspace_id"],+ "agent_eval_memories_topic_id_topics_id_fk": {+ "name": "agent_eval_memories_topic_id_topics_id_fk",+ "tableFrom": "agent_eval_memories",+ "tableTo": "topics",+ "columnsFrom": ["topic_id"],"columnsTo": ["id"],- "onDelete": "cascade",+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "agent_eval_memories_thread_id_threads_id_fk": {+ "name": "agent_eval_memories_thread_id_threads_id_fk",+ "tableFrom": "agent_eval_memories",+ "tableTo": "threads",+ "columnsFrom": ["thread_id"],+ "columnsTo": ["id"],+ "onDelete": "set null","onUpdate": "no action"}},@@ -3201,27 +3060,57 @@"checkConstraints": {},"isRLSEnabled": false},- "public.agent_eval_experiment_benchmarks": {- "name": "agent_eval_experiment_benchmarks",+ "public.agent_eval_benchmarks": {+ "name": "agent_eval_benchmarks","schema": "","columns": {- "experiment_id": {- "name": "experiment_id",+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "identifier": {+ "name": "identifier","type": "text","primaryKey": false,"notNull": true},- "benchmark_id": {- "name": "benchmark_id",+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "description": {+ "name": "description","type": "text","primaryKey": false,+ "notNull": false+ },+ "rubrics": {+ "name": "rubrics",+ "type": "jsonb",+ "primaryKey": false,"notNull": true},+ "reference_url": {+ "name": "reference_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },"user_id": {"name": "user_id","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},"workspace_id": {"name": "workspace_id",@@ -3229,20 +3118,63 @@"primaryKey": false,"notNull": false},+ "is_system": {+ "name": "is_system",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": true+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },"created_at": {"name": "created_at","type": "timestamp with time zone","primaryKey": false,"notNull": true,"default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"}},"indexes": {- "agent_eval_experiment_benchmarks_benchmark_id_idx": {- "name": "agent_eval_experiment_benchmarks_benchmark_id_idx",+ "agent_eval_benchmarks_identifier_user_id_unique": {+ "name": "agent_eval_benchmarks_identifier_user_id_unique","columns": [{- "expression": "benchmark_id",+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"agent_eval_benchmarks\".\"workspace_id\" is null",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_benchmarks_is_system_idx": {+ "name": "agent_eval_benchmarks_is_system_idx",+ "columns": [+ {+ "expression": "is_system","isExpression": false,"asc": true,"nulls": "last"@@ -3253,8 +3185,8 @@"method": "btree","with": {}},- "agent_eval_experiment_benchmarks_user_id_idx": {- "name": "agent_eval_experiment_benchmarks_user_id_idx",+ "agent_eval_benchmarks_user_id_idx": {+ "name": "agent_eval_benchmarks_user_id_idx","columns": [{"expression": "user_id",@@ -3268,8 +3200,8 @@"method": "btree","with": {}},- "agent_eval_experiment_benchmarks_workspace_id_idx": {- "name": "agent_eval_experiment_benchmarks_workspace_id_idx",+ "agent_eval_benchmarks_workspace_id_idx": {+ "name": "agent_eval_benchmarks_workspace_id_idx","columns": [{"expression": "workspace_id",@@ -3282,39 +3214,43 @@"concurrently": false,"method": "btree","with": {}+ },+ "agent_eval_benchmarks_identifier_workspace_id_unique": {+ "name": "agent_eval_benchmarks_identifier_workspace_id_unique",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"agent_eval_benchmarks\".\"workspace_id\" is not null",+ "concurrently": false,+ "method": "btree",+ "with": {}}},"foreignKeys": {- "agent_eval_experiment_benchmarks_experiment_id_agent_eval_experiments_id_fk": {- "name": "agent_eval_experiment_benchmarks_experiment_id_agent_eval_experiments_id_fk",- "tableFrom": "agent_eval_experiment_benchmarks",- "tableTo": "agent_eval_experiments",- "columnsFrom": ["experiment_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "agent_eval_experiment_benchmarks_benchmark_id_agent_eval_benchmarks_id_fk": {- "name": "agent_eval_experiment_benchmarks_benchmark_id_agent_eval_benchmarks_id_fk",- "tableFrom": "agent_eval_experiment_benchmarks",- "tableTo": "agent_eval_benchmarks",- "columnsFrom": ["benchmark_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "agent_eval_experiment_benchmarks_user_id_users_id_fk": {- "name": "agent_eval_experiment_benchmarks_user_id_users_id_fk",- "tableFrom": "agent_eval_experiment_benchmarks",+ "agent_eval_benchmarks_user_id_users_id_fk": {+ "name": "agent_eval_benchmarks_user_id_users_id_fk",+ "tableFrom": "agent_eval_benchmarks","tableTo": "users","columnsFrom": ["user_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "agent_eval_experiment_benchmarks_workspace_id_workspaces_id_fk": {- "name": "agent_eval_experiment_benchmarks_workspace_id_workspaces_id_fk",- "tableFrom": "agent_eval_experiment_benchmarks",+ "agent_eval_benchmarks_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_benchmarks_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_benchmarks","tableTo": "workspaces","columnsFrom": ["workspace_id"],"columnsTo": ["id"],@@ -3322,19 +3258,14 @@"onUpdate": "no action"}},- "compositePrimaryKeys": {- "agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk": {- "name": "agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk",- "columns": ["experiment_id", "benchmark_id"]- }- },+ "compositePrimaryKeys": {},"uniqueConstraints": {},"policies": {},"checkConstraints": {},"isRLSEnabled": false},- "public.agent_eval_experiments": {- "name": "agent_eval_experiments",+ "public.agent_eval_datasets": {+ "name": "agent_eval_datasets","schema": "","columns": {"id": {@@ -3343,11 +3274,29 @@"primaryKey": true,"notNull": true},+ "benchmark_id": {+ "name": "benchmark_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "source_experiment_id": {+ "name": "source_experiment_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "identifier": {+ "name": "identifier",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },"user_id": {"name": "user_id","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},"workspace_id": {"name": "workspace_id",@@ -3367,6 +3316,18 @@"primaryKey": false,"notNull": false},+ "eval_mode": {+ "name": "eval_mode",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "eval_config": {+ "name": "eval_config",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },"metadata": {"name": "metadata","type": "jsonb",@@ -3396,9 +3357,15 @@}},"indexes": {- "agent_eval_experiments_user_id_idx": {- "name": "agent_eval_experiments_user_id_idx",+ "agent_eval_datasets_identifier_user_id_unique": {+ "name": "agent_eval_datasets_identifier_user_id_unique","columns": [+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },{"expression": "user_id","isExpression": false,@@ -3406,13 +3373,59 @@"nulls": "last"}],+ "isUnique": true,+ "where": "\"agent_eval_datasets\".\"workspace_id\" is null",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_datasets_benchmark_id_idx": {+ "name": "agent_eval_datasets_benchmark_id_idx",+ "columns": [+ {+ "expression": "benchmark_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],"isUnique": false,"concurrently": false,"method": "btree","with": {}},- "agent_eval_experiments_workspace_id_idx": {- "name": "agent_eval_experiments_workspace_id_idx",+ "agent_eval_datasets_source_experiment_id_idx": {+ "name": "agent_eval_datasets_source_experiment_id_idx",+ "columns": [+ {+ "expression": "source_experiment_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_datasets_user_id_idx": {+ "name": "agent_eval_datasets_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_datasets_workspace_id_idx": {+ "name": "agent_eval_datasets_workspace_id_idx","columns": [{"expression": "workspace_id",@@ -3425,21 +3438,61 @@"concurrently": false,"method": "btree","with": {}+ },+ "agent_eval_datasets_identifier_workspace_id_unique": {+ "name": "agent_eval_datasets_identifier_workspace_id_unique",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"agent_eval_datasets\".\"workspace_id\" is not null",+ "concurrently": false,+ "method": "btree",+ "with": {}}},"foreignKeys": {- "agent_eval_experiments_user_id_users_id_fk": {- "name": "agent_eval_experiments_user_id_users_id_fk",- "tableFrom": "agent_eval_experiments",+ "agent_eval_datasets_benchmark_id_agent_eval_benchmarks_id_fk": {+ "name": "agent_eval_datasets_benchmark_id_agent_eval_benchmarks_id_fk",+ "tableFrom": "agent_eval_datasets",+ "tableTo": "agent_eval_benchmarks",+ "columnsFrom": ["benchmark_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_datasets_source_experiment_id_agent_eval_experiments_id_fk": {+ "name": "agent_eval_datasets_source_experiment_id_agent_eval_experiments_id_fk",+ "tableFrom": "agent_eval_datasets",+ "tableTo": "agent_eval_experiments",+ "columnsFrom": ["source_experiment_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "agent_eval_datasets_user_id_users_id_fk": {+ "name": "agent_eval_datasets_user_id_users_id_fk",+ "tableFrom": "agent_eval_datasets","tableTo": "users","columnsFrom": ["user_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "agent_eval_experiments_workspace_id_workspaces_id_fk": {- "name": "agent_eval_experiments_workspace_id_workspaces_id_fk",- "tableFrom": "agent_eval_experiments",+ "agent_eval_datasets_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_datasets_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_datasets","tableTo": "workspaces","columnsFrom": ["workspace_id"],"columnsTo": ["id"],@@ -3453,15 +3506,22 @@"checkConstraints": {},"isRLSEnabled": false},- "public.agent_eval_run_topics": {- "name": "agent_eval_run_topics",+ "public.agent_eval_environments": {+ "name": "agent_eval_environments","schema": "","columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },"user_id": {"name": "user_id","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},"workspace_id": {"name": "workspace_id",@@ -3469,47 +3529,42 @@"primaryKey": false,"notNull": false},- "run_id": {- "name": "run_id",- "type": "text",- "primaryKey": false,- "notNull": true- },- "topic_id": {- "name": "topic_id",+ "identifier": {+ "name": "identifier","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "test_case_id": {- "name": "test_case_id",+ "name": {+ "name": "name","type": "text","primaryKey": false,"notNull": true},- "status": {- "name": "status",+ "description": {+ "name": "description","type": "text","primaryKey": false,"notNull": false},- "score": {- "name": "score",- "type": "real",+ "config": {+ "name": "config",+ "type": "jsonb","primaryKey": false,- "notNull": false+ "notNull": true},- "passed": {- "name": "passed",- "type": "boolean",+ "metadata": {+ "name": "metadata",+ "type": "jsonb","primaryKey": false,"notNull": false},- "eval_result": {- "name": "eval_result",- "type": "jsonb",+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},"created_at": {"name": "created_at",@@ -3517,11 +3572,18 @@"primaryKey": false,"notNull": true,"default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"}},"indexes": {- "agent_eval_run_topics_user_id_idx": {- "name": "agent_eval_run_topics_user_id_idx",+ "agent_eval_environments_user_id_idx": {+ "name": "agent_eval_environments_user_id_idx","columns": [{"expression": "user_id",@@ -3535,11 +3597,11 @@"method": "btree","with": {}},- "agent_eval_run_topics_run_id_idx": {- "name": "agent_eval_run_topics_run_id_idx",+ "agent_eval_environments_workspace_id_idx": {+ "name": "agent_eval_environments_workspace_id_idx","columns": [{- "expression": "run_id",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"@@ -3550,24 +3612,37 @@"method": "btree","with": {}},- "agent_eval_run_topics_test_case_id_idx": {- "name": "agent_eval_run_topics_test_case_id_idx",+ "agent_eval_environments_identifier_user_id_unique": {+ "name": "agent_eval_environments_identifier_user_id_unique","columns": [{- "expression": "test_case_id",+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,+ "isUnique": true,+ "where": "\"agent_eval_environments\".\"identifier\" IS NOT NULL AND \"agent_eval_environments\".\"workspace_id\" IS NULL","concurrently": false,"method": "btree","with": {}},- "agent_eval_run_topics_workspace_id_idx": {- "name": "agent_eval_run_topics_workspace_id_idx",+ "agent_eval_environments_identifier_workspace_id_unique": {+ "name": "agent_eval_environments_identifier_workspace_id_unique","columns": [+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },{"expression": "workspace_id","isExpression": false,@@ -3575,64 +3650,471 @@"nulls": "last"}],- "isUnique": false,+ "isUnique": true,+ "where": "\"agent_eval_environments\".\"identifier\" IS NOT NULL AND \"agent_eval_environments\".\"workspace_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}}},"foreignKeys": {- "agent_eval_run_topics_user_id_users_id_fk": {- "name": "agent_eval_run_topics_user_id_users_id_fk",- "tableFrom": "agent_eval_run_topics",+ "agent_eval_environments_user_id_users_id_fk": {+ "name": "agent_eval_environments_user_id_users_id_fk",+ "tableFrom": "agent_eval_environments","tableTo": "users","columnsFrom": ["user_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "agent_eval_run_topics_workspace_id_workspaces_id_fk": {- "name": "agent_eval_run_topics_workspace_id_workspaces_id_fk",- "tableFrom": "agent_eval_run_topics",+ "agent_eval_environments_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_environments_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_environments","tableTo": "workspaces","columnsFrom": ["workspace_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"- },- "agent_eval_run_topics_run_id_agent_eval_runs_id_fk": {- "name": "agent_eval_run_topics_run_id_agent_eval_runs_id_fk",- "tableFrom": "agent_eval_run_topics",- "tableTo": "agent_eval_runs",- "columnsFrom": ["run_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "agent_eval_run_topics_topic_id_topics_id_fk": {- "name": "agent_eval_run_topics_topic_id_topics_id_fk",- "tableFrom": "agent_eval_run_topics",- "tableTo": "topics",- "columnsFrom": ["topic_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "agent_eval_run_topics_test_case_id_agent_eval_test_cases_id_fk": {- "name": "agent_eval_run_topics_test_case_id_agent_eval_test_cases_id_fk",- "tableFrom": "agent_eval_run_topics",- "tableTo": "agent_eval_test_cases",- "columnsFrom": ["test_case_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"}},- "compositePrimaryKeys": {- "agent_eval_run_topics_run_id_topic_id_pk": {- "name": "agent_eval_run_topics_run_id_topic_id_pk",- "columns": ["run_id", "topic_id"]- }+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.agent_eval_experiment_benchmarks": {+ "name": "agent_eval_experiment_benchmarks",+ "schema": "",+ "columns": {+ "experiment_id": {+ "name": "experiment_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "benchmark_id": {+ "name": "benchmark_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "agent_eval_experiment_benchmarks_benchmark_id_idx": {+ "name": "agent_eval_experiment_benchmarks_benchmark_id_idx",+ "columns": [+ {+ "expression": "benchmark_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_experiment_benchmarks_user_id_idx": {+ "name": "agent_eval_experiment_benchmarks_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_experiment_benchmarks_workspace_id_idx": {+ "name": "agent_eval_experiment_benchmarks_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "agent_eval_experiment_benchmarks_experiment_id_agent_eval_experiments_id_fk": {+ "name": "agent_eval_experiment_benchmarks_experiment_id_agent_eval_experiments_id_fk",+ "tableFrom": "agent_eval_experiment_benchmarks",+ "tableTo": "agent_eval_experiments",+ "columnsFrom": ["experiment_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_experiment_benchmarks_benchmark_id_agent_eval_benchmarks_id_fk": {+ "name": "agent_eval_experiment_benchmarks_benchmark_id_agent_eval_benchmarks_id_fk",+ "tableFrom": "agent_eval_experiment_benchmarks",+ "tableTo": "agent_eval_benchmarks",+ "columnsFrom": ["benchmark_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_experiment_benchmarks_user_id_users_id_fk": {+ "name": "agent_eval_experiment_benchmarks_user_id_users_id_fk",+ "tableFrom": "agent_eval_experiment_benchmarks",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_experiment_benchmarks_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_experiment_benchmarks_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_experiment_benchmarks",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk": {+ "name": "agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk",+ "columns": ["experiment_id", "benchmark_id"]+ }+ },+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.agent_eval_experiments": {+ "name": "agent_eval_experiments",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "agent_eval_experiments_user_id_idx": {+ "name": "agent_eval_experiments_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_experiments_workspace_id_idx": {+ "name": "agent_eval_experiments_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "agent_eval_experiments_user_id_users_id_fk": {+ "name": "agent_eval_experiments_user_id_users_id_fk",+ "tableFrom": "agent_eval_experiments",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_experiments_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_experiments_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_experiments",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.agent_eval_run_topics": {+ "name": "agent_eval_run_topics",+ "schema": "",+ "columns": {+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "run_id": {+ "name": "run_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "topic_id": {+ "name": "topic_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "test_case_id": {+ "name": "test_case_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "score": {+ "name": "score",+ "type": "real",+ "primaryKey": false,+ "notNull": false+ },+ "passed": {+ "name": "passed",+ "type": "boolean",+ "primaryKey": false,+ "notNull": false+ },+ "eval_result": {+ "name": "eval_result",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "agent_eval_run_topics_user_id_idx": {+ "name": "agent_eval_run_topics_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_run_topics_run_id_idx": {+ "name": "agent_eval_run_topics_run_id_idx",+ "columns": [+ {+ "expression": "run_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_run_topics_test_case_id_idx": {+ "name": "agent_eval_run_topics_test_case_id_idx",+ "columns": [+ {+ "expression": "test_case_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "agent_eval_run_topics_workspace_id_idx": {+ "name": "agent_eval_run_topics_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "agent_eval_run_topics_user_id_users_id_fk": {+ "name": "agent_eval_run_topics_user_id_users_id_fk",+ "tableFrom": "agent_eval_run_topics",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_run_topics_workspace_id_workspaces_id_fk": {+ "name": "agent_eval_run_topics_workspace_id_workspaces_id_fk",+ "tableFrom": "agent_eval_run_topics",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_run_topics_run_id_agent_eval_runs_id_fk": {+ "name": "agent_eval_run_topics_run_id_agent_eval_runs_id_fk",+ "tableFrom": "agent_eval_run_topics",+ "tableTo": "agent_eval_runs",+ "columnsFrom": ["run_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_run_topics_topic_id_topics_id_fk": {+ "name": "agent_eval_run_topics_topic_id_topics_id_fk",+ "tableFrom": "agent_eval_run_topics",+ "tableTo": "topics",+ "columnsFrom": ["topic_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "agent_eval_run_topics_test_case_id_agent_eval_test_cases_id_fk": {+ "name": "agent_eval_run_topics_test_case_id_agent_eval_test_cases_id_fk",+ "tableFrom": "agent_eval_run_topics",+ "tableTo": "agent_eval_test_cases",+ "columnsFrom": ["test_case_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "agent_eval_run_topics_run_id_topic_id_pk": {+ "name": "agent_eval_run_topics_run_id_topic_id_pk",+ "columns": ["run_id", "topic_id"]+ }},"uniqueConstraints": {},"policies": {},@@ -3921,7 +4403,7 @@"name": "user_id","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},"workspace_id": {"name": "workspace_id",@@ -3935,6 +4417,12 @@"primaryKey": false,"notNull": true},+ "environment_id": {+ "name": "environment_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },"content": {"name": "content","type": "jsonb",@@ -4018,6 +4506,21 @@"method": "btree","with": {}},+ "agent_eval_test_cases_environment_id_idx": {+ "name": "agent_eval_test_cases_environment_id_idx",+ "columns": [+ {+ "expression": "environment_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },"agent_eval_test_cases_sort_order_idx": {"name": "agent_eval_test_cases_sort_order_idx","columns": [@@ -4076,6 +4579,15 @@"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"+ },+ "agent_eval_test_cases_environment_id_agent_eval_environments_id_fk": {+ "name": "agent_eval_test_cases_environment_id_agent_eval_environments_id_fk",+ "tableFrom": "agent_eval_test_cases",+ "tableTo": "agent_eval_environments",+ "columnsFrom": ["environment_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"}},"compositePrimaryKeys": {},@@ -4849,6 +5361,21 @@"method": "btree","with": {}},+ "agent_inbox_messages_topic_id_idx": {+ "name": "agent_inbox_messages_topic_id_idx",+ "columns": [+ {+ "expression": "topic_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },"agent_inbox_messages_user_id_idx": {"name": "agent_inbox_messages_user_id_idx","columns": [@@ -6856,6 +7383,27 @@"method": "btree","with": {}},+ "agent_operations_workspace_id_created_at_idx": {+ "name": "agent_operations_workspace_id_created_at_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },"agent_operations_metadata_idx": {"name": "agent_operations_metadata_idx","columns": [@@ -10796,6 +11344,12 @@"primaryKey": false,"notNull": false},+ "wake": {+ "name": "wake",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },"manifest": {"name": "manifest","type": "jsonb",@@ -17912,6 +18466,12 @@"primaryKey": false,"notNull": false},+ "created_by_agent_id": {+ "name": "created_by_agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },"visibility": {"name": "visibility","type": "text",@@ -22331,100 +22891,927 @@}},"indexes": {- "linear_sync_rules_project_id_idx": {- "name": "linear_sync_rules_project_id_idx",+ "linear_sync_rules_project_id_idx": {+ "name": "linear_sync_rules_project_id_idx",+ "columns": [+ {+ "expression": "project_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "linear_sync_rules_connection_id_idx": {+ "name": "linear_sync_rules_connection_id_idx",+ "columns": [+ {+ "expression": "connection_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "linear_sync_rules_user_id_idx": {+ "name": "linear_sync_rules_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "linear_sync_rules_workspace_id_idx": {+ "name": "linear_sync_rules_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "linear_sync_rules_project_id_projects_id_fk": {+ "name": "linear_sync_rules_project_id_projects_id_fk",+ "tableFrom": "linear_sync_rules",+ "tableTo": "projects",+ "columnsFrom": ["project_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "linear_sync_rules_connection_id_linear_connections_id_fk": {+ "name": "linear_sync_rules_connection_id_linear_connections_id_fk",+ "tableFrom": "linear_sync_rules",+ "tableTo": "linear_connections",+ "columnsFrom": ["connection_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "linear_sync_rules_user_id_users_id_fk": {+ "name": "linear_sync_rules_user_id_users_id_fk",+ "tableFrom": "linear_sync_rules",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "linear_sync_rules_workspace_id_workspaces_id_fk": {+ "name": "linear_sync_rules_workspace_id_workspaces_id_fk",+ "tableFrom": "linear_sync_rules",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.llm_generation_tracing": {+ "name": "llm_generation_tracing",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "scenario": {+ "name": "scenario",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "prompt_version": {+ "name": "prompt_version",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "prompt_hash": {+ "name": "prompt_hash",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "schema_name": {+ "name": "schema_name",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "topic_id": {+ "name": "topic_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "trigger": {+ "name": "trigger",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "parent_tracing_id": {+ "name": "parent_tracing_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "provider": {+ "name": "provider",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "model": {+ "name": "model",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "success": {+ "name": "success",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true+ },+ "error_code": {+ "name": "error_code",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "error_detail": {+ "name": "error_detail",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "validation_failed": {+ "name": "validation_failed",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },+ "input_hash": {+ "name": "input_hash",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "input_hint": {+ "name": "input_hint",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "latency_ms": {+ "name": "latency_ms",+ "type": "integer",+ "primaryKey": false,+ "notNull": false+ },+ "input_tokens": {+ "name": "input_tokens",+ "type": "integer",+ "primaryKey": false,+ "notNull": false+ },+ "output_tokens": {+ "name": "output_tokens",+ "type": "integer",+ "primaryKey": false,+ "notNull": false+ },+ "cost_usd": {+ "name": "cost_usd",+ "type": "numeric(12, 8)",+ "primaryKey": false,+ "notNull": false+ },+ "storage_key": {+ "name": "storage_key",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "feedback_signal": {+ "name": "feedback_signal",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "feedback_score": {+ "name": "feedback_score",+ "type": "numeric(3, 2)",+ "primaryKey": false,+ "notNull": false+ },+ "feedback_source": {+ "name": "feedback_source",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "feedback_data": {+ "name": "feedback_data",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "feedback_updated_at": {+ "name": "feedback_updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "trace_id": {+ "name": "trace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "span_id": {+ "name": "span_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false,+ "default": "'{}'::jsonb"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "llm_generation_tracing_scenario_idx": {+ "name": "llm_generation_tracing_scenario_idx",+ "columns": [+ {+ "expression": "scenario",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_prompt_version_idx": {+ "name": "llm_generation_tracing_prompt_version_idx",+ "columns": [+ {+ "expression": "prompt_version",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_user_id_idx": {+ "name": "llm_generation_tracing_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_agent_id_idx": {+ "name": "llm_generation_tracing_agent_id_idx",+ "columns": [+ {+ "expression": "agent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_topic_id_idx": {+ "name": "llm_generation_tracing_topic_id_idx",+ "columns": [+ {+ "expression": "topic_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_workspace_id_idx": {+ "name": "llm_generation_tracing_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_provider_idx": {+ "name": "llm_generation_tracing_provider_idx",+ "columns": [+ {+ "expression": "provider",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_model_idx": {+ "name": "llm_generation_tracing_model_idx",+ "columns": [+ {+ "expression": "model",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_success_idx": {+ "name": "llm_generation_tracing_success_idx",+ "columns": [+ {+ "expression": "success",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_error_code_idx": {+ "name": "llm_generation_tracing_error_code_idx",+ "columns": [+ {+ "expression": "error_code",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_validation_failed_idx": {+ "name": "llm_generation_tracing_validation_failed_idx",+ "columns": [+ {+ "expression": "validation_failed",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_feedback_signal_idx": {+ "name": "llm_generation_tracing_feedback_signal_idx",+ "columns": [+ {+ "expression": "feedback_signal",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "llm_generation_tracing_created_at_idx": {+ "name": "llm_generation_tracing_created_at_idx",+ "columns": [+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "llm_generation_tracing_workspace_id_workspaces_id_fk": {+ "name": "llm_generation_tracing_workspace_id_workspaces_id_fk",+ "tableFrom": "llm_generation_tracing",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.meeting_minutes": {+ "name": "meeting_minutes",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "meeting_id": {+ "name": "meeting_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "summary": {+ "name": "summary",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "chapters": {+ "name": "chapters",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "decisions": {+ "name": "decisions",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "action_items": {+ "name": "action_items",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "keywords": {+ "name": "keywords",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "document_id": {+ "name": "document_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "model": {+ "name": "model",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "meeting_minutes_meeting_id_unique": {+ "name": "meeting_minutes_meeting_id_unique",+ "columns": [+ {+ "expression": "meeting_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "meeting_minutes_document_id_idx": {+ "name": "meeting_minutes_document_id_idx",+ "columns": [+ {+ "expression": "document_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "meeting_minutes_meeting_id_meetings_id_fk": {+ "name": "meeting_minutes_meeting_id_meetings_id_fk",+ "tableFrom": "meeting_minutes",+ "tableTo": "meetings",+ "columnsFrom": ["meeting_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "meeting_minutes_document_id_documents_id_fk": {+ "name": "meeting_minutes_document_id_documents_id_fk",+ "tableFrom": "meeting_minutes",+ "tableTo": "documents",+ "columnsFrom": ["document_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.meeting_segments": {+ "name": "meeting_segments",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "meeting_id": {+ "name": "meeting_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "speaker_id": {+ "name": "speaker_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "source": {+ "name": "source",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "seq": {+ "name": "seq",+ "type": "integer",+ "primaryKey": false,+ "notNull": true+ },+ "start_ms": {+ "name": "start_ms",+ "type": "integer",+ "primaryKey": false,+ "notNull": true+ },+ "end_ms": {+ "name": "end_ms",+ "type": "integer",+ "primaryKey": false,+ "notNull": true+ },+ "text": {+ "name": "text",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "meeting_segments_meeting_id_source_seq_unique": {+ "name": "meeting_segments_meeting_id_source_seq_unique",+ "columns": [+ {+ "expression": "meeting_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "source",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "seq",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "meeting_segments_meeting_id_source_start_ms_idx": {+ "name": "meeting_segments_meeting_id_source_start_ms_idx",+ "columns": [+ {+ "expression": "meeting_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "source",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "start_ms",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "meeting_segments_speaker_id_idx": {+ "name": "meeting_segments_speaker_id_idx",+ "columns": [+ {+ "expression": "speaker_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "meeting_segments_meeting_id_meetings_id_fk": {+ "name": "meeting_segments_meeting_id_meetings_id_fk",+ "tableFrom": "meeting_segments",+ "tableTo": "meetings",+ "columnsFrom": ["meeting_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "meeting_segments_speaker_id_meeting_speakers_id_fk": {+ "name": "meeting_segments_speaker_id_meeting_speakers_id_fk",+ "tableFrom": "meeting_segments",+ "tableTo": "meeting_speakers",+ "columnsFrom": ["speaker_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.meeting_speakers": {+ "name": "meeting_speakers",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "meeting_id": {+ "name": "meeting_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "label": {+ "name": "label",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "display_name": {+ "name": "display_name",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "meeting_speakers_meeting_id_label_unique": {+ "name": "meeting_speakers_meeting_id_label_unique","columns": [{- "expression": "project_id",+ "expression": "meeting_id","isExpression": false,"asc": true,"nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "linear_sync_rules_connection_id_idx": {- "name": "linear_sync_rules_connection_id_idx",- "columns": [- {- "expression": "connection_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "linear_sync_rules_user_id_idx": {- "name": "linear_sync_rules_user_id_idx",- "columns": [- {- "expression": "user_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "linear_sync_rules_workspace_id_idx": {- "name": "linear_sync_rules_workspace_id_idx",- "columns": [+ },{- "expression": "workspace_id",+ "expression": "label","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,+ "isUnique": true,"concurrently": false,"method": "btree","with": {}}},"foreignKeys": {- "linear_sync_rules_project_id_projects_id_fk": {- "name": "linear_sync_rules_project_id_projects_id_fk",- "tableFrom": "linear_sync_rules",- "tableTo": "projects",- "columnsFrom": ["project_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "linear_sync_rules_connection_id_linear_connections_id_fk": {- "name": "linear_sync_rules_connection_id_linear_connections_id_fk",- "tableFrom": "linear_sync_rules",- "tableTo": "linear_connections",- "columnsFrom": ["connection_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "linear_sync_rules_user_id_users_id_fk": {- "name": "linear_sync_rules_user_id_users_id_fk",- "tableFrom": "linear_sync_rules",- "tableTo": "users",- "columnsFrom": ["user_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"- },- "linear_sync_rules_workspace_id_workspaces_id_fk": {- "name": "linear_sync_rules_workspace_id_workspaces_id_fk",- "tableFrom": "linear_sync_rules",- "tableTo": "workspaces",- "columnsFrom": ["workspace_id"],+ "meeting_speakers_meeting_id_meetings_id_fk": {+ "name": "meeting_speakers_meeting_id_meetings_id_fk",+ "tableFrom": "meeting_speakers",+ "tableTo": "meetings",+ "columnsFrom": ["meeting_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"@@ -22436,8 +23823,8 @@"checkConstraints": {},"isRLSEnabled": false},- "public.llm_generation_tracing": {- "name": "llm_generation_tracing",+ "public.meetings": {+ "name": "meetings","schema": "","columns": {"id": {@@ -22447,193 +23834,106 @@"notNull": true,"default": "gen_random_uuid()"},- "scenario": {- "name": "scenario",- "type": "text",- "primaryKey": false,- "notNull": true- },- "prompt_version": {- "name": "prompt_version",- "type": "text",- "primaryKey": false,- "notNull": true- },- "prompt_hash": {- "name": "prompt_hash",- "type": "text",- "primaryKey": false,- "notNull": true- },- "schema_name": {- "name": "schema_name",- "type": "text",- "primaryKey": false,- "notNull": false- },"user_id": {"name": "user_id","type": "text","primaryKey": false,"notNull": true},- "agent_id": {- "name": "agent_id",- "type": "text",- "primaryKey": false,- "notNull": false- },- "topic_id": {- "name": "topic_id",- "type": "text",- "primaryKey": false,- "notNull": false- },"workspace_id": {"name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "trigger": {- "name": "trigger",+ "title": {+ "name": "title","type": "text","primaryKey": false,- "notNull": false- },- "parent_tracing_id": {- "name": "parent_tracing_id",- "type": "uuid",- "primaryKey": false,- "notNull": false+ "notNull": true},- "provider": {- "name": "provider",+ "status": {+ "name": "status","type": "text","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "'recording'"},- "model": {- "name": "model",+ "platform": {+ "name": "platform","type": "text","primaryKey": false,- "notNull": false- },- "success": {- "name": "success",- "type": "boolean",- "primaryKey": false,"notNull": true},- "error_code": {- "name": "error_code",+ "realtime_provider": {+ "name": "realtime_provider","type": "text","primaryKey": false,- "notNull": false- },- "error_detail": {- "name": "error_detail",- "type": "text",- "primaryKey": false,- "notNull": false- },- "validation_failed": {- "name": "validation_failed",- "type": "boolean",- "primaryKey": false,- "notNull": true,- "default": false+ "notNull": true},- "input_hash": {- "name": "input_hash",+ "refine_provider": {+ "name": "refine_provider","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "input_hint": {- "name": "input_hint",+ "language": {+ "name": "language","type": "text","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "'auto'"},- "latency_ms": {- "name": "latency_ms",- "type": "integer",+ "started_at": {+ "name": "started_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},- "input_tokens": {- "name": "input_tokens",- "type": "integer",+ "ended_at": {+ "name": "ended_at",+ "type": "timestamp with time zone","primaryKey": false,"notNull": false},- "output_tokens": {- "name": "output_tokens",+ "duration_ms": {+ "name": "duration_ms","type": "integer","primaryKey": false,"notNull": false},- "cost_usd": {- "name": "cost_usd",- "type": "numeric(12, 8)",- "primaryKey": false,- "notNull": false- },- "storage_key": {- "name": "storage_key",- "type": "text",- "primaryKey": false,- "notNull": false- },- "feedback_signal": {- "name": "feedback_signal",+ "audio_file_id": {+ "name": "audio_file_id","type": "text","primaryKey": false,"notNull": false},- "feedback_score": {- "name": "feedback_score",- "type": "numeric(3, 2)",- "primaryKey": false,- "notNull": false- },- "feedback_source": {- "name": "feedback_source",+ "local_audio_path": {+ "name": "local_audio_path","type": "text","primaryKey": false,"notNull": false},- "feedback_data": {- "name": "feedback_data",+ "error": {+ "name": "error","type": "jsonb","primaryKey": false,"notNull": false},- "feedback_updated_at": {- "name": "feedback_updated_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": false- },- "trace_id": {- "name": "trace_id",- "type": "text",- "primaryKey": false,- "notNull": false- },- "span_id": {- "name": "span_id",+ "visibility": {+ "name": "visibility","type": "text","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "'private'"},- "metadata": {- "name": "metadata",- "type": "jsonb",+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false,- "default": "'{}'::jsonb"+ "notNull": true,+ "default": "now()"},"created_at": {"name": "created_at",@@ -22641,149 +23941,33 @@"primaryKey": false,"notNull": true,"default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"}},"indexes": {- "llm_generation_tracing_scenario_idx": {- "name": "llm_generation_tracing_scenario_idx",- "columns": [- {- "expression": "scenario",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_prompt_version_idx": {- "name": "llm_generation_tracing_prompt_version_idx",- "columns": [- {- "expression": "prompt_version",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_user_id_idx": {- "name": "llm_generation_tracing_user_id_idx",+ "meetings_user_id_workspace_id_created_at_idx": {+ "name": "meetings_user_id_workspace_id_created_at_idx","columns": [{"expression": "user_id","isExpression": false,"asc": true,"nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_agent_id_idx": {- "name": "llm_generation_tracing_agent_id_idx",- "columns": [- {- "expression": "agent_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_topic_id_idx": {- "name": "llm_generation_tracing_topic_id_idx",- "columns": [- {- "expression": "topic_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_workspace_id_idx": {- "name": "llm_generation_tracing_workspace_id_idx",- "columns": [+ },{"expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_provider_idx": {- "name": "llm_generation_tracing_provider_idx",- "columns": [- {- "expression": "provider",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_model_idx": {- "name": "llm_generation_tracing_model_idx",- "columns": [- {- "expression": "model",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_success_idx": {- "name": "llm_generation_tracing_success_idx",- "columns": [- {- "expression": "success",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_error_code_idx": {- "name": "llm_generation_tracing_error_code_idx",- "columns": [+ },{- "expression": "error_code",+ "expression": "created_at","isExpression": false,"asc": true,"nulls": "last"@@ -22794,26 +23978,17 @@"method": "btree","with": {}},- "llm_generation_tracing_validation_failed_idx": {- "name": "llm_generation_tracing_validation_failed_idx",+ "meetings_workspace_id_created_at_idx": {+ "name": "meetings_workspace_id_created_at_idx","columns": [{- "expression": "validation_failed",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "llm_generation_tracing_feedback_signal_idx": {- "name": "llm_generation_tracing_feedback_signal_idx",- "columns": [+ },{- "expression": "feedback_signal",+ "expression": "created_at","isExpression": false,"asc": true,"nulls": "last"@@ -22824,11 +23999,11 @@"method": "btree","with": {}},- "llm_generation_tracing_created_at_idx": {- "name": "llm_generation_tracing_created_at_idx",+ "meetings_audio_file_id_idx": {+ "name": "meetings_audio_file_id_idx","columns": [{- "expression": "created_at",+ "expression": "audio_file_id","isExpression": false,"asc": true,"nulls": "last"@@ -22841,14 +24016,32 @@}},"foreignKeys": {- "llm_generation_tracing_workspace_id_workspaces_id_fk": {- "name": "llm_generation_tracing_workspace_id_workspaces_id_fk",- "tableFrom": "llm_generation_tracing",+ "meetings_user_id_users_id_fk": {+ "name": "meetings_user_id_users_id_fk",+ "tableFrom": "meetings",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "meetings_workspace_id_workspaces_id_fk": {+ "name": "meetings_workspace_id_workspaces_id_fk",+ "tableFrom": "meetings","tableTo": "workspaces","columnsFrom": ["workspace_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"+ },+ "meetings_audio_file_id_files_id_fk": {+ "name": "meetings_audio_file_id_files_id_fk",+ "tableFrom": "meetings",+ "tableTo": "files",+ "columnsFrom": ["audio_file_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"}},"compositePrimaryKeys": {},@@ -29009,6 +30202,12 @@"primaryKey": false,"notNull": false},+ "last_seen_at": {+ "name": "last_seen_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },"accessed_at": {"name": "accessed_at","type": "timestamp with time zone",@@ -36815,6 +38014,370 @@"checkConstraints": {},"isRLSEnabled": false},+ "public.task_label_links": {+ "name": "task_label_links",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "task_id": {+ "name": "task_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "label_id": {+ "name": "label_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "task_label_links_task_id_label_id_unique": {+ "name": "task_label_links_task_id_label_id_unique",+ "columns": [+ {+ "expression": "task_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "label_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_label_links_label_id_idx": {+ "name": "task_label_links_label_id_idx",+ "columns": [+ {+ "expression": "label_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_label_links_user_id_idx": {+ "name": "task_label_links_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_label_links_workspace_id_idx": {+ "name": "task_label_links_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "task_label_links_task_id_tasks_id_fk": {+ "name": "task_label_links_task_id_tasks_id_fk",+ "tableFrom": "task_label_links",+ "tableTo": "tasks",+ "columnsFrom": ["task_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "task_label_links_label_id_task_labels_id_fk": {+ "name": "task_label_links_label_id_task_labels_id_fk",+ "tableFrom": "task_label_links",+ "tableTo": "task_labels",+ "columnsFrom": ["label_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "task_label_links_user_id_users_id_fk": {+ "name": "task_label_links_user_id_users_id_fk",+ "tableFrom": "task_label_links",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "task_label_links_workspace_id_workspaces_id_fk": {+ "name": "task_label_links_workspace_id_workspaces_id_fk",+ "tableFrom": "task_label_links",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.task_labels": {+ "name": "task_labels",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "parent_id": {+ "name": "parent_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "is_group": {+ "name": "is_group",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "color": {+ "name": "color",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "sort_order": {+ "name": "sort_order",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "task_labels_user_id_idx": {+ "name": "task_labels_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_labels_workspace_id_idx": {+ "name": "task_labels_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_labels_parent_id_idx": {+ "name": "task_labels_parent_id_idx",+ "columns": [+ {+ "expression": "parent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_labels_user_id_name_unique": {+ "name": "task_labels_user_id_name_unique",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "lower(\"name\")",+ "asc": true,+ "isExpression": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"task_labels\".\"workspace_id\" IS NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "task_labels_workspace_id_name_unique": {+ "name": "task_labels_workspace_id_name_unique",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "lower(\"name\")",+ "asc": true,+ "isExpression": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"task_labels\".\"workspace_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "task_labels_user_id_users_id_fk": {+ "name": "task_labels_user_id_users_id_fk",+ "tableFrom": "task_labels",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "task_labels_workspace_id_workspaces_id_fk": {+ "name": "task_labels_workspace_id_workspaces_id_fk",+ "tableFrom": "task_labels",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "task_labels_parent_id_task_labels_id_fk": {+ "name": "task_labels_parent_id_task_labels_id_fk",+ "tableFrom": "task_labels",+ "tableTo": "task_labels",+ "columnsFrom": ["parent_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },"public.threads": {"name": "threads","schema": "",@@ -46847,11 +48410,18 @@"notNull": true,"default": "'pending'"},+ "reusable": {+ "name": "reusable",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },"expires_at": {"name": "expires_at","type": "timestamp with time zone","primaryKey": false,- "notNull": true+ "notNull": false},"created_at": {"name": "created_at",@@ -46959,7 +48529,12 @@}},"policies": {},- "checkConstraints": {},+ "checkConstraints": {+ "workspace_invitations_expiry_required": {+ "name": "workspace_invitations_expiry_required",+ "value": "\"workspace_invitations\".\"reusable\" OR \"workspace_invitations\".\"expires_at\" IS NOT NULL"+ }+ },"isRLSEnabled": false},"public.workspace_members": {diff --git a/packages/database/migrations/meta/_journal.json b/packages/database/migrations/meta/_journal.jsonindex f7423c196b0..c14a9f668df 100644--- a/packages/database/migrations/meta/_journal.json+++ b/packages/database/migrations/meta/_journal.json@@ -1477,7 +1477,14 @@"when": 1794152994440,"tag": "0210_agent_operations_workspace_created_at_idx","breakpoints": true+ },+ {+ "idx": 211,+ "version": "7",+ "when": 1794233764532,+ "tag": "0211_add_documents_created_by_agent_id",+ "breakpoints": true}],"version": "6"-}\ No newline at end of file+}diff --git a/packages/database/src/schemas/file.ts b/packages/database/src/schemas/file.tsindex a4e6d92a9ae..4ec9a66896f 100644--- a/packages/database/src/schemas/file.ts+++ b/packages/database/src/schemas/file.ts@@ -160,6 +160,13 @@ export const documents = pgTable(workspaceId: text('workspace_id').references(() => workspaces.id, { onDelete: 'cascade' }),+ /**+ * Agent that created this document through a tool (e.g. notebook or+ * knowledge base), used to separate agent output from user-authored+ * documents. `NULL` means user-created.+ */+ createdByAgentId: text('created_by_agent_id'),+/*** Visibility within the owning workspace. `public` (default) means every* workspace member can see the document; `private` constrains it to the