From e3fcc208b8ead009d1a08dc2031392757ee10652 Mon Sep 17 00:00:00 2001 From: Katia Bulatova Date: Thu, 6 Aug 2026 17:38:23 +0000 Subject: [PATCH] refactor(dashboard-agent-db): collapse the agent's migrations into one The datastore's 21 migrations recorded the development history of a feature that has never shipped, including a column added in 0019 and dropped in 0020. Regenerated from the schema with drizzle-kit, so the single file is exactly what `src/schema.ts` declares. Replaying from an empty database gives the same 8 tables, 118 columns, 26 indexes and 9 constraints as the 21 files did; only the physical column order differs, because a column added by ALTER lands at the end. --- .../drizzle/0000_loose_franklin_storm.sql | 166 +++ .../drizzle/0000_magenta_lilandra.sql | 25 - .../drizzle/0001_slimy_living_tribunal.sql | 38 - .../drizzle/0002_luxuriant_king_cobra.sql | 37 - .../drizzle/0003_famous_champions.sql | 1 - .../drizzle/0004_moaning_omega_sentinel.sql | 1 - .../drizzle/0005_aspiring_unus.sql | 3 - .../drizzle/0006_wooden_hex.sql | 1 - .../drizzle/0007_glamorous_colleen_wing.sql | 2 - .../drizzle/0008_chunky_spot.sql | 2 - .../drizzle/0009_harsh_satana.sql | 1 - .../drizzle/0010_lumpy_killraven.sql | 12 - .../drizzle/0011_perfect_toad.sql | 1 - .../drizzle/0012_windy_silverclaw.sql | 1 - .../drizzle/0013_ordinary_kabuki.sql | 3 - .../drizzle/0014_round_princess_powerful.sql | 1 - .../drizzle/0015_greedy_havok.sql | 23 - .../drizzle/0016_lucky_barracuda.sql | 6 - .../drizzle/0017_blushing_ultron.sql | 1 - .../drizzle/0018_fantastic_cerebro.sql | 3 - .../drizzle/0019_steep_silver_fox.sql | 13 - .../drizzle/0020_past_the_fury.sql | 1 - .../drizzle/meta/0000_snapshot.json | 1141 ++++++++++++++- .../drizzle/meta/0001_snapshot.json | 441 ------ .../drizzle/meta/0002_snapshot.json | 723 --------- .../drizzle/meta/0003_snapshot.json | 729 ---------- .../drizzle/meta/0004_snapshot.json | 751 ---------- .../drizzle/meta/0005_snapshot.json | 757 ---------- .../drizzle/meta/0006_snapshot.json | 763 ---------- .../drizzle/meta/0007_snapshot.json | 775 ---------- .../drizzle/meta/0008_snapshot.json | 788 ---------- .../drizzle/meta/0009_snapshot.json | 816 ----------- .../drizzle/meta/0010_snapshot.json | 902 ------------ .../drizzle/meta/0011_snapshot.json | 918 ------------ .../drizzle/meta/0012_snapshot.json | 933 ------------ .../drizzle/meta/0013_snapshot.json | 955 ------------ .../drizzle/meta/0014_snapshot.json | 977 ------------- .../drizzle/meta/0015_snapshot.json | 1124 -------------- .../drizzle/meta/0016_snapshot.json | 1203 --------------- .../drizzle/meta/0017_snapshot.json | 1196 --------------- .../drizzle/meta/0018_snapshot.json | 1202 --------------- .../drizzle/meta/0019_snapshot.json | 1293 ----------------- .../drizzle/meta/0020_snapshot.json | 1286 ---------------- .../drizzle/meta/_journal.json | 146 +- 44 files changed, 1301 insertions(+), 18860 deletions(-) create mode 100644 internal-packages/dashboard-agent-db/drizzle/0000_loose_franklin_storm.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0000_magenta_lilandra.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0001_slimy_living_tribunal.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0002_luxuriant_king_cobra.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0003_famous_champions.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0004_moaning_omega_sentinel.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0005_aspiring_unus.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0006_wooden_hex.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0007_glamorous_colleen_wing.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0008_chunky_spot.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0009_harsh_satana.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0010_lumpy_killraven.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0011_perfect_toad.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0012_windy_silverclaw.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0013_ordinary_kabuki.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0014_round_princess_powerful.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0015_greedy_havok.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0016_lucky_barracuda.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0017_blushing_ultron.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0018_fantastic_cerebro.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0019_steep_silver_fox.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/0020_past_the_fury.sql delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0001_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0002_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0003_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0004_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0005_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0006_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0007_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0008_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0009_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0010_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0011_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0012_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0013_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0014_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0015_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0016_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0017_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0018_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0019_snapshot.json delete mode 100644 internal-packages/dashboard-agent-db/drizzle/meta/0020_snapshot.json diff --git a/internal-packages/dashboard-agent-db/drizzle/0000_loose_franklin_storm.sql b/internal-packages/dashboard-agent-db/drizzle/0000_loose_franklin_storm.sql new file mode 100644 index 000000000..88cbff015 --- /dev/null +++ b/internal-packages/dashboard-agent-db/drizzle/0000_loose_franklin_storm.sql @@ -0,0 +1,166 @@ +CREATE SCHEMA "trigger_dashboard_agent"; +--> statement-breakpoint +CREATE TABLE "trigger_dashboard_agent"."chat_messages" ( + "chat_id" text NOT NULL, + "message_id" text NOT NULL, + "position" integer NOT NULL, + "role" text NOT NULL, + "message" jsonb NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "chat_messages_chat_id_message_id_pk" PRIMARY KEY("chat_id","message_id"), + CONSTRAINT "chat_messages_chat_position_key" UNIQUE("chat_id","position") +); +--> statement-breakpoint +CREATE TABLE "trigger_dashboard_agent"."chat_sessions" ( + "chat_id" text PRIMARY KEY NOT NULL, + "public_access_token" text NOT NULL, + "last_event_id" text, + "run_id" text, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "trigger_dashboard_agent"."chat_turn_evals" ( + "chat_id" text NOT NULL, + "turn" integer NOT NULL, + "organization_id" text NOT NULL, + "user_id" text NOT NULL, + "agent_run_id" text, + "eval_run_id" text, + "project_ref" text, + "environment" text, + "current_page" text, + "model" text, + "prompt_slug" text, + "prompt_version" integer, + "tools_used" jsonb DEFAULT '[]'::jsonb NOT NULL, + "tool_error" boolean DEFAULT false NOT NULL, + "judge_model" text, + "score_grounded" smallint, + "score_answered" smallint, + "score_concise" smallint, + "passed" boolean, + "intent_category" text, + "outcome" text, + "sentiment" text, + "capability_gap" boolean DEFAULT false NOT NULL, + "docs_gap" boolean DEFAULT false NOT NULL, + "support_opportunity" boolean DEFAULT false NOT NULL, + "feature_request" boolean DEFAULT false NOT NULL, + "topics" jsonb DEFAULT '[]'::jsonb NOT NULL, + "signals" jsonb DEFAULT '[]'::jsonb NOT NULL, + "summary" text, + "user_text" text, + "judge" jsonb, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "chat_turn_evals_chat_id_turn_pk" PRIMARY KEY("chat_id","turn") +); +--> statement-breakpoint +CREATE TABLE "trigger_dashboard_agent"."chats" ( + "id" text PRIMARY KEY NOT NULL, + "organization_id" text NOT NULL, + "user_id" text NOT NULL, + "title" text DEFAULT 'New chat' NOT NULL, + "metadata" jsonb DEFAULT '{}'::jsonb NOT NULL, + "pinned_at" timestamp with time zone, + "last_read_at" timestamp with time zone, + "deleted_at" timestamp with time zone, + "last_message_at" timestamp with time zone, + "next_message_position" integer DEFAULT 1 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 "trigger_dashboard_agent"."investigations" ( + "id" text PRIMARY KEY NOT NULL, + "chat_id" text NOT NULL, + "project_ref" text NOT NULL, + "environment_ref" text NOT NULL, + "revision" integer DEFAULT 0 NOT NULL, + "state" jsonb 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 "trigger_dashboard_agent"."watch_batches" ( + "environment_id" text NOT NULL, + "cadence_minutes" integer NOT NULL, + "epoch" integer DEFAULT 0 NOT NULL, + "generation" integer DEFAULT 0 NOT NULL, + "status" text DEFAULT 'running' NOT NULL, + "armed_at" timestamp with time zone DEFAULT now() NOT NULL, + "last_tick_at" timestamp with time zone, + CONSTRAINT "watch_batches_environment_id_cadence_minutes_pk" PRIMARY KEY("environment_id","cadence_minutes") +); +--> statement-breakpoint +CREATE TABLE "trigger_dashboard_agent"."watch_submissions" ( + "chat_id" text NOT NULL, + "client_request_id" text NOT NULL, + "organization_id" text NOT NULL, + "user_id" text NOT NULL, + "project_id" text NOT NULL, + "environment_id" text NOT NULL, + "draft_hash" text NOT NULL, + "draft" jsonb NOT NULL, + "state" text DEFAULT 'pending' NOT NULL, + "watch_id" text, + "unavailable" boolean DEFAULT false NOT NULL, + "external_notification_status" text DEFAULT 'not_requested' NOT NULL, + "external_notification_reason" text, + "immediate_result" text, + "refusal_code" text, + "refusal_error" text, + "refusal_existing_id" text, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "watch_submissions_chat_id_client_request_id_pk" PRIMARY KEY("chat_id","client_request_id") +); +--> statement-breakpoint +CREATE TABLE "trigger_dashboard_agent"."watches" ( + "id" text PRIMARY KEY NOT NULL, + "chat_id" text NOT NULL, + "identity" text NOT NULL, + "spec" jsonb NOT NULL, + "status" text DEFAULT 'active' NOT NULL, + "delivery_status" text DEFAULT 'not_required' NOT NULL, + "cancel_reason" text, + "resolution" text, + "observed_outcome" jsonb, + "investigate_on_attention" boolean DEFAULT false NOT NULL, + "organization_id" text NOT NULL, + "project_id" text NOT NULL, + "project_ref" text, + "environment_id" text NOT NULL, + "user_id" text NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "expires_at" timestamp with time zone NOT NULL, + "last_checked_at" timestamp with time zone, + "last_attempted_at" timestamp with time zone, + "fired_at" timestamp with time zone, + "delivery_claimed_at" timestamp with time zone, + "delivery_claim_id" text, + "delivered_at" timestamp with time zone, + "cancelled_at" timestamp with time zone, + "last_result" jsonb, + "tick_count" integer DEFAULT 0 NOT NULL, + "alert_dispatch_key" text, + "retention_at" timestamp with time zone GENERATED ALWAYS AS (greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)) STORED, + "cadence_minutes" integer GENERATED ALWAYS AS (((spec ->> 'checkEveryMinutes')::int)) STORED +); +--> statement-breakpoint +CREATE INDEX "chat_messages_chat_user_role_idx" ON "trigger_dashboard_agent"."chat_messages" USING btree ("chat_id","message_id") WHERE "trigger_dashboard_agent"."chat_messages"."role" = 'user';--> statement-breakpoint +CREATE INDEX "chat_turn_evals_org_created_idx" ON "trigger_dashboard_agent"."chat_turn_evals" USING btree ("organization_id","created_at" DESC NULLS LAST);--> statement-breakpoint +CREATE INDEX "chat_turn_evals_created_idx" ON "trigger_dashboard_agent"."chat_turn_evals" USING btree ("created_at");--> statement-breakpoint +CREATE INDEX "chat_turn_evals_org_opps_idx" ON "trigger_dashboard_agent"."chat_turn_evals" USING btree ("organization_id","created_at" DESC NULLS LAST) WHERE "trigger_dashboard_agent"."chat_turn_evals"."capability_gap" or "trigger_dashboard_agent"."chat_turn_evals"."docs_gap" or "trigger_dashboard_agent"."chat_turn_evals"."support_opportunity" or "trigger_dashboard_agent"."chat_turn_evals"."feature_request";--> statement-breakpoint +CREATE INDEX "chats_org_user_last_msg_idx" ON "trigger_dashboard_agent"."chats" USING btree ("organization_id","user_id","last_message_at" DESC NULLS LAST) WHERE "trigger_dashboard_agent"."chats"."deleted_at" is null;--> statement-breakpoint +CREATE INDEX "investigations_chat_idx" ON "trigger_dashboard_agent"."investigations" USING btree ("chat_id");--> statement-breakpoint +CREATE INDEX "investigations_open_updated_idx" ON "trigger_dashboard_agent"."investigations" USING btree ("updated_at") WHERE "trigger_dashboard_agent"."investigations"."state"->>'outcome' = 'in_progress';--> statement-breakpoint +CREATE INDEX "watch_submissions_created_idx" ON "trigger_dashboard_agent"."watch_submissions" USING btree ("created_at");--> statement-breakpoint +CREATE INDEX "watches_chat_idx" ON "trigger_dashboard_agent"."watches" USING btree ("chat_id");--> statement-breakpoint +CREATE UNIQUE INDEX "watches_chat_active_identity_key" ON "trigger_dashboard_agent"."watches" USING btree ("chat_id","project_id","environment_id","identity") WHERE "trigger_dashboard_agent"."watches"."status" = 'active';--> statement-breakpoint +CREATE INDEX "watches_status_expires_idx" ON "trigger_dashboard_agent"."watches" USING btree ("status","expires_at");--> statement-breakpoint +CREATE INDEX "watches_pending_delivery_idx" ON "trigger_dashboard_agent"."watches" USING btree ("fired_at","last_checked_at") WHERE "trigger_dashboard_agent"."watches"."delivery_status" in ('pending', 'delivering');--> statement-breakpoint +CREATE INDEX "watches_org_user_wake_idx" ON "trigger_dashboard_agent"."watches" USING btree ("organization_id","user_id",coalesce("fired_at", "last_checked_at") desc) WHERE "trigger_dashboard_agent"."watches"."delivery_status" = 'delivered' and "trigger_dashboard_agent"."watches"."status" in ('fired', 'expired');--> statement-breakpoint +CREATE INDEX "watches_org_user_active_idx" ON "trigger_dashboard_agent"."watches" USING btree ("organization_id","user_id") WHERE "trigger_dashboard_agent"."watches"."status" = 'active';--> statement-breakpoint +CREATE INDEX "watches_active_env_cadence_idx" ON "trigger_dashboard_agent"."watches" USING btree ("environment_id","cadence_minutes",coalesce("last_attempted_at", "last_checked_at", "created_at"),"expires_at") WHERE "trigger_dashboard_agent"."watches"."status" = 'active';--> statement-breakpoint +CREATE INDEX "watches_env_cadence_delivery_idx" ON "trigger_dashboard_agent"."watches" USING btree ("environment_id","cadence_minutes","delivery_status",coalesce("fired_at", "last_checked_at")) WHERE "trigger_dashboard_agent"."watches"."status" in ('fired', 'expired') and "trigger_dashboard_agent"."watches"."delivery_status" in ('pending', 'delivering');--> statement-breakpoint +CREATE INDEX "watches_retention_idx" ON "trigger_dashboard_agent"."watches" USING btree ("retention_at") WHERE "trigger_dashboard_agent"."watches"."status" in ('fired', 'expired', 'cancelled') and "trigger_dashboard_agent"."watches"."delivery_status" in ('not_required', 'delivered'); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0000_magenta_lilandra.sql b/internal-packages/dashboard-agent-db/drizzle/0000_magenta_lilandra.sql deleted file mode 100644 index 0eb2c72b9..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0000_magenta_lilandra.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE SCHEMA IF NOT EXISTS "trigger_dashboard_agent"; ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "trigger_dashboard_agent"."chat_sessions" ( - "chat_id" text PRIMARY KEY NOT NULL, - "public_access_token" text NOT NULL, - "last_event_id" text, - "run_id" text, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "trigger_dashboard_agent"."chats" ( - "id" text PRIMARY KEY NOT NULL, - "organization_id" text NOT NULL, - "user_id" text NOT NULL, - "title" text DEFAULT 'New chat' NOT NULL, - "messages" jsonb DEFAULT '[]'::jsonb NOT NULL, - "metadata" jsonb DEFAULT '{}'::jsonb NOT NULL, - "pinned_at" timestamp with time zone, - "deleted_at" timestamp with time zone, - "last_message_at" timestamp with time zone, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "chats_org_user_last_msg_idx" ON "trigger_dashboard_agent"."chats" USING btree ("organization_id","user_id","last_message_at" DESC NULLS LAST) WHERE "trigger_dashboard_agent"."chats"."deleted_at" is null; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0001_slimy_living_tribunal.sql b/internal-packages/dashboard-agent-db/drizzle/0001_slimy_living_tribunal.sql deleted file mode 100644 index 4c9afe5f6..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0001_slimy_living_tribunal.sql +++ /dev/null @@ -1,38 +0,0 @@ -CREATE TABLE IF NOT EXISTS "trigger_dashboard_agent"."chat_turn_evals" ( - "chat_id" text NOT NULL, - "turn" integer NOT NULL, - "organization_id" text NOT NULL, - "user_id" text NOT NULL, - "agent_run_id" text, - "eval_run_id" text, - "project_ref" text, - "environment" text, - "current_page" text, - "model" text, - "prompt_slug" text, - "prompt_version" integer, - "tools_used" jsonb DEFAULT '[]'::jsonb NOT NULL, - "tool_error" boolean DEFAULT false NOT NULL, - "judge_model" text, - "score_grounded" smallint, - "score_answered" smallint, - "score_concise" smallint, - "passed" boolean, - "intent_category" text, - "outcome" text, - "sentiment" text, - "capability_gap" boolean DEFAULT false NOT NULL, - "docs_gap" boolean DEFAULT false NOT NULL, - "support_opportunity" boolean DEFAULT false NOT NULL, - "feature_request" boolean DEFAULT false NOT NULL, - "topics" jsonb DEFAULT '[]'::jsonb NOT NULL, - "signals" jsonb DEFAULT '[]'::jsonb NOT NULL, - "summary" text, - "user_text" text, - "judge" jsonb, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "chat_turn_evals_chat_id_turn_pk" PRIMARY KEY("chat_id","turn") -); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "chat_turn_evals_org_created_idx" ON "trigger_dashboard_agent"."chat_turn_evals" USING btree ("organization_id","created_at" DESC NULLS LAST);--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "chat_turn_evals_org_opps_idx" ON "trigger_dashboard_agent"."chat_turn_evals" USING btree ("organization_id","created_at" DESC NULLS LAST) WHERE "trigger_dashboard_agent"."chat_turn_evals"."capability_gap" or "trigger_dashboard_agent"."chat_turn_evals"."docs_gap" or "trigger_dashboard_agent"."chat_turn_evals"."support_opportunity" or "trigger_dashboard_agent"."chat_turn_evals"."feature_request"; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0002_luxuriant_king_cobra.sql b/internal-packages/dashboard-agent-db/drizzle/0002_luxuriant_king_cobra.sql deleted file mode 100644 index 042b42989..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0002_luxuriant_king_cobra.sql +++ /dev/null @@ -1,37 +0,0 @@ -CREATE TABLE "trigger_dashboard_agent"."investigations" ( - "id" text PRIMARY KEY NOT NULL, - "chat_id" text NOT NULL, - "project_ref" text NOT NULL, - "environment_ref" text NOT NULL, - "revision" integer DEFAULT 0 NOT NULL, - "state" jsonb 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 "trigger_dashboard_agent"."watches" ( - "id" text PRIMARY KEY NOT NULL, - "chat_id" text NOT NULL, - "identity" text NOT NULL, - "spec" jsonb NOT NULL, - "status" text DEFAULT 'active' NOT NULL, - "delivery_status" text DEFAULT 'not_required' NOT NULL, - "cancel_reason" text, - "organization_id" text NOT NULL, - "project_id" text NOT NULL, - "environment_id" text NOT NULL, - "user_id" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "expires_at" timestamp with time zone NOT NULL, - "last_checked_at" timestamp with time zone, - "fired_at" timestamp with time zone, - "delivered_at" timestamp with time zone, - "cancelled_at" timestamp with time zone, - "last_result" jsonb, - "tick_count" integer DEFAULT 0 NOT NULL -); ---> statement-breakpoint -CREATE INDEX "investigations_chat_idx" ON "trigger_dashboard_agent"."investigations" USING btree ("chat_id");--> statement-breakpoint -CREATE INDEX "watches_chat_idx" ON "trigger_dashboard_agent"."watches" USING btree ("chat_id");--> statement-breakpoint -CREATE UNIQUE INDEX "watches_chat_active_identity_key" ON "trigger_dashboard_agent"."watches" USING btree ("chat_id","project_id","environment_id","identity") WHERE "trigger_dashboard_agent"."watches"."status" = 'active';--> statement-breakpoint -CREATE INDEX "watches_status_expires_idx" ON "trigger_dashboard_agent"."watches" USING btree ("status","expires_at"); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0003_famous_champions.sql b/internal-packages/dashboard-agent-db/drizzle/0003_famous_champions.sql deleted file mode 100644 index 2a2c4c3c9..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0003_famous_champions.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."chats" ADD COLUMN "last_read_at" timestamp with time zone; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0004_moaning_omega_sentinel.sql b/internal-packages/dashboard-agent-db/drizzle/0004_moaning_omega_sentinel.sql deleted file mode 100644 index e9f58cce8..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0004_moaning_omega_sentinel.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "watches_pending_delivery_idx" ON "trigger_dashboard_agent"."watches" USING btree ("fired_at","last_checked_at") WHERE "trigger_dashboard_agent"."watches"."delivery_status" = 'pending'; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0005_aspiring_unus.sql b/internal-packages/dashboard-agent-db/drizzle/0005_aspiring_unus.sql deleted file mode 100644 index f208999a8..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0005_aspiring_unus.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP INDEX "trigger_dashboard_agent"."watches_pending_delivery_idx";--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "delivery_claimed_at" timestamp with time zone;--> statement-breakpoint -CREATE INDEX "watches_pending_delivery_idx" ON "trigger_dashboard_agent"."watches" USING btree ("fired_at","last_checked_at") WHERE "trigger_dashboard_agent"."watches"."delivery_status" in ('pending', 'delivering'); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0006_wooden_hex.sql b/internal-packages/dashboard-agent-db/drizzle/0006_wooden_hex.sql deleted file mode 100644 index 1aee1fbc8..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0006_wooden_hex.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "delivery_claim_id" text; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0007_glamorous_colleen_wing.sql b/internal-packages/dashboard-agent-db/drizzle/0007_glamorous_colleen_wing.sql deleted file mode 100644 index 845d156e7..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0007_glamorous_colleen_wing.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "resolution" text;--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "observed_outcome" jsonb; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0008_chunky_spot.sql b/internal-packages/dashboard-agent-db/drizzle/0008_chunky_spot.sql deleted file mode 100644 index 5e81fa052..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0008_chunky_spot.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "investigate_on_attention" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "project_ref" text; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0009_harsh_satana.sql b/internal-packages/dashboard-agent-db/drizzle/0009_harsh_satana.sql deleted file mode 100644 index da465d012..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0009_harsh_satana.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "watches_org_user_wake_idx" ON "trigger_dashboard_agent"."watches" USING btree ("organization_id","user_id",coalesce("fired_at", "last_checked_at") desc) WHERE "trigger_dashboard_agent"."watches"."delivery_status" = 'delivered' and "trigger_dashboard_agent"."watches"."status" in ('fired', 'expired'); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0010_lumpy_killraven.sql b/internal-packages/dashboard-agent-db/drizzle/0010_lumpy_killraven.sql deleted file mode 100644 index 343a0d18f..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0010_lumpy_killraven.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE "trigger_dashboard_agent"."watch_batches" ( - "environment_id" text NOT NULL, - "cadence_minutes" integer NOT NULL, - "epoch" integer DEFAULT 0 NOT NULL, - "generation" integer DEFAULT 0 NOT NULL, - "status" text DEFAULT 'running' NOT NULL, - "armed_at" timestamp with time zone DEFAULT now() NOT NULL, - "last_tick_at" timestamp with time zone, - CONSTRAINT "watch_batches_environment_id_cadence_minutes_pk" PRIMARY KEY("environment_id","cadence_minutes") -); ---> statement-breakpoint -CREATE INDEX "watches_active_env_idx" ON "trigger_dashboard_agent"."watches" USING btree ("environment_id","expires_at") WHERE "trigger_dashboard_agent"."watches"."status" = 'active'; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0011_perfect_toad.sql b/internal-packages/dashboard-agent-db/drizzle/0011_perfect_toad.sql deleted file mode 100644 index bfba00ddc..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0011_perfect_toad.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "investigations_open_updated_idx" ON "trigger_dashboard_agent"."investigations" USING btree ("updated_at") WHERE "trigger_dashboard_agent"."investigations"."state"->>'outcome' = 'in_progress'; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0012_windy_silverclaw.sql b/internal-packages/dashboard-agent-db/drizzle/0012_windy_silverclaw.sql deleted file mode 100644 index 8abb6c86d..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0012_windy_silverclaw.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "chat_turn_evals_created_idx" ON "trigger_dashboard_agent"."chat_turn_evals" USING btree ("created_at"); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0013_ordinary_kabuki.sql b/internal-packages/dashboard-agent-db/drizzle/0013_ordinary_kabuki.sql deleted file mode 100644 index 2d28c71cf..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0013_ordinary_kabuki.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP INDEX "trigger_dashboard_agent"."watches_active_env_idx";--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "cadence_minutes" integer GENERATED ALWAYS AS (((spec ->> 'checkEveryMinutes')::int)) STORED;--> statement-breakpoint -CREATE INDEX "watches_active_env_cadence_idx" ON "trigger_dashboard_agent"."watches" USING btree ("environment_id","cadence_minutes",coalesce("last_checked_at", "created_at"),"expires_at") WHERE "trigger_dashboard_agent"."watches"."status" = 'active'; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0014_round_princess_powerful.sql b/internal-packages/dashboard-agent-db/drizzle/0014_round_princess_powerful.sql deleted file mode 100644 index 72301ba5c..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0014_round_princess_powerful.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "watches_org_user_active_idx" ON "trigger_dashboard_agent"."watches" USING btree ("organization_id","user_id") WHERE "trigger_dashboard_agent"."watches"."status" = 'active'; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0015_greedy_havok.sql b/internal-packages/dashboard-agent-db/drizzle/0015_greedy_havok.sql deleted file mode 100644 index 34728d969..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0015_greedy_havok.sql +++ /dev/null @@ -1,23 +0,0 @@ -CREATE TABLE "trigger_dashboard_agent"."watch_submissions" ( - "chat_id" text NOT NULL, - "client_request_id" text NOT NULL, - "organization_id" text NOT NULL, - "user_id" text NOT NULL, - "project_id" text NOT NULL, - "environment_id" text NOT NULL, - "draft_hash" text NOT NULL, - "draft" jsonb NOT NULL, - "state" text DEFAULT 'pending' NOT NULL, - "watch_id" text, - "unavailable" boolean DEFAULT false NOT NULL, - "notified_externally" boolean DEFAULT false NOT NULL, - "immediate_result" text, - "refusal_code" text, - "refusal_error" text, - "refusal_existing_id" text, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "watch_submissions_chat_id_client_request_id_pk" PRIMARY KEY("chat_id","client_request_id") -); ---> statement-breakpoint -CREATE INDEX "watch_submissions_created_idx" ON "trigger_dashboard_agent"."watch_submissions" USING btree ("created_at"); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0016_lucky_barracuda.sql b/internal-packages/dashboard-agent-db/drizzle/0016_lucky_barracuda.sql deleted file mode 100644 index a6046d15a..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0016_lucky_barracuda.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."watch_submissions" ADD COLUMN "external_notification_status" text DEFAULT 'not_requested' NOT NULL;--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watch_submissions" ADD COLUMN "external_notification_reason" text;--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "alert_dispatch_key" text;--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "retention_at" timestamp with time zone GENERATED ALWAYS AS (greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)) STORED;--> statement-breakpoint -CREATE INDEX "watches_env_cadence_delivery_idx" ON "trigger_dashboard_agent"."watches" USING btree ("environment_id","cadence_minutes","delivery_status",coalesce("fired_at", "last_checked_at")) WHERE "trigger_dashboard_agent"."watches"."status" in ('fired', 'expired') and "trigger_dashboard_agent"."watches"."delivery_status" in ('pending', 'delivering');--> statement-breakpoint -CREATE INDEX "watches_retention_idx" ON "trigger_dashboard_agent"."watches" USING btree ("retention_at") WHERE "trigger_dashboard_agent"."watches"."status" in ('fired', 'expired', 'cancelled') and "trigger_dashboard_agent"."watches"."delivery_status" in ('not_required', 'delivered'); \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0017_blushing_ultron.sql b/internal-packages/dashboard-agent-db/drizzle/0017_blushing_ultron.sql deleted file mode 100644 index 35034c06d..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0017_blushing_ultron.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."watch_submissions" DROP COLUMN "notified_externally"; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0018_fantastic_cerebro.sql b/internal-packages/dashboard-agent-db/drizzle/0018_fantastic_cerebro.sql deleted file mode 100644 index 555fcbdee..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0018_fantastic_cerebro.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP INDEX "trigger_dashboard_agent"."watches_active_env_cadence_idx";--> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."watches" ADD COLUMN "last_attempted_at" timestamp with time zone;--> statement-breakpoint -CREATE INDEX "watches_active_env_cadence_idx" ON "trigger_dashboard_agent"."watches" USING btree ("environment_id","cadence_minutes",coalesce("last_attempted_at", "last_checked_at", "created_at"),"expires_at") WHERE "trigger_dashboard_agent"."watches"."status" = 'active'; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/0019_steep_silver_fox.sql b/internal-packages/dashboard-agent-db/drizzle/0019_steep_silver_fox.sql deleted file mode 100644 index 966e1d256..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0019_steep_silver_fox.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE "trigger_dashboard_agent"."chat_messages" ( - "chat_id" text NOT NULL, - "message_id" text NOT NULL, - "position" integer NOT NULL, - "role" text NOT NULL, - "message" jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "chat_messages_chat_id_message_id_pk" PRIMARY KEY("chat_id","message_id"), - CONSTRAINT "chat_messages_chat_position_key" UNIQUE("chat_id","position") -); ---> statement-breakpoint -ALTER TABLE "trigger_dashboard_agent"."chats" ADD COLUMN "next_message_position" integer DEFAULT 1 NOT NULL;--> statement-breakpoint -CREATE INDEX "chat_messages_chat_user_role_idx" ON "trigger_dashboard_agent"."chat_messages" USING btree ("chat_id","message_id") WHERE "trigger_dashboard_agent"."chat_messages"."role" = 'user'; diff --git a/internal-packages/dashboard-agent-db/drizzle/0020_past_the_fury.sql b/internal-packages/dashboard-agent-db/drizzle/0020_past_the_fury.sql deleted file mode 100644 index 37aa15284..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/0020_past_the_fury.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "trigger_dashboard_agent"."chats" DROP COLUMN "messages"; \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0000_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0000_snapshot.json index 9ff7afa4f..44c094fa5 100644 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0000_snapshot.json +++ b/internal-packages/dashboard-agent-db/drizzle/meta/0000_snapshot.json @@ -1,9 +1,99 @@ { - "id": "512ce1a7-b31d-4644-9639-3e124b22e52e", + "id": "5277f2c5-c0c1-4190-a0a4-68b42a5cfcd9", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { + "trigger_dashboard_agent.chat_messages": { + "name": "chat_messages", + "schema": "trigger_dashboard_agent", + "columns": { + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "message_id": { + "name": "message_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chat_messages_chat_user_role_idx": { + "name": "chat_messages_chat_user_role_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"chat_messages\".\"role\" = 'user'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "chat_messages_chat_id_message_id_pk": { + "name": "chat_messages_chat_id_message_id_pk", + "columns": [ + "chat_id", + "message_id" + ] + } + }, + "uniqueConstraints": { + "chat_messages_chat_position_key": { + "name": "chat_messages_chat_position_key", + "nullsNotDistinct": false, + "columns": [ + "chat_id", + "position" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "trigger_dashboard_agent.chat_sessions": { "name": "chat_sessions", "schema": "trigger_dashboard_agent", @@ -48,6 +138,287 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "trigger_dashboard_agent.chat_turn_evals": { + "name": "chat_turn_evals", + "schema": "trigger_dashboard_agent", + "columns": { + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "turn": { + "name": "turn", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent_run_id": { + "name": "agent_run_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "eval_run_id": { + "name": "eval_run_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_ref": { + "name": "project_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "environment": { + "name": "environment", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_page": { + "name": "current_page", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prompt_slug": { + "name": "prompt_slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prompt_version": { + "name": "prompt_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tools_used": { + "name": "tools_used", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "tool_error": { + "name": "tool_error", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "judge_model": { + "name": "judge_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "score_grounded": { + "name": "score_grounded", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "score_answered": { + "name": "score_answered", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "score_concise": { + "name": "score_concise", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "passed": { + "name": "passed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "intent_category": { + "name": "intent_category", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "outcome": { + "name": "outcome", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sentiment": { + "name": "sentiment", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "capability_gap": { + "name": "capability_gap", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "docs_gap": { + "name": "docs_gap", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "support_opportunity": { + "name": "support_opportunity", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "feature_request": { + "name": "feature_request", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "topics": { + "name": "topics", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "signals": { + "name": "signals", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_text": { + "name": "user_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "judge": { + "name": "judge", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chat_turn_evals_org_created_idx": { + "name": "chat_turn_evals_org_created_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_turn_evals_created_idx": { + "name": "chat_turn_evals_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_turn_evals_org_opps_idx": { + "name": "chat_turn_evals_org_opps_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "chat_turn_evals_chat_id_turn_pk": { + "name": "chat_turn_evals_chat_id_turn_pk", + "columns": [ + "chat_id", + "turn" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "trigger_dashboard_agent.chats": { "name": "chats", "schema": "trigger_dashboard_agent", @@ -77,13 +448,6 @@ "notNull": true, "default": "'New chat'" }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, "metadata": { "name": "metadata", "type": "jsonb", @@ -97,6 +461,12 @@ "primaryKey": false, "notNull": false }, + "last_read_at": { + "name": "last_read_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, "deleted_at": { "name": "deleted_at", "type": "timestamp with time zone", @@ -109,6 +479,13 @@ "primaryKey": false, "notNull": false }, + "next_message_position": { + "name": "next_message_position", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, "created_at": { "name": "created_at", "type": "timestamp with time zone", @@ -160,6 +537,752 @@ "policies": {}, "checkConstraints": {}, "isRLSEnabled": false + }, + "trigger_dashboard_agent.investigations": { + "name": "investigations", + "schema": "trigger_dashboard_agent", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "project_ref": { + "name": "project_ref", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_ref": { + "name": "environment_ref", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "state": { + "name": "state", + "type": "jsonb", + "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": { + "investigations_chat_idx": { + "name": "investigations_chat_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "investigations_open_updated_idx": { + "name": "investigations_open_updated_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "trigger_dashboard_agent.watch_batches": { + "name": "watch_batches", + "schema": "trigger_dashboard_agent", + "columns": { + "environment_id": { + "name": "environment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cadence_minutes": { + "name": "cadence_minutes", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "epoch": { + "name": "epoch", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "generation": { + "name": "generation", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'running'" + }, + "armed_at": { + "name": "armed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_tick_at": { + "name": "last_tick_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "watch_batches_environment_id_cadence_minutes_pk": { + "name": "watch_batches_environment_id_cadence_minutes_pk", + "columns": [ + "environment_id", + "cadence_minutes" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "trigger_dashboard_agent.watch_submissions": { + "name": "watch_submissions", + "schema": "trigger_dashboard_agent", + "columns": { + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_request_id": { + "name": "client_request_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "draft_hash": { + "name": "draft_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "draft": { + "name": "draft", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "watch_id": { + "name": "watch_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "unavailable": { + "name": "unavailable", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "external_notification_status": { + "name": "external_notification_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'not_requested'" + }, + "external_notification_reason": { + "name": "external_notification_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "immediate_result": { + "name": "immediate_result", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refusal_code": { + "name": "refusal_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refusal_error": { + "name": "refusal_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refusal_existing_id": { + "name": "refusal_existing_id", + "type": "text", + "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": { + "watch_submissions_created_idx": { + "name": "watch_submissions_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "watch_submissions_chat_id_client_request_id_pk": { + "name": "watch_submissions_chat_id_client_request_id_pk", + "columns": [ + "chat_id", + "client_request_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "trigger_dashboard_agent.watches": { + "name": "watches", + "schema": "trigger_dashboard_agent", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "identity": { + "name": "identity", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "spec": { + "name": "spec", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "delivery_status": { + "name": "delivery_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'not_required'" + }, + "cancel_reason": { + "name": "cancel_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "resolution": { + "name": "resolution", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "observed_outcome": { + "name": "observed_outcome", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "investigate_on_attention": { + "name": "investigate_on_attention", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "project_ref": { + "name": "project_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_checked_at": { + "name": "last_checked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_attempted_at": { + "name": "last_attempted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "fired_at": { + "name": "fired_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "delivery_claimed_at": { + "name": "delivery_claimed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "delivery_claim_id": { + "name": "delivery_claim_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "delivered_at": { + "name": "delivered_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "cancelled_at": { + "name": "cancelled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_result": { + "name": "last_result", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "tick_count": { + "name": "tick_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "alert_dispatch_key": { + "name": "alert_dispatch_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "retention_at": { + "name": "retention_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)", + "type": "stored" + } + }, + "cadence_minutes": { + "name": "cadence_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "((spec ->> 'checkEveryMinutes')::int)", + "type": "stored" + } + } + }, + "indexes": { + "watches_chat_idx": { + "name": "watches_chat_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_chat_active_identity_key": { + "name": "watches_chat_active_identity_key", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_status_expires_idx": { + "name": "watches_status_expires_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_pending_delivery_idx": { + "name": "watches_pending_delivery_idx", + "columns": [ + { + "expression": "fired_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_checked_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_org_user_wake_idx": { + "name": "watches_org_user_wake_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_org_user_active_idx": { + "name": "watches_org_user_active_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_active_env_cadence_idx": { + "name": "watches_active_env_cadence_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cadence_minutes", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"last_attempted_at\", \"last_checked_at\", \"created_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_env_cadence_delivery_idx": { + "name": "watches_env_cadence_delivery_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cadence_minutes", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "delivery_status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"fired_at\", \"last_checked_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "watches_retention_idx": { + "name": "watches_retention_idx", + "columns": [ + { + "expression": "retention_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired', 'cancelled') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('not_required', 'delivered')", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false } }, "enums": {}, @@ -175,4 +1298,4 @@ "schemas": {}, "tables": {} } -} +} \ No newline at end of file diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0001_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0001_snapshot.json deleted file mode 100644 index 57f716b95..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "id": "7a42a0cf-9933-4381-adad-98c25105465b", - "prevId": "512ce1a7-b31d-4644-9639-3e124b22e52e", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0002_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0002_snapshot.json deleted file mode 100644 index d4f28573f..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,723 +0,0 @@ -{ - "id": "8ead7f7d-2107-47ce-9b5a-018db41155de", - "prevId": "7a42a0cf-9933-4381-adad-98c25105465b", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0003_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0003_snapshot.json deleted file mode 100644 index 41740446d..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,729 +0,0 @@ -{ - "id": "b79cb5ef-25c0-40ab-877e-9e9ed462ba97", - "prevId": "8ead7f7d-2107-47ce-9b5a-018db41155de", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0004_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0004_snapshot.json deleted file mode 100644 index c00c03209..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,751 +0,0 @@ -{ - "id": "762767b5-e7e9-4561-a9cb-d51a95149bee", - "prevId": "b79cb5ef-25c0-40ab-877e-9e9ed462ba97", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'pending'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0005_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 02dcf86be..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,757 +0,0 @@ -{ - "id": "9c249eee-ff92-457e-b567-aa883095d741", - "prevId": "762767b5-e7e9-4561-a9cb-d51a95149bee", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0006_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0006_snapshot.json deleted file mode 100644 index c04203644..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,763 +0,0 @@ -{ - "id": "9b9a3bfd-59ae-4d36-a6f5-35badd82774f", - "prevId": "9c249eee-ff92-457e-b567-aa883095d741", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0007_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0007_snapshot.json deleted file mode 100644 index a1ed71829..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,775 +0,0 @@ -{ - "id": "21d8439f-e7c1-4354-b0d0-5ffce3cfc58a", - "prevId": "9b9a3bfd-59ae-4d36-a6f5-35badd82774f", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0008_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0008_snapshot.json deleted file mode 100644 index ae522c3e3..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,788 +0,0 @@ -{ - "id": "19a98528-b006-4694-b342-5a83f82ae36c", - "prevId": "21d8439f-e7c1-4354-b0d0-5ffce3cfc58a", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0009_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 8d28f37bd..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,816 +0,0 @@ -{ - "id": "584a82d7-236e-40da-8526-1a39f84bafbb", - "prevId": "19a98528-b006-4694-b342-5a83f82ae36c", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0010_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0010_snapshot.json deleted file mode 100644 index 152e2b9fb..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,902 +0,0 @@ -{ - "id": "338fef16-6640-4d6f-b2bd-08424ea60171", - "prevId": "584a82d7-236e-40da-8526-1a39f84bafbb", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_idx": { - "name": "watches_active_env_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0011_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0011_snapshot.json deleted file mode 100644 index bf1993474..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,918 +0,0 @@ -{ - "id": "79f05cca-034f-499e-9031-f877ada1938d", - "prevId": "338fef16-6640-4d6f-b2bd-08424ea60171", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_idx": { - "name": "watches_active_env_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0012_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0012_snapshot.json deleted file mode 100644 index 5885b481c..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0012_snapshot.json +++ /dev/null @@ -1,933 +0,0 @@ -{ - "id": "89362890-229a-4b83-bb70-3c7f58c3a0da", - "prevId": "79f05cca-034f-499e-9031-f877ada1938d", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_idx": { - "name": "watches_active_env_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0013_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0013_snapshot.json deleted file mode 100644 index 34086eb64..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0013_snapshot.json +++ /dev/null @@ -1,955 +0,0 @@ -{ - "id": "88e422a2-e087-4dca-9390-eebd87baeb5d", - "prevId": "89362890-229a-4b83-bb70-3c7f58c3a0da", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0014_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0014_snapshot.json deleted file mode 100644 index 28a887fc8..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0014_snapshot.json +++ /dev/null @@ -1,977 +0,0 @@ -{ - "id": "4a212cff-76fa-45d2-a160-0aae128a2b9f", - "prevId": "88e422a2-e087-4dca-9390-eebd87baeb5d", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0015_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0015_snapshot.json deleted file mode 100644 index ed0da12de..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0015_snapshot.json +++ /dev/null @@ -1,1124 +0,0 @@ -{ - "id": "2b607039-c208-4d36-aebd-971909669b6d", - "prevId": "4a212cff-76fa-45d2-a160-0aae128a2b9f", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_submissions": { - "name": "watch_submissions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "client_request_id": { - "name": "client_request_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft_hash": { - "name": "draft_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft": { - "name": "draft", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "watch_id": { - "name": "watch_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unavailable": { - "name": "unavailable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "notified_externally": { - "name": "notified_externally", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "immediate_result": { - "name": "immediate_result", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_code": { - "name": "refusal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_error": { - "name": "refusal_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_existing_id": { - "name": "refusal_existing_id", - "type": "text", - "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": { - "watch_submissions_created_idx": { - "name": "watch_submissions_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_submissions_chat_id_client_request_id_pk": { - "name": "watch_submissions_chat_id_client_request_id_pk", - "columns": ["chat_id", "client_request_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0016_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0016_snapshot.json deleted file mode 100644 index c1deb660a..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0016_snapshot.json +++ /dev/null @@ -1,1203 +0,0 @@ -{ - "id": "cbbd760c-7ebf-4999-ba94-782e053cb0ab", - "prevId": "2b607039-c208-4d36-aebd-971909669b6d", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_submissions": { - "name": "watch_submissions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "client_request_id": { - "name": "client_request_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft_hash": { - "name": "draft_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft": { - "name": "draft", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "watch_id": { - "name": "watch_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unavailable": { - "name": "unavailable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "external_notification_status": { - "name": "external_notification_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_requested'" - }, - "external_notification_reason": { - "name": "external_notification_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "notified_externally": { - "name": "notified_externally", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "immediate_result": { - "name": "immediate_result", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_code": { - "name": "refusal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_error": { - "name": "refusal_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_existing_id": { - "name": "refusal_existing_id", - "type": "text", - "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": { - "watch_submissions_created_idx": { - "name": "watch_submissions_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_submissions_chat_id_client_request_id_pk": { - "name": "watch_submissions_chat_id_client_request_id_pk", - "columns": ["chat_id", "client_request_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alert_dispatch_key": { - "name": "alert_dispatch_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_at": { - "name": "retention_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)", - "type": "stored" - } - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_env_cadence_delivery_idx": { - "name": "watches_env_cadence_delivery_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_retention_idx": { - "name": "watches_retention_idx", - "columns": [ - { - "expression": "retention_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired', 'cancelled') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('not_required', 'delivered')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0017_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0017_snapshot.json deleted file mode 100644 index 342402863..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0017_snapshot.json +++ /dev/null @@ -1,1196 +0,0 @@ -{ - "id": "1ceaeb67-642b-45d8-8c3d-4bc91a9a7e5d", - "prevId": "cbbd760c-7ebf-4999-ba94-782e053cb0ab", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_submissions": { - "name": "watch_submissions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "client_request_id": { - "name": "client_request_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft_hash": { - "name": "draft_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft": { - "name": "draft", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "watch_id": { - "name": "watch_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unavailable": { - "name": "unavailable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "external_notification_status": { - "name": "external_notification_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_requested'" - }, - "external_notification_reason": { - "name": "external_notification_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "immediate_result": { - "name": "immediate_result", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_code": { - "name": "refusal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_error": { - "name": "refusal_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_existing_id": { - "name": "refusal_existing_id", - "type": "text", - "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": { - "watch_submissions_created_idx": { - "name": "watch_submissions_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_submissions_chat_id_client_request_id_pk": { - "name": "watch_submissions_chat_id_client_request_id_pk", - "columns": ["chat_id", "client_request_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alert_dispatch_key": { - "name": "alert_dispatch_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_at": { - "name": "retention_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)", - "type": "stored" - } - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_env_cadence_delivery_idx": { - "name": "watches_env_cadence_delivery_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_retention_idx": { - "name": "watches_retention_idx", - "columns": [ - { - "expression": "retention_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired', 'cancelled') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('not_required', 'delivered')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0018_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0018_snapshot.json deleted file mode 100644 index 0414ad84b..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0018_snapshot.json +++ /dev/null @@ -1,1202 +0,0 @@ -{ - "id": "5e3aca4d-7824-405d-87a6-83e1208a87ae", - "prevId": "1ceaeb67-642b-45d8-8c3d-4bc91a9a7e5d", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_submissions": { - "name": "watch_submissions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "client_request_id": { - "name": "client_request_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft_hash": { - "name": "draft_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft": { - "name": "draft", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "watch_id": { - "name": "watch_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unavailable": { - "name": "unavailable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "external_notification_status": { - "name": "external_notification_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_requested'" - }, - "external_notification_reason": { - "name": "external_notification_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "immediate_result": { - "name": "immediate_result", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_code": { - "name": "refusal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_error": { - "name": "refusal_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_existing_id": { - "name": "refusal_existing_id", - "type": "text", - "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": { - "watch_submissions_created_idx": { - "name": "watch_submissions_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_submissions_chat_id_client_request_id_pk": { - "name": "watch_submissions_chat_id_client_request_id_pk", - "columns": ["chat_id", "client_request_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_attempted_at": { - "name": "last_attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alert_dispatch_key": { - "name": "alert_dispatch_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_at": { - "name": "retention_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)", - "type": "stored" - } - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_attempted_at\", \"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_env_cadence_delivery_idx": { - "name": "watches_env_cadence_delivery_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_retention_idx": { - "name": "watches_retention_idx", - "columns": [ - { - "expression": "retention_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired', 'cancelled') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('not_required', 'delivered')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0019_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0019_snapshot.json deleted file mode 100644 index 25812ddec..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0019_snapshot.json +++ /dev/null @@ -1,1293 +0,0 @@ -{ - "id": "1e8ad446-624b-42ca-9c4f-a24dbba2aaca", - "prevId": "5e3aca4d-7824-405d-87a6-83e1208a87ae", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_messages": { - "name": "chat_messages", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "message": { - "name": "message", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_messages_chat_user_role_idx": { - "name": "chat_messages_chat_user_role_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_messages\".\"role\" = 'user'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_messages_chat_id_message_id_pk": { - "name": "chat_messages_chat_id_message_id_pk", - "columns": ["chat_id", "message_id"] - } - }, - "uniqueConstraints": { - "chat_messages_chat_position_key": { - "name": "chat_messages_chat_position_key", - "nullsNotDistinct": false, - "columns": ["chat_id", "position"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "next_message_position": { - "name": "next_message_position", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_submissions": { - "name": "watch_submissions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "client_request_id": { - "name": "client_request_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft_hash": { - "name": "draft_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft": { - "name": "draft", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "watch_id": { - "name": "watch_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unavailable": { - "name": "unavailable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "external_notification_status": { - "name": "external_notification_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_requested'" - }, - "external_notification_reason": { - "name": "external_notification_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "immediate_result": { - "name": "immediate_result", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_code": { - "name": "refusal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_error": { - "name": "refusal_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_existing_id": { - "name": "refusal_existing_id", - "type": "text", - "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": { - "watch_submissions_created_idx": { - "name": "watch_submissions_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_submissions_chat_id_client_request_id_pk": { - "name": "watch_submissions_chat_id_client_request_id_pk", - "columns": ["chat_id", "client_request_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_attempted_at": { - "name": "last_attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alert_dispatch_key": { - "name": "alert_dispatch_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_at": { - "name": "retention_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)", - "type": "stored" - } - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_attempted_at\", \"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_env_cadence_delivery_idx": { - "name": "watches_env_cadence_delivery_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_retention_idx": { - "name": "watches_retention_idx", - "columns": [ - { - "expression": "retention_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired', 'cancelled') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('not_required', 'delivered')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/0020_snapshot.json b/internal-packages/dashboard-agent-db/drizzle/meta/0020_snapshot.json deleted file mode 100644 index e8ff1f44e..000000000 --- a/internal-packages/dashboard-agent-db/drizzle/meta/0020_snapshot.json +++ /dev/null @@ -1,1286 +0,0 @@ -{ - "id": "95b1a243-7726-419c-8c48-93f9e5a09022", - "prevId": "1e8ad446-624b-42ca-9c4f-a24dbba2aaca", - "version": "7", - "dialect": "postgresql", - "tables": { - "trigger_dashboard_agent.chat_messages": { - "name": "chat_messages", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "message": { - "name": "message", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_messages_chat_user_role_idx": { - "name": "chat_messages_chat_user_role_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_messages\".\"role\" = 'user'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_messages_chat_id_message_id_pk": { - "name": "chat_messages_chat_id_message_id_pk", - "columns": ["chat_id", "message_id"] - } - }, - "uniqueConstraints": { - "chat_messages_chat_position_key": { - "name": "chat_messages_chat_position_key", - "nullsNotDistinct": false, - "columns": ["chat_id", "position"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_sessions": { - "name": "chat_sessions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_access_token": { - "name": "public_access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_event_id": { - "name": "last_event_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "run_id": { - "name": "run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chat_turn_evals": { - "name": "chat_turn_evals", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "turn": { - "name": "turn", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "agent_run_id": { - "name": "agent_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "eval_run_id": { - "name": "eval_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "current_page": { - "name": "current_page", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_slug": { - "name": "prompt_slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "prompt_version": { - "name": "prompt_version", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "tools_used": { - "name": "tools_used", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "tool_error": { - "name": "tool_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "judge_model": { - "name": "judge_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "score_grounded": { - "name": "score_grounded", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_answered": { - "name": "score_answered", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "score_concise": { - "name": "score_concise", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "passed": { - "name": "passed", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "intent_category": { - "name": "intent_category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sentiment": { - "name": "sentiment", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "capability_gap": { - "name": "capability_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "docs_gap": { - "name": "docs_gap", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "support_opportunity": { - "name": "support_opportunity", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "feature_request": { - "name": "feature_request", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "topics": { - "name": "topics", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "signals": { - "name": "signals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "summary": { - "name": "summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_text": { - "name": "user_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "judge": { - "name": "judge", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_turn_evals_org_created_idx": { - "name": "chat_turn_evals_org_created_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_created_idx": { - "name": "chat_turn_evals_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_turn_evals_org_opps_idx": { - "name": "chat_turn_evals_org_opps_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chat_turn_evals\".\"capability_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"docs_gap\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"support_opportunity\" or \"trigger_dashboard_agent\".\"chat_turn_evals\".\"feature_request\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "chat_turn_evals_chat_id_turn_pk": { - "name": "chat_turn_evals_chat_id_turn_pk", - "columns": ["chat_id", "turn"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.chats": { - "name": "chats", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'New chat'" - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_read_at": { - "name": "last_read_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_message_at": { - "name": "last_message_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "next_message_position": { - "name": "next_message_position", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "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": { - "chats_org_user_last_msg_idx": { - "name": "chats_org_user_last_msg_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_message_at", - "isExpression": false, - "asc": false, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.investigations": { - "name": "investigations", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_ref": { - "name": "environment_ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "state": { - "name": "state", - "type": "jsonb", - "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": { - "investigations_chat_idx": { - "name": "investigations_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "investigations_open_updated_idx": { - "name": "investigations_open_updated_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"investigations\".\"state\"->>'outcome' = 'in_progress'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_batches": { - "name": "watch_batches", - "schema": "trigger_dashboard_agent", - "columns": { - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "generation": { - "name": "generation", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'running'" - }, - "armed_at": { - "name": "armed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_tick_at": { - "name": "last_tick_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_batches_environment_id_cadence_minutes_pk": { - "name": "watch_batches_environment_id_cadence_minutes_pk", - "columns": ["environment_id", "cadence_minutes"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watch_submissions": { - "name": "watch_submissions", - "schema": "trigger_dashboard_agent", - "columns": { - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "client_request_id": { - "name": "client_request_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft_hash": { - "name": "draft_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "draft": { - "name": "draft", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "watch_id": { - "name": "watch_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unavailable": { - "name": "unavailable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "external_notification_status": { - "name": "external_notification_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_requested'" - }, - "external_notification_reason": { - "name": "external_notification_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "immediate_result": { - "name": "immediate_result", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_code": { - "name": "refusal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_error": { - "name": "refusal_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refusal_existing_id": { - "name": "refusal_existing_id", - "type": "text", - "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": { - "watch_submissions_created_idx": { - "name": "watch_submissions_created_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "watch_submissions_chat_id_client_request_id_pk": { - "name": "watch_submissions_chat_id_client_request_id_pk", - "columns": ["chat_id", "client_request_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "trigger_dashboard_agent.watches": { - "name": "watches", - "schema": "trigger_dashboard_agent", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identity": { - "name": "identity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spec": { - "name": "spec", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "delivery_status": { - "name": "delivery_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'not_required'" - }, - "cancel_reason": { - "name": "cancel_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolution": { - "name": "resolution", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "observed_outcome": { - "name": "observed_outcome", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "investigate_on_attention": { - "name": "investigate_on_attention", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "organization_id": { - "name": "organization_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "project_ref": { - "name": "project_ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "environment_id": { - "name": "environment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_checked_at": { - "name": "last_checked_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_attempted_at": { - "name": "last_attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fired_at": { - "name": "fired_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claimed_at": { - "name": "delivery_claimed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "delivery_claim_id": { - "name": "delivery_claim_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "delivered_at": { - "name": "delivered_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cancelled_at": { - "name": "cancelled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_result": { - "name": "last_result", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tick_count": { - "name": "tick_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alert_dispatch_key": { - "name": "alert_dispatch_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_at": { - "name": "retention_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "greatest(delivered_at, cancelled_at, fired_at, last_checked_at, created_at)", - "type": "stored" - } - }, - "cadence_minutes": { - "name": "cadence_minutes", - "type": "integer", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "((spec ->> 'checkEveryMinutes')::int)", - "type": "stored" - } - } - }, - "indexes": { - "watches_chat_idx": { - "name": "watches_chat_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_chat_active_identity_key": { - "name": "watches_chat_active_identity_key", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_status_expires_idx": { - "name": "watches_status_expires_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_pending_delivery_idx": { - "name": "watches_pending_delivery_idx", - "columns": [ - { - "expression": "fired_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_checked_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_wake_idx": { - "name": "watches_org_user_wake_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\") desc", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"delivery_status\" = 'delivered' and \"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_org_user_active_idx": { - "name": "watches_org_user_active_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_active_env_cadence_idx": { - "name": "watches_active_env_cadence_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"last_attempted_at\", \"last_checked_at\", \"created_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - }, - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" = 'active'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_env_cadence_delivery_idx": { - "name": "watches_env_cadence_delivery_idx", - "columns": [ - { - "expression": "environment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "cadence_minutes", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"fired_at\", \"last_checked_at\")", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('pending', 'delivering')", - "concurrently": false, - "method": "btree", - "with": {} - }, - "watches_retention_idx": { - "name": "watches_retention_idx", - "columns": [ - { - "expression": "retention_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"trigger_dashboard_agent\".\"watches\".\"status\" in ('fired', 'expired', 'cancelled') and \"trigger_dashboard_agent\".\"watches\".\"delivery_status\" in ('not_required', 'delivered')", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": { - "trigger_dashboard_agent": "trigger_dashboard_agent" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/internal-packages/dashboard-agent-db/drizzle/meta/_journal.json b/internal-packages/dashboard-agent-db/drizzle/meta/_journal.json index 39e68580d..e5e73ec9e 100644 --- a/internal-packages/dashboard-agent-db/drizzle/meta/_journal.json +++ b/internal-packages/dashboard-agent-db/drizzle/meta/_journal.json @@ -5,149 +5,9 @@ { "idx": 0, "version": "7", - "when": 1781711036274, - "tag": "0000_magenta_lilandra", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1781990914081, - "tag": "0001_slimy_living_tribunal", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1785152602605, - "tag": "0002_luxuriant_king_cobra", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1785320232281, - "tag": "0003_famous_champions", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1785511915186, - "tag": "0004_moaning_omega_sentinel", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1785518300333, - "tag": "0005_aspiring_unus", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1785527453164, - "tag": "0006_wooden_hex", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1785706535148, - "tag": "0007_glamorous_colleen_wing", - "breakpoints": true - }, - { - "idx": 8, - "version": "7", - "when": 1785708513120, - "tag": "0008_chunky_spot", - "breakpoints": true - }, - { - "idx": 9, - "version": "7", - "when": 1785936955047, - "tag": "0009_harsh_satana", - "breakpoints": true - }, - { - "idx": 10, - "version": "7", - "when": 1785942560158, - "tag": "0010_lumpy_killraven", - "breakpoints": true - }, - { - "idx": 11, - "version": "7", - "when": 1785967899562, - "tag": "0011_perfect_toad", - "breakpoints": true - }, - { - "idx": 12, - "version": "7", - "when": 1785974189237, - "tag": "0012_windy_silverclaw", - "breakpoints": true - }, - { - "idx": 13, - "version": "7", - "when": 1785980277010, - "tag": "0013_ordinary_kabuki", - "breakpoints": true - }, - { - "idx": 14, - "version": "7", - "when": 1785980549999, - "tag": "0014_round_princess_powerful", - "breakpoints": true - }, - { - "idx": 15, - "version": "7", - "when": 1785999579576, - "tag": "0015_greedy_havok", - "breakpoints": true - }, - { - "idx": 16, - "version": "7", - "when": 1786007361837, - "tag": "0016_lucky_barracuda", - "breakpoints": true - }, - { - "idx": 17, - "version": "7", - "when": 1786007377644, - "tag": "0017_blushing_ultron", - "breakpoints": true - }, - { - "idx": 18, - "version": "7", - "when": 1786010944621, - "tag": "0018_fantastic_cerebro", - "breakpoints": true - }, - { - "idx": 19, - "version": "7", - "when": 1786025679054, - "tag": "0019_steep_silver_fox", - "breakpoints": true - }, - { - "idx": 20, - "version": "7", - "when": 1786026024630, - "tag": "0020_past_the_fury", + "when": 1786037737131, + "tag": "0000_loose_franklin_storm", "breakpoints": true } ] -} +} \ No newline at end of file