🤯 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 contact tables and conversations between people (#23045)
Arvin Xu69e7229cf817
diff --git a/docs/development/database-schema.dbml b/docs/development/database-schema.dbmlindex 7b50358b82a..9e321585caf 100644--- a/docs/development/database-schema.dbml+++ b/docs/development/database-schema.dbml@@ -1540,6 +1540,7 @@ table channels {workspace_id textproject_id textagent_id text+ peer_user_id texttitle text [not null]sequence integer [not null, default: 0]status text [not null, default: 'active']@@ -1690,6 +1691,78 @@ table user_installed_plugins {}}+table user_contact_requests {+ id uuid [pk, not null, default: `gen_random_uuid()`]+ requester_id text [not null]+ addressee_id text [not null]+ message text+ status text [not null, default: 'pending']+ responded_at "timestamp with time zone"+ accessed_at "timestamp with time zone" [not null, default: `now()`]+ created_at "timestamp with time zone" [not null, default: `now()`]+ updated_at "timestamp with time zone" [not null, default: `now()`]++ indexes {+ (requester_id, addressee_id) [name: 'user_contact_requests_pending_unique', unique]+ (addressee_id, status) [name: 'user_contact_requests_addressee_status_idx']+ (requester_id, status) [name: 'user_contact_requests_requester_status_idx']++ }+}++table user_contact_tag_assignments {+ id uuid [pk, not null, default: `gen_random_uuid()`]+ tag_id uuid [not null]+ contact_id uuid [not null]+ user_id text [not null]+ accessed_at "timestamp with time zone" [not null, default: `now()`]+ created_at "timestamp with time zone" [not null, default: `now()`]+ updated_at "timestamp with time zone" [not null, default: `now()`]++ indexes {+ (tag_id, contact_id) [name: 'user_contact_tag_assignments_tag_id_contact_id_unique', unique]+ contact_id [name: 'user_contact_tag_assignments_contact_id_idx']+ user_id [name: 'user_contact_tag_assignments_user_id_idx']+ }+}++table user_contact_tags {+ id uuid [pk, not null, default: `gen_random_uuid()`]+ user_id text [not null]+ name text [not null]+ color text+ sort_order integer [not null, default: 0]+ accessed_at "timestamp with time zone" [not null, default: `now()`]+ created_at "timestamp with time zone" [not null, default: `now()`]+ updated_at "timestamp with time zone" [not null, default: `now()`]++ indexes {+ (user_id, name) [name: 'user_contact_tags_user_id_name_unique', unique]+ }+}++table user_contacts {+ id uuid [pk, not null, default: `gen_random_uuid()`]+ user_id text [not null]+ type text [not null]+ contact_user_id text+ agent_id text+ remark text+ description text+ phones text[]+ metadata jsonb+ accessed_at "timestamp with time zone" [not null, default: `now()`]+ created_at "timestamp with time zone" [not null, default: `now()`]+ updated_at "timestamp with time zone" [not null, default: `now()`]++ indexes {+ (user_id, contact_user_id) [name: 'user_contacts_user_unique', unique]+ (user_id, agent_id) [name: 'user_contacts_agent_unique', unique]+ contact_user_id [name: 'user_contacts_contact_user_id_idx']+ agent_id [name: 'user_contacts_agent_id_idx']+ }+}+table dashboard_items {id uuid [pk, not null, default: `gen_random_uuid()`]dashboard_id uuid [not null]diff --git a/packages/database/migrations/0214_user_contacts.sql b/packages/database/migrations/0214_user_contacts.sqlnew file mode 100644index 00000000000..9d0796496b6--- /dev/null+++ b/packages/database/migrations/0214_user_contacts.sql@@ -0,0 +1,81 @@+CREATE TABLE IF NOT EXISTS "user_contact_requests" (+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,+ "requester_id" text NOT NULL,+ "addressee_id" text NOT NULL,+ "message" text,+ "status" text DEFAULT 'pending' NOT NULL,+ "responded_at" timestamp with time zone,+ "accessed_at" timestamp with time zone DEFAULT now() NOT NULL,+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL,+ CONSTRAINT "user_contact_requests_not_self_check" CHECK ("user_contact_requests"."requester_id" <> "user_contact_requests"."addressee_id")+);+--> statement-breakpoint+CREATE TABLE IF NOT EXISTS "user_contact_tag_assignments" (+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,+ "tag_id" uuid NOT NULL,+ "contact_id" uuid NOT NULL,+ "user_id" text NOT NULL,+ "accessed_at" timestamp with time zone DEFAULT now() NOT NULL,+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL+);+--> statement-breakpoint+CREATE TABLE IF NOT EXISTS "user_contact_tags" (+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,+ "user_id" text NOT NULL,+ "name" text NOT NULL,+ "color" text,+ "sort_order" integer DEFAULT 0 NOT NULL,+ "accessed_at" timestamp with time zone DEFAULT now() NOT NULL,+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL+);+--> statement-breakpoint+CREATE TABLE IF NOT EXISTS "user_contacts" (+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,+ "user_id" text NOT NULL,+ "type" text NOT NULL,+ "contact_user_id" text,+ "agent_id" text,+ "remark" text,+ "description" text,+ "phones" text[],+ "metadata" jsonb,+ "accessed_at" timestamp with time zone DEFAULT now() NOT NULL,+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL+);+--> statement-breakpoint+ALTER TABLE "channels" ADD COLUMN IF NOT EXISTS "peer_user_id" text;--> statement-breakpoint+ALTER TABLE "user_contact_requests" DROP CONSTRAINT IF EXISTS "user_contact_requests_requester_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "user_contact_requests" ADD CONSTRAINT "user_contact_requests_requester_id_users_id_fk" FOREIGN KEY ("requester_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contact_requests" DROP CONSTRAINT IF EXISTS "user_contact_requests_addressee_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "user_contact_requests" ADD CONSTRAINT "user_contact_requests_addressee_id_users_id_fk" FOREIGN KEY ("addressee_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contact_tag_assignments" DROP CONSTRAINT IF EXISTS "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk";--> statement-breakpoint+ALTER TABLE "user_contact_tag_assignments" ADD CONSTRAINT "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk" FOREIGN KEY ("tag_id") REFERENCES "public"."user_contact_tags"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contact_tag_assignments" DROP CONSTRAINT IF EXISTS "user_contact_tag_assignments_contact_id_user_contacts_id_fk";--> statement-breakpoint+ALTER TABLE "user_contact_tag_assignments" ADD CONSTRAINT "user_contact_tag_assignments_contact_id_user_contacts_id_fk" FOREIGN KEY ("contact_id") REFERENCES "public"."user_contacts"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contact_tag_assignments" DROP CONSTRAINT IF EXISTS "user_contact_tag_assignments_user_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "user_contact_tag_assignments" ADD CONSTRAINT "user_contact_tag_assignments_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contact_tags" DROP CONSTRAINT IF EXISTS "user_contact_tags_user_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "user_contact_tags" ADD CONSTRAINT "user_contact_tags_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contacts" DROP CONSTRAINT IF EXISTS "user_contacts_user_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "user_contacts" ADD CONSTRAINT "user_contacts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contacts" DROP CONSTRAINT IF EXISTS "user_contacts_contact_user_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "user_contacts" ADD CONSTRAINT "user_contacts_contact_user_id_users_id_fk" FOREIGN KEY ("contact_user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "user_contacts" DROP CONSTRAINT IF EXISTS "user_contacts_agent_id_agents_id_fk";--> statement-breakpoint+ALTER TABLE "user_contacts" ADD CONSTRAINT "user_contacts_agent_id_agents_id_fk" FOREIGN KEY ("agent_id") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+CREATE UNIQUE INDEX IF NOT EXISTS "user_contact_requests_pending_unique" ON "user_contact_requests" USING btree ("requester_id","addressee_id") WHERE "user_contact_requests"."status" = 'pending';--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "user_contact_requests_addressee_status_idx" ON "user_contact_requests" USING btree ("addressee_id","status");--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "user_contact_requests_requester_status_idx" ON "user_contact_requests" USING btree ("requester_id","status");--> statement-breakpoint+CREATE UNIQUE INDEX IF NOT EXISTS "user_contact_tag_assignments_tag_id_contact_id_unique" ON "user_contact_tag_assignments" USING btree ("tag_id","contact_id");--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "user_contact_tag_assignments_contact_id_idx" ON "user_contact_tag_assignments" USING btree ("contact_id");--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "user_contact_tag_assignments_user_id_idx" ON "user_contact_tag_assignments" USING btree ("user_id");--> statement-breakpoint+CREATE UNIQUE INDEX IF NOT EXISTS "user_contact_tags_user_id_name_unique" ON "user_contact_tags" USING btree ("user_id","name");--> statement-breakpoint+CREATE UNIQUE INDEX IF NOT EXISTS "user_contacts_user_unique" ON "user_contacts" USING btree ("user_id","contact_user_id") WHERE "user_contacts"."contact_user_id" IS NOT NULL;--> statement-breakpoint+CREATE UNIQUE INDEX IF NOT EXISTS "user_contacts_agent_unique" ON "user_contacts" USING btree ("user_id","agent_id") WHERE "user_contacts"."agent_id" IS NOT NULL;--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "user_contacts_contact_user_id_idx" ON "user_contacts" USING btree ("contact_user_id");--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "user_contacts_agent_id_idx" ON "user_contacts" USING btree ("agent_id");--> statement-breakpoint+ALTER TABLE "channels" DROP CONSTRAINT IF EXISTS "channels_peer_user_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "channels" ADD CONSTRAINT "channels_peer_user_id_users_id_fk" FOREIGN KEY ("peer_user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;\ No newline at end of filediff --git a/packages/database/migrations/meta/0204_snapshot.json b/packages/database/migrations/meta/0214_snapshot.jsonsimilarity index 95%rename from packages/database/migrations/meta/0204_snapshot.jsonrename to packages/database/migrations/meta/0214_snapshot.jsonindex a8b0a2ee623..3d8f559095e 100644--- a/packages/database/migrations/meta/0204_snapshot.json+++ b/packages/database/migrations/meta/0214_snapshot.json@@ -6,9 +6,9 @@},"dialect": "postgresql","enums": {},- "id": "f22d5caf-0104-4f65-9ab8-8f6823ea199e",+ "id": "3ad7c485-f325-43ae-80bf-417a3e451b33","policies": {},- "prevId": "ebab7fa5-987a-48f1-81d0-c4262738714d",+ "prevId": "46e3c4ea-97e4-4a8e-87d2-d89b786c7131","roles": {},"schemas": {},"sequences": {@@ -132,6 +132,12 @@"primaryKey": false,"notNull": false},+ "review_mark_id": {+ "name": "review_mark_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },"client_id": {"name": "client_id","type": "text",@@ -300,6 +306,21 @@"concurrently": false,"method": "btree","with": {}+ },+ "acceptance_comments_review_mark_id_idx": {+ "name": "acceptance_comments_review_mark_id_idx",+ "columns": [+ {+ "expression": "review_mark_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}}},"foreignKeys": {@@ -366,6 +387,15 @@"onDelete": "set null","onUpdate": "no action"},+ "acceptance_comments_review_mark_id_acceptance_review_marks_id_fk": {+ "name": "acceptance_comments_review_mark_id_acceptance_review_marks_id_fk",+ "tableFrom": "acceptance_comments",+ "tableTo": "acceptance_review_marks",+ "columnsFrom": ["review_mark_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },"acceptance_comments_resolved_by_user_id_users_id_fk": {"name": "acceptance_comments_resolved_by_user_id_users_id_fk","tableFrom": "acceptance_comments",@@ -741,6 +771,450 @@"checkConstraints": {},"isRLSEnabled": false},+ "public.acceptance_review_marks": {+ "name": "acceptance_review_marks",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "review_id": {+ "name": "review_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "seq": {+ "name": "seq",+ "type": "integer",+ "primaryKey": false,+ "notNull": true+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "url": {+ "name": "url",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "route_key": {+ "name": "route_key",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "page_meta": {+ "name": "page_meta",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "rect_document": {+ "name": "rect_document",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "rect_viewport": {+ "name": "rect_viewport",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "scroll": {+ "name": "scroll",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "viewport": {+ "name": "viewport",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "regions": {+ "name": "regions",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "region_refs": {+ "name": "region_refs",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "targets": {+ "name": "targets",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "sketch": {+ "name": "sketch",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "context": {+ "name": "context",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "screenshot_file_id": {+ "name": "screenshot_file_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "content": {+ "name": "content",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "client_id": {+ "name": "client_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "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": {+ "acceptance_review_marks_review_id_client_id_unique": {+ "name": "acceptance_review_marks_review_id_client_id_unique",+ "columns": [+ {+ "expression": "review_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "client_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "acceptance_review_marks_review_id_seq_unique": {+ "name": "acceptance_review_marks_review_id_seq_unique",+ "columns": [+ {+ "expression": "review_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "seq",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "acceptance_review_marks_route_key_review_id_idx": {+ "name": "acceptance_review_marks_route_key_review_id_idx",+ "columns": [+ {+ "expression": "route_key",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "review_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "acceptance_review_marks_review_id_acceptance_reviews_id_fk": {+ "name": "acceptance_review_marks_review_id_acceptance_reviews_id_fk",+ "tableFrom": "acceptance_review_marks",+ "tableTo": "acceptance_reviews",+ "columnsFrom": ["review_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "acceptance_review_marks_screenshot_file_id_files_id_fk": {+ "name": "acceptance_review_marks_screenshot_file_id_files_id_fk",+ "tableFrom": "acceptance_review_marks",+ "tableTo": "files",+ "columnsFrom": ["screenshot_file_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.acceptance_reviews": {+ "name": "acceptance_reviews",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "site_id": {+ "name": "site_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "project_id": {+ "name": "project_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'draft'"+ },+ "task_id": {+ "name": "task_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "last_mark_seq": {+ "name": "last_mark_seq",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "submitted_at": {+ "name": "submitted_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "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": {+ "acceptance_reviews_site_id_created_at_idx": {+ "name": "acceptance_reviews_site_id_created_at_idx",+ "columns": [+ {+ "expression": "site_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "acceptance_reviews_task_id_idx": {+ "name": "acceptance_reviews_task_id_idx",+ "columns": [+ {+ "expression": "task_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "acceptance_reviews_user_id_idx": {+ "name": "acceptance_reviews_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "acceptance_reviews_workspace_id_idx": {+ "name": "acceptance_reviews_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "acceptance_reviews_one_draft_per_user_unique": {+ "name": "acceptance_reviews_one_draft_per_user_unique",+ "columns": [+ {+ "expression": "site_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"acceptance_reviews\".\"status\" = 'draft'",+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "acceptance_reviews_site_id_project_sites_id_fk": {+ "name": "acceptance_reviews_site_id_project_sites_id_fk",+ "tableFrom": "acceptance_reviews",+ "tableTo": "project_sites",+ "columnsFrom": ["site_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "acceptance_reviews_user_id_users_id_fk": {+ "name": "acceptance_reviews_user_id_users_id_fk",+ "tableFrom": "acceptance_reviews",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "acceptance_reviews_workspace_id_workspaces_id_fk": {+ "name": "acceptance_reviews_workspace_id_workspaces_id_fk",+ "tableFrom": "acceptance_reviews",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "acceptance_reviews_project_id_projects_id_fk": {+ "name": "acceptance_reviews_project_id_projects_id_fk",+ "tableFrom": "acceptance_reviews",+ "tableTo": "projects",+ "columnsFrom": ["project_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "acceptance_reviews_task_id_tasks_id_fk": {+ "name": "acceptance_reviews_task_id_tasks_id_fk",+ "tableFrom": "acceptance_reviews",+ "tableTo": "tasks",+ "columnsFrom": ["task_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },"public.agents": {"name": "agents","schema": "",@@ -1610,6 +2084,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 +3236,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 +3390,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 +3420,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 +3435,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 +3450,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 +3465,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 +3534,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 +3592,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 +3659,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 +3674,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 +3688,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 +3732,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 +3748,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 +3790,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 +3831,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 +3847,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 +3912,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 +3980,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 +4003,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 +4046,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 +4071,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 +4086,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 +4124,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 +4877,7 @@"name": "user_id","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},"workspace_id": {"name": "workspace_id",@@ -3935,6 +4891,12 @@"primaryKey": false,"notNull": true},+ "environment_id": {+ "name": "environment_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },"content": {"name": "content","type": "jsonb",@@ -4018,6 +4980,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 +5053,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 +5835,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 +7857,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 +11818,12 @@"primaryKey": false,"notNull": false},+ "wake": {+ "name": "wake",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },"manifest": {"name": "manifest","type": "jsonb",@@ -12076,6 +13104,12 @@"primaryKey": false,"notNull": false},+ "peer_user_id": {+ "name": "peer_user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },"title": {"name": "title","type": "text",@@ -12261,6 +13295,15 @@"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"+ },+ "channels_peer_user_id_users_id_fk": {+ "name": "channels_peer_user_id_users_id_fk",+ "tableFrom": "channels",+ "tableTo": "users",+ "columnsFrom": ["peer_user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"}},"compositePrimaryKeys": {},@@ -13328,8 +14371,8 @@"checkConstraints": {},"isRLSEnabled": false},- "public.dashboard_items": {- "name": "dashboard_items",+ "public.user_contact_requests": {+ "name": "user_contact_requests","schema": "","columns": {"id": {@@ -13339,42 +14382,36 @@"notNull": true,"default": "gen_random_uuid()"},- "dashboard_id": {- "name": "dashboard_id",- "type": "uuid",- "primaryKey": false,- "notNull": true- },- "widget_id": {- "name": "widget_id",- "type": "uuid",+ "requester_id": {+ "name": "requester_id",+ "type": "text","primaryKey": false,"notNull": true},- "user_id": {- "name": "user_id",+ "addressee_id": {+ "name": "addressee_id","type": "text","primaryKey": false,"notNull": true},- "workspace_id": {- "name": "workspace_id",+ "message": {+ "name": "message","type": "text","primaryKey": false,"notNull": false},- "layout": {- "name": "layout",- "type": "jsonb",+ "status": {+ "name": "status",+ "type": "text","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "'pending'"},- "sort_order": {- "name": "sort_order",- "type": "integer",+ "responded_at": {+ "name": "responded_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": true,- "default": 0+ "notNull": false},"accessed_at": {"name": "accessed_at",@@ -13399,38 +14436,39 @@}},"indexes": {- "dashboard_items_dashboard_id_widget_id_unique": {- "name": "dashboard_items_dashboard_id_widget_id_unique",+ "user_contact_requests_pending_unique": {+ "name": "user_contact_requests_pending_unique","columns": [{- "expression": "dashboard_id",+ "expression": "requester_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "widget_id",+ "expression": "addressee_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": true,+ "where": "\"user_contact_requests\".\"status\" = 'pending'","concurrently": false,"method": "btree","with": {}},- "dashboard_items_dashboard_id_sort_order_idx": {- "name": "dashboard_items_dashboard_id_sort_order_idx",+ "user_contact_requests_addressee_status_idx": {+ "name": "user_contact_requests_addressee_status_idx","columns": [{- "expression": "dashboard_id",+ "expression": "addressee_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "sort_order",+ "expression": "status","isExpression": false,"asc": true,"nulls": "last"@@ -13441,11 +14479,17 @@"method": "btree","with": {}},- "dashboard_items_widget_id_idx": {- "name": "dashboard_items_widget_id_idx",+ "user_contact_requests_requester_status_idx": {+ "name": "user_contact_requests_requester_status_idx","columns": [{- "expression": "widget_id",+ "expression": "requester_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status","isExpression": false,"asc": true,"nulls": "last"@@ -13455,12 +14499,117 @@"concurrently": false,"method": "btree","with": {}+ }+ },+ "foreignKeys": {+ "user_contact_requests_requester_id_users_id_fk": {+ "name": "user_contact_requests_requester_id_users_id_fk",+ "tableFrom": "user_contact_requests",+ "tableTo": "users",+ "columnsFrom": ["requester_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"},- "dashboard_items_user_id_idx": {- "name": "dashboard_items_user_id_idx",+ "user_contact_requests_addressee_id_users_id_fk": {+ "name": "user_contact_requests_addressee_id_users_id_fk",+ "tableFrom": "user_contact_requests",+ "tableTo": "users",+ "columnsFrom": ["addressee_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {+ "user_contact_requests_not_self_check": {+ "name": "user_contact_requests_not_self_check",+ "value": "\"user_contact_requests\".\"requester_id\" <> \"user_contact_requests\".\"addressee_id\""+ }+ },+ "isRLSEnabled": false+ },+ "public.user_contact_tag_assignments": {+ "name": "user_contact_tag_assignments",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "tag_id": {+ "name": "tag_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "contact_id": {+ "name": "contact_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "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": {+ "user_contact_tag_assignments_tag_id_contact_id_unique": {+ "name": "user_contact_tag_assignments_tag_id_contact_id_unique","columns": [{- "expression": "user_id",+ "expression": "tag_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "contact_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_contact_tag_assignments_contact_id_idx": {+ "name": "user_contact_tag_assignments_contact_id_idx",+ "columns": [+ {+ "expression": "contact_id","isExpression": false,"asc": true,"nulls": "last"@@ -13471,11 +14620,11 @@"method": "btree","with": {}},- "dashboard_items_workspace_id_idx": {- "name": "dashboard_items_workspace_id_idx",+ "user_contact_tag_assignments_user_id_idx": {+ "name": "user_contact_tag_assignments_user_id_idx","columns": [{- "expression": "workspace_id",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"@@ -13488,41 +14637,32 @@}},"foreignKeys": {- "dashboard_items_dashboard_id_dashboards_id_fk": {- "name": "dashboard_items_dashboard_id_dashboards_id_fk",- "tableFrom": "dashboard_items",- "tableTo": "dashboards",- "columnsFrom": ["dashboard_id"],+ "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk": {+ "name": "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk",+ "tableFrom": "user_contact_tag_assignments",+ "tableTo": "user_contact_tags",+ "columnsFrom": ["tag_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "dashboard_items_widget_id_widgets_id_fk": {- "name": "dashboard_items_widget_id_widgets_id_fk",- "tableFrom": "dashboard_items",- "tableTo": "widgets",- "columnsFrom": ["widget_id"],+ "user_contact_tag_assignments_contact_id_user_contacts_id_fk": {+ "name": "user_contact_tag_assignments_contact_id_user_contacts_id_fk",+ "tableFrom": "user_contact_tag_assignments",+ "tableTo": "user_contacts",+ "columnsFrom": ["contact_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"},- "dashboard_items_user_id_users_id_fk": {- "name": "dashboard_items_user_id_users_id_fk",- "tableFrom": "dashboard_items",+ "user_contact_tag_assignments_user_id_users_id_fk": {+ "name": "user_contact_tag_assignments_user_id_users_id_fk",+ "tableFrom": "user_contact_tag_assignments","tableTo": "users","columnsFrom": ["user_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"- },- "dashboard_items_workspace_id_workspaces_id_fk": {- "name": "dashboard_items_workspace_id_workspaces_id_fk",- "tableFrom": "dashboard_items",- "tableTo": "workspaces",- "columnsFrom": ["workspace_id"],- "columnsTo": ["id"],- "onDelete": "cascade",- "onUpdate": "no action"}},"compositePrimaryKeys": {},@@ -13531,8 +14671,8 @@"checkConstraints": {},"isRLSEnabled": false},- "public.dashboards": {- "name": "dashboards",+ "public.user_contact_tags": {+ "name": "user_contact_tags","schema": "","columns": {"id": {@@ -13548,38 +14688,14 @@"primaryKey": false,"notNull": true},- "workspace_id": {- "name": "workspace_id",- "type": "text",- "primaryKey": false,- "notNull": false- },- "project_id": {- "name": "project_id",- "type": "text",- "primaryKey": false,- "notNull": false- },- "agent_id": {- "name": "agent_id",- "type": "text",- "primaryKey": false,- "notNull": false- },- "title": {- "name": "title",+ "name": {+ "name": "name","type": "text","primaryKey": false,"notNull": true},- "description": {- "name": "description",- "type": "text",- "primaryKey": false,- "notNull": false- },- "icon": {- "name": "icon",+ "color": {+ "name": "color","type": "text","primaryKey": false,"notNull": false@@ -13591,31 +14707,548 @@"notNull": true,"default": 0},- "metadata": {- "name": "metadata",- "type": "jsonb",- "primaryKey": false,- "notNull": false- },- "visibility": {- "name": "visibility",- "type": "text",- "primaryKey": false,- "notNull": true,- "default": "'public'"- },- "deleted_at": {- "name": "deleted_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": false- },- "is_deleted": {- "name": "is_deleted",- "type": "boolean",- "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": {+ "user_contact_tags_user_id_name_unique": {+ "name": "user_contact_tags_user_id_name_unique",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "name",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "user_contact_tags_user_id_users_id_fk": {+ "name": "user_contact_tags_user_id_users_id_fk",+ "tableFrom": "user_contact_tags",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.user_contacts": {+ "name": "user_contacts",+ "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+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "contact_user_id": {+ "name": "contact_user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "remark": {+ "name": "remark",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "phones": {+ "name": "phones",+ "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": {+ "user_contacts_user_unique": {+ "name": "user_contacts_user_unique",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "contact_user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"user_contacts\".\"contact_user_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_contacts_agent_unique": {+ "name": "user_contacts_agent_unique",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "agent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"user_contacts\".\"agent_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_contacts_contact_user_id_idx": {+ "name": "user_contacts_contact_user_id_idx",+ "columns": [+ {+ "expression": "contact_user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_contacts_agent_id_idx": {+ "name": "user_contacts_agent_id_idx",+ "columns": [+ {+ "expression": "agent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "user_contacts_user_id_users_id_fk": {+ "name": "user_contacts_user_id_users_id_fk",+ "tableFrom": "user_contacts",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "user_contacts_contact_user_id_users_id_fk": {+ "name": "user_contacts_contact_user_id_users_id_fk",+ "tableFrom": "user_contacts",+ "tableTo": "users",+ "columnsFrom": ["contact_user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "user_contacts_agent_id_agents_id_fk": {+ "name": "user_contacts_agent_id_agents_id_fk",+ "tableFrom": "user_contacts",+ "tableTo": "agents",+ "columnsFrom": ["agent_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.dashboard_items": {+ "name": "dashboard_items",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "dashboard_id": {+ "name": "dashboard_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "widget_id": {+ "name": "widget_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+ },+ "layout": {+ "name": "layout",+ "type": "jsonb",+ "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": {+ "dashboard_items_dashboard_id_widget_id_unique": {+ "name": "dashboard_items_dashboard_id_widget_id_unique",+ "columns": [+ {+ "expression": "dashboard_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "widget_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "dashboard_items_dashboard_id_sort_order_idx": {+ "name": "dashboard_items_dashboard_id_sort_order_idx",+ "columns": [+ {+ "expression": "dashboard_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "sort_order",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "dashboard_items_widget_id_idx": {+ "name": "dashboard_items_widget_id_idx",+ "columns": [+ {+ "expression": "widget_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "dashboard_items_user_id_idx": {+ "name": "dashboard_items_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "dashboard_items_workspace_id_idx": {+ "name": "dashboard_items_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "dashboard_items_dashboard_id_dashboards_id_fk": {+ "name": "dashboard_items_dashboard_id_dashboards_id_fk",+ "tableFrom": "dashboard_items",+ "tableTo": "dashboards",+ "columnsFrom": ["dashboard_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "dashboard_items_widget_id_widgets_id_fk": {+ "name": "dashboard_items_widget_id_widgets_id_fk",+ "tableFrom": "dashboard_items",+ "tableTo": "widgets",+ "columnsFrom": ["widget_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "dashboard_items_user_id_users_id_fk": {+ "name": "dashboard_items_user_id_users_id_fk",+ "tableFrom": "dashboard_items",+ "tableTo": "users",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "dashboard_items_workspace_id_workspaces_id_fk": {+ "name": "dashboard_items_workspace_id_workspaces_id_fk",+ "tableFrom": "dashboard_items",+ "tableTo": "workspaces",+ "columnsFrom": ["workspace_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.dashboards": {+ "name": "dashboards",+ "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+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "project_id": {+ "name": "project_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "title": {+ "name": "title",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "icon": {+ "name": "icon",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "sort_order": {+ "name": "sort_order",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "visibility": {+ "name": "visibility",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'public'"+ },+ "deleted_at": {+ "name": "deleted_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "is_deleted": {+ "name": "is_deleted",+ "type": "boolean",+ "primaryKey": false,+ "notNull": false+ },"accessed_at": {"name": "accessed_at","type": "timestamp with time zone",@@ -17912,6 +19545,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 +23970,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 +24902,8 @@"checkConstraints": {},"isRLSEnabled": false},- "public.llm_generation_tracing": {- "name": "llm_generation_tracing",+ "public.meetings": {+ "name": "meetings","schema": "","columns": {"id": {@@ -22447,193 +24913,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",- "type": "text",- "primaryKey": false,- "notNull": false- },- "error_detail": {- "name": "error_detail",+ "realtime_provider": {+ "name": "realtime_provider","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 +25020,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 +25057,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 +25078,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 +25095,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": {},@@ -47379,6 +49651,13 @@"primaryKey": false,"notNull": false},+ "config": {+ "name": "config",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'{}'::jsonb"+ },"joined_at": {"name": "joined_at","type": "timestamp with time zone",diff --git a/packages/database/migrations/meta/_journal.json b/packages/database/migrations/meta/_journal.jsonindex 3f68a14162a..9a1b58cca32 100644--- a/packages/database/migrations/meta/_journal.json+++ b/packages/database/migrations/meta/_journal.json@@ -1498,6 +1498,13 @@"when": 1794492684486,"tag": "0213_acceptance_review_rounds","breakpoints": true+ },+ {+ "idx": 214,+ "version": "7",+ "when": 1794757089562,+ "tag": "0214_user_contacts",+ "breakpoints": true}],"version": "6"diff --git a/packages/database/src/schemas/channel.ts b/packages/database/src/schemas/channel.tsindex a7999140f97..a15c615fc83 100644--- a/packages/database/src/schemas/channel.ts+++ b/packages/database/src/schemas/channel.ts@@ -82,6 +82,12 @@ export const channels = pgTable(/** Bound Agent for a direct conversation; NULL for a group. Deleted with the Agent. */agentId: text('agent_id').references(() => agents.id, { onDelete: 'cascade' }),+ /**+ * The other person of a personal conversation between two contacts; `userId` is the one who+ * opened it. Both are owner members. Deleted with either account. One conversation per pair+ * is kept by the application, which serializes opening it.+ */+ peerUserId: text('peer_user_id').references(() => users.id, { onDelete: 'cascade' }),title: text('title').notNull(),/** Last allocated message sequence; incremented under the row lock when a message lands. */diff --git a/packages/database/src/schemas/contact.ts b/packages/database/src/schemas/contact.tsnew file mode 100644index 00000000000..6afb2b6ef59--- /dev/null+++ b/packages/database/src/schemas/contact.ts@@ -0,0 +1,161 @@+import type { ContactMetadata, ContactRequestStatus, ContactType } from '@lobechat/types';+import { sql } from 'drizzle-orm';+import {+ check,+ index,+ integer,+ jsonb,+ pgTable,+ text,+ uniqueIndex,+ uuid,+} from 'drizzle-orm/pg-core';++import { timestamps, timestamptz } from './_helpers';+import { agents } from './agent';+import { users } from './user';++/**+ * One entry in a person's address book. Address books are personal: they are not scoped to a+ * workspace, and every read pins `user_id`.+ *+ * A `user` entry exists only for an accepted contact request, and always in both directions.+ * An `agent` entry is another person's Agent added through its share link. It references the+ * Agent, not the share: an Agent has at most one share row, and access is rechecked against+ * that live row on every read and run, so pausing the share disables the entry without+ * deleting it. The application keeps the row shape (`contact_user_id` for `user`, `agent_id`+ * for `agent`) and never adds yourself.+ *+ * Remark, note, phone numbers and metadata belong to the address book's owner: they describe the+ * entry for them alone and are never shown to the other person. Grouping is in+ * `user_contact_tags`, shared across the whole address book.+ */+export const userContacts = pgTable(+ 'user_contacts',+ {+ // Only ever addressed through the contact's own id, so no id prefix.+ id: uuid('id').defaultRandom().primaryKey().notNull(),++ userId: text('user_id')+ .references(() => users.id, { onDelete: 'cascade' })+ .notNull(),++ type: text('type').$type<ContactType>().notNull(),+ contactUserId: text('contact_user_id').references(() => users.id, { onDelete: 'cascade' }),+ agentId: text('agent_id').references(() => agents.id, { onDelete: 'cascade' }),++ // The owner's own notes about this entry; never shown to the other person.+ /** Remark name shown instead of the contact's own name. */+ remark: text('remark'),+ /** Free-form note. */+ description: text('description'),+ phones: text('phones').array(),+ metadata: jsonb('metadata').$type<ContactMetadata>(),++ ...timestamps,+ },+ (t) => [+ uniqueIndex('user_contacts_user_unique')+ .on(t.userId, t.contactUserId)+ .where(sql`${t.contactUserId} IS NOT NULL`),+ uniqueIndex('user_contacts_agent_unique')+ .on(t.userId, t.agentId)+ .where(sql`${t.agentId} IS NOT NULL`),+ // Neither partial index serves the cascades from users and agents.+ index('user_contacts_contact_user_id_idx').on(t.contactUserId),+ index('user_contacts_agent_id_idx').on(t.agentId),+ ],+);++/**+ * A request to become mutual contacts. At most one pending request exists per ordered pair;+ * a request sent while the other person's request is pending accepts it instead. Answered+ * rows are kept for their status, and a new request may follow a declined or cancelled one.+ */+export const userContactRequests = pgTable(+ 'user_contact_requests',+ {+ // Accepted, declined or cancelled by id.+ id: uuid('id').defaultRandom().primaryKey().notNull(),++ requesterId: text('requester_id')+ .references(() => users.id, { onDelete: 'cascade' })+ .notNull(),+ addresseeId: text('addressee_id')+ .references(() => users.id, { onDelete: 'cascade' })+ .notNull(),++ message: text('message'),+ status: text('status').$type<ContactRequestStatus>().notNull().default('pending'),+ respondedAt: timestamptz('responded_at'),++ ...timestamps,+ },+ (t) => [+ uniqueIndex('user_contact_requests_pending_unique')+ .on(t.requesterId, t.addresseeId)+ .where(sql`${t.status} = 'pending'`),+ index('user_contact_requests_addressee_status_idx').on(t.addresseeId, t.status),+ index('user_contact_requests_requester_status_idx').on(t.requesterId, t.status),+ check('user_contact_requests_not_self_check', sql`${t.requesterId} <> ${t.addresseeId}`),+ ],+);++export type UserContactItem = typeof userContacts.$inferSelect;+export type NewUserContact = typeof userContacts.$inferInsert;+export type UserContactRequestItem = typeof userContactRequests.$inferSelect;++/**+ * A tag of a person's address book: one global grouping, applied to any number of entries+ * through `user_contact_tag_assignments`. Personal, like the address book.+ */+export const userContactTags = pgTable(+ 'user_contact_tags',+ {+ id: uuid('id').defaultRandom().primaryKey().notNull(),++ userId: text('user_id')+ .references(() => users.id, { onDelete: 'cascade' })+ .notNull(),++ name: text('name').notNull(),+ /** Display color as a CSS hex value, e.g. `#F5A623`. */+ color: text('color'),+ /** Position in the tag list, ascending. */+ sortOrder: integer('sort_order').notNull().default(0),++ ...timestamps,+ },+ // Names are what tells two tags apart, so they are unique per address book.+ (t) => [uniqueIndex('user_contact_tags_user_id_name_unique').on(t.userId, t.name)],+);++/** An address book entry carrying a tag; an entry can carry any number of them. */+export const userContactTagAssignments = pgTable(+ 'user_contact_tag_assignments',+ {+ // Only ever read in bulk for a tag or an entry.+ id: uuid('id').defaultRandom().primaryKey().notNull(),+ tagId: uuid('tag_id')+ .references(() => userContactTags.id, { onDelete: 'cascade' })+ .notNull(),+ contactId: uuid('contact_id')+ .references(() => userContacts.id, { onDelete: 'cascade' })+ .notNull(),++ userId: text('user_id')+ .references(() => users.id, { onDelete: 'cascade' })+ .notNull(),++ ...timestamps,+ },+ (t) => [+ uniqueIndex('user_contact_tag_assignments_tag_id_contact_id_unique').on(t.tagId, t.contactId),+ index('user_contact_tag_assignments_contact_id_idx').on(t.contactId),+ index('user_contact_tag_assignments_user_id_idx').on(t.userId),+ ],+);++export type UserContactTagItem = typeof userContactTags.$inferSelect;+export type NewUserContactTag = typeof userContactTags.$inferInsert;+export type UserContactTagAssignmentItem = typeof userContactTagAssignments.$inferSelect;diff --git a/packages/database/src/schemas/index.ts b/packages/database/src/schemas/index.tsindex 22bf7877b2a..f3ab74e1d31 100644--- a/packages/database/src/schemas/index.ts+++ b/packages/database/src/schemas/index.ts@@ -24,6 +24,7 @@ export * from './betterAuth';export * from './channel';export * from './chatGroup';export * from './connector';+export * from './contact';export * from './dashboard';export * from './device';export * from './documentComment';diff --git a/packages/types/src/contact.ts b/packages/types/src/contact.tsnew file mode 100644index 00000000000..a068657b2e5--- /dev/null+++ b/packages/types/src/contact.ts@@ -0,0 +1,13 @@+/**+ * Address book: people who accepted each other's contact request, and other people's Agents+ * added through their share link. Own Agents are not stored here; clients list them from the+ * Agent list as before.+ */+export const CONTACT_TYPES = ['user', 'agent'] as const;+export type ContactType = (typeof CONTACT_TYPES)[number];++export const CONTACT_REQUEST_STATUSES = ['pending', 'accepted', 'declined', 'cancelled'] as const;+export type ContactRequestStatus = (typeof CONTACT_REQUEST_STATUSES)[number];++/** Owner-side extras of an address book entry; open for later management features. */+export type ContactMetadata = Record<string, unknown>;diff --git a/packages/types/src/index.ts b/packages/types/src/index.tsindex d91266b545b..c1e9effb049 100644--- a/packages/types/src/index.ts+++ b/packages/types/src/index.ts@@ -17,6 +17,7 @@ export * from './auth';export * from './brief';export * from './channel';export * from './chunk';+export * from './contact';export * from './conversation';export * from './creds';export * from './dashboard';