diff --git a/docs/openapi.json b/docs/openapi.json index 1f78db422c..2eda2d8a4f 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -69976,6 +69976,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -70065,6 +70068,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", @@ -73337,6 +73341,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -73469,6 +73476,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", @@ -73827,6 +73835,9 @@ ] } }, + "openInFullscreen": { + "type": "boolean" + }, "teamIds": { "type": "array", "items": { @@ -73948,6 +73959,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -74032,6 +74046,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", @@ -75351,6 +75366,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -75483,6 +75501,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", @@ -75846,6 +75865,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -75978,6 +76000,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", @@ -76341,6 +76364,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -76473,6 +76499,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", @@ -76836,6 +76863,9 @@ "enabled": { "type": "boolean" }, + "openInFullscreen": { + "type": "boolean" + }, "locked": { "type": "boolean" }, @@ -76968,6 +76998,7 @@ "spec", "latestVersion", "enabled", + "openInFullscreen", "locked", "createdAt", "updatedAt", diff --git a/docs/pages/platform-apps.md b/docs/pages/platform-apps.md index d9928e5897..3ecd5361f8 100644 --- a/docs/pages/platform-apps.md +++ b/docs/pages/platform-apps.md @@ -3,7 +3,7 @@ title: MCP Apps category: Apps order: 1 description: User-authored MCP Apps — sandboxed HTML interfaces with their own data store and tools -lastUpdated: 2026-08-25 +lastUpdated: 2026-08-26 --- @@ -38,6 +38,14 @@ The `/apps` gallery lists everything the viewer can reach in two sections: apps While the feature is enabled, newly created agents get the full app tool set assigned by default — the staged flow (`refine_app`, `scaffold_app`, `read_app`, `edit_app`, `validate_app`, `publish_app`) plus the supporting `preview_app_tool`, `get_app_diagnostics`, `render_app`, `list_apps`, and `delete_app` — so "build me an app" works in chat without per-agent setup. The tools can be unassigned per agent like any other; agents created before the feature was enabled need them assigned manually. +## Fullscreen + +An app can fill the page instead of sitting next to the conversation. The control is on every surface that frames an app — the hover bar over an inline app, and the top bar of the right panel. Press it again, or Escape, to go back. + +Fullscreen covers the page, not the whole window. The sidebar stays where it is; collapse it yourself if you want the extra width. + +Set **Opens in** to *Fullscreen* in App settings and the app arrives that way every time — for a dashboard you open to read, not to talk to. It is a starting point, not a lock: leaving fullscreen keeps you out of it for the rest of that view. + ## Locking an App A locked app is immutable. Agents refuse every change to it — edits, tool assignments, deletion — until it is unlocked. Viewing and running are unaffected. An agent may unlock an app only when you directly ask it to; it never unlocks one on its own. Lock or unlock an app in App settings, or ask an agent in chat. diff --git a/platform/backend/src/database/migrations/0440_chilly_bulldozer.sql b/platform/backend/src/database/migrations/0440_chilly_bulldozer.sql new file mode 100644 index 0000000000..e79e894aad --- /dev/null +++ b/platform/backend/src/database/migrations/0440_chilly_bulldozer.sql @@ -0,0 +1 @@ +ALTER TABLE "apps" ADD COLUMN "open_in_fullscreen" boolean DEFAULT false NOT NULL; \ No newline at end of file diff --git a/platform/backend/src/database/migrations/meta/0440_snapshot.json b/platform/backend/src/database/migrations/meta/0440_snapshot.json new file mode 100644 index 0000000000..97800eab59 --- /dev/null +++ b/platform/backend/src/database/migrations/meta/0440_snapshot.json @@ -0,0 +1,22078 @@ +{ + "id": "80e4be7f-65ac-476a-9f3e-a31aed1eb32e", + "prevId": "28be2ed2-72e9-4f80-a6f9-98ec213fcd90", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.a2a_artifact": { + "name": "a2a_artifact", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parts": { + "name": "parts", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_artifact_task_id_idx": { + "name": "a2a_artifact_task_id_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_artifact_task_id_a2a_task_id_fk": { + "name": "a2a_artifact_task_id_a2a_task_id_fk", + "tableFrom": "a2a_artifact", + "tableTo": "a2a_task", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_context_compactions": { + "name": "a2a_context_compactions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "context_id": { + "name": "context_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "boundary_message_id": { + "name": "boundary_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "original_token_estimate": { + "name": "original_token_estimate", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "compacted_token_estimate": { + "name": "compacted_token_estimate", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_context_compactions_context_id_created_at_idx": { + "name": "a2a_context_compactions_context_id_created_at_idx", + "columns": [ + { + "expression": "context_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_context_compactions_context_id_a2a_context_id_fk": { + "name": "a2a_context_compactions_context_id_a2a_context_id_fk", + "tableFrom": "a2a_context_compactions", + "tableTo": "a2a_context", + "columnsFrom": [ + "context_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "a2a_context_compactions_boundary_message_id_a2a_message_id_fk": { + "name": "a2a_context_compactions_boundary_message_id_a2a_message_id_fk", + "tableFrom": "a2a_context_compactions", + "tableTo": "a2a_message", + "columnsFrom": [ + "boundary_message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_context": { + "name": "a2a_context", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "actor_kind": { + "name": "actor_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "actor_id": { + "name": "actor_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_context_actor_kind_id_idx": { + "name": "a2a_context_actor_kind_id_idx", + "columns": [ + { + "expression": "actor_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_context_updated_at_idx": { + "name": "a2a_context_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_message": { + "name": "a2a_message", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "context_id": { + "name": "context_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parts": { + "name": "parts", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_message_context_id_idx": { + "name": "a2a_message_context_id_idx", + "columns": [ + { + "expression": "context_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_message_task_id_idx": { + "name": "a2a_message_task_id_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_message_updated_at_idx": { + "name": "a2a_message_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_message_context_id_a2a_context_id_fk": { + "name": "a2a_message_context_id_a2a_context_id_fk", + "tableFrom": "a2a_message", + "tableTo": "a2a_context", + "columnsFrom": [ + "context_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "a2a_message_task_id_a2a_task_id_fk": { + "name": "a2a_message_task_id_a2a_task_id_fk", + "tableFrom": "a2a_message", + "tableTo": "a2a_task", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_push_notification_config": { + "name": "a2a_push_notification_config", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_scheme": { + "name": "auth_scheme", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_credentials": { + "name": "auth_credentials", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_push_notification_config_task_id_idx": { + "name": "a2a_push_notification_config_task_id_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_push_notification_config_task_id_a2a_task_id_fk": { + "name": "a2a_push_notification_config_task_id_a2a_task_id_fk", + "tableFrom": "a2a_push_notification_config", + "tableTo": "a2a_task", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_task_approval_request": { + "name": "a2a_task_approval_request", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "approval_id": { + "name": "approval_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_call_id": { + "name": "tool_call_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_name": { + "name": "tool_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "approved": { + "name": "approved", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "resolved": { + "name": "resolved", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_task_approval_request_task_id_approval_id_idx": { + "name": "a2a_task_approval_request_task_id_approval_id_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "approval_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_task_approval_request_task_id_a2a_task_id_fk": { + "name": "a2a_task_approval_request_task_id_a2a_task_id_fk", + "tableFrom": "a2a_task_approval_request", + "tableTo": "a2a_task", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_task_event": { + "name": "a2a_task_event", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "seq": { + "name": "seq", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_task_event_task_id_seq_idx": { + "name": "a2a_task_event_task_id_seq_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_task_event_created_at_idx": { + "name": "a2a_task_event_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_task_event_task_id_a2a_task_id_fk": { + "name": "a2a_task_event_task_id_a2a_task_id_fk", + "tableFrom": "a2a_task_event", + "tableTo": "a2a_task", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.a2a_task": { + "name": "a2a_task", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "context_id": { + "name": "context_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status_reason": { + "name": "status_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state_changed_at": { + "name": "state_changed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_heartbeat_at": { + "name": "last_heartbeat_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "next_event_seq": { + "name": "next_event_seq", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "a2a_task_context_id_idx": { + "name": "a2a_task_context_id_idx", + "columns": [ + { + "expression": "context_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_task_updated_at_idx": { + "name": "a2a_task_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_task_agent_state_changed_idx": { + "name": "a2a_task_agent_state_changed_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "state_changed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "a2a_task_active_heartbeat_idx": { + "name": "a2a_task_active_heartbeat_idx", + "columns": [ + { + "expression": "last_heartbeat_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"a2a_task\".\"state\" IN ('TASK_STATE_SUBMITTED', 'TASK_STATE_WORKING')", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "a2a_task_context_id_a2a_context_id_fk": { + "name": "a2a_task_context_id_a2a_context_id_fk", + "tableFrom": "a2a_task", + "tableTo": "a2a_context", + "columnsFrom": [ + "context_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "a2a_task_agent_id_agents_id_fk": { + "name": "a2a_task_agent_id_agents_id_fk", + "tableFrom": "a2a_task", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "account_user_id_user_id_fk": { + "name": "account_user_id_user_id_fk", + "tableFrom": "account", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_connector_assignment": { + "name": "agent_connector_assignment", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_connector_assignment_agent_idx": { + "name": "agent_connector_assignment_agent_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_connector_assignment_connector_idx": { + "name": "agent_connector_assignment_connector_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_connector_assignment_agent_id_agents_id_fk": { + "name": "agent_connector_assignment_agent_id_agents_id_fk", + "tableFrom": "agent_connector_assignment", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_connector_assignment_connector_id_knowledge_base_connectors_id_fk": { + "name": "agent_connector_assignment_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "agent_connector_assignment", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_connector_assignment_agent_id_connector_id_pk": { + "name": "agent_connector_assignment_agent_id_connector_id_pk", + "columns": [ + "agent_id", + "connector_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_excluded_connectors": { + "name": "agent_excluded_connectors", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_excluded_connectors_agent_id_agents_id_fk": { + "name": "agent_excluded_connectors_agent_id_agents_id_fk", + "tableFrom": "agent_excluded_connectors", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_excluded_connectors_connector_id_knowledge_base_connectors_id_fk": { + "name": "agent_excluded_connectors_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "agent_excluded_connectors", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_excluded_connectors_agent_id_connector_id_pk": { + "name": "agent_excluded_connectors_agent_id_connector_id_pk", + "columns": [ + "agent_id", + "connector_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_excluded_skills": { + "name": "agent_excluded_skills", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_excluded_skills_agent_id_agents_id_fk": { + "name": "agent_excluded_skills_agent_id_agents_id_fk", + "tableFrom": "agent_excluded_skills", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_excluded_skills_skill_id_skills_id_fk": { + "name": "agent_excluded_skills_skill_id_skills_id_fk", + "tableFrom": "agent_excluded_skills", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_excluded_skills_agent_id_skill_id_pk": { + "name": "agent_excluded_skills_agent_id_skill_id_pk", + "columns": [ + "agent_id", + "skill_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_excluded_subagents": { + "name": "agent_excluded_subagents", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "target_agent_id": { + "name": "target_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_excluded_subagents_agent_id_agents_id_fk": { + "name": "agent_excluded_subagents_agent_id_agents_id_fk", + "tableFrom": "agent_excluded_subagents", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_excluded_subagents_target_agent_id_agents_id_fk": { + "name": "agent_excluded_subagents_target_agent_id_agents_id_fk", + "tableFrom": "agent_excluded_subagents", + "tableTo": "agents", + "columnsFrom": [ + "target_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_excluded_subagents_agent_id_target_agent_id_pk": { + "name": "agent_excluded_subagents_agent_id_target_agent_id_pk", + "columns": [ + "agent_id", + "target_agent_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_excluded_tools": { + "name": "agent_excluded_tools", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_excluded_tools_agent_id_agents_id_fk": { + "name": "agent_excluded_tools_agent_id_agents_id_fk", + "tableFrom": "agent_excluded_tools", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_excluded_tools_tool_id_tools_id_fk": { + "name": "agent_excluded_tools_tool_id_tools_id_fk", + "tableFrom": "agent_excluded_tools", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_excluded_tools_agent_id_tool_id_pk": { + "name": "agent_excluded_tools_agent_id_tool_id_pk", + "columns": [ + "agent_id", + "tool_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_knowledge_base": { + "name": "agent_knowledge_base", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_knowledge_base_agent_idx": { + "name": "agent_knowledge_base_agent_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_knowledge_base_kb_idx": { + "name": "agent_knowledge_base_kb_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_knowledge_base_agent_id_agents_id_fk": { + "name": "agent_knowledge_base_agent_id_agents_id_fk", + "tableFrom": "agent_knowledge_base", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_knowledge_base_knowledge_base_id_knowledge_bases_id_fk": { + "name": "agent_knowledge_base_knowledge_base_id_knowledge_bases_id_fk", + "tableFrom": "agent_knowledge_base", + "tableTo": "knowledge_bases", + "columnsFrom": [ + "knowledge_base_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_knowledge_base_agent_id_knowledge_base_id_pk": { + "name": "agent_knowledge_base_agent_id_knowledge_base_id_pk", + "columns": [ + "agent_id", + "knowledge_base_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_labels": { + "name": "agent_labels", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "value_id": { + "name": "value_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_labels_agent_id_agents_id_fk": { + "name": "agent_labels_agent_id_agents_id_fk", + "tableFrom": "agent_labels", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_labels_key_id_label_keys_id_fk": { + "name": "agent_labels_key_id_label_keys_id_fk", + "tableFrom": "agent_labels", + "tableTo": "label_keys", + "columnsFrom": [ + "key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_labels_value_id_label_values_id_fk": { + "name": "agent_labels_value_id_label_values_id_fk", + "tableFrom": "agent_labels", + "tableTo": "label_values", + "columnsFrom": [ + "value_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_labels_agent_id_key_id_pk": { + "name": "agent_labels_agent_id_key_id_pk", + "columns": [ + "agent_id", + "key_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_skills": { + "name": "agent_skills", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_skills_agent_id_agents_id_fk": { + "name": "agent_skills_agent_id_agents_id_fk", + "tableFrom": "agent_skills", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_skills_skill_id_skills_id_fk": { + "name": "agent_skills_skill_id_skills_id_fk", + "tableFrom": "agent_skills", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "agent_skills_agent_id_skill_id_unique": { + "name": "agent_skills_agent_id_skill_id_unique", + "nullsNotDistinct": false, + "columns": [ + "agent_id", + "skill_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_suggested_prompts": { + "name": "agent_suggested_prompts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "summary_title": { + "name": "summary_title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_suggested_prompts_agent_id_idx": { + "name": "agent_suggested_prompts_agent_id_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_suggested_prompts_agent_id_agents_id_fk": { + "name": "agent_suggested_prompts_agent_id_agents_id_fk", + "tableFrom": "agent_suggested_prompts", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_team": { + "name": "agent_team", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_team_agent_id_agents_id_fk": { + "name": "agent_team_agent_id_agents_id_fk", + "tableFrom": "agent_team", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_team_team_id_team_id_fk": { + "name": "agent_team_team_id_team_id_fk", + "tableFrom": "agent_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_team_agent_id_team_id_pk": { + "name": "agent_team_agent_id_team_id_pk", + "columns": [ + "agent_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_tools": { + "name": "agent_tools", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "credential_resolution_mode": { + "name": "credential_resolution_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'static'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_tools_agent_id_agents_id_fk": { + "name": "agent_tools_agent_id_agents_id_fk", + "tableFrom": "agent_tools", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_tools_tool_id_tools_id_fk": { + "name": "agent_tools_tool_id_tools_id_fk", + "tableFrom": "agent_tools", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_tools_mcp_server_id_mcp_server_id_fk": { + "name": "agent_tools_mcp_server_id_mcp_server_id_fk", + "tableFrom": "agent_tools", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "agent_tools_agent_id_tool_id_unique": { + "name": "agent_tools_agent_id_tool_id_unique", + "nullsNotDistinct": false, + "columns": [ + "agent_id", + "tool_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_user": { + "name": "agent_user", + "schema": "", + "columns": { + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'use'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "agent_user_agent_id_agents_id_fk": { + "name": "agent_user_agent_id_agents_id_fk", + "tableFrom": "agent_user", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_user_user_id_user_id_fk": { + "name": "agent_user_user_id_user_id_fk", + "tableFrom": "agent_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "agent_user_agent_id_user_id_pk": { + "name": "agent_user_agent_id_user_id_pk", + "columns": [ + "agent_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "agent_user_level_check": { + "name": "agent_user_level_check", + "value": "\n \"agent_user\".\"level\" in ('use', 'write')" + } + }, + "isRLSEnabled": false + }, + "public.agent_versions": { + "name": "agent_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_versions_agent_id_idx": { + "name": "agent_versions_agent_id_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_versions_agent_version_uidx": { + "name": "agent_versions_agent_version_uidx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "version", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_versions_agent_id_agents_id_fk": { + "name": "agent_versions_agent_id_agents_id_fk", + "tableFrom": "agent_versions", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agents": { + "name": "agents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'personal'" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_personal_gateway": { + "name": "is_personal_gateway", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_personal_proxy": { + "name": "is_personal_proxy", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "consider_context_untrusted": { + "name": "consider_context_untrusted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "agent_type": { + "name": "agent_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'mcp_gateway'" + }, + "system_prompt": { + "name": "system_prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "incoming_email_enabled": { + "name": "incoming_email_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "incoming_email_security_mode": { + "name": "incoming_email_security_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'private'" + }, + "incoming_email_allowed_domain": { + "name": "incoming_email_allowed_domain", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "llm_api_key_id": { + "name": "llm_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "llm_model": { + "name": "llm_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model_id": { + "name": "model_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "identity_provider_id": { + "name": "identity_provider_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "passthrough_headers": { + "name": "passthrough_headers", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "tool_exposure_mode": { + "name": "tool_exposure_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'full'" + }, + "missing_credential_behavior": { + "name": "missing_credential_behavior", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'allow'" + }, + "access_all_tools": { + "name": "access_all_tools", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "access_all_skills": { + "name": "access_all_skills", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "access_all_subagents": { + "name": "access_all_subagents", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "built_in_agent_config": { + "name": "built_in_agent_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "built_in": { + "name": "built_in", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "\"agents\".\"built_in_agent_config\" IS NOT NULL", + "type": "stored" + } + }, + "latest_version": { + "name": "latest_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "agents_slug_idx": { + "name": "agents_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agents\".\"slug\" IS NOT NULL AND \"agents\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_organization_id_idx": { + "name": "agents_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_agent_type_idx": { + "name": "agents_agent_type_idx", + "columns": [ + { + "expression": "agent_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_identity_provider_id_idx": { + "name": "agents_identity_provider_id_idx", + "columns": [ + { + "expression": "identity_provider_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_environment_id_idx": { + "name": "agents_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_author_id_idx": { + "name": "agents_author_id_idx", + "columns": [ + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_scope_idx": { + "name": "agents_scope_idx", + "columns": [ + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_personal_gateway_per_member_idx": { + "name": "agents_personal_gateway_per_member_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agents\".\"agent_type\" = 'mcp_gateway' AND \"agents\".\"is_personal_gateway\" = true AND \"agents\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_personal_proxy_per_member_idx": { + "name": "agents_personal_proxy_per_member_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agents\".\"agent_type\" = 'llm_proxy' AND \"agents\".\"is_personal_proxy\" = true AND \"agents\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agents_org_default_llm_proxy_idx": { + "name": "agents_org_default_llm_proxy_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agents\".\"agent_type\" = 'llm_proxy' AND \"agents\".\"is_default\" = true AND \"agents\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agents_author_id_user_id_fk": { + "name": "agents_author_id_user_id_fk", + "tableFrom": "agents", + "tableTo": "user", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agents_llm_api_key_id_chat_api_keys_id_fk": { + "name": "agents_llm_api_key_id_chat_api_keys_id_fk", + "tableFrom": "agents", + "tableTo": "chat_api_keys", + "columnsFrom": [ + "llm_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agents_model_id_models_id_fk": { + "name": "agents_model_id_models_id_fk", + "tableFrom": "agents", + "tableTo": "models", + "columnsFrom": [ + "model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agents_identity_provider_id_identity_provider_id_fk": { + "name": "agents_identity_provider_id_identity_provider_id_fk", + "tableFrom": "agents", + "tableTo": "identity_provider", + "columnsFrom": [ + "identity_provider_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agents_environment_id_environments_id_fk": { + "name": "agents_environment_id_environments_id_fk", + "tableFrom": "agents", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.apikey": { + "name": "apikey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "config_id": { + "name": "config_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'default'" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refill_interval": { + "name": "refill_interval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "refill_amount": { + "name": "refill_amount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_refill_at": { + "name": "last_refill_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "rate_limit_enabled": { + "name": "rate_limit_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "rate_limit_time_window": { + "name": "rate_limit_time_window", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 86400000 + }, + "rate_limit_max": { + "name": "rate_limit_max", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 10 + }, + "request_count": { + "name": "request_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "remaining": { + "name": "remaining", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_request": { + "name": "last_request", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_apikey_reference_id": { + "name": "idx_apikey_reference_id", + "columns": [ + { + "expression": "reference_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_apikey_config_id": { + "name": "idx_apikey_config_id", + "columns": [ + { + "expression": "config_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "apikey_reference_id_user_id_fk": { + "name": "apikey_reference_id_user_id_fk", + "tableFrom": "apikey", + "tableTo": "user", + "columnsFrom": [ + "reference_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_data": { + "name": "app_data", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_data_app_id_user_id_idx": { + "name": "app_data_app_id_user_id_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "app_data_shared_partition_key_idx": { + "name": "app_data_shared_partition_key_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"app_data\".\"user_id\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "app_data_user_partition_key_idx": { + "name": "app_data_user_partition_key_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"app_data\".\"user_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "app_data_app_id_apps_id_fk": { + "name": "app_data_app_id_apps_id_fk", + "tableFrom": "app_data", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_data_user_id_user_id_fk": { + "name": "app_data_user_id_user_id_fk", + "tableFrom": "app_data", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_data_owner_user_id_user_id_fk": { + "name": "app_data_owner_user_id_user_id_fk", + "tableFrom": "app_data", + "tableTo": "user", + "columnsFrom": [ + "owner_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_labels": { + "name": "app_labels", + "schema": "", + "columns": { + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "value_id": { + "name": "value_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "app_labels_app_id_apps_id_fk": { + "name": "app_labels_app_id_apps_id_fk", + "tableFrom": "app_labels", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_labels_key_id_label_keys_id_fk": { + "name": "app_labels_key_id_label_keys_id_fk", + "tableFrom": "app_labels", + "tableTo": "label_keys", + "columnsFrom": [ + "key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_labels_value_id_label_values_id_fk": { + "name": "app_labels_value_id_label_values_id_fk", + "tableFrom": "app_labels", + "tableTo": "label_values", + "columnsFrom": [ + "value_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "app_labels_app_id_key_id_pk": { + "name": "app_labels_app_id_key_id_pk", + "columns": [ + "app_id", + "key_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_pins": { + "name": "app_pins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "resource_uri": { + "name": "resource_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tool_name": { + "name": "tool_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pinned_at": { + "name": "pinned_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_pins_user_app_uidx": { + "name": "app_pins_user_app_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"app_pins\".\"app_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "app_pins_user_external_uidx": { + "name": "app_pins_user_external_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_uri", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "tool_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"app_pins\".\"mcp_server_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "app_pins_app_id_idx": { + "name": "app_pins_app_id_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "app_pins_mcp_server_id_idx": { + "name": "app_pins_mcp_server_id_idx", + "columns": [ + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "app_pins_user_id_user_id_fk": { + "name": "app_pins_user_id_user_id_fk", + "tableFrom": "app_pins", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_pins_app_id_apps_id_fk": { + "name": "app_pins_app_id_apps_id_fk", + "tableFrom": "app_pins", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_pins_mcp_server_id_mcp_server_id_fk": { + "name": "app_pins_mcp_server_id_mcp_server_id_fk", + "tableFrom": "app_pins", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_render_diagnostics": { + "name": "app_render_diagnostics", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "entries": { + "name": "entries", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "rendered_at": { + "name": "rendered_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_render_diagnostics_app_user_idx": { + "name": "app_render_diagnostics_app_user_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "app_render_diagnostics_app_id_apps_id_fk": { + "name": "app_render_diagnostics_app_id_apps_id_fk", + "tableFrom": "app_render_diagnostics", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_render_diagnostics_user_id_user_id_fk": { + "name": "app_render_diagnostics_user_id_user_id_fk", + "tableFrom": "app_render_diagnostics", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_render_screenshots": { + "name": "app_render_screenshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rendered_at": { + "name": "rendered_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_render_screenshots_app_user_idx": { + "name": "app_render_screenshots_app_user_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "app_render_screenshots_app_id_apps_id_fk": { + "name": "app_render_screenshots_app_id_apps_id_fk", + "tableFrom": "app_render_screenshots", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_render_screenshots_user_id_user_id_fk": { + "name": "app_render_screenshots_user_id_user_id_fk", + "tableFrom": "app_render_screenshots", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_tools": { + "name": "app_tools", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "credential_resolution_mode": { + "name": "credential_resolution_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'static'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "app_tools_app_id_apps_id_fk": { + "name": "app_tools_app_id_apps_id_fk", + "tableFrom": "app_tools", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_tools_tool_id_tools_id_fk": { + "name": "app_tools_tool_id_tools_id_fk", + "tableFrom": "app_tools", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "app_tools_mcp_server_id_mcp_server_id_fk": { + "name": "app_tools_mcp_server_id_mcp_server_id_fk", + "tableFrom": "app_tools", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "app_tools_app_id_tool_id_unique": { + "name": "app_tools_app_id_tool_id_unique", + "nullsNotDistinct": false, + "columns": [ + "app_id", + "tool_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_versions": { + "name": "app_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "html": { + "name": "html", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ui_permissions": { + "name": "ui_permissions", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "spec": { + "name": "spec", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_versions_app_id_idx": { + "name": "app_versions_app_id_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "app_versions_app_version_uidx": { + "name": "app_versions_app_version_uidx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "version", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "app_versions_app_id_apps_id_fk": { + "name": "app_versions_app_id_apps_id_fk", + "tableFrom": "app_versions", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.apps": { + "name": "apps", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "template_id": { + "name": "template_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "spec": { + "name": "spec", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "latest_version": { + "name": "latest_version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "open_in_fullscreen": { + "name": "open_in_fullscreen", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "locked": { + "name": "locked", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "lock_grace_session_key": { + "name": "lock_grace_session_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "authoring_session_id": { + "name": "authoring_session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "apps_organization_id_idx": { + "name": "apps_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apps_mcp_server_id_idx": { + "name": "apps_mcp_server_id_idx", + "columns": [ + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apps_authoring_session_id_idx": { + "name": "apps_authoring_session_id_idx", + "columns": [ + { + "expression": "authoring_session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apps_org_author_name_uidx": { + "name": "apps_org_author_name_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"apps\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "apps_org_slug_uidx": { + "name": "apps_org_slug_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"apps\".\"slug\" IS NOT NULL AND \"apps\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "apps_author_id_user_id_fk": { + "name": "apps_author_id_user_id_fk", + "tableFrom": "apps", + "tableTo": "user", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "apps_mcp_server_id_mcp_server_id_fk": { + "name": "apps_mcp_server_id_mcp_server_id_fk", + "tableFrom": "apps", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.audit_logs": { + "name": "audit_logs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "event_sequence": { + "name": "event_sequence", + "type": "bigserial", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "actor_id": { + "name": "actor_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_type": { + "name": "actor_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "actor_name": { + "name": "actor_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_email": { + "name": "actor_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "outcome": { + "name": "outcome", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "resource_id": { + "name": "resource_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "resource_name": { + "name": "resource_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "before": { + "name": "before", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "after": { + "name": "after", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "http_method": { + "name": "http_method", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "http_path": { + "name": "http_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "http_route": { + "name": "http_route", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "http_status": { + "name": "http_status", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_ip": { + "name": "source_ip", + "type": "inet", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "audit_logs_org_created_at_seq_idx": { + "name": "audit_logs_org_created_at_seq_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + }, + { + "expression": "event_sequence", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_logs_org_actor_created_at_idx": { + "name": "audit_logs_org_actor_created_at_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_logs_org_resource_idx": { + "name": "audit_logs_org_resource_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_logs_org_resource_id_created_at_idx": { + "name": "audit_logs_org_resource_id_created_at_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_logs_org_action_created_at_idx": { + "name": "audit_logs_org_action_created_at_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "action", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_logs_org_outcome_created_at_idx": { + "name": "audit_logs_org_outcome_created_at_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "outcome", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_logs_created_at_idx": { + "name": "audit_logs_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "audit_logs_organization_id_organization_id_fk": { + "name": "audit_logs_organization_id_organization_id_fk", + "tableFrom": "audit_logs", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "audit_logs_actor_id_user_id_fk": { + "name": "audit_logs_actor_id_user_id_fk", + "tableFrom": "audit_logs", + "tableTo": "user", + "columnsFrom": [ + "actor_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "audit_logs_impersonated_by_user_id_fk": { + "name": "audit_logs_impersonated_by_user_id_fk", + "tableFrom": "audit_logs", + "tableTo": "user", + "columnsFrom": [ + "impersonated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.browser_tab_states": { + "name": "browser_tab_states", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isolation_key": { + "name": "isolation_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tab_index": { + "name": "tab_index", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "browser_tab_states_agent_user_isolation_idx": { + "name": "browser_tab_states_agent_user_isolation_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "isolation_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "browser_tab_states_user_id_idx": { + "name": "browser_tab_states_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "browser_tab_states_agent_id_agents_id_fk": { + "name": "browser_tab_states_agent_id_agents_id_fk", + "tableFrom": "browser_tab_states", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "browser_tab_states_user_id_user_id_fk": { + "name": "browser_tab_states_user_id_user_id_fk", + "tableFrom": "browser_tab_states", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_active_run_events": { + "name": "chat_active_run_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "seq": { + "name": "seq", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "payloads": { + "name": "payloads", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "chat_active_run_events_run_id_chat_active_runs_id_fk": { + "name": "chat_active_run_events_run_id_chat_active_runs_id_fk", + "tableFrom": "chat_active_run_events", + "tableTo": "chat_active_runs", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "chat_active_run_events_run_id_seq_uidx": { + "name": "chat_active_run_events_run_id_seq_uidx", + "nullsNotDistinct": false, + "columns": [ + "run_id", + "seq" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_active_runs": { + "name": "chat_active_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "stop_requested_at": { + "name": "stop_requested_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chat_active_runs_conversation_id_idx": { + "name": "chat_active_runs_conversation_id_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_active_runs_running_conversation_uidx": { + "name": "chat_active_runs_running_conversation_uidx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"chat_active_runs\".\"status\" = 'running'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_active_runs_running_updated_at_idx": { + "name": "chat_active_runs_running_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"chat_active_runs\".\"status\" = 'running'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_active_runs_terminal_updated_at_idx": { + "name": "chat_active_runs_terminal_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"chat_active_runs\".\"status\" != 'running'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chat_active_runs_conversation_id_conversations_id_fk": { + "name": "chat_active_runs_conversation_id_conversations_id_fk", + "tableFrom": "chat_active_runs", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_tool_execution_claims": { + "name": "chat_tool_execution_claims", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tool_call_id": { + "name": "tool_call_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_name": { + "name": "tool_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'executing'" + }, + "result": { + "name": "result", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "chat_tool_execution_claims_conversation_id_conversations_id_fk": { + "name": "chat_tool_execution_claims_conversation_id_conversations_id_fk", + "tableFrom": "chat_tool_execution_claims", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "chat_tool_execution_claims_conversation_id_tool_call_id_unique": { + "name": "chat_tool_execution_claims_conversation_id_tool_call_id_unique", + "nullsNotDistinct": false, + "columns": [ + "conversation_id", + "tool_call_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chatops_channel_binding": { + "name": "chatops_channel_binding", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "channel_name": { + "name": "channel_name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "workspace_name": { + "name": "workspace_name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "is_dm": { + "name": "is_dm", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "answer_all_messages": { + "name": "answer_all_messages", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "channel_instructions": { + "name": "channel_instructions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dm_owner_email": { + "name": "dm_owner_email", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chatops_channel_binding_provider_channel_workspace_idx": { + "name": "chatops_channel_binding_provider_channel_workspace_idx", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chatops_channel_binding_organization_id_idx": { + "name": "chatops_channel_binding_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chatops_channel_binding_agent_id_idx": { + "name": "chatops_channel_binding_agent_id_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chatops_channel_binding_agent_id_agents_id_fk": { + "name": "chatops_channel_binding_agent_id_agents_id_fk", + "tableFrom": "chatops_channel_binding", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chatops_processed_message": { + "name": "chatops_processed_message", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "message_id": { + "name": "message_id", + "type": "varchar(512)", + "primaryKey": false, + "notNull": true + }, + "processed_at": { + "name": "processed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chatops_processed_message_processed_at_idx": { + "name": "chatops_processed_message_processed_at_idx", + "columns": [ + { + "expression": "processed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "chatops_processed_message_message_id_unique": { + "name": "chatops_processed_message_message_id_unique", + "nullsNotDistinct": false, + "columns": [ + "message_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chatops_thread_contexts": { + "name": "chatops_thread_contexts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "provider": { + "name": "provider", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "thread_id": { + "name": "thread_id", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "context_id": { + "name": "context_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chatops_thread_contexts_context_id_idx": { + "name": "chatops_thread_contexts_context_id_idx", + "columns": [ + { + "expression": "context_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chatops_thread_contexts_context_id_a2a_context_id_fk": { + "name": "chatops_thread_contexts_context_id_a2a_context_id_fk", + "tableFrom": "chatops_thread_contexts", + "tableTo": "a2a_context", + "columnsFrom": [ + "context_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "chatops_thread_contexts_thread_key_uq": { + "name": "chatops_thread_contexts_thread_key_uq", + "nullsNotDistinct": true, + "columns": [ + "provider", + "channel_id", + "workspace_id", + "thread_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connection_setup_plugins": { + "name": "connection_setup_plugins", + "schema": "", + "columns": { + "connection_setup_id": { + "name": "connection_setup_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "plugin_id": { + "name": "plugin_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "connection_setup_plugins_plugin_id_idx": { + "name": "connection_setup_plugins_plugin_id_idx", + "columns": [ + { + "expression": "plugin_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connection_setup_plugins_connection_setup_id_connection_setups_id_fk": { + "name": "connection_setup_plugins_connection_setup_id_connection_setups_id_fk", + "tableFrom": "connection_setup_plugins", + "tableTo": "connection_setups", + "columnsFrom": [ + "connection_setup_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connection_setup_plugins_plugin_id_plugins_id_fk": { + "name": "connection_setup_plugins_plugin_id_plugins_id_fk", + "tableFrom": "connection_setup_plugins", + "tableTo": "plugins", + "columnsFrom": [ + "plugin_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "connection_setup_plugins_connection_setup_id_plugin_id_pk": { + "name": "connection_setup_plugins_connection_setup_id_plugin_id_pk", + "columns": [ + "connection_setup_id", + "plugin_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connection_setup_skills": { + "name": "connection_setup_skills", + "schema": "", + "columns": { + "connection_setup_id": { + "name": "connection_setup_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "connection_setup_skills_skill_id_idx": { + "name": "connection_setup_skills_skill_id_idx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connection_setup_skills_connection_setup_id_connection_setups_id_fk": { + "name": "connection_setup_skills_connection_setup_id_connection_setups_id_fk", + "tableFrom": "connection_setup_skills", + "tableTo": "connection_setups", + "columnsFrom": [ + "connection_setup_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connection_setup_skills_skill_id_skills_id_fk": { + "name": "connection_setup_skills_skill_id_skills_id_fk", + "tableFrom": "connection_setup_skills", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "connection_setup_skills_connection_setup_id_skill_id_pk": { + "name": "connection_setup_skills_connection_setup_id_skill_id_pk", + "columns": [ + "connection_setup_id", + "skill_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connection_setups": { + "name": "connection_setups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "platform": { + "name": "platform", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'macos'" + }, + "base_url": { + "name": "base_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mcp_gateway_id": { + "name": "mcp_gateway_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "llm_proxy_id": { + "name": "llm_proxy_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "proxy_auth": { + "name": "proxy_auth", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'provider-key'" + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "virtual_api_key_id": { + "name": "virtual_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "include_skills": { + "name": "include_skills", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "skill_link_ttl_days": { + "name": "skill_link_ttl_days", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "skill_share_link_id": { + "name": "skill_share_link_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "varchar(22)", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "consumed_at": { + "name": "consumed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "connection_setups_token_hash_idx": { + "name": "connection_setups_token_hash_idx", + "columns": [ + { + "expression": "token_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "connection_setups_org_id_idx": { + "name": "connection_setups_org_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "connection_setups_token_start_idx": { + "name": "connection_setups_token_start_idx", + "columns": [ + { + "expression": "token_start", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connection_setups_organization_id_organization_id_fk": { + "name": "connection_setups_organization_id_organization_id_fk", + "tableFrom": "connection_setups", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connection_setups_user_id_user_id_fk": { + "name": "connection_setups_user_id_user_id_fk", + "tableFrom": "connection_setups", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connection_setups_mcp_gateway_id_agents_id_fk": { + "name": "connection_setups_mcp_gateway_id_agents_id_fk", + "tableFrom": "connection_setups", + "tableTo": "agents", + "columnsFrom": [ + "mcp_gateway_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connection_setups_llm_proxy_id_agents_id_fk": { + "name": "connection_setups_llm_proxy_id_agents_id_fk", + "tableFrom": "connection_setups", + "tableTo": "agents", + "columnsFrom": [ + "llm_proxy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connection_setups_virtual_api_key_id_virtual_api_keys_id_fk": { + "name": "connection_setups_virtual_api_key_id_virtual_api_keys_id_fk", + "tableFrom": "connection_setups", + "tableTo": "virtual_api_keys", + "columnsFrom": [ + "virtual_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "connection_setups_skill_share_link_id_skill_share_link_id_fk": { + "name": "connection_setups_skill_share_link_id_skill_share_link_id_fk", + "tableFrom": "connection_setups", + "tableTo": "skill_share_link", + "columnsFrom": [ + "skill_share_link_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connector_runs": { + "name": "connector_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "run_type": { + "name": "run_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'content'" + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "documents_processed": { + "name": "documents_processed", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "documents_ingested": { + "name": "documents_ingested", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "total_items": { + "name": "total_items", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "total_batches": { + "name": "total_batches", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "completed_batches": { + "name": "completed_batches", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "item_errors": { + "name": "item_errors", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "items_skipped": { + "name": "items_skipped", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "documents_without_text": { + "name": "documents_without_text", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logs": { + "name": "logs", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "checkpoint": { + "name": "checkpoint", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "lease_owner": { + "name": "lease_owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lease_expires_at": { + "name": "lease_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "lease_epoch": { + "name": "lease_epoch", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "heartbeat_at": { + "name": "heartbeat_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "connector_runs_connector_id_idx": { + "name": "connector_runs_connector_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "connector_runs_one_running_per_connector_run_type_idx": { + "name": "connector_runs_one_running_per_connector_run_type_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "run_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "status = 'running'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "connector_runs_lease_expires_at_idx": { + "name": "connector_runs_lease_expires_at_idx", + "columns": [ + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "status = 'running'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connector_runs_connector_id_knowledge_base_connectors_id_fk": { + "name": "connector_runs_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "connector_runs", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.content_encryption_state": { + "name": "content_encryption_state", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "key_fingerprint": { + "name": "key_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "interactions_cursor_created_at": { + "name": "interactions_cursor_created_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "interactions_cursor_id": { + "name": "interactions_cursor_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "messages_cursor_id": { + "name": "messages_cursor_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mcp_tool_calls_cursor_id": { + "name": "mcp_tool_calls_cursor_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_attachments": { + "name": "conversation_attachments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "uploaded_by_user_id": { + "name": "uploaded_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "original_name": { + "name": "original_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_size": { + "name": "file_size", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_data": { + "name": "file_data", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "text_preview": { + "name": "text_preview", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locked_chat": { + "name": "locked_chat", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "text_preview_status": { + "name": "text_preview_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "conversation_attachments_conversation_id_idx": { + "name": "conversation_attachments_conversation_id_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "conversation_attachments_org_created_at_idx": { + "name": "conversation_attachments_org_created_at_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "conversation_attachments_conversation_id_content_hash_live_uidx": { + "name": "conversation_attachments_conversation_id_content_hash_live_uidx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "content_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"conversation_attachments\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "conversation_attachments_conversation_id_conversations_id_fk": { + "name": "conversation_attachments_conversation_id_conversations_id_fk", + "tableFrom": "conversation_attachments", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_chat_errors": { + "name": "conversation_chat_errors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "error": { + "name": "error", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "conversation_chat_errors_conversation_id_idx": { + "name": "conversation_chat_errors_conversation_id_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "conversation_chat_errors_conversation_id_conversations_id_fk": { + "name": "conversation_chat_errors_conversation_id_conversations_id_fk", + "tableFrom": "conversation_chat_errors", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_compactions": { + "name": "conversation_compactions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "compacted_through_message_id": { + "name": "compacted_through_message_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "trigger": { + "name": "trigger", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "original_token_estimate": { + "name": "original_token_estimate", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "compacted_token_estimate": { + "name": "compacted_token_estimate", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "conversation_compactions_conversation_id_created_at_idx": { + "name": "conversation_compactions_conversation_id_created_at_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "conversation_compactions_conversation_id_conversations_id_fk": { + "name": "conversation_compactions_conversation_id_conversations_id_fk", + "tableFrom": "conversation_compactions", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_enabled_tools": { + "name": "conversation_enabled_tools", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_enabled_tools_conversation_id_conversations_id_fk": { + "name": "conversation_enabled_tools_conversation_id_conversations_id_fk", + "tableFrom": "conversation_enabled_tools", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "conversation_enabled_tools_tool_id_tools_id_fk": { + "name": "conversation_enabled_tools_tool_id_tools_id_fk", + "tableFrom": "conversation_enabled_tools", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "conversation_enabled_tools_conversation_id_tool_id_pk": { + "name": "conversation_enabled_tools_conversation_id_tool_id_pk", + "columns": [ + "conversation_id", + "tool_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_share_team": { + "name": "conversation_share_team", + "schema": "", + "columns": { + "share_id": { + "name": "share_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_share_team_share_id_conversation_shares_id_fk": { + "name": "conversation_share_team_share_id_conversation_shares_id_fk", + "tableFrom": "conversation_share_team", + "tableTo": "conversation_shares", + "columnsFrom": [ + "share_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "conversation_share_team_team_id_team_id_fk": { + "name": "conversation_share_team_team_id_team_id_fk", + "tableFrom": "conversation_share_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "conversation_share_team_share_id_team_id_pk": { + "name": "conversation_share_team_share_id_team_id_pk", + "columns": [ + "share_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_share_user": { + "name": "conversation_share_user", + "schema": "", + "columns": { + "share_id": { + "name": "share_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_share_user_share_id_conversation_shares_id_fk": { + "name": "conversation_share_user_share_id_conversation_shares_id_fk", + "tableFrom": "conversation_share_user", + "tableTo": "conversation_shares", + "columnsFrom": [ + "share_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "conversation_share_user_user_id_user_id_fk": { + "name": "conversation_share_user_user_id_user_id_fk", + "tableFrom": "conversation_share_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "conversation_share_user_share_id_user_id_pk": { + "name": "conversation_share_user_share_id_user_id_pk", + "columns": [ + "share_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_shares": { + "name": "conversation_shares", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "conversation_share_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'organization'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_shares_conversation_id_conversations_id_fk": { + "name": "conversation_shares_conversation_id_conversations_id_fk", + "tableFrom": "conversation_shares", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "conversation_shares_conversation_id_unique": { + "name": "conversation_shares_conversation_id_unique", + "nullsNotDistinct": false, + "columns": [ + "conversation_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversations": { + "name": "conversations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "chat_api_key_id": { + "name": "chat_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "selected_model": { + "name": "selected_model", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'gpt-4o'" + }, + "selected_provider": { + "name": "selected_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model_id": { + "name": "model_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "thinking_effort": { + "name": "thinking_effort", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_custom_tool_selection": { + "name": "has_custom_tool_selection", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "hooks_debug_enabled": { + "name": "hooks_debug_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "todo_list": { + "name": "todo_list", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "artifact": { + "name": "artifact", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "title_is_placeholder": { + "name": "title_is_placeholder", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "locked_chat": { + "name": "locked_chat", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "locked_chat_dek_fingerprint": { + "name": "locked_chat_dek_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locked_chat_escrow": { + "name": "locked_chat_escrow", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "pinned_at": { + "name": "pinned_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_message_at": { + "name": "last_message_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_read_at": { + "name": "last_read_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "conversations_project_id_idx": { + "name": "conversations_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "conversations_active_owner_last_message_idx": { + "name": "conversations_active_owner_last_message_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "\"last_message_at\" desc", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conversations\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "conversations_last_message_at_idx": { + "name": "conversations_last_message_at_idx", + "columns": [ + { + "expression": "last_message_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "conversations_agent_id_agents_id_fk": { + "name": "conversations_agent_id_agents_id_fk", + "tableFrom": "conversations", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "conversations_chat_api_key_id_chat_api_keys_id_fk": { + "name": "conversations_chat_api_key_id_chat_api_keys_id_fk", + "tableFrom": "conversations", + "tableTo": "chat_api_keys", + "columnsFrom": [ + "chat_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "conversations_model_id_models_id_fk": { + "name": "conversations_model_id_models_id_fk", + "tableFrom": "conversations", + "tableTo": "models", + "columnsFrom": [ + "model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "conversations_project_id_projects_id_fk": { + "name": "conversations_project_id_projects_id_fk", + "tableFrom": "conversations", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.encryption_key_canaries": { + "name": "encryption_key_canaries", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "encrypted_canary": { + "name": "encrypted_canary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "purpose": { + "name": "purpose", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'secrets'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "encryption_key_canaries_purpose_idx": { + "name": "encryption_key_canaries_purpose_idx", + "columns": [ + { + "expression": "purpose", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_default_user_limits": { + "name": "environment_default_user_limits", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "limit_value": { + "name": "limit_value", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "cleanup_interval": { + "name": "cleanup_interval", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'calendar_month'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "environment_default_user_limits_org_global_unique": { + "name": "environment_default_user_limits_org_global_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"environment_default_user_limits\".\"environment_id\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "environment_default_user_limits_org_idx": { + "name": "environment_default_user_limits_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_default_user_limits_organization_id_organization_id_fk": { + "name": "environment_default_user_limits_organization_id_organization_id_fk", + "tableFrom": "environment_default_user_limits", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_default_user_limits_environment_id_environments_id_fk": { + "name": "environment_default_user_limits_environment_id_environments_id_fk", + "tableFrom": "environment_default_user_limits", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environment_default_user_limits_environment_unique": { + "name": "environment_default_user_limits_environment_unique", + "nullsNotDistinct": false, + "columns": [ + "environment_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_resource_defaults": { + "name": "environment_resource_defaults", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource": { + "name": "resource", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "environment_resource_defaults_environment_id_idx": { + "name": "environment_resource_defaults_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_resource_defaults_organization_id_organization_id_fk": { + "name": "environment_resource_defaults_organization_id_organization_id_fk", + "tableFrom": "environment_resource_defaults", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_resource_defaults_environment_id_environments_id_fk": { + "name": "environment_resource_defaults_environment_id_environments_id_fk", + "tableFrom": "environment_resource_defaults", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environment_resource_defaults_org_resource_unique": { + "name": "environment_resource_defaults_org_resource_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "resource" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environments": { + "name": "environments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "namespace": { + "name": "namespace", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "network_policy": { + "name": "network_policy", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "validation_regex": { + "name": "validation_regex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "trusted_image_registries": { + "name": "trusted_image_registries", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "restricted": { + "name": "restricted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "environments_org_idx": { + "name": "environments_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environments_organization_id_organization_id_fk": { + "name": "environments_organization_id_organization_id_fk", + "tableFrom": "environments", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environments_org_name_unique": { + "name": "environments_org_name_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.external_mcp_skill_usage_events": { + "name": "external_mcp_skill_usage_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "session_id": { + "name": "session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "context_tokens": { + "name": "context_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "external_skill_usage_server_uri_created_idx": { + "name": "external_skill_usage_server_uri_created_idx", + "columns": [ + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "uri", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "external_mcp_skill_usage_events_mcp_server_id_mcp_server_id_fk": { + "name": "external_mcp_skill_usage_events_mcp_server_id_mcp_server_id_fk", + "tableFrom": "external_mcp_skill_usage_events", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.files": { + "name": "files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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": "uuid", + "primaryKey": false, + "notNull": false + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "sandbox_id": { + "name": "sandbox_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "filename": { + "name": "filename", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "storage_provider": { + "name": "storage_provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'db'" + }, + "data": { + "name": "data", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "object_key": { + "name": "object_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "files_organization_id_idx": { + "name": "files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_user_id_idx": { + "name": "files_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_project_id_idx": { + "name": "files_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_conversation_id_idx": { + "name": "files_conversation_id_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_sandbox_id_idx": { + "name": "files_sandbox_id_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_app_id_idx": { + "name": "files_app_id_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_user_conversation_filename_uidx": { + "name": "files_user_conversation_filename_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"files\".\"project_id\" IS NULL AND \"files\".\"conversation_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_user_app_filename_uidx": { + "name": "files_user_app_filename_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"files\".\"app_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_user_filename_orphan_uidx": { + "name": "files_user_filename_orphan_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"files\".\"project_id\" IS NULL AND \"files\".\"conversation_id\" IS NULL AND \"files\".\"app_id\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_project_filename_uidx": { + "name": "files_project_filename_uidx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"files\".\"project_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "files_user_id_user_id_fk": { + "name": "files_user_id_user_id_fk", + "tableFrom": "files", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "files_project_id_projects_id_fk": { + "name": "files_project_id_projects_id_fk", + "tableFrom": "files", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "files_conversation_id_conversations_id_fk": { + "name": "files_conversation_id_conversations_id_fk", + "tableFrom": "files", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "files_app_id_apps_id_fk": { + "name": "files_app_id_apps_id_fk", + "tableFrom": "files", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "files_sandbox_id_skill_sandboxes_id_fk": { + "name": "files_sandbox_id_skill_sandboxes_id_fk", + "tableFrom": "files", + "tableTo": "skill_sandboxes", + "columnsFrom": [ + "sandbox_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "files_storage_payload_chk": { + "name": "files_storage_payload_chk", + "value": "(\n (\"files\".\"storage_provider\" = 'db' AND \"files\".\"data\" IS NOT NULL AND \"files\".\"object_key\" IS NULL)\n OR (\"files\".\"storage_provider\" <> 'db' AND \"files\".\"object_key\" IS NOT NULL AND \"files\".\"data\" IS NULL)\n )" + } + }, + "isRLSEnabled": false + }, + "public.github_app_configs": { + "name": "github_app_configs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "github_url": { + "name": "github_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'https://api.github.com'" + }, + "app_id": { + "name": "app_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "installation_id": { + "name": "installation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "github_app_configs_organization_id_idx": { + "name": "github_app_configs_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_app_configs_secret_id_secret_id_fk": { + "name": "github_app_configs_secret_id_secret_id_fk", + "tableFrom": "github_app_configs", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_pats": { + "name": "github_pats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "github_pats_organization_id_idx": { + "name": "github_pats_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_pats_secret_id_secret_id_fk": { + "name": "github_pats_secret_id_secret_id_fk", + "tableFrom": "github_pats", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.hook_files": { + "name": "hook_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "event": { + "name": "event", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": 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": { + "hook_files_agent_id_idx": { + "name": "hook_files_agent_id_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "hook_files_agent_event_file_uidx": { + "name": "hook_files_agent_event_file_uidx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "event", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "file_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "hook_files_agent_id_agents_id_fk": { + "name": "hook_files_agent_id_agents_id_fk", + "tableFrom": "hook_files", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.identity_provider": { + "name": "identity_provider", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "issuer": { + "name": "issuer", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oidc_config": { + "name": "oidc_config", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "saml_config": { + "name": "saml_config", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "role_mapping": { + "name": "role_mapping", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "team_sync_config": { + "name": "team_sync_config", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domain_verified": { + "name": "domain_verified", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "sso_login_enabled": { + "name": "sso_login_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + } + }, + "indexes": {}, + "foreignKeys": { + "identity_provider_user_id_user_id_fk": { + "name": "identity_provider_user_id_user_id_fk", + "tableFrom": "identity_provider", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "identity_provider_provider_id_unique": { + "name": "identity_provider_provider_id_unique", + "nullsNotDistinct": false, + "columns": [ + "provider_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.incoming_email_subscription": { + "name": "incoming_email_subscription", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "webhook_url": { + "name": "webhook_url", + "type": "varchar(1024)", + "primaryKey": false, + "notNull": true + }, + "client_state": { + "name": "client_state", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.interactions": { + "name": "interactions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "profile_id": { + "name": "profile_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "external_agent_id": { + "name": "external_agent_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "execution_id": { + "name": "execution_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "virtual_key_id": { + "name": "virtual_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "passthrough_virtual_key_id": { + "name": "passthrough_virtual_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "session_id": { + "name": "session_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "session_source": { + "name": "session_source", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "auth_method": { + "name": "auth_method", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "billing_mode": { + "name": "billing_mode", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'metered'" + }, + "authenticated_app_id": { + "name": "authenticated_app_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "authenticated_app_name": { + "name": "authenticated_app_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "request": { + "name": "request", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "processed_request": { + "name": "processed_request", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "thread_id": { + "name": "thread_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "request_shared_prefix": { + "name": "request_shared_prefix", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "processed_request_shared_prefix": { + "name": "processed_request_shared_prefix", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "request_last_message_idx": { + "name": "request_last_message_idx", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "request_last_message_hash": { + "name": "request_last_message_hash", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "response": { + "name": "response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "dual_llm_analyses": { + "name": "dual_llm_analyses", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "unsafe_context_boundary": { + "name": "unsafe_context_boundary", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "tool_call_block": { + "name": "tool_call_block", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "locked_chat_conversation_id": { + "name": "locked_chat_conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "baseline_model": { + "name": "baseline_model", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "input_tokens_estimated": { + "name": "input_tokens_estimated", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cache_write_tokens": { + "name": "cache_write_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "baseline_cost": { + "name": "baseline_cost", + "type": "numeric(13, 10)", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "numeric(13, 10)", + "primaryKey": false, + "notNull": false + }, + "cache_cost": { + "name": "cache_cost", + "type": "numeric(13, 10)", + "primaryKey": false, + "notNull": false + }, + "cache_savings": { + "name": "cache_savings", + "type": "numeric(13, 10)", + "primaryKey": false, + "notNull": false + }, + "toon_tokens_before": { + "name": "toon_tokens_before", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "toon_tokens_after": { + "name": "toon_tokens_after", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "toon_cost_savings": { + "name": "toon_cost_savings", + "type": "numeric(13, 10)", + "primaryKey": false, + "notNull": false + }, + "toon_skip_reason": { + "name": "toon_skip_reason", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "interactions_agent_id_idx": { + "name": "interactions_agent_id_idx", + "columns": [ + { + "expression": "profile_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_external_agent_id_idx": { + "name": "interactions_external_agent_id_idx", + "columns": [ + { + "expression": "external_agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_execution_id_idx": { + "name": "interactions_execution_id_idx", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_user_id_idx": { + "name": "interactions_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_environment_id_idx": { + "name": "interactions_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_session_id_idx": { + "name": "interactions_session_id_idx", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_created_at_idx": { + "name": "interactions_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_statistics_covering_idx": { + "name": "interactions_statistics_covering_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "profile_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "model", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "input_tokens", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "output_tokens", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cache_read_tokens", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cost", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "baseline_cost", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "toon_cost_savings", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cache_savings", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_profile_created_at_idx": { + "name": "interactions_profile_created_at_idx", + "columns": [ + { + "expression": "profile_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_session_created_at_idx": { + "name": "interactions_session_created_at_idx", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_session_thread_created_at_idx": { + "name": "interactions_session_thread_created_at_idx", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "thread_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "interactions_parent_id_idx": { + "name": "interactions_parent_id_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "interactions_profile_id_agents_id_fk": { + "name": "interactions_profile_id_agents_id_fk", + "tableFrom": "interactions", + "tableTo": "agents", + "columnsFrom": [ + "profile_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "interactions_user_id_user_id_fk": { + "name": "interactions_user_id_user_id_fk", + "tableFrom": "interactions", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "interactions_virtual_key_id_virtual_api_keys_id_fk": { + "name": "interactions_virtual_key_id_virtual_api_keys_id_fk", + "tableFrom": "interactions", + "tableTo": "virtual_api_keys", + "columnsFrom": [ + "virtual_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "interactions_passthrough_virtual_key_id_virtual_api_keys_id_fk": { + "name": "interactions_passthrough_virtual_key_id_virtual_api_keys_id_fk", + "tableFrom": "interactions", + "tableTo": "virtual_api_keys", + "columnsFrom": [ + "passthrough_virtual_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "interactions_environment_id_environments_id_fk": { + "name": "interactions_environment_id_environments_id_fk", + "tableFrom": "interactions", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "interactions_parent_id_interactions_id_fk": { + "name": "interactions_parent_id_interactions_id_fk", + "tableFrom": "interactions", + "tableTo": "interactions", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.internal_mcp_catalog": { + "name": "internal_mcp_catalog", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "instructions": { + "name": "instructions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "installation_command": { + "name": "installation_command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "requires_auth": { + "name": "requires_auth", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "auth_description": { + "name": "auth_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_fields": { + "name": "auth_fields", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "server_type": { + "name": "server_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multitenant": { + "name": "multitenant", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "deployment_name": { + "name": "deployment_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dynamic_connection_mcp_server_id": { + "name": "dynamic_connection_mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "server_url": { + "name": "server_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "skills_refresh_generation": { + "name": "skills_refresh_generation", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "docs_url": { + "name": "docs_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_secret_id": { + "name": "client_secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "local_config_secret_id": { + "name": "local_config_secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "local_config": { + "name": "local_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "deployment_spec_yaml": { + "name": "deployment_spec_yaml", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_config": { + "name": "user_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "oauth_config": { + "name": "oauth_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "enterprise_managed_config": { + "name": "enterprise_managed_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "mcp_catalog_scope", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'org'" + }, + "parent_catalog_item_id": { + "name": "parent_catalog_item_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "child_name": { + "name": "child_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cloned_from": { + "name": "cloned_from", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "preset_entry_id": { + "name": "preset_entry_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "preset_field_values": { + "name": "preset_field_values", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "preset_secret_id": { + "name": "preset_secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "catalog_reinstall_required": { + "name": "catalog_reinstall_required", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "catalog_item_approval_status": { + "name": "catalog_item_approval_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "catalog_item_approval_reason": { + "name": "catalog_item_approval_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "catalog_item_approval_reviewed_by": { + "name": "catalog_item_approval_reviewed_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "catalog_item_approval_reviewed_at": { + "name": "catalog_item_approval_reviewed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "internal_mcp_catalog_organization_id_idx": { + "name": "internal_mcp_catalog_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "internal_mcp_catalog_author_id_idx": { + "name": "internal_mcp_catalog_author_id_idx", + "columns": [ + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "internal_mcp_catalog_scope_idx": { + "name": "internal_mcp_catalog_scope_idx", + "columns": [ + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "internal_mcp_catalog_parent_id_idx": { + "name": "internal_mcp_catalog_parent_id_idx", + "columns": [ + { + "expression": "parent_catalog_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "internal_mcp_catalog_cloned_from_idx": { + "name": "internal_mcp_catalog_cloned_from_idx", + "columns": [ + { + "expression": "cloned_from", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "internal_mcp_catalog_environment_id_idx": { + "name": "internal_mcp_catalog_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "internal_mcp_catalog_deleted_at_idx": { + "name": "internal_mcp_catalog_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "internal_mcp_catalog_client_secret_id_secret_id_fk": { + "name": "internal_mcp_catalog_client_secret_id_secret_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "secret", + "columnsFrom": [ + "client_secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "internal_mcp_catalog_local_config_secret_id_secret_id_fk": { + "name": "internal_mcp_catalog_local_config_secret_id_secret_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "secret", + "columnsFrom": [ + "local_config_secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "internal_mcp_catalog_author_id_user_id_fk": { + "name": "internal_mcp_catalog_author_id_user_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "user", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "internal_mcp_catalog_parent_catalog_item_id_internal_mcp_catalog_id_fk": { + "name": "internal_mcp_catalog_parent_catalog_item_id_internal_mcp_catalog_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "parent_catalog_item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "internal_mcp_catalog_cloned_from_internal_mcp_catalog_id_fk": { + "name": "internal_mcp_catalog_cloned_from_internal_mcp_catalog_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "cloned_from" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "internal_mcp_catalog_preset_entry_id_mcp_preset_entry_id_fk": { + "name": "internal_mcp_catalog_preset_entry_id_mcp_preset_entry_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "mcp_preset_entry", + "columnsFrom": [ + "preset_entry_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "internal_mcp_catalog_preset_secret_id_secret_id_fk": { + "name": "internal_mcp_catalog_preset_secret_id_secret_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "secret", + "columnsFrom": [ + "preset_secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "internal_mcp_catalog_environment_id_environments_id_fk": { + "name": "internal_mcp_catalog_environment_id_environments_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "internal_mcp_catalog_catalog_item_approval_reviewed_by_user_id_fk": { + "name": "internal_mcp_catalog_catalog_item_approval_reviewed_by_user_id_fk", + "tableFrom": "internal_mcp_catalog", + "tableTo": "user", + "columnsFrom": [ + "catalog_item_approval_reviewed_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "internal_mcp_catalog_parent_name_unique": { + "name": "internal_mcp_catalog_parent_name_unique", + "nullsNotDistinct": false, + "columns": [ + "parent_catalog_item_id", + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invitation": { + "name": "invitation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "inviter_id": { + "name": "inviter_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "invitation_organization_id_organization_id_fk": { + "name": "invitation_organization_id_organization_id_fk", + "tableFrom": "invitation", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "invitation_inviter_id_user_id_fk": { + "name": "invitation_inviter_id_user_id_fk", + "tableFrom": "invitation", + "tableTo": "user", + "columnsFrom": [ + "inviter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.jwks": { + "name": "jwks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "private_key": { + "name": "private_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_bm25_corpus_stats": { + "name": "kb_bm25_corpus_stats", + "schema": "", + "columns": { + "fts_language": { + "name": "fts_language", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "n_docs": { + "name": "n_docs", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "avg_dl": { + "name": "avg_dl", + "type": "numeric", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_bm25_term_stats": { + "name": "kb_bm25_term_stats", + "schema": "", + "columns": { + "fts_language": { + "name": "fts_language", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "term": { + "name": "term", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "df": { + "name": "df", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "kb_bm25_term_stats_pkey": { + "name": "kb_bm25_term_stats_pkey", + "columns": [ + "fts_language", + "term" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_chunks": { + "name": "kb_chunks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "document_id": { + "name": "document_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chunk_index": { + "name": "chunk_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "embedding": { + "name": "embedding", + "type": "vector(1536)", + "primaryKey": false, + "notNull": false + }, + "embedding_1024": { + "name": "embedding_1024", + "type": "vector(1024)", + "primaryKey": false, + "notNull": false + }, + "embedding_768": { + "name": "embedding_768", + "type": "vector(768)", + "primaryKey": false, + "notNull": false + }, + "embedding_384": { + "name": "embedding_384", + "type": "vector(384)", + "primaryKey": false, + "notNull": false + }, + "embedding_3072": { + "name": "embedding_3072", + "type": "vector(3072)", + "primaryKey": false, + "notNull": false + }, + "embedding_1408": { + "name": "embedding_1408", + "type": "vector(1408)", + "primaryKey": false, + "notNull": false + }, + "search_vector": { + "name": "search_vector", + "type": "tsvector", + "primaryKey": false, + "notNull": false + }, + "tok_len": { + "name": "tok_len", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_index": { + "name": "parent_index", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "metadata_suffix_semantic": { + "name": "metadata_suffix_semantic", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata_suffix_keyword": { + "name": "metadata_suffix_keyword", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contextual_header": { + "name": "contextual_header", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fts_language": { + "name": "fts_language", + "type": "regconfig", + "primaryKey": false, + "notNull": true, + "default": "'english'" + }, + "acl": { + "name": "acl", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_chunks_document_id_idx": { + "name": "kb_chunks_document_id_idx", + "columns": [ + { + "expression": "document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_chunks_document_id_parent_index_idx": { + "name": "kb_chunks_document_id_parent_index_idx", + "columns": [ + { + "expression": "document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_index", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"kb_chunks\".\"parent_index\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_chunks_document_id_kb_documents_id_fk": { + "name": "kb_chunks_document_id_kb_documents_id_fk", + "tableFrom": "kb_chunks", + "tableTo": "kb_documents", + "columnsFrom": [ + "document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_container_acls": { + "name": "kb_container_acls", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "container_key": { + "name": "container_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "acl": { + "name": "acl", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "fingerprint": { + "name": "fingerprint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stale": { + "name": "stale", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_container_acls_connector_key_idx": { + "name": "kb_container_acls_connector_key_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "container_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_container_acls_acl_gin_idx": { + "name": "kb_container_acls_acl_gin_idx", + "columns": [ + { + "expression": "acl", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": { + "kb_container_acls_connector_id_knowledge_base_connectors_id_fk": { + "name": "kb_container_acls_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "kb_container_acls", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_directories": { + "name": "kb_directories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'org-wide'" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_directories_organization_id_idx": { + "name": "kb_directories_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_directories_org_name_uidx": { + "name": "kb_directories_org_name_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_directories_created_by_user_id_fk": { + "name": "kb_directories_created_by_user_id_fk", + "tableFrom": "kb_directories", + "tableTo": "user", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_directory_team": { + "name": "kb_directory_team", + "schema": "", + "columns": { + "directory_id": { + "name": "directory_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "kb_directory_team_team_idx": { + "name": "kb_directory_team_team_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_directory_team_directory_id_kb_directories_id_fk": { + "name": "kb_directory_team_directory_id_kb_directories_id_fk", + "tableFrom": "kb_directory_team", + "tableTo": "kb_directories", + "columnsFrom": [ + "directory_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "kb_directory_team_directory_id_team_id_pk": { + "name": "kb_directory_team_directory_id_team_id_pk", + "columns": [ + "directory_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_documents": { + "name": "kb_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_url": { + "name": "source_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "acl": { + "name": "acl", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "container_key": { + "name": "container_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "embedding_status": { + "name": "embedding_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "chunk_count": { + "name": "chunk_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_documents_org_id_idx": { + "name": "kb_documents_org_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_documents_source_idx": { + "name": "kb_documents_source_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_documents_container_idx": { + "name": "kb_documents_container_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "container_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_documents_connector_id_knowledge_base_connectors_id_fk": { + "name": "kb_documents_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "kb_documents", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_external_groups": { + "name": "kb_external_groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connector_type": { + "name": "connector_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "group_id": { + "name": "group_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_external_groups_unique_idx": { + "name": "kb_external_groups_unique_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_external_groups_connector_id_idx": { + "name": "kb_external_groups_connector_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_external_groups_connector_id_knowledge_base_connectors_id_fk": { + "name": "kb_external_groups_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "kb_external_groups", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_external_user_groups": { + "name": "kb_external_user_groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connector_type": { + "name": "connector_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "group_id": { + "name": "group_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_account_id": { + "name": "external_account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "member_email": { + "name": "member_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "account_type": { + "name": "account_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stale": { + "name": "stale", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_external_user_groups_unique_idx": { + "name": "kb_external_user_groups_unique_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_external_user_groups_member_email_idx": { + "name": "kb_external_user_groups_member_email_idx", + "columns": [ + { + "expression": "member_email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_external_user_groups_connector_id_idx": { + "name": "kb_external_user_groups_connector_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_external_user_groups_connector_id_knowledge_base_connectors_id_fk": { + "name": "kb_external_user_groups_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "kb_external_user_groups", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_file_document": { + "name": "kb_file_document", + "schema": "", + "columns": { + "kb_file_id": { + "name": "kb_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "kb_document_id": { + "name": "kb_document_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "kb_file_document_document_idx": { + "name": "kb_file_document_document_idx", + "columns": [ + { + "expression": "kb_document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_file_document_kb_file_id_kb_files_id_fk": { + "name": "kb_file_document_kb_file_id_kb_files_id_fk", + "tableFrom": "kb_file_document", + "tableTo": "kb_files", + "columnsFrom": [ + "kb_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "kb_file_document_kb_document_id_kb_documents_id_fk": { + "name": "kb_file_document_kb_document_id_kb_documents_id_fk", + "tableFrom": "kb_file_document", + "tableTo": "kb_documents", + "columnsFrom": [ + "kb_document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "kb_file_document_kb_file_id_kb_document_id_pk": { + "name": "kb_file_document_kb_file_id_kb_document_id_pk", + "columns": [ + "kb_file_id", + "kb_document_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_file_team": { + "name": "kb_file_team", + "schema": "", + "columns": { + "kb_file_id": { + "name": "kb_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "kb_file_team_team_idx": { + "name": "kb_file_team_team_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_file_team_kb_file_id_kb_files_id_fk": { + "name": "kb_file_team_kb_file_id_kb_files_id_fk", + "tableFrom": "kb_file_team", + "tableTo": "kb_files", + "columnsFrom": [ + "kb_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "kb_file_team_kb_file_id_team_id_pk": { + "name": "kb_file_team_kb_file_id_team_id_pk", + "columns": [ + "kb_file_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_files": { + "name": "kb_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "directory_id": { + "name": "directory_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'org-wide'" + }, + "filename": { + "name": "filename", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "storage_provider": { + "name": "storage_provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'db'" + }, + "data": { + "name": "data", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "object_key": { + "name": "object_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uploaded_by": { + "name": "uploaded_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_files_organization_id_idx": { + "name": "kb_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_files_directory_id_idx": { + "name": "kb_files_directory_id_idx", + "columns": [ + { + "expression": "directory_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_files_org_directory_filename_uidx": { + "name": "kb_files_org_directory_filename_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "directory_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"kb_files\".\"directory_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_files_org_root_filename_uidx": { + "name": "kb_files_org_root_filename_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"kb_files\".\"directory_id\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_files_directory_id_kb_directories_id_fk": { + "name": "kb_files_directory_id_kb_directories_id_fk", + "tableFrom": "kb_files", + "tableTo": "kb_directories", + "columnsFrom": [ + "directory_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "kb_files_uploaded_by_user_id_fk": { + "name": "kb_files_uploaded_by_user_id_fk", + "tableFrom": "kb_files", + "tableTo": "user", + "columnsFrom": [ + "uploaded_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "kb_files_storage_payload_chk": { + "name": "kb_files_storage_payload_chk", + "value": "(\n (\"kb_files\".\"storage_provider\" = 'db' AND \"kb_files\".\"data\" IS NOT NULL AND \"kb_files\".\"object_key\" IS NULL)\n OR (\"kb_files\".\"storage_provider\" <> 'db' AND \"kb_files\".\"object_key\" IS NOT NULL AND \"kb_files\".\"data\" IS NULL)\n )" + } + }, + "isRLSEnabled": false + }, + "public.kb_member_overrides": { + "name": "kb_member_overrides", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_account_id": { + "name": "external_account_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", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_member_overrides_unique_idx": { + "name": "kb_member_overrides_unique_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_member_overrides_user_id_idx": { + "name": "kb_member_overrides_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kb_member_overrides_connector_id_knowledge_base_connectors_id_fk": { + "name": "kb_member_overrides_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "kb_member_overrides", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "kb_member_overrides_user_id_user_id_fk": { + "name": "kb_member_overrides_user_id_user_id_fk", + "tableFrom": "kb_member_overrides", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kb_upload_connector": { + "name": "kb_upload_connector", + "schema": "", + "columns": { + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "kb_upload_connector_knowledge_base_id_knowledge_bases_id_fk": { + "name": "kb_upload_connector_knowledge_base_id_knowledge_bases_id_fk", + "tableFrom": "kb_upload_connector", + "tableTo": "knowledge_bases", + "columnsFrom": [ + "knowledge_base_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "kb_upload_connector_connector_id_knowledge_base_connectors_id_fk": { + "name": "kb_upload_connector_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "kb_upload_connector", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_base_connector_assignment": { + "name": "knowledge_base_connector_assignment", + "schema": "", + "columns": { + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_connector_assignment_kb_id_idx": { + "name": "kb_connector_assignment_kb_id_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_connector_assignment_connector_id_idx": { + "name": "kb_connector_assignment_connector_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "knowledge_base_connector_assignment_knowledge_base_id_knowledge_bases_id_fk": { + "name": "knowledge_base_connector_assignment_knowledge_base_id_knowledge_bases_id_fk", + "tableFrom": "knowledge_base_connector_assignment", + "tableTo": "knowledge_bases", + "columnsFrom": [ + "knowledge_base_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "knowledge_base_connector_assignment_connector_id_knowledge_base_connectors_id_fk": { + "name": "knowledge_base_connector_assignment_connector_id_knowledge_base_connectors_id_fk", + "tableFrom": "knowledge_base_connector_assignment", + "tableTo": "knowledge_base_connectors", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_base_connectors": { + "name": "knowledge_base_connectors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'org-wide'" + }, + "team_ids": { + "name": "team_ids", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "connector_type": { + "name": "connector_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'0 */6 * * *'" + }, + "fts_language": { + "name": "fts_language", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'english'" + }, + "permission_sync_interval_seconds": { + "name": "permission_sync_interval_seconds", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1800 + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "last_sync_at": { + "name": "last_sync_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_sync_status": { + "name": "last_sync_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_sync_error": { + "name": "last_sync_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_permission_sync_at": { + "name": "last_permission_sync_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_permission_sync_status": { + "name": "last_permission_sync_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "checkpoint": { + "name": "checkpoint", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "permission_sync_state": { + "name": "permission_sync_state", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "acl_config_epoch": { + "name": "acl_config_epoch", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "knowledge_base_connectors_organization_id_idx": { + "name": "knowledge_base_connectors_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "deleted_at IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "knowledge_base_connectors_environment_id_idx": { + "name": "knowledge_base_connectors_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "deleted_at IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "knowledge_base_connectors_secret_id_secret_id_fk": { + "name": "knowledge_base_connectors_secret_id_secret_id_fk", + "tableFrom": "knowledge_base_connectors", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "knowledge_base_connectors_environment_id_environments_id_fk": { + "name": "knowledge_base_connectors_environment_id_environments_id_fk", + "tableFrom": "knowledge_base_connectors", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_bases": { + "name": "knowledge_bases", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "knowledge_bases_organization_id_idx": { + "name": "knowledge_bases_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "deleted_at IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.label_keys": { + "name": "label_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "label_keys_key_unique": { + "name": "label_keys_key_unique", + "nullsNotDistinct": false, + "columns": [ + "key" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.label_values": { + "name": "label_values", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "label_values_value_unique": { + "name": "label_values_value_unique", + "nullsNotDistinct": false, + "columns": [ + "value" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.limit_model_usage": { + "name": "limit_model_usage", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "limit_id": { + "name": "limit_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "current_usage_tokens_in": { + "name": "current_usage_tokens_in", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "current_usage_tokens_out": { + "name": "current_usage_tokens_out", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "limit_model_usage_limit_id_idx": { + "name": "limit_model_usage_limit_id_idx", + "columns": [ + { + "expression": "limit_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "limit_model_usage_limit_model_idx": { + "name": "limit_model_usage_limit_model_idx", + "columns": [ + { + "expression": "limit_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "model", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "limit_model_usage_limit_id_limits_id_fk": { + "name": "limit_model_usage_limit_id_limits_id_fk", + "tableFrom": "limit_model_usage", + "tableTo": "limits", + "columnsFrom": [ + "limit_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.limits": { + "name": "limits", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "entity_type": { + "name": "entity_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "entity_id": { + "name": "entity_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "limit_type": { + "name": "limit_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "limit_value": { + "name": "limit_value", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "mcp_server_name": { + "name": "mcp_server_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "tool_name": { + "name": "tool_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "cleanup_interval": { + "name": "cleanup_interval", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'1w'" + }, + "last_cleanup": { + "name": "last_cleanup", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "limits_entity_idx": { + "name": "limits_entity_idx", + "columns": [ + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "limits_type_idx": { + "name": "limits_type_idx", + "columns": [ + { + "expression": "limit_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.api_key_models": { + "name": "api_key_models", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "api_key_id": { + "name": "api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "model_id": { + "name": "model_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "is_best": { + "name": "is_best", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "recommended_for_agents": { + "name": "recommended_for_agents", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "api_key_models_api_key_id_idx": { + "name": "api_key_models_api_key_id_idx", + "columns": [ + { + "expression": "api_key_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "api_key_models_model_id_idx": { + "name": "api_key_models_model_id_idx", + "columns": [ + { + "expression": "model_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "api_key_models_api_key_id_chat_api_keys_id_fk": { + "name": "api_key_models_api_key_id_chat_api_keys_id_fk", + "tableFrom": "api_key_models", + "tableTo": "chat_api_keys", + "columnsFrom": [ + "api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "api_key_models_model_id_models_id_fk": { + "name": "api_key_models_model_id_models_id_fk", + "tableFrom": "api_key_models", + "tableTo": "models", + "columnsFrom": [ + "model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "api_key_models_unique": { + "name": "api_key_models_unique", + "nullsNotDistinct": false, + "columns": [ + "api_key_id", + "model_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_api_keys": { + "name": "chat_api_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'personal'" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "base_url": { + "name": "base_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "inference_base_url": { + "name": "inference_base_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "extra_headers": { + "name": "extra_headers", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "is_system": { + "name": "is_system", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_primary": { + "name": "is_primary", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "chat_api_keys_organization_id_idx": { + "name": "chat_api_keys_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_api_keys_org_provider_idx": { + "name": "chat_api_keys_org_provider_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_api_keys_system_unique": { + "name": "chat_api_keys_system_unique", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"chat_api_keys\".\"is_system\" = true", + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_api_keys_primary_personal_unique": { + "name": "chat_api_keys_primary_personal_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"chat_api_keys\".\"is_primary\" = true AND \"chat_api_keys\".\"scope\" = 'personal'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_api_keys_primary_team_unique": { + "name": "chat_api_keys_primary_team_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"chat_api_keys\".\"is_primary\" = true AND \"chat_api_keys\".\"scope\" = 'team'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_api_keys_primary_org_unique": { + "name": "chat_api_keys_primary_org_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"chat_api_keys\".\"is_primary\" = true AND \"chat_api_keys\".\"scope\" = 'org'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chat_api_keys_secret_id_secret_id_fk": { + "name": "chat_api_keys_secret_id_secret_id_fk", + "tableFrom": "chat_api_keys", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "chat_api_keys_user_id_user_id_fk": { + "name": "chat_api_keys_user_id_user_id_fk", + "tableFrom": "chat_api_keys", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "chat_api_keys_team_id_team_id_fk": { + "name": "chat_api_keys_team_id_team_id_fk", + "tableFrom": "chat_api_keys", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_catalog_labels": { + "name": "mcp_catalog_labels", + "schema": "", + "columns": { + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "value_id": { + "name": "value_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "mcp_catalog_labels_catalog_id_internal_mcp_catalog_id_fk": { + "name": "mcp_catalog_labels_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "mcp_catalog_labels", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_catalog_labels_key_id_label_keys_id_fk": { + "name": "mcp_catalog_labels_key_id_label_keys_id_fk", + "tableFrom": "mcp_catalog_labels", + "tableTo": "label_keys", + "columnsFrom": [ + "key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_catalog_labels_value_id_label_values_id_fk": { + "name": "mcp_catalog_labels_value_id_label_values_id_fk", + "tableFrom": "mcp_catalog_labels", + "tableTo": "label_values", + "columnsFrom": [ + "value_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "mcp_catalog_labels_catalog_id_key_id_pk": { + "name": "mcp_catalog_labels_catalog_id_key_id_pk", + "columns": [ + "catalog_id", + "key_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_catalog_skills": { + "name": "mcp_catalog_skills", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "frontmatter": { + "name": "frontmatter", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "resources": { + "name": "resources", + "type": "jsonb", + "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": { + "mcp_catalog_skills_catalog_uri_uidx": { + "name": "mcp_catalog_skills_catalog_uri_uidx", + "columns": [ + { + "expression": "catalog_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "uri", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_catalog_skills_catalog_idx": { + "name": "mcp_catalog_skills_catalog_idx", + "columns": [ + { + "expression": "catalog_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_catalog_skills_catalog_id_internal_mcp_catalog_id_fk": { + "name": "mcp_catalog_skills_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "mcp_catalog_skills", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_catalog_team": { + "name": "mcp_catalog_team", + "schema": "", + "columns": { + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'write'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "mcp_catalog_team_catalog_id_internal_mcp_catalog_id_fk": { + "name": "mcp_catalog_team_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "mcp_catalog_team", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_catalog_team_team_id_team_id_fk": { + "name": "mcp_catalog_team_team_id_team_id_fk", + "tableFrom": "mcp_catalog_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "mcp_catalog_team_catalog_id_team_id_pk": { + "name": "mcp_catalog_team_catalog_id_team_id_pk", + "columns": [ + "catalog_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "mcp_catalog_team_level_check": { + "name": "mcp_catalog_team_level_check", + "value": "\n \"mcp_catalog_team\".\"level\" in ('use', 'write')" + } + }, + "isRLSEnabled": false + }, + "public.mcp_catalog_user": { + "name": "mcp_catalog_user", + "schema": "", + "columns": { + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'use'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "mcp_catalog_user_catalog_id_internal_mcp_catalog_id_fk": { + "name": "mcp_catalog_user_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "mcp_catalog_user", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_catalog_user_user_id_user_id_fk": { + "name": "mcp_catalog_user_user_id_user_id_fk", + "tableFrom": "mcp_catalog_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "mcp_catalog_user_catalog_id_user_id_pk": { + "name": "mcp_catalog_user_catalog_id_user_id_pk", + "columns": [ + "catalog_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "mcp_catalog_user_level_check": { + "name": "mcp_catalog_user_level_check", + "value": "\n \"mcp_catalog_user\".\"level\" in ('use', 'write')" + } + }, + "isRLSEnabled": false + }, + "public.mcp_deployment_leases": { + "name": "mcp_deployment_leases", + "schema": "", + "columns": { + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "holder": { + "name": "holder", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "acquired_at": { + "name": "acquired_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "mcp_deployment_leases_scope_key_pk": { + "name": "mcp_deployment_leases_scope_key_pk", + "columns": [ + "scope", + "key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_gateway_tasks": { + "name": "mcp_gateway_tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "principal": { + "name": "principal", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_name": { + "name": "tool_name", + "type": "varchar(512)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true, + "default": "'working'" + }, + "result": { + "name": "result", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mcp_gateway_tasks_agent_principal_idx": { + "name": "mcp_gateway_tasks_agent_principal_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "principal", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_gateway_tasks_expires_at_idx": { + "name": "mcp_gateway_tasks_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_gateway_tasks_agent_id_agents_id_fk": { + "name": "mcp_gateway_tasks_agent_id_agents_id_fk", + "tableFrom": "mcp_gateway_tasks", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_http_sessions": { + "name": "mcp_http_sessions", + "schema": "", + "columns": { + "connection_key": { + "name": "connection_key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "session_id": { + "name": "session_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "session_endpoint_url": { + "name": "session_endpoint_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "session_endpoint_pod_name": { + "name": "session_endpoint_pod_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_preset_entry": { + "name": "mcp_preset_entry", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "validation_regex": { + "name": "validation_regex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mcp_preset_entry_org_idx": { + "name": "mcp_preset_entry_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_preset_entry_organization_id_organization_id_fk": { + "name": "mcp_preset_entry_organization_id_organization_id_fk", + "tableFrom": "mcp_preset_entry", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mcp_preset_entry_org_name_unique": { + "name": "mcp_preset_entry_org_name_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_server_alert_mutes": { + "name": "mcp_server_alert_mutes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "issue_kind": { + "name": "issue_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "issue_fingerprint": { + "name": "issue_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mcp_server_alert_mutes_viewer_server_alert_uidx": { + "name": "mcp_server_alert_mutes_viewer_server_alert_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "issue_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"mcp_server_alert_mutes\".\"mcp_server_id\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_server_alert_mutes_viewer_catalog_alert_uidx": { + "name": "mcp_server_alert_mutes_viewer_catalog_alert_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "catalog_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "issue_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"mcp_server_alert_mutes\".\"mcp_server_id\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_server_alert_mutes_catalog_id_idx": { + "name": "mcp_server_alert_mutes_catalog_id_idx", + "columns": [ + { + "expression": "catalog_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_server_alert_mutes_mcp_server_id_idx": { + "name": "mcp_server_alert_mutes_mcp_server_id_idx", + "columns": [ + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_server_alert_mutes_user_id_user_id_fk": { + "name": "mcp_server_alert_mutes_user_id_user_id_fk", + "tableFrom": "mcp_server_alert_mutes", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_server_alert_mutes_catalog_id_internal_mcp_catalog_id_fk": { + "name": "mcp_server_alert_mutes_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "mcp_server_alert_mutes", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_server_alert_mutes_mcp_server_id_mcp_server_id_fk": { + "name": "mcp_server_alert_mutes_mcp_server_id_mcp_server_id_fk", + "tableFrom": "mcp_server_alert_mutes", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "mcp_server_alert_mutes_issue_kind_check": { + "name": "mcp_server_alert_mutes_issue_kind_check", + "value": "\"mcp_server_alert_mutes\".\"issue_kind\" in ('failed-to-start', 'not-running', 'needs-reauth')" + } + }, + "isRLSEnabled": false + }, + "public.mcp_server_user": { + "name": "mcp_server_user", + "schema": "", + "columns": { + "mcp_server_id": { + "name": "mcp_server_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "mcp_server_user_mcp_server_id_mcp_server_id_fk": { + "name": "mcp_server_user_mcp_server_id_mcp_server_id_fk", + "tableFrom": "mcp_server_user", + "tableTo": "mcp_server", + "columnsFrom": [ + "mcp_server_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_server_user_user_id_user_id_fk": { + "name": "mcp_server_user_user_id_user_id_fk", + "tableFrom": "mcp_server_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "mcp_server_user_mcp_server_id_user_id_pk": { + "name": "mcp_server_user_mcp_server_id_user_id_pk", + "columns": [ + "mcp_server_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_server": { + "name": "mcp_server", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "deployment_name": { + "name": "deployment_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "server_type": { + "name": "server_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "environment_values": { + "name": "environment_values", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "owner_id": { + "name": "owner_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'personal'" + }, + "reinstall_required": { + "name": "reinstall_required", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "reinstall_reason": { + "name": "reinstall_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_installation_status": { + "name": "local_installation_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "local_installation_error": { + "name": "local_installation_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_refresh_error": { + "name": "oauth_refresh_error", + "type": "oauth_refresh_error_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "oauth_refresh_error_message": { + "name": "oauth_refresh_error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_refresh_error_description": { + "name": "oauth_refresh_error_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_refresh_failed_at": { + "name": "oauth_refresh_failed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "hibernation_mode": { + "name": "hibernation_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'inherit'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "mcp_server_scope_idx": { + "name": "mcp_server_scope_idx", + "columns": [ + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_server_deleted_at_idx": { + "name": "mcp_server_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_server_catalog_id_internal_mcp_catalog_id_fk": { + "name": "mcp_server_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "mcp_server", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "mcp_server_secret_id_secret_id_fk": { + "name": "mcp_server_secret_id_secret_id_fk", + "tableFrom": "mcp_server", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "mcp_server_owner_id_user_id_fk": { + "name": "mcp_server_owner_id_user_id_fk", + "tableFrom": "mcp_server", + "tableTo": "user", + "columnsFrom": [ + "owner_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "mcp_server_team_id_team_id_fk": { + "name": "mcp_server_team_id_team_id_fk", + "tableFrom": "mcp_server", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_tool_calls": { + "name": "mcp_tool_calls", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "owner_type": { + "name": "owner_type", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'agent'" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mcp_server_name": { + "name": "mcp_server_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "tool_call": { + "name": "tool_call", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "tool_result": { + "name": "tool_result", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "locked_chat_conversation_id": { + "name": "locked_chat_conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_method": { + "name": "auth_method", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mcp_tool_calls_agent_id_idx": { + "name": "mcp_tool_calls_agent_id_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_tool_calls_user_id_idx": { + "name": "mcp_tool_calls_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_tool_calls_app_id_idx": { + "name": "mcp_tool_calls_app_id_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_tool_calls_created_at_idx": { + "name": "mcp_tool_calls_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_tool_calls_agent_id_agents_id_fk": { + "name": "mcp_tool_calls_agent_id_agents_id_fk", + "tableFrom": "mcp_tool_calls", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "mcp_tool_calls_app_id_apps_id_fk": { + "name": "mcp_tool_calls_app_id_apps_id_fk", + "tableFrom": "mcp_tool_calls", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "mcp_tool_calls_user_id_user_id_fk": { + "name": "mcp_tool_calls_user_id_user_id_fk", + "tableFrom": "mcp_tool_calls", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.member": { + "name": "member", + "schema": "", + "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 + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "default_agent_id": { + "name": "default_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "default_model_id": { + "name": "default_model_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "default_chat_api_key_id": { + "name": "default_chat_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "member_user_id_organization_id_idx": { + "name": "member_user_id_organization_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "member_organization_id_organization_id_fk": { + "name": "member_organization_id_organization_id_fk", + "tableFrom": "member", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "member_user_id_user_id_fk": { + "name": "member_user_id_user_id_fk", + "tableFrom": "member", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "member_default_agent_id_agents_id_fk": { + "name": "member_default_agent_id_agents_id_fk", + "tableFrom": "member", + "tableTo": "agents", + "columnsFrom": [ + "default_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "member_default_model_id_models_id_fk": { + "name": "member_default_model_id_models_id_fk", + "tableFrom": "member", + "tableTo": "models", + "columnsFrom": [ + "default_model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "member_default_chat_api_key_id_chat_api_keys_id_fk": { + "name": "member_default_chat_api_key_id_chat_api_keys_id_fk", + "tableFrom": "member", + "tableTo": "chat_api_keys", + "columnsFrom": [ + "default_chat_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages": { + "name": "messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "feedback": { + "name": "feedback", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "messages_conversation_id_idx": { + "name": "messages_conversation_id_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "messages_conversation_id_conversations_id_fk": { + "name": "messages_conversation_id_conversations_id_fk", + "tableFrom": "messages", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "messages_feedback_check": { + "name": "messages_feedback_check", + "value": "\"messages\".\"feedback\" in ('up', 'down')" + } + }, + "isRLSEnabled": false + }, + "public.model_team": { + "name": "model_team", + "schema": "", + "columns": { + "model_id": { + "name": "model_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "model_team_model_id_models_id_fk": { + "name": "model_team_model_id_models_id_fk", + "tableFrom": "model_team", + "tableTo": "models", + "columnsFrom": [ + "model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "model_team_team_id_team_id_fk": { + "name": "model_team_team_id_team_id_fk", + "tableFrom": "model_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "model_team_model_id_team_id_pk": { + "name": "model_team_model_id_team_id_pk", + "columns": [ + "model_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.model_user": { + "name": "model_user", + "schema": "", + "columns": { + "model_id": { + "name": "model_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'use'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "model_user_model_id_models_id_fk": { + "name": "model_user_model_id_models_id_fk", + "tableFrom": "model_user", + "tableTo": "models", + "columnsFrom": [ + "model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "model_user_user_id_user_id_fk": { + "name": "model_user_user_id_user_id_fk", + "tableFrom": "model_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "model_user_model_id_user_id_pk": { + "name": "model_user_model_id_user_id_pk", + "columns": [ + "model_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "model_user_level_check": { + "name": "model_user_level_check", + "value": "\n \"model_user\".\"level\" in ('use', 'write')" + } + }, + "isRLSEnabled": false + }, + "public.models": { + "name": "models", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model_id": { + "name": "model_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "context_length": { + "name": "context_length", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "output_length": { + "name": "output_length", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "custom_context_length": { + "name": "custom_context_length", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "custom_output_length": { + "name": "custom_output_length", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "input_modalities": { + "name": "input_modalities", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "output_modalities": { + "name": "output_modalities", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "supports_tool_calling": { + "name": "supports_tool_calling", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "supports_reasoning_effort": { + "name": "supports_reasoning_effort", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "supported_endpoints": { + "name": "supported_endpoints", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "prompt_price_per_token": { + "name": "prompt_price_per_token", + "type": "numeric(20, 12)", + "primaryKey": false, + "notNull": false + }, + "completion_price_per_token": { + "name": "completion_price_per_token", + "type": "numeric(20, 12)", + "primaryKey": false, + "notNull": false + }, + "cache_read_price_per_token": { + "name": "cache_read_price_per_token", + "type": "numeric(20, 12)", + "primaryKey": false, + "notNull": false + }, + "cache_write_price_per_token": { + "name": "cache_write_price_per_token", + "type": "numeric(20, 12)", + "primaryKey": false, + "notNull": false + }, + "custom_price_per_million_input": { + "name": "custom_price_per_million_input", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "custom_price_per_million_output": { + "name": "custom_price_per_million_output", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "custom_price_per_million_cache_read": { + "name": "custom_price_per_million_cache_read", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "custom_price_per_million_cache_write": { + "name": "custom_price_per_million_cache_write", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "ignored": { + "name": "ignored", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "embedding_dimensions": { + "name": "embedding_dimensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "default_parameters": { + "name": "default_parameters", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "configured_parameters": { + "name": "configured_parameters", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "discovered_via_llm_proxy": { + "name": "discovered_via_llm_proxy", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "models_provider_model_idx": { + "name": "models_provider_model_idx", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "model_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "models_external_id_idx": { + "name": "models_external_id_idx", + "columns": [ + { + "expression": "external_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "models_provider_model_unique": { + "name": "models_provider_model_unique", + "nullsNotDistinct": false, + "columns": [ + "provider", + "model_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.oauth_access_token": { + "name": "oauth_access_token", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "session_id": { + "name": "session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_id": { + "name": "refresh_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_access_token_client_id_oauth_client_client_id_fk": { + "name": "oauth_access_token_client_id_oauth_client_client_id_fk", + "tableFrom": "oauth_access_token", + "tableTo": "oauth_client", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "client_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_access_token_session_id_session_id_fk": { + "name": "oauth_access_token_session_id_session_id_fk", + "tableFrom": "oauth_access_token", + "tableTo": "session", + "columnsFrom": [ + "session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "oauth_access_token_user_id_user_id_fk": { + "name": "oauth_access_token_user_id_user_id_fk", + "tableFrom": "oauth_access_token", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_access_token_refresh_id_oauth_refresh_token_id_fk": { + "name": "oauth_access_token_refresh_id_oauth_refresh_token_id_fk", + "tableFrom": "oauth_access_token", + "tableTo": "oauth_refresh_token", + "columnsFrom": [ + "refresh_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "oauth_access_token_token_unique": { + "name": "oauth_access_token_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.oauth_client_team": { + "name": "oauth_client_team", + "schema": "", + "columns": { + "oauth_client_id": { + "name": "oauth_client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_oauth_client_team_team_id": { + "name": "idx_oauth_client_team_team_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "oauth_client_team_oauth_client_id_oauth_client_id_fk": { + "name": "oauth_client_team_oauth_client_id_oauth_client_id_fk", + "tableFrom": "oauth_client_team", + "tableTo": "oauth_client", + "columnsFrom": [ + "oauth_client_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_client_team_team_id_team_id_fk": { + "name": "oauth_client_team_team_id_team_id_fk", + "tableFrom": "oauth_client_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "oauth_client_team_oauth_client_id_team_id_pk": { + "name": "oauth_client_team_oauth_client_id_team_id_pk", + "columns": [ + "oauth_client_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.oauth_client": { + "name": "oauth_client", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_secret": { + "name": "client_secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contacts": { + "name": "contacts", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "tos": { + "name": "tos", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "policy": { + "name": "policy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "software_id": { + "name": "software_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "software_version": { + "name": "software_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "software_statement": { + "name": "software_statement", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "disabled": { + "name": "disabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "skip_consent": { + "name": "skip_consent", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "enable_end_session": { + "name": "enable_end_session", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subject_type": { + "name": "subject_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redirect_uris": { + "name": "redirect_uris", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "post_logout_redirect_uris": { + "name": "post_logout_redirect_uris", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "token_endpoint_auth_method": { + "name": "token_endpoint_auth_method", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "grant_types": { + "name": "grant_types", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "response_types": { + "name": "response_types", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "public": { + "name": "public", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "require_pkce": { + "name": "require_pkce", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_client_user_id_user_id_fk": { + "name": "oauth_client_user_id_user_id_fk", + "tableFrom": "oauth_client", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "oauth_client_client_id_unique": { + "name": "oauth_client_client_id_unique", + "nullsNotDistinct": false, + "columns": [ + "client_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.oauth_consent": { + "name": "oauth_consent", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_consent_client_id_oauth_client_client_id_fk": { + "name": "oauth_consent_client_id_oauth_client_client_id_fk", + "tableFrom": "oauth_consent", + "tableTo": "oauth_client", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "client_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_consent_user_id_user_id_fk": { + "name": "oauth_consent_user_id_user_id_fk", + "tableFrom": "oauth_consent", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.oauth_refresh_token": { + "name": "oauth_refresh_token", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "session_id": { + "name": "session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_time": { + "name": "auth_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "revoked": { + "name": "revoked", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_refresh_token_client_id_oauth_client_client_id_fk": { + "name": "oauth_refresh_token_client_id_oauth_client_client_id_fk", + "tableFrom": "oauth_refresh_token", + "tableTo": "oauth_client", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "client_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_refresh_token_session_id_session_id_fk": { + "name": "oauth_refresh_token_session_id_session_id_fk", + "tableFrom": "oauth_refresh_token", + "tableTo": "session", + "columnsFrom": [ + "session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "oauth_refresh_token_user_id_user_id_fk": { + "name": "oauth_refresh_token_user_id_user_id_fk", + "tableFrom": "oauth_refresh_token", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization_role": { + "name": "organization_role", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "permission": { + "name": "permission", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "organization_role_organization_id_organization_id_fk": { + "name": "organization_role_organization_id_organization_id_fk", + "tableFrom": "organization_role", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organization_role_organization_id_role_unique": { + "name": "organization_role_organization_id_role_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "role" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization": { + "name": "organization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "analytics_instance_id": { + "name": "analytics_instance_id", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "analytics_instance_started_at": { + "name": "analytics_instance_started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "analytics_instance_last_heartbeat_at": { + "name": "analytics_instance_last_heartbeat_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "logo": { + "name": "logo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logo_dark": { + "name": "logo_dark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "onboarding_complete": { + "name": "onboarding_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "onboarding_survey_completed_at": { + "name": "onboarding_survey_completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'caffeine'" + }, + "custom_font": { + "name": "custom_font", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'lato'" + }, + "convert_tool_results_to_toon": { + "name": "convert_tool_results_to_toon", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "compression_scope": { + "name": "compression_scope", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'organization'" + }, + "online_mcp_catalog_enabled": { + "name": "online_mcp_catalog_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "online_skill_catalog_enabled": { + "name": "online_skill_catalog_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "skill_marketplace_anonymous_access": { + "name": "skill_marketplace_anonymous_access", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "global_tool_policy": { + "name": "global_tool_policy", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'permissive'" + }, + "discovered_tool_policy": { + "name": "discovered_tool_policy", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'relaxed'" + }, + "default_discovered_tool_invocation_policy": { + "name": "default_discovered_tool_invocation_policy", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'allow_when_context_is_untrusted'" + }, + "default_discovered_tool_result_policy": { + "name": "default_discovered_tool_result_policy", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'mark_as_untrusted'" + }, + "allow_chat_file_uploads": { + "name": "allow_chat_file_uploads", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "allow_tool_auto_assignment": { + "name": "allow_tool_auto_assignment", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "embedding_model": { + "name": "embedding_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "embedding_dimensions": { + "name": "embedding_dimensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "embedding_chat_api_key_id": { + "name": "embedding_chat_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reranker_chat_api_key_id": { + "name": "reranker_chat_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reranker_model": { + "name": "reranker_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ocr_chat_api_key_id": { + "name": "ocr_chat_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ocr_model": { + "name": "ocr_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kb_bm25_k1": { + "name": "kb_bm25_k1", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "kb_bm25_b": { + "name": "kb_bm25_b", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "kb_contextual_retrieval_mode": { + "name": "kb_contextual_retrieval_mode", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "default_llm_model": { + "name": "default_llm_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_llm_provider": { + "name": "default_llm_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_model_id": { + "name": "default_model_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "default_llm_api_key_id": { + "name": "default_llm_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "default_user_limit_value": { + "name": "default_user_limit_value", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "default_user_limit_model": { + "name": "default_user_limit_model", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "default_user_limit_cleanup_interval": { + "name": "default_user_limit_cleanup_interval", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "default_member_role": { + "name": "default_member_role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_agent_id": { + "name": "default_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "favicon": { + "name": "favicon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "app_name": { + "name": "app_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "og_description": { + "name": "og_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "footer_text": { + "name": "footer_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "chat_links": { + "name": "chat_links", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "onboarding_wizard": { + "name": "onboarding_wizard", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "chat_placeholders": { + "name": "chat_placeholders", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "animate_chat_placeholders": { + "name": "animate_chat_placeholders", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "icon_logo": { + "name": "icon_logo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon_logo_dark": { + "name": "icon_logo_dark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "chat_error_support_message": { + "name": "chat_error_support_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "slim_chat_error_ui": { + "name": "slim_chat_error_ui", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "require_two_factor": { + "name": "require_two_factor", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "session_max_age_seconds": { + "name": "session_max_age_seconds", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "oauth_access_token_lifetime_seconds": { + "name": "oauth_access_token_lifetime_seconds", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 31536000 + }, + "connection_default_mcp_gateway_id": { + "name": "connection_default_mcp_gateway_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "connection_default_llm_proxy_id": { + "name": "connection_default_llm_proxy_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "connection_default_client_id": { + "name": "connection_default_client_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "connection_shown_client_ids": { + "name": "connection_shown_client_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "connection_shown_providers": { + "name": "connection_shown_providers", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "connection_base_urls": { + "name": "connection_base_urls", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "connection_default_provider_keys": { + "name": "connection_default_provider_keys", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "model_provider_overrides": { + "name": "model_provider_overrides", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "messaging_channel_overrides": { + "name": "messaging_channel_overrides", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "knowledge_connector_overrides": { + "name": "knowledge_connector_overrides", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "preset_entity_name": { + "name": "preset_entity_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "preset_entity_name_plural": { + "name": "preset_entity_name_plural", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "preset_entity_default_label": { + "name": "preset_entity_default_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_environment_name": { + "name": "default_environment_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_environment_namespace": { + "name": "default_environment_namespace", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_environment_description": { + "name": "default_environment_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_network_policy": { + "name": "default_network_policy", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "default_environment_restricted": { + "name": "default_environment_restricted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "default_environment_validation_regex": { + "name": "default_environment_validation_regex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_environment_trusted_image_registries": { + "name": "default_environment_trusted_image_registries", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "skill_tools_enabled": { + "name": "skill_tools_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "mcp_idle_hibernation_enabled": { + "name": "mcp_idle_hibernation_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "apps_hackathon_recorder_enabled": { + "name": "apps_hackathon_recorder_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "new_apps_disabled_by_default": { + "name": "new_apps_disabled_by_default", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "new_apps_locked_by_default": { + "name": "new_apps_locked_by_default", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "preset_entity_default_validation_regex": { + "name": "preset_entity_default_validation_regex", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "organization_default_model_id_models_id_fk": { + "name": "organization_default_model_id_models_id_fk", + "tableFrom": "organization", + "tableTo": "models", + "columnsFrom": [ + "default_model_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organization_slug_unique": { + "name": "organization_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugin_files": { + "name": "plugin_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "plugin_id": { + "name": "plugin_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "encoding": { + "name": "encoding", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'utf8'" + }, + "mode": { + "name": "mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'100644'" + }, + "digest": { + "name": "digest", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "plugin_files_plugin_id_idx": { + "name": "plugin_files_plugin_id_idx", + "columns": [ + { + "expression": "plugin_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugin_files_plugin_path_uidx": { + "name": "plugin_files_plugin_path_uidx", + "columns": [ + { + "expression": "plugin_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "plugin_files_plugin_id_plugins_id_fk": { + "name": "plugin_files_plugin_id_plugins_id_fk", + "tableFrom": "plugin_files", + "tableTo": "plugins", + "columnsFrom": [ + "plugin_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugin_team": { + "name": "plugin_team", + "schema": "", + "columns": { + "plugin_id": { + "name": "plugin_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "plugin_team_plugin_id_plugins_id_fk": { + "name": "plugin_team_plugin_id_plugins_id_fk", + "tableFrom": "plugin_team", + "tableTo": "plugins", + "columnsFrom": [ + "plugin_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "plugin_team_team_id_team_id_fk": { + "name": "plugin_team_team_id_team_id_fk", + "tableFrom": "plugin_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "plugin_team_plugin_id_team_id_pk": { + "name": "plugin_team_plugin_id_team_id_pk", + "columns": [ + "plugin_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugin_user": { + "name": "plugin_user", + "schema": "", + "columns": { + "plugin_id": { + "name": "plugin_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "plugin_user_plugin_id_plugins_id_fk": { + "name": "plugin_user_plugin_id_plugins_id_fk", + "tableFrom": "plugin_user", + "tableTo": "plugins", + "columnsFrom": [ + "plugin_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "plugin_user_user_id_user_id_fk": { + "name": "plugin_user_user_id_user_id_fk", + "tableFrom": "plugin_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "plugin_user_plugin_id_user_id_pk": { + "name": "plugin_user_plugin_id_user_id_pk", + "columns": [ + "plugin_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugins": { + "name": "plugins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'org'" + }, + "client_type": { + "name": "client_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "supported_platforms": { + "name": "supported_platforms", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{\"posix\"}'" + }, + "plugin_slug": { + "name": "plugin_slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_kind": { + "name": "source_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'manual'" + }, + "source_repo": { + "name": "source_repo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_ref": { + "name": "source_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_sha": { + "name": "source_sha", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_subdir": { + "name": "source_subdir", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_exclude": { + "name": "source_exclude", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "source_marketplace_repo": { + "name": "source_marketplace_repo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_marketplace_path": { + "name": "source_marketplace_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_marketplace_plugin_name": { + "name": "source_marketplace_plugin_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_sync_interval": { + "name": "github_sync_interval", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_sync_ref": { + "name": "github_sync_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_app_config_id": { + "name": "github_app_config_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "github_pat_id": { + "name": "github_pat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_sync_error": { + "name": "last_sync_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pending_source_sha": { + "name": "pending_source_sha", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pending_content_hash": { + "name": "pending_content_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pending_detected_at": { + "name": "pending_detected_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "sync_generation": { + "name": "sync_generation", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "approved_content_hash": { + "name": "approved_content_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "approved_at": { + "name": "approved_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "approved_by": { + "name": "approved_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "plugins_organization_id_idx": { + "name": "plugins_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugins_scope_idx": { + "name": "plugins_scope_idx", + "columns": [ + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugins_github_sync_due_idx": { + "name": "plugins_github_sync_due_idx", + "columns": [ + { + "expression": "last_synced_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"plugins\".\"github_sync_interval\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugins_org_client_type_idx": { + "name": "plugins_org_client_type_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "client_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugins_org_plugin_slug_uidx": { + "name": "plugins_org_plugin_slug_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "plugin_slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"plugins\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugins_source_id_uidx": { + "name": "plugins_source_id_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"plugins\".\"source_id\" IS NOT NULL AND \"plugins\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugins_org_marketplace_entry_uidx": { + "name": "plugins_org_marketplace_entry_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"source_marketplace_repo\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "source_marketplace_path", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"source_marketplace_plugin_name\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"plugins\".\"source_marketplace_repo\" IS NOT NULL AND \"plugins\".\"source_marketplace_path\" IS NOT NULL AND \"plugins\".\"source_marketplace_plugin_name\" IS NOT NULL AND \"plugins\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "plugins_author_id_user_id_fk": { + "name": "plugins_author_id_user_id_fk", + "tableFrom": "plugins", + "tableTo": "user", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "plugins_github_app_config_id_github_app_configs_id_fk": { + "name": "plugins_github_app_config_id_github_app_configs_id_fk", + "tableFrom": "plugins", + "tableTo": "github_app_configs", + "columnsFrom": [ + "github_app_config_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "no action" + }, + "plugins_github_pat_id_github_pats_id_fk": { + "name": "plugins_github_pat_id_github_pats_id_fk", + "tableFrom": "plugins", + "tableTo": "github_pats", + "columnsFrom": [ + "github_pat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "no action" + }, + "plugins_approved_by_user_id_fk": { + "name": "plugins_approved_by_user_id_fk", + "tableFrom": "plugins", + "tableTo": "user", + "columnsFrom": [ + "approved_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.processed_email": { + "name": "processed_email", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "message_id": { + "name": "message_id", + "type": "varchar(512)", + "primaryKey": false, + "notNull": true + }, + "processed_at": { + "name": "processed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "processed_email_processed_at_idx": { + "name": "processed_email_processed_at_idx", + "columns": [ + { + "expression": "processed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "processed_email_message_id_unique": { + "name": "processed_email_message_id_unique", + "nullsNotDistinct": false, + "columns": [ + "message_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_pins": { + "name": "project_pins", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "pinned_at": { + "name": "pinned_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "project_pins_project_id_idx": { + "name": "project_pins_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_pins_user_id_user_id_fk": { + "name": "project_pins_user_id_user_id_fk", + "tableFrom": "project_pins", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_pins_project_id_projects_id_fk": { + "name": "project_pins_project_id_projects_id_fk", + "tableFrom": "project_pins", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "project_pins_user_id_project_id_pk": { + "name": "project_pins_user_id_project_id_pk", + "columns": [ + "user_id", + "project_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_share_team": { + "name": "project_share_team", + "schema": "", + "columns": { + "share_id": { + "name": "share_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "project_share_team_share_id_project_shares_id_fk": { + "name": "project_share_team_share_id_project_shares_id_fk", + "tableFrom": "project_share_team", + "tableTo": "project_shares", + "columnsFrom": [ + "share_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_share_team_team_id_team_id_fk": { + "name": "project_share_team_team_id_team_id_fk", + "tableFrom": "project_share_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "project_share_team_share_id_team_id_pk": { + "name": "project_share_team_share_id_team_id_pk", + "columns": [ + "share_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_share_user": { + "name": "project_share_user", + "schema": "", + "columns": { + "share_id": { + "name": "share_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "project_share_user_share_id_project_shares_id_fk": { + "name": "project_share_user_share_id_project_shares_id_fk", + "tableFrom": "project_share_user", + "tableTo": "project_shares", + "columnsFrom": [ + "share_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_share_user_user_id_user_id_fk": { + "name": "project_share_user_user_id_user_id_fk", + "tableFrom": "project_share_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "project_share_user_share_id_user_id_pk": { + "name": "project_share_user_share_id_user_id_pk", + "columns": [ + "share_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_shares": { + "name": "project_shares", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "project_share_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'organization'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "project_shares_project_id_projects_id_fk": { + "name": "project_shares_project_id_projects_id_fk", + "tableFrom": "project_shares", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "project_shares_project_id_unique": { + "name": "project_shares_project_id_unique", + "nullsNotDistinct": false, + "columns": [ + "project_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.projects": { + "name": "projects", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_agent_id": { + "name": "default_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "projects_user_name_uidx": { + "name": "projects_user_name_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"projects\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "projects_org_slug_uidx": { + "name": "projects_org_slug_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "projects_user_id_user_id_fk": { + "name": "projects_user_id_user_id_fk", + "tableFrom": "projects", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "projects_default_agent_id_agents_id_fk": { + "name": "projects_default_agent_id_agents_id_fk", + "tableFrom": "projects", + "tableTo": "agents", + "columnsFrom": [ + "default_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.schedule_trigger_runs": { + "name": "schedule_trigger_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "trigger_id": { + "name": "trigger_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "run_kind": { + "name": "run_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'running'" + }, + "initiated_by_user_id": { + "name": "initiated_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "chat_conversation_id": { + "name": "chat_conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artifact": { + "name": "artifact", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "schedule_trigger_runs_trigger_id_idx": { + "name": "schedule_trigger_runs_trigger_id_idx", + "columns": [ + { + "expression": "trigger_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "schedule_trigger_runs_chat_conversation_id_idx": { + "name": "schedule_trigger_runs_chat_conversation_id_idx", + "columns": [ + { + "expression": "chat_conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "schedule_trigger_runs_trigger_id_schedule_triggers_id_fk": { + "name": "schedule_trigger_runs_trigger_id_schedule_triggers_id_fk", + "tableFrom": "schedule_trigger_runs", + "tableTo": "schedule_triggers", + "columnsFrom": [ + "trigger_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.schedule_triggers": { + "name": "schedule_triggers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "message_template": { + "name": "message_template", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cron_expression": { + "name": "cron_expression", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "timezone": { + "name": "timezone", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_executed_at": { + "name": "last_executed_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()" + } + }, + "indexes": { + "schedule_triggers_agent_id_idx": { + "name": "schedule_triggers_agent_id_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "schedule_triggers_project_id_idx": { + "name": "schedule_triggers_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "schedule_triggers_actor_user_id_idx": { + "name": "schedule_triggers_actor_user_id_idx", + "columns": [ + { + "expression": "actor_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "schedule_triggers_enabled_last_executed_at_idx": { + "name": "schedule_triggers_enabled_last_executed_at_idx", + "columns": [ + { + "expression": "enabled", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "schedule_triggers_agent_id_agents_id_fk": { + "name": "schedule_triggers_agent_id_agents_id_fk", + "tableFrom": "schedule_triggers", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schedule_triggers_project_id_projects_id_fk": { + "name": "schedule_triggers_project_id_projects_id_fk", + "tableFrom": "schedule_triggers", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schedule_triggers_actor_user_id_user_id_fk": { + "name": "schedule_triggers_actor_user_id_user_id_fk", + "tableFrom": "schedule_triggers", + "tableTo": "user", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.secret": { + "name": "secret", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true, + "default": "'secret'" + }, + "secret": { + "name": "secret", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "is_vault": { + "name": "is_vault", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_byos_vault": { + "name": "is_byos_vault", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.service_account_tokens": { + "name": "service_account_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "service_account_id": { + "name": "service_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "disabled": { + "name": "disabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "service_account_tokens_service_account_id_idx": { + "name": "service_account_tokens_service_account_id_idx", + "columns": [ + { + "expression": "service_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "service_account_tokens_token_start_idx": { + "name": "service_account_tokens_token_start_idx", + "columns": [ + { + "expression": "token_start", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "service_account_tokens_token_hash_unique_idx": { + "name": "service_account_tokens_token_hash_unique_idx", + "columns": [ + { + "expression": "token_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "service_account_tokens_service_account_id_service_accounts_id_fk": { + "name": "service_account_tokens_service_account_id_service_accounts_id_fk", + "tableFrom": "service_account_tokens", + "tableTo": "service_accounts", + "columnsFrom": [ + "service_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.service_accounts": { + "name": "service_accounts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "disabled": { + "name": "disabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "service_accounts_organization_id_idx": { + "name": "service_accounts_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "service_accounts_organization_id_name_unique_idx": { + "name": "service_accounts_organization_id_name_unique_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "service_accounts_organization_id_organization_id_fk": { + "name": "service_accounts_organization_id_organization_id_fk", + "tableFrom": "service_accounts", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active_organization_id": { + "name": "active_organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_user_id_fk": { + "name": "session_user_id_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_token_unique": { + "name": "session_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.site_notification": { + "name": "site_notification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + } + }, + "indexes": {}, + "foreignKeys": { + "site_notification_organization_id_organization_id_fk": { + "name": "site_notification_organization_id_organization_id_fk", + "tableFrom": "site_notification", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_environment": { + "name": "skill_environment", + "schema": "", + "columns": { + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_environment_environment_id_idx": { + "name": "skill_environment_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_environment_skill_id_skills_id_fk": { + "name": "skill_environment_skill_id_skills_id_fk", + "tableFrom": "skill_environment", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_environment_environment_id_environments_id_fk": { + "name": "skill_environment_environment_id_environments_id_fk", + "tableFrom": "skill_environment", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "skill_environment_skill_id_environment_id_pk": { + "name": "skill_environment_skill_id_environment_id_pk", + "columns": [ + "skill_id", + "environment_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_files": { + "name": "skill_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "encoding": { + "name": "encoding", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'utf8'" + }, + "digest": { + "name": "digest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_files_skill_id_idx": { + "name": "skill_files_skill_id_idx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_files_skill_path_idx": { + "name": "skill_files_skill_path_idx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_files_skill_id_skills_id_fk": { + "name": "skill_files_skill_id_skills_id_fk", + "tableFrom": "skill_files", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_marketplace_credential": { + "name": "skill_marketplace_credential", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_marketplace_credential_org_user_idx": { + "name": "skill_marketplace_credential_org_user_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_marketplace_credential_organization_id_organization_id_fk": { + "name": "skill_marketplace_credential_organization_id_organization_id_fk", + "tableFrom": "skill_marketplace_credential", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_marketplace_credential_user_id_user_id_fk": { + "name": "skill_marketplace_credential_user_id_user_id_fk", + "tableFrom": "skill_marketplace_credential", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "skill_marketplace_credential_token_hash_unique": { + "name": "skill_marketplace_credential_token_hash_unique", + "nullsNotDistinct": false, + "columns": [ + "token_hash" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_marketplace_repo": { + "name": "skill_marketplace_repo", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "marketplace_name": { + "name": "marketplace_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_marketplace_repo_org_user_uidx": { + "name": "skill_marketplace_repo_org_user_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skill_marketplace_repo\".\"user_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_marketplace_repo_org_anon_uidx": { + "name": "skill_marketplace_repo_org_anon_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skill_marketplace_repo\".\"user_id\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_marketplace_repo_organization_id_organization_id_fk": { + "name": "skill_marketplace_repo_organization_id_organization_id_fk", + "tableFrom": "skill_marketplace_repo", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_marketplace_repo_user_id_user_id_fk": { + "name": "skill_marketplace_repo_user_id_user_id_fk", + "tableFrom": "skill_marketplace_repo", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_sandbox_commands": { + "name": "skill_sandbox_commands", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sandbox_id": { + "name": "sandbox_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cwd": { + "name": "cwd", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stdout": { + "name": "stdout", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "stderr": { + "name": "stderr", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "exit_code": { + "name": "exit_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "duration_ms": { + "name": "duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "timeout_seconds": { + "name": "timeout_seconds", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_sandbox_commands_sandbox_id_idx": { + "name": "skill_sandbox_commands_sandbox_id_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandbox_commands_sandbox_created_idx": { + "name": "skill_sandbox_commands_sandbox_created_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_sandbox_commands_sandbox_id_skill_sandboxes_id_fk": { + "name": "skill_sandbox_commands_sandbox_id_skill_sandboxes_id_fk", + "tableFrom": "skill_sandbox_commands", + "tableTo": "skill_sandboxes", + "columnsFrom": [ + "sandbox_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_sandbox_files": { + "name": "skill_sandbox_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sandbox_id": { + "name": "sandbox_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "original_name": { + "name": "original_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_attachment_id": { + "name": "source_attachment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_sandbox_files_sandbox_id_idx": { + "name": "skill_sandbox_files_sandbox_id_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandbox_files_sandbox_kind_idx": { + "name": "skill_sandbox_files_sandbox_kind_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandbox_files_sandbox_attachment_uidx": { + "name": "skill_sandbox_files_sandbox_attachment_uidx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_attachment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skill_sandbox_files\".\"source_attachment_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_sandbox_files_sandbox_id_skill_sandboxes_id_fk": { + "name": "skill_sandbox_files_sandbox_id_skill_sandboxes_id_fk", + "tableFrom": "skill_sandbox_files", + "tableTo": "skill_sandboxes", + "columnsFrom": [ + "sandbox_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "skill_sandbox_files_id_kind_uidx": { + "name": "skill_sandbox_files_id_kind_uidx", + "nullsNotDistinct": false, + "columns": [ + "id", + "kind" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_sandbox_replay_events": { + "name": "skill_sandbox_replay_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sandbox_id": { + "name": "sandbox_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sequence": { + "name": "sequence", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command_id": { + "name": "command_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "file_id": { + "name": "file_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "file_kind": { + "name": "file_kind", + "type": "text", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "'upload'", + "type": "stored" + } + }, + "skill_mount_id": { + "name": "skill_mount_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_sandbox_replay_events_sandbox_id_idx": { + "name": "skill_sandbox_replay_events_sandbox_id_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandbox_replay_events_sandbox_sequence_uidx": { + "name": "skill_sandbox_replay_events_sandbox_sequence_uidx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sequence", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_sandbox_replay_events_sandbox_id_skill_sandboxes_id_fk": { + "name": "skill_sandbox_replay_events_sandbox_id_skill_sandboxes_id_fk", + "tableFrom": "skill_sandbox_replay_events", + "tableTo": "skill_sandboxes", + "columnsFrom": [ + "sandbox_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_sandbox_replay_events_command_id_skill_sandbox_commands_id_fk": { + "name": "skill_sandbox_replay_events_command_id_skill_sandbox_commands_id_fk", + "tableFrom": "skill_sandbox_replay_events", + "tableTo": "skill_sandbox_commands", + "columnsFrom": [ + "command_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_sandbox_replay_events_skill_mount_id_skill_sandbox_skill_mounts_id_fk": { + "name": "skill_sandbox_replay_events_skill_mount_id_skill_sandbox_skill_mounts_id_fk", + "tableFrom": "skill_sandbox_replay_events", + "tableTo": "skill_sandbox_skill_mounts", + "columnsFrom": [ + "skill_mount_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_sandbox_replay_events_file_fk": { + "name": "skill_sandbox_replay_events_file_fk", + "tableFrom": "skill_sandbox_replay_events", + "tableTo": "skill_sandbox_files", + "columnsFrom": [ + "file_id", + "file_kind" + ], + "columnsTo": [ + "id", + "kind" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "skill_sandbox_replay_events_one_payload_chk": { + "name": "skill_sandbox_replay_events_one_payload_chk", + "value": "(\n (\"skill_sandbox_replay_events\".\"command_id\" IS NOT NULL)::int\n + (\"skill_sandbox_replay_events\".\"file_id\" IS NOT NULL)::int\n + (\"skill_sandbox_replay_events\".\"skill_mount_id\" IS NOT NULL)::int\n ) = 1" + } + }, + "isRLSEnabled": false + }, + "public.skill_sandbox_skill_mounts": { + "name": "skill_sandbox_skill_mounts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sandbox_id": { + "name": "sandbox_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_version_id": { + "name": "skill_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_name": { + "name": "skill_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_sandbox_skill_mounts_sandbox_id_idx": { + "name": "skill_sandbox_skill_mounts_sandbox_id_idx", + "columns": [ + { + "expression": "sandbox_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_sandbox_skill_mounts_sandbox_id_skill_sandboxes_id_fk": { + "name": "skill_sandbox_skill_mounts_sandbox_id_skill_sandboxes_id_fk", + "tableFrom": "skill_sandbox_skill_mounts", + "tableTo": "skill_sandboxes", + "columnsFrom": [ + "sandbox_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_sandbox_skill_mounts_skill_version_id_skill_versions_id_fk": { + "name": "skill_sandbox_skill_mounts_skill_version_id_skill_versions_id_fk", + "tableFrom": "skill_sandbox_skill_mounts", + "tableTo": "skill_versions", + "columnsFrom": [ + "skill_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "skill_sandbox_skill_mounts_sandbox_skill_uidx": { + "name": "skill_sandbox_skill_mounts_sandbox_skill_uidx", + "nullsNotDistinct": false, + "columns": [ + "sandbox_id", + "skill_id" + ] + }, + "skill_sandbox_skill_mounts_sandbox_name_uidx": { + "name": "skill_sandbox_skill_mounts_sandbox_name_uidx", + "nullsNotDistinct": false, + "columns": [ + "sandbox_id", + "skill_name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_sandboxes": { + "name": "skill_sandboxes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "app_id": { + "name": "app_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "default_cwd": { + "name": "default_cwd", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "next_replay_sequence": { + "name": "next_replay_sequence", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_sandboxes_organization_id_idx": { + "name": "skill_sandboxes_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandboxes_user_id_idx": { + "name": "skill_sandboxes_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandboxes_conversation_id_idx": { + "name": "skill_sandboxes_conversation_id_idx", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandboxes_app_id_idx": { + "name": "skill_sandboxes_app_id_idx", + "columns": [ + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandboxes_default_uidx": { + "name": "skill_sandboxes_default_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skill_sandboxes\".\"is_default\"", + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_sandboxes_app_default_uidx": { + "name": "skill_sandboxes_app_default_uidx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "app_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skill_sandboxes\".\"is_default\" AND \"skill_sandboxes\".\"app_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_sandboxes_user_id_user_id_fk": { + "name": "skill_sandboxes_user_id_user_id_fk", + "tableFrom": "skill_sandboxes", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_sandboxes_conversation_id_conversations_id_fk": { + "name": "skill_sandboxes_conversation_id_conversations_id_fk", + "tableFrom": "skill_sandboxes", + "tableTo": "conversations", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "skill_sandboxes_app_id_apps_id_fk": { + "name": "skill_sandboxes_app_id_apps_id_fk", + "tableFrom": "skill_sandboxes", + "tableTo": "apps", + "columnsFrom": [ + "app_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_share_link_plugins": { + "name": "skill_share_link_plugins", + "schema": "", + "columns": { + "share_link_id": { + "name": "share_link_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "plugin_id": { + "name": "plugin_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_share_link_plugins_plugin_id_idx": { + "name": "skill_share_link_plugins_plugin_id_idx", + "columns": [ + { + "expression": "plugin_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_share_link_plugins_share_link_id_skill_share_link_id_fk": { + "name": "skill_share_link_plugins_share_link_id_skill_share_link_id_fk", + "tableFrom": "skill_share_link_plugins", + "tableTo": "skill_share_link", + "columnsFrom": [ + "share_link_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_share_link_plugins_plugin_id_plugins_id_fk": { + "name": "skill_share_link_plugins_plugin_id_plugins_id_fk", + "tableFrom": "skill_share_link_plugins", + "tableTo": "plugins", + "columnsFrom": [ + "plugin_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "skill_share_link_plugins_share_link_id_plugin_id_pk": { + "name": "skill_share_link_plugins_share_link_id_plugin_id_pk", + "columns": [ + "share_link_id", + "plugin_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_share_link_revision": { + "name": "skill_share_link_revision", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "link_id": { + "name": "link_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "repo_id": { + "name": "repo_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "sequence": { + "name": "sequence", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "commit_sha": { + "name": "commit_sha", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_sha": { + "name": "parent_sha", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "skill_share_link_revision_link_seq_idx": { + "name": "skill_share_link_revision_link_seq_idx", + "columns": [ + { + "expression": "link_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sequence", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_share_link_revision_link_id_idx": { + "name": "skill_share_link_revision_link_id_idx", + "columns": [ + { + "expression": "link_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_share_link_revision_repo_seq_idx": { + "name": "skill_share_link_revision_repo_seq_idx", + "columns": [ + { + "expression": "repo_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sequence", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_share_link_revision_repo_id_idx": { + "name": "skill_share_link_revision_repo_id_idx", + "columns": [ + { + "expression": "repo_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_share_link_revision_link_id_skill_share_link_id_fk": { + "name": "skill_share_link_revision_link_id_skill_share_link_id_fk", + "tableFrom": "skill_share_link_revision", + "tableTo": "skill_share_link", + "columnsFrom": [ + "link_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_share_link_revision_repo_id_skill_marketplace_repo_id_fk": { + "name": "skill_share_link_revision_repo_id_skill_marketplace_repo_id_fk", + "tableFrom": "skill_share_link_revision", + "tableTo": "skill_marketplace_repo", + "columnsFrom": [ + "repo_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "skill_share_link_revision_owner_check": { + "name": "skill_share_link_revision_owner_check", + "value": "(\"skill_share_link_revision\".\"link_id\" IS NULL) != (\"skill_share_link_revision\".\"repo_id\" IS NULL)" + } + }, + "isRLSEnabled": false + }, + "public.skill_share_link_skill": { + "name": "skill_share_link_skill", + "schema": "", + "columns": { + "share_link_id": { + "name": "share_link_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_share_link_skill_skill_id_idx": { + "name": "skill_share_link_skill_skill_id_idx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_share_link_skill_share_link_id_skill_share_link_id_fk": { + "name": "skill_share_link_skill_share_link_id_skill_share_link_id_fk", + "tableFrom": "skill_share_link_skill", + "tableTo": "skill_share_link", + "columnsFrom": [ + "share_link_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_share_link_skill_skill_id_skills_id_fk": { + "name": "skill_share_link_skill_skill_id_skills_id_fk", + "tableFrom": "skill_share_link_skill", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "skill_share_link_skill_share_link_id_skill_id_pk": { + "name": "skill_share_link_skill_share_link_id_skill_id_pk", + "columns": [ + "share_link_id", + "skill_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_share_link": { + "name": "skill_share_link", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "varchar(22)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "marketplace_name": { + "name": "marketplace_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "plugin_client_type": { + "name": "plugin_client_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plugin_platform": { + "name": "plugin_platform", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_share_link_token_hash_idx": { + "name": "skill_share_link_token_hash_idx", + "columns": [ + { + "expression": "token_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_share_link_org_id_idx": { + "name": "skill_share_link_org_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_share_link_token_start_idx": { + "name": "skill_share_link_token_start_idx", + "columns": [ + { + "expression": "token_start", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_share_link_organization_id_organization_id_fk": { + "name": "skill_share_link_organization_id_organization_id_fk", + "tableFrom": "skill_share_link", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_share_link_created_by_user_id_user_id_fk": { + "name": "skill_share_link_created_by_user_id_user_id_fk", + "tableFrom": "skill_share_link", + "tableTo": "user", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_team": { + "name": "skill_team", + "schema": "", + "columns": { + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "skill_team_skill_id_skills_id_fk": { + "name": "skill_team_skill_id_skills_id_fk", + "tableFrom": "skill_team", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_team_team_id_team_id_fk": { + "name": "skill_team_team_id_team_id_fk", + "tableFrom": "skill_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "skill_team_skill_id_team_id_pk": { + "name": "skill_team_skill_id_team_id_pk", + "columns": [ + "skill_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_usage_events": { + "name": "skill_usage_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "session_id": { + "name": "session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "context_tokens": { + "name": "context_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_usage_events_skill_created_idx": { + "name": "skill_usage_events_skill_created_idx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_usage_events_skill_id_skills_id_fk": { + "name": "skill_usage_events_skill_id_skills_id_fk", + "tableFrom": "skill_usage_events", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_user": { + "name": "skill_user", + "schema": "", + "columns": { + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'use'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "skill_user_skill_id_skills_id_fk": { + "name": "skill_user_skill_id_skills_id_fk", + "tableFrom": "skill_user", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_user_user_id_user_id_fk": { + "name": "skill_user_user_id_user_id_fk", + "tableFrom": "skill_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "skill_user_skill_id_user_id_pk": { + "name": "skill_user_skill_id_user_id_pk", + "columns": [ + "skill_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "skill_user_level_check": { + "name": "skill_user_level_check", + "value": "\n \"skill_user\".\"level\" in ('use', 'write')" + } + }, + "isRLSEnabled": false + }, + "public.skill_version_files": { + "name": "skill_version_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "version_id": { + "name": "version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "encoding": { + "name": "encoding", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_version_files_version_id_idx": { + "name": "skill_version_files_version_id_idx", + "columns": [ + { + "expression": "version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_version_files_version_path_uidx": { + "name": "skill_version_files_version_path_uidx", + "columns": [ + { + "expression": "version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_version_files_version_id_skill_versions_id_fk": { + "name": "skill_version_files_version_id_skill_versions_id_fk", + "tableFrom": "skill_version_files", + "tableTo": "skill_versions", + "columnsFrom": [ + "version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill_versions": { + "name": "skill_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "skill_id": { + "name": "skill_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_commit": { + "name": "source_commit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_versions_skill_id_idx": { + "name": "skill_versions_skill_id_idx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skill_versions_skill_version_uidx": { + "name": "skill_versions_skill_version_uidx", + "columns": [ + { + "expression": "skill_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "version", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_versions_skill_id_skills_id_fk": { + "name": "skill_versions_skill_id_skills_id_fk", + "tableFrom": "skill_versions", + "tableTo": "skills", + "columnsFrom": [ + "skill_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skills": { + "name": "skills", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'personal'" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "frontmatter_blob": { + "name": "frontmatter_blob", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "digest": { + "name": "digest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "latest_version": { + "name": "latest_version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "license": { + "name": "license", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "compatibility": { + "name": "compatibility", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "allowed_tools": { + "name": "allowed_tools", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "agent_name": { + "name": "agent_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "templated": { + "name": "templated", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "source_type": { + "name": "source_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'manual'" + }, + "source_ref": { + "name": "source_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_commit": { + "name": "source_commit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_sync_interval": { + "name": "github_sync_interval", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_sync_ref": { + "name": "github_sync_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_app_config_id": { + "name": "github_app_config_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "github_pat_id": { + "name": "github_pat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_sync_error": { + "name": "last_sync_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "usage_count": { + "name": "usage_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "skills_organization_id_idx": { + "name": "skills_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skills_scope_idx": { + "name": "skills_scope_idx", + "columns": [ + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "skills_github_sync_due_idx": { + "name": "skills_github_sync_due_idx", + "columns": [ + { + "expression": "last_synced_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"skills\".\"github_sync_interval\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "skills_org_personal_name_idx": { + "name": "skills_org_personal_name_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skills\".\"scope\" = 'personal' AND \"skills\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "skills_org_shared_name_idx": { + "name": "skills_org_shared_name_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"skills\".\"scope\" in ('team', 'org') AND \"skills\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skills_author_id_user_id_fk": { + "name": "skills_author_id_user_id_fk", + "tableFrom": "skills", + "tableTo": "user", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "skills_github_app_config_id_github_app_configs_id_fk": { + "name": "skills_github_app_config_id_github_app_configs_id_fk", + "tableFrom": "skills", + "tableTo": "github_app_configs", + "columnsFrom": [ + "github_app_config_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "skills_github_pat_id_github_pats_id_fk": { + "name": "skills_github_pat_id_github_pats_id_fk", + "tableFrom": "skills", + "tableTo": "github_pats", + "columnsFrom": [ + "github_pat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tasks": { + "name": "tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "task_type": { + "name": "task_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "max_attempts": { + "name": "max_attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "scheduled_for": { + "name": "scheduled_for", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "heartbeat_at": { + "name": "heartbeat_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "periodic": { + "name": "periodic", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "tasks_dequeue_idx": { + "name": "tasks_dequeue_idx", + "columns": [ + { + "expression": "task_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scheduled_for", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_unique_periodic_idx": { + "name": "tasks_unique_periodic_idx", + "columns": [ + { + "expression": "task_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"tasks\".\"periodic\" = true AND \"tasks\".\"status\" IN ('pending', 'processing')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_batch_embedding_connector_run_idx": { + "name": "tasks_batch_embedding_connector_run_idx", + "columns": [ + { + "expression": "(\"payload\" ->> 'connectorRunId')", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"tasks\".\"task_type\" = 'batch_embedding' AND \"tasks\".\"status\" IN ('pending', 'processing')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_plugin_github_sync_single_flight_idx": { + "name": "tasks_plugin_github_sync_single_flight_idx", + "columns": [ + { + "expression": "(\"payload\" ->> 'pluginId')", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"tasks\".\"task_type\" = 'plugin_github_sync' AND \"tasks\".\"status\" IN ('pending', 'processing')", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team_external_group": { + "name": "team_external_group", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "group_identifier": { + "name": "group_identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "team_external_group_team_id_team_id_fk": { + "name": "team_external_group_team_id_team_id_fk", + "tableFrom": "team_external_group", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "team_external_group_team_group_unique": { + "name": "team_external_group_team_group_unique", + "nullsNotDistinct": false, + "columns": [ + "team_id", + "group_identifier" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team_labels": { + "name": "team_labels", + "schema": "", + "columns": { + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "value_id": { + "name": "value_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "team_labels_team_id_team_id_fk": { + "name": "team_labels_team_id_team_id_fk", + "tableFrom": "team_labels", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_labels_key_id_label_keys_id_fk": { + "name": "team_labels_key_id_label_keys_id_fk", + "tableFrom": "team_labels", + "tableTo": "label_keys", + "columnsFrom": [ + "key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_labels_value_id_label_values_id_fk": { + "name": "team_labels_value_id_label_values_id_fk", + "tableFrom": "team_labels", + "tableTo": "label_values", + "columnsFrom": [ + "value_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "team_labels_team_id_key_id_pk": { + "name": "team_labels_team_id_key_id_pk", + "columns": [ + "team_id", + "key_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team_member": { + "name": "team_member", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "synced_from_sso": { + "name": "synced_from_sso", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "team_member_team_id_user_id_unique_idx": { + "name": "team_member_team_id_user_id_unique_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "team_member_team_id_user_id_idx": { + "name": "team_member_team_id_user_id_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "team_member_user_id_team_id_idx": { + "name": "team_member_user_id_team_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "team_member_team_id_team_id_fk": { + "name": "team_member_team_id_team_id_fk", + "tableFrom": "team_member", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_member_user_id_user_id_fk": { + "name": "team_member_user_id_user_id_fk", + "tableFrom": "team_member", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team_token": { + "name": "team_token", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_organization_token": { + "name": "is_organization_token", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "name": { + "name": "name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_team_token_org_id": { + "name": "idx_team_token_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_team_token_team_id": { + "name": "idx_team_token_team_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_team_token_token_start": { + "name": "idx_team_token_token_start", + "columns": [ + { + "expression": "token_start", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "team_token_organization_id_organization_id_fk": { + "name": "team_token_organization_id_organization_id_fk", + "tableFrom": "team_token", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_token_team_id_team_id_fk": { + "name": "team_token_team_id_team_id_fk", + "tableFrom": "team_token", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_token_secret_id_secret_id_fk": { + "name": "team_token_secret_id_secret_id_fk", + "tableFrom": "team_token", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "team_token_organization_id_team_id_unique": { + "name": "team_token_organization_id_team_id_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "team_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team_vault_folder": { + "name": "team_vault_folder", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "vault_path": { + "name": "vault_path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "team_vault_folder_team_id_team_id_fk": { + "name": "team_vault_folder_team_id_team_id_fk", + "tableFrom": "team_vault_folder", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "team_vault_folder_team_id_unique": { + "name": "team_vault_folder_team_id_unique", + "nullsNotDistinct": false, + "columns": [ + "team_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team": { + "name": "team", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "convert_tool_results_to_toon": { + "name": "convert_tool_results_to_toon", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "team_organization_id_organization_id_fk": { + "name": "team_organization_id_organization_id_fk", + "tableFrom": "team", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_created_by_user_id_fk": { + "name": "team_created_by_user_id_fk", + "tableFrom": "team", + "tableTo": "user", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tool_invocation_policies": { + "name": "tool_invocation_policies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "conditions": { + "name": "conditions", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "tool_invocation_policies_tool_id_tools_id_fk": { + "name": "tool_invocation_policies_tool_id_tools_id_fk", + "tableFrom": "tool_invocation_policies", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tool_observations": { + "name": "tool_observations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_agent_id": { + "name": "external_agent_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "tool_observations_user_client_idx": { + "name": "tool_observations_user_client_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tool_observations_tool_id_tools_id_fk": { + "name": "tool_observations_tool_id_tools_id_fk", + "tableFrom": "tool_observations", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tool_observations_user_id_user_id_fk": { + "name": "tool_observations_user_id_user_id_fk", + "tableFrom": "tool_observations", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tool_observations_tool_id_user_id_external_agent_id_unique": { + "name": "tool_observations_tool_id_user_id_external_agent_id_unique", + "nullsNotDistinct": false, + "columns": [ + "tool_id", + "user_id", + "external_agent_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tools": { + "name": "tools", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "catalog_id": { + "name": "catalog_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "delegate_to_agent_id": { + "name": "delegate_to_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "raw_name": { + "name": "raw_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parameters": { + "name": "parameters", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meta": { + "name": "meta", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "cloned_pending_discovery": { + "name": "cloned_pending_discovery", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "policies_auto_configured_at": { + "name": "policies_auto_configured_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "policies_auto_configuring_started_at": { + "name": "policies_auto_configuring_started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "policies_auto_configured_reasoning": { + "name": "policies_auto_configured_reasoning", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "policies_auto_configured_model": { + "name": "policies_auto_configured_model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tools_archestra_catalog_name_uidx": { + "name": "tools_archestra_catalog_name_uidx", + "columns": [ + { + "expression": "catalog_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"tools\".\"catalog_id\" = '00000000-0000-4000-8000-000000000001' and \"tools\".\"agent_id\" is null and \"tools\".\"delegate_to_agent_id\" is null and \"tools\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "tools_delegate_to_agent_id_idx": { + "name": "tools_delegate_to_agent_id_idx", + "columns": [ + { + "expression": "delegate_to_agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tools_cloned_pending_discovery_idx": { + "name": "tools_cloned_pending_discovery_idx", + "columns": [ + { + "expression": "cloned_pending_discovery", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tools_deleted_at_idx": { + "name": "tools_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tools_agent_id_agents_id_fk": { + "name": "tools_agent_id_agents_id_fk", + "tableFrom": "tools", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tools_catalog_id_internal_mcp_catalog_id_fk": { + "name": "tools_catalog_id_internal_mcp_catalog_id_fk", + "tableFrom": "tools", + "tableTo": "internal_mcp_catalog", + "columnsFrom": [ + "catalog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tools_delegate_to_agent_id_agents_id_fk": { + "name": "tools_delegate_to_agent_id_agents_id_fk", + "tableFrom": "tools", + "tableTo": "agents", + "columnsFrom": [ + "delegate_to_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tools_catalog_id_name_agent_id_delegate_to_agent_id_unique": { + "name": "tools_catalog_id_name_agent_id_delegate_to_agent_id_unique", + "nullsNotDistinct": false, + "columns": [ + "catalog_id", + "name", + "agent_id", + "delegate_to_agent_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.trusted_data_policies": { + "name": "trusted_data_policies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tool_id": { + "name": "tool_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "conditions": { + "name": "conditions", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'mark_as_trusted'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "trusted_data_policies_tool_id_tools_id_fk": { + "name": "trusted_data_policies_tool_id_tools_id_fk", + "tableFrom": "trusted_data_policies", + "tableTo": "tools", + "columnsFrom": [ + "tool_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.two_factor": { + "name": "two_factor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "backup_codes": { + "name": "backup_codes", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "verified": { + "name": "verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "failed_verification_count": { + "name": "failed_verification_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "locked_until": { + "name": "locked_until", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "two_factor_user_id_user_id_fk": { + "name": "two_factor_user_id_user_id_fk", + "tableFrom": "two_factor", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_onboarding_seen_items": { + "name": "user_onboarding_seen_items", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "item": { + "name": "item", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "seen_at": { + "name": "seen_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "user_onboarding_seen_items_user_id_user_id_fk": { + "name": "user_onboarding_seen_items_user_id_user_id_fk", + "tableFrom": "user_onboarding_seen_items", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "user_onboarding_seen_items_user_id_item_pk": { + "name": "user_onboarding_seen_items_user_id_item_pk", + "columns": [ + "user_id", + "item" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_token": { + "name": "user_token", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_user_token_org_id": { + "name": "idx_user_token_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_user_token_user_id": { + "name": "idx_user_token_user_id", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_user_token_token_start": { + "name": "idx_user_token_token_start", + "columns": [ + { + "expression": "token_start", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_token_organization_id_organization_id_fk": { + "name": "user_token_organization_id_organization_id_fk", + "tableFrom": "user_token", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_token_user_id_user_id_fk": { + "name": "user_token_user_id_user_id_fk", + "tableFrom": "user_token", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_token_secret_id_secret_id_fk": { + "name": "user_token_secret_id_secret_id_fk", + "tableFrom": "user_token", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_token_organization_id_user_id_unique": { + "name": "user_token_organization_id_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "user_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "banned": { + "name": "banned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "ban_reason": { + "name": "ban_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ban_expires": { + "name": "ban_expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "two_factor_enabled": { + "name": "two_factor_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_email_unique": { + "name": "user_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.virtual_api_key_llm_proxy": { + "name": "virtual_api_key_llm_proxy", + "schema": "", + "columns": { + "virtual_api_key_id": { + "name": "virtual_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "llm_proxy_id": { + "name": "llm_proxy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_virtual_api_key_llm_proxy_llm_proxy_id": { + "name": "idx_virtual_api_key_llm_proxy_llm_proxy_id", + "columns": [ + { + "expression": "llm_proxy_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "virtual_api_key_llm_proxy_virtual_api_key_id_virtual_api_keys_id_fk": { + "name": "virtual_api_key_llm_proxy_virtual_api_key_id_virtual_api_keys_id_fk", + "tableFrom": "virtual_api_key_llm_proxy", + "tableTo": "virtual_api_keys", + "columnsFrom": [ + "virtual_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "virtual_api_key_llm_proxy_llm_proxy_id_agents_id_fk": { + "name": "virtual_api_key_llm_proxy_llm_proxy_id_agents_id_fk", + "tableFrom": "virtual_api_key_llm_proxy", + "tableTo": "agents", + "columnsFrom": [ + "llm_proxy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "virtual_api_key_llm_proxy_virtual_api_key_id_llm_proxy_id_pk": { + "name": "virtual_api_key_llm_proxy_virtual_api_key_id_llm_proxy_id_pk", + "columns": [ + "virtual_api_key_id", + "llm_proxy_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.virtual_api_key_provider_api_key": { + "name": "virtual_api_key_provider_api_key", + "schema": "", + "columns": { + "virtual_api_key_id": { + "name": "virtual_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_api_key_id": { + "name": "provider_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_virtual_api_key_provider_api_key_id": { + "name": "idx_virtual_api_key_provider_api_key_id", + "columns": [ + { + "expression": "provider_api_key_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "virtual_api_key_provider_api_key_virtual_api_key_id_virtual_api_keys_id_fk": { + "name": "virtual_api_key_provider_api_key_virtual_api_key_id_virtual_api_keys_id_fk", + "tableFrom": "virtual_api_key_provider_api_key", + "tableTo": "virtual_api_keys", + "columnsFrom": [ + "virtual_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "virtual_api_key_provider_api_key_provider_api_key_id_chat_api_keys_id_fk": { + "name": "virtual_api_key_provider_api_key_provider_api_key_id_chat_api_keys_id_fk", + "tableFrom": "virtual_api_key_provider_api_key", + "tableTo": "chat_api_keys", + "columnsFrom": [ + "provider_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "virtual_api_key_provider_api_key_virtual_api_key_id_provider_pk": { + "name": "virtual_api_key_provider_api_key_virtual_api_key_id_provider_pk", + "columns": [ + "virtual_api_key_id", + "provider" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.virtual_api_key_team": { + "name": "virtual_api_key_team", + "schema": "", + "columns": { + "virtual_api_key_id": { + "name": "virtual_api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_virtual_api_key_team_team_id": { + "name": "idx_virtual_api_key_team_team_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "virtual_api_key_team_virtual_api_key_id_virtual_api_keys_id_fk": { + "name": "virtual_api_key_team_virtual_api_key_id_virtual_api_keys_id_fk", + "tableFrom": "virtual_api_key_team", + "tableTo": "virtual_api_keys", + "columnsFrom": [ + "virtual_api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "virtual_api_key_team_team_id_team_id_fk": { + "name": "virtual_api_key_team_team_id_team_id_fk", + "tableFrom": "virtual_api_key_team", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "virtual_api_key_team_virtual_api_key_id_team_id_pk": { + "name": "virtual_api_key_team_virtual_api_key_id_team_id_pk", + "columns": [ + "virtual_api_key_id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.virtual_api_keys": { + "name": "virtual_api_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "key_type": { + "name": "key_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'standard'" + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "token_start": { + "name": "token_start", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'org'" + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_virtual_api_key_organization_id": { + "name": "idx_virtual_api_key_organization_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_virtual_api_key_token_start": { + "name": "idx_virtual_api_key_token_start", + "columns": [ + { + "expression": "token_start", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_virtual_api_key_scope": { + "name": "idx_virtual_api_key_scope", + "columns": [ + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_virtual_api_key_author_id": { + "name": "idx_virtual_api_key_author_id", + "columns": [ + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "virtual_api_keys_secret_id_secret_id_fk": { + "name": "virtual_api_keys_secret_id_secret_id_fk", + "tableFrom": "virtual_api_keys", + "tableTo": "secret", + "columnsFrom": [ + "secret_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "virtual_api_keys_author_id_user_id_fk": { + "name": "virtual_api_keys_author_id_user_id_fk", + "tableFrom": "virtual_api_keys", + "tableTo": "user", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.conversation_share_visibility": { + "name": "conversation_share_visibility", + "schema": "public", + "values": [ + "organization", + "team", + "user" + ] + }, + "public.mcp_catalog_scope": { + "name": "mcp_catalog_scope", + "schema": "public", + "values": [ + "personal", + "team", + "org" + ] + }, + "public.oauth_refresh_error_enum": { + "name": "oauth_refresh_error_enum", + "schema": "public", + "values": [ + "refresh_failed", + "no_refresh_token" + ] + }, + "public.project_share_visibility": { + "name": "project_share_visibility", + "schema": "public", + "values": [ + "organization", + "team", + "user" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/platform/backend/src/database/migrations/meta/_journal.json b/platform/backend/src/database/migrations/meta/_journal.json index cdd488c9ae..1d523ef5e7 100644 --- a/platform/backend/src/database/migrations/meta/_journal.json +++ b/platform/backend/src/database/migrations/meta/_journal.json @@ -3081,6 +3081,13 @@ "when": 1787788381995, "tag": "0439_harsh_matthew_murdock", "breakpoints": true + }, + { + "idx": 440, + "version": "7", + "when": 1787840395780, + "tag": "0440_chilly_bulldozer", + "breakpoints": true } ] } \ No newline at end of file diff --git a/platform/backend/src/database/schemas/app.ts b/platform/backend/src/database/schemas/app.ts index 1ff553e9ff..05ddc4ba41 100644 --- a/platform/backend/src/database/schemas/app.ts +++ b/platform/backend/src/database/schemas/app.ts @@ -82,6 +82,17 @@ const appsTable = softDeletablePgTable( * the backing catalog and answers *who* the audience is once enabled). */ enabled: boolean("enabled").notNull().default(true), + /** + * Whether the app opens filling its host surface rather than sitting inline + * next to the conversation. A display default only: the runtime's display + * mode stays a live, per-view toggle (the host's fullscreen control and the + * app's own `ui/request-display-mode`), so this seeds the first render of a + * surface that hosts an app alongside other content and nothing else. Apps + * whose UI is the whole point — a dashboard opened to be looked at, not + * talked to — set it so the chat around them doesn't have to be dismissed + * by hand on every open. + */ + openInFullscreen: boolean("open_in_fullscreen").notNull().default(false), /** * Whether the app is locked against modification. A locked app refuses * every agent-driven mutation (html edits, spec, tools, delete) until diff --git a/platform/backend/src/models/app.ts b/platform/backend/src/models/app.ts index c0e0898bb1..2260f86cd8 100644 --- a/platform/backend/src/models/app.ts +++ b/platform/backend/src/models/app.ts @@ -590,6 +590,7 @@ class AppModel { | "spec" | "environmentId" | "icon" + | "openInFullscreen" > >; version?: VersionPayload; @@ -604,13 +605,18 @@ class AppModel { const patch = params.patch ?? {}; // App-row columns only; scope/environmentId/icon are owned by the backing catalog. const appRowPatch: Partial< - Pick + Pick< + AppRow, + "name" | "slug" | "description" | "spec" | "openInFullscreen" + > > = {}; if (patch.name !== undefined) appRowPatch.name = patch.name; if (patch.slug !== undefined) appRowPatch.slug = patch.slug; if (patch.description !== undefined) appRowPatch.description = patch.description; if (patch.spec !== undefined) appRowPatch.spec = patch.spec; + if (patch.openInFullscreen !== undefined) + appRowPatch.openInFullscreen = patch.openInFullscreen; const ok = await withDbTransaction(async (tx) => { let app: AppRow | undefined; diff --git a/platform/backend/src/routes/app/app.routes.ts b/platform/backend/src/routes/app/app.routes.ts index 029073daa0..ddfae63132 100644 --- a/platform/backend/src/routes/app/app.routes.ts +++ b/platform/backend/src/routes/app/app.routes.ts @@ -954,7 +954,13 @@ const appRoutes: FastifyPluginAsyncZod = async (fastify) => { const patch: Partial< Pick< App, - "name" | "slug" | "description" | "scope" | "environmentId" | "icon" + | "name" + | "slug" + | "description" + | "scope" + | "environmentId" + | "icon" + | "openInFullscreen" > > = {}; if (body.name !== undefined) patch.name = body.name; @@ -964,6 +970,8 @@ const appRoutes: FastifyPluginAsyncZod = async (fastify) => { if (body.environmentId !== undefined) patch.environmentId = body.environmentId; if (body.icon !== undefined) patch.icon = body.icon; + if (body.openInFullscreen !== undefined) + patch.openInFullscreen = body.openInFullscreen; // Permissions ride the version envelope; an html-bearing edit inherits // the current head's value when the caller omits it. diff --git a/platform/backend/src/routes/app/update.app.route.test.ts b/platform/backend/src/routes/app/update.app.route.test.ts index 887302985c..375fc9f143 100644 --- a/platform/backend/src/routes/app/update.app.route.test.ts +++ b/platform/backend/src/routes/app/update.app.route.test.ts @@ -66,6 +66,41 @@ describe("PATCH /api/apps/:appId", () => { }); }); + test("toggles the fullscreen-by-default display preference", async ({ + makeApp, + }) => { + const created = await makeApp({ organizationId, scope: "org" }); + expect(created.openInFullscreen).toBe(false); + + const enabled = await app.inject({ + method: "PATCH", + url: `/api/apps/${created.id}`, + payload: { openInFullscreen: true }, + }); + expect(enabled.statusCode).toBe(200); + expect(enabled.json().openInFullscreen).toBe(true); + expect( + mustExist(await AppModel.findById(created.id)).openInFullscreen, + ).toBe(true); + + // An unrelated edit must not silently reset the preference. + const renamed = await app.inject({ + method: "PATCH", + url: `/api/apps/${created.id}`, + payload: { name: "Still fullscreen" }, + }); + expect(renamed.statusCode).toBe(200); + expect(renamed.json().openInFullscreen).toBe(true); + + const disabled = await app.inject({ + method: "PATCH", + url: `/api/apps/${created.id}`, + payload: { openInFullscreen: false }, + }); + expect(disabled.statusCode).toBe(200); + expect(disabled.json().openInFullscreen).toBe(false); + }); + test("sets and clears the icon, storing it on the app's backing catalog", async ({ makeApp, }) => { diff --git a/platform/backend/src/types/app.ts b/platform/backend/src/types/app.ts index 3b12509bd2..e5e1bc568f 100644 --- a/platform/backend/src/types/app.ts +++ b/platform/backend/src/types/app.ts @@ -434,6 +434,9 @@ export const UpdateAppSchema = z.object({ // Replace the app's labels with this set. Omitted leaves them unchanged; an // empty array clears them. labels: z.array(AgentLabelWithDetailsSchema).optional(), + // Seed the app's first render at fullscreen instead of inline. A display + // default only — the host's fullscreen control still toggles it per view. + openInFullscreen: z.boolean().optional(), }); export type { AppSpec } from "./app-spec"; diff --git a/platform/e2e-tests/tests/apps.spec.ts b/platform/e2e-tests/tests/apps.spec.ts index 30e7b5cfe0..1c277bd402 100644 --- a/platform/e2e-tests/tests/apps.spec.ts +++ b/platform/e2e-tests/tests/apps.spec.ts @@ -116,6 +116,93 @@ test("create an app from a template and run it standalone", async ({ } }); +// Opens as a chat with the app already mounted, and asserts two things the app +// itself has no say in: that the host put it in fullscreen because that is the +// app's saved default (nothing here calls `ui/request-display-mode`), and that +// fullscreen leaves the sidebar on screen — hiding the navigation is the +// sidebar's own collapse control to do. +const FULLSCREEN_PROBE_HTML = ` + +e2e fullscreen probe + +

loading…

+ + +`; + +test("an app whose default is fullscreen opens filling the page, with the sidebar still there", async ({ + page, + request, + makeApiRequest, +}) => { + const name = `e2e-fullscreen-app-${Date.now()}`; + const createRes = await makeApiRequest({ + request, + method: "post", + urlSuffix: "/api/apps", + data: { name, scope: "personal" }, + }); + const app = (await createRes.json()) as { id: string }; + + try { + const patchRes = await makeApiRequest({ + request, + method: "patch", + urlSuffix: `/api/apps/${app.id}`, + data: { html: FULLSCREEN_PROBE_HTML, openInFullscreen: true }, + }); + expect(patchRes.ok()).toBeTruthy(); + expect((await patchRes.json()).openInFullscreen).toBe(true); + + const openRes = await makeApiRequest({ + request, + method: "post", + urlSuffix: `/api/apps/${app.id}/open-in-chat`, + }); + const { conversationId } = (await openRes.json()) as { + conversationId: string; + }; + await goToPage(page, `/chat/${conversationId}`); + + // Fullscreen without the app asking for it: only the saved default and the + // host's own control can produce this. + const exitFullscreen = page.getByRole("button", { + name: "Exit fullscreen", + }); + await expect(exitFullscreen).toBeVisible({ timeout: 30_000 }); + + // The sidebar is untouched, and the app starts where the sidebar ends + // rather than covering it. + const sidebar = page.locator('[data-slot="sidebar-container"]').first(); + await expect(sidebar).toBeVisible(); + const sidebarBox = await sidebar.boundingBox(); + const appBox = await page.locator("iframe").first().boundingBox(); + expect(sidebarBox).not.toBeNull(); + expect(appBox).not.toBeNull(); + expect(appBox?.x).toBeGreaterThanOrEqual( + (sidebarBox?.x ?? 0) + (sidebarBox?.width ?? 0), + ); + + // Leaving fullscreen is the viewer's to keep: the default must not snap it + // back the moment they exit. + await exitFullscreen.click(); + await expect( + page.getByRole("button", { name: "Enter fullscreen" }), + ).toBeVisible(); + } finally { + await makeApiRequest({ + request, + method: "delete", + urlSuffix: `/api/apps/${app.id}`, + ignoreStatusCheck: true, + }); + } +}); + // Two `hidden` elements, both with a display override. `#reset-hides` uses an // ordinary rule the injected base sheet's `[hidden]` reset must still beat; // `#stuck-visible` fights back with `!important` and stays painted — the footgun diff --git a/platform/frontend/src/app/_parts/app-shell.tsx b/platform/frontend/src/app/_parts/app-shell.tsx index 6fe2079018..40cfa5b1a5 100644 --- a/platform/frontend/src/app/_parts/app-shell.tsx +++ b/platform/frontend/src/app/_parts/app-shell.tsx @@ -22,6 +22,7 @@ import { } from "@/components/ui/sidebar"; import { Toaster } from "@/components/ui/sonner"; import { Version } from "@/components/version"; +import { MAIN_CONTENT_ID } from "@/lib/app-shell-region"; import { useHasPermissions, useSession } from "@/lib/auth/auth.query"; import { ConnectivityProvider, @@ -49,11 +50,6 @@ const SITE_NOTIFICATION_READ_PERMISSION: Permissions = { siteNotification: ["read"], }; -// Target for the "skip to main content" link (WCAG 2.4.1 Bypass Blocks). The -//
element carries this id and tabIndex={-1} so activating the link moves -// keyboard focus past the sidebar navigation and into the page content. -const MAIN_CONTENT_ID = "main-content"; - interface AppShellProps { children: React.ReactNode; } @@ -187,6 +183,12 @@ export function AppShell({ children }: AppShellProps) { + {/* MAIN_CONTENT_ID + tabIndex={-1} make this the "skip to main + content" target (WCAG 2.4.1 Bypass Blocks), so activating that + link moves keyboard focus past the sidebar navigation and into + the page. A fullscreen MCP App sizes itself to the same element + (see McpAppCard), which is why the id is shared rather than + spelled twice. */}
{ + mockUseApp.mockReturnValue({ data: undefined } as ReturnType); +}); + // ── Helpers ────────────────────────────────────────────────────────────────── const defaultProps = { @@ -306,6 +313,77 @@ describe("McpAppSection", () => { expect(screen.getByText("Renamed Dashboard")).toBeInTheDocument(); expect(screen.queryByText("Stale Dashboard")).not.toBeInTheDocument(); }); + + it("offers the host's own way into fullscreen, without the app asking for it", async () => { + // The bridge is stubbed, so nothing here ever calls + // `ui/request-display-mode` — which is exactly the case that used to leave + // an app with no way to fill the surface. + await act(async () => { + render( + , + ); + }); + + await userEvent.click( + screen.getByRole("button", { name: "Enter fullscreen" }), + ); + + expect( + screen.getByRole("button", { name: "Exit fullscreen" }), + ).toBeInTheDocument(); + }); + + it("opens an app straight into fullscreen when that is its saved default", async () => { + mockUseApp.mockReturnValue({ + data: { name: "Ops Board", openInFullscreen: true }, + } as ReturnType); + + await act(async () => { + render( + , + ); + }); + + expect( + screen.getByRole("button", { name: "Exit fullscreen" }), + ).toBeInTheDocument(); + }); + + it("does not re-enter fullscreen after the viewer leaves it", async () => { + mockUseApp.mockReturnValue({ + data: { name: "Ops Board", openInFullscreen: true }, + } as ReturnType); + + await act(async () => { + render( + , + ); + }); + + await userEvent.click( + screen.getByRole("button", { name: "Exit fullscreen" }), + ); + + // The default seeds the first render only; re-applying it here would trap + // the viewer in fullscreen. + expect( + screen.getByRole("button", { name: "Enter fullscreen" }), + ).toBeInTheDocument(); + }); }); describe("McpAppContainer (via McpAppSection)", () => { diff --git a/platform/frontend/src/components/chat/mcp-app-container.tsx b/platform/frontend/src/components/chat/mcp-app-container.tsx index 3f3583e070..742e51090d 100644 --- a/platform/frontend/src/components/chat/mcp-app-container.tsx +++ b/platform/frontend/src/components/chat/mcp-app-container.tsx @@ -6,6 +6,7 @@ import { useCallback, useEffect, useMemo, + useRef, useState, useSyncExternalStore, } from "react"; @@ -17,7 +18,7 @@ import { INITIAL_INLINE_HEIGHT } from "@/components/mcp-app/app-height"; import { AppSettingsDialog } from "@/components/mcp-app/app-settings-dialog"; import { McpAppCard } from "@/components/mcp-app/mcp-app-card"; import { - McpAppFullscreenExitButton, + McpAppFullscreenButton, McpAppPill, McpAppRefreshButton, McpAppSettingsButton, @@ -380,11 +381,27 @@ export function McpAppEntryContent({ const handleShowInPanel = () => { if (!toolCallId) return; - setDisplayMode("inline"); // panel is the app's frame — never fullscreen there + // Hand the app over inline: the panel instance owns its own display mode + // from here (including the app's fullscreen default), so leaving this one + // fullscreen would only strand an invisible overlay behind the panel. + setDisplayMode("inline"); setPanelApp(toolCallId); openRightPanel(); }; + // Seed the first render at fullscreen when the app's author made that its + // default. Applied once, and only on a surface that is actually showing the + // app, so leaving fullscreen (or the app asking for inline through the SDK) + // is never undone underneath the viewer. + const showingLiveSurface = isPanelSurface || expandedInline; + const fullscreenDefaultApplied = useRef(false); + useEffect(() => { + if (fullscreenDefaultApplied.current) return; + if (!showingLiveSurface || !ownedApp?.openInFullscreen) return; + fullscreenDefaultApplied.current = true; + setDisplayMode("fullscreen"); + }, [showingLiveSurface, ownedApp?.openInFullscreen, setDisplayMode]); + const handleResourceStateChange = useCallback( (state: "renderable" | "empty" | "error") => { setResourceState({ key: resourceKey, state }); @@ -528,25 +545,29 @@ export function McpAppEntryContent({ {isOwnedInPanel ? ( setSettingsOpen(true)} /> ) : null} - {/* Apps can request fullscreen from the panel too (via the SDK); the - bar is the only chrome there, so it must carry the way back out. - Escape alone doesn't cut it — focus usually sits inside the - iframe, where the host never sees the keydown. */} - {displayMode === "fullscreen" ? ( - - ) : null} + {/* The bar is the only chrome the panel has, so it carries the way + into fullscreen and the way back out. Escape alone doesn't cut it + for the exit — focus usually sits inside the iframe, where the + host never sees the keydown. */} + } /> ); // Frameless inline (item 4): no top bar — chat context identifies the app. - // Only fullscreen-exit floats as a hover overlay (while fullscreen). The + // The fullscreen toggle floats as a hover overlay in both directions; the // open-in-right-panel control is a labeled button below the app instead. - const inlineOverlay = - displayMode === "fullscreen" ? ( - - ) : null; + const inlineOverlay = ( + + ); const liveSurface = ( diff --git a/platform/frontend/src/components/mcp-app/app-settings-dialog.test.tsx b/platform/frontend/src/components/mcp-app/app-settings-dialog.test.tsx index ed593b8fc0..20c0ab93ba 100644 --- a/platform/frontend/src/components/mcp-app/app-settings-dialog.test.tsx +++ b/platform/frontend/src/components/mcp-app/app-settings-dialog.test.tsx @@ -48,6 +48,7 @@ const app = { latestVersion: 1, enabled: true, locked: false, + openInFullscreen: false, createdAt: "2026-01-01T00:00:00.000Z", updatedAt: "2026-01-01T00:00:00.000Z", deletedAt: null, diff --git a/platform/frontend/src/components/mcp-app/app-settings-form.test.tsx b/platform/frontend/src/components/mcp-app/app-settings-form.test.tsx index 718045e232..ba770461a8 100644 --- a/platform/frontend/src/components/mcp-app/app-settings-form.test.tsx +++ b/platform/frontend/src/components/mcp-app/app-settings-form.test.tsx @@ -1,6 +1,17 @@ import { fireEvent, render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; import { beforeEach, describe, expect, test, vi } from "vitest"; +// Radix's Select (the "Opens in" control) measures and scrolls its popover. +global.ResizeObserver = class ResizeObserver { + observe = vi.fn(); + unobserve = vi.fn(); + disconnect = vi.fn(); +}; +Element.prototype.scrollIntoView = vi.fn(); +Element.prototype.hasPointerCapture = vi.fn(); +Element.prototype.releasePointerCapture = vi.fn(); + const { updateMutateAsync, setEnabledMutateAsync, @@ -204,12 +215,50 @@ describe("AppSettingsForm save", () => { // every save — here the fixture's empty one. labels: [], icon: null, + openInFullscreen: false, }, }); expect(assignMutateAsync).not.toHaveBeenCalled(); expect(unassignMutateAsync).not.toHaveBeenCalled(); }); + test("switches the app to opening fullscreen", async () => { + const user = userEvent.setup(); + const { container, onBack } = renderForm(); + + await user.click(screen.getByRole("combobox", { name: "Opens in" })); + await user.click(screen.getByRole("option", { name: /fullscreen/i })); + submitForm(container); + + await waitFor(() => expect(onBack).toHaveBeenCalled()); + expect(updateMutateAsync).toHaveBeenCalledWith( + expect.objectContaining({ + body: expect.objectContaining({ openInFullscreen: true }), + }), + ); + }); + + test("seeds from the app's saved display default and re-sends it on an unrelated save", async () => { + const { container, onBack } = renderForm({ + app: { ...APP, openInFullscreen: true } as typeof APP, + }); + expect( + screen.getByRole("combobox", { name: "Opens in" }), + ).toHaveTextContent("Fullscreen"); + + fireEvent.change(screen.getByLabelText("Name *"), { + target: { value: "Budget v2" }, + }); + submitForm(container); + + await waitFor(() => expect(onBack).toHaveBeenCalled()); + expect(updateMutateAsync).toHaveBeenCalledWith( + expect.objectContaining({ + body: expect.objectContaining({ openInFullscreen: true }), + }), + ); + }); + test("sends a picked icon", async () => { const { container, onBack } = renderForm(); diff --git a/platform/frontend/src/components/mcp-app/app-settings-form.tsx b/platform/frontend/src/components/mcp-app/app-settings-form.tsx index 2e507c36d7..825fcec207 100644 --- a/platform/frontend/src/components/mcp-app/app-settings-form.tsx +++ b/platform/frontend/src/components/mcp-app/app-settings-form.tsx @@ -118,6 +118,9 @@ export function AppSettingsForm({ const [lockedStatus, setLockedStatus] = useState<"unlocked" | "locked">( app.locked ? "locked" : "unlocked", ); + const [openMode, setOpenMode] = useState<"inline" | "fullscreen">( + app.openInFullscreen ? "fullscreen" : "inline", + ); // The form's fourth option. On the wire an app shared with named people stays // `personal` and carries grants, so "user" is a UI-side reading of // (scope, users) — see the save path below, which maps it back. @@ -201,6 +204,24 @@ export function AppSettingsForm({ (option) => option.value === lockedStatus, )?.description; + const openModeOptions = [ + { + value: "inline" as const, + label: "Inline", + description: + "Opens next to the conversation, at the size the app asks for", + }, + { + value: "fullscreen" as const, + label: "Fullscreen", + description: + "Fills the page on open, for an app you look at rather than talk to", + }, + ]; + const selectedOpenModeDescription = openModeOptions.find( + (option) => option.value === openMode, + )?.description; + const options: VisibilityOption[] = [ { value: "personal", @@ -323,6 +344,7 @@ export function AppSettingsForm({ body.description = values.description.trim() || null; body.icon = values.icon; body.environmentId = environmentId; + body.openInFullscreen = openMode === "fullscreen"; // Flush a label typed into the picker but not yet committed, so a save // doesn't silently drop it. const finalLabels = labelsRef.current?.saveUnsavedLabel() ?? labels; @@ -488,6 +510,36 @@ export function AppSettingsForm({ ) : null} +
+ + + {selectedOpenModeDescription ? ( +

+ {selectedOpenModeDescription} +

+ ) : null} +
+ + ({ + top: 0, + left: SIDEBAR_WIDTH, + width: window.innerWidth - SIDEBAR_WIDTH, + height: window.innerHeight, + }) as DOMRect; + document.body.appendChild(main); + return main; +} + +afterEach(() => { + document.getElementById(MAIN_CONTENT_ID)?.remove(); +}); + +describe("McpAppCard fullscreen geometry", () => { + it("fills the shell's main region rather than the viewport, leaving the sidebar on screen", () => { + mountAppShellMain(); + + const { container } = render( + {}}> +
app
+
, + ); + + const card = container.firstElementChild as HTMLElement; + expect(card.style.left).toBe(`${SIDEBAR_WIDTH}px`); + expect(card.style.width).toBe(`${window.innerWidth - SIDEBAR_WIDTH}px`); + }); + + it("falls back to the viewport where no shell is rendered (the standalone run page)", () => { + const { container } = render( + {}}> +
app
+
, + ); + + const card = container.firstElementChild as HTMLElement; + expect(card.style.left).toBe("0px"); + expect(card.style.width).toBe(`${window.innerWidth}px`); + }); + + it("takes no fixed geometry while inline", () => { + mountAppShellMain(); + + const { container } = render( + {}}> +
app
+
, + ); + + const card = container.firstElementChild as HTMLElement; + expect(card.style.width).toBe(""); + expect(card.className).not.toContain("fixed"); + }); + + it("leaves fullscreen on Escape", async () => { + mountAppShellMain(); + const onToggleFullscreen = vi.fn(); + + render( + +
app
+
, + ); + + await userEvent.keyboard("{Escape}"); + expect(onToggleFullscreen).toHaveBeenCalledOnce(); + }); +}); diff --git a/platform/frontend/src/components/mcp-app/mcp-app-card.tsx b/platform/frontend/src/components/mcp-app/mcp-app-card.tsx index 8028075173..cd0a37281d 100644 --- a/platform/frontend/src/components/mcp-app/mcp-app-card.tsx +++ b/platform/frontend/src/components/mcp-app/mcp-app-card.tsx @@ -1,6 +1,11 @@ import type { McpUiDisplayMode } from "@modelcontextprotocol/ext-apps"; import type React from "react"; import { useEffect, useState } from "react"; +import { + type AppShellRegion, + findAppShellMain, + readAppShellRegion, +} from "@/lib/app-shell-region"; import { cn } from "@/lib/utils"; /** @@ -12,8 +17,10 @@ import { cn } from "@/lib/utils"; * discrete action buttons) — so the card itself stays free of action wiring. * * Uses a single stable tree for inline / fullscreen / fill so the iframe child - * is never unmounted when toggling — only CSS classes change. In fullscreen, - * uses `position: fixed` covering the viewport. + * is never unmounted when toggling — only CSS classes change. In fullscreen it + * is `position: fixed` over the app shell's main region rather than the + * viewport, so the sidebar stays on screen: hiding the navigation is the + * sidebar's own collapse control to do, not a side effect of enlarging an app. */ export function McpAppCard({ displayMode, @@ -44,12 +51,7 @@ export function McpAppCard({ overlay?: React.ReactNode; }) { const isFullscreen = displayMode === "fullscreen"; - const [bounds, setBounds] = useState<{ - top: number; - left: number; - width: number; - height: number; - } | null>(null); + const [bounds, setBounds] = useState(null); useEffect(() => { if (!isFullscreen) return; @@ -65,23 +67,30 @@ export function McpAppCard({ setBounds(null); return; } - const update = () => - setBounds({ - top: 0, - left: 0, - width: window.innerWidth, - height: window.innerHeight, - }); + const update = () => setBounds(readAppShellRegion()); update(); + // The main region also changes width when the sidebar is collapsed or + // expanded, which no window resize reports — and it animates, so observing + // the element keeps the app pinned to its edge for the whole transition. + const main = findAppShellMain(); + const observer = main ? new ResizeObserver(update) : null; + observer?.observe(main as HTMLElement); window.addEventListener("resize", update); - return () => window.removeEventListener("resize", update); + return () => { + observer?.disconnect(); + window.removeEventListener("resize", update); + }; }, [isFullscreen]); return (
{ ).toBeDisabled(); }); - it("fires onClick when the fullscreen-exit button is pressed", async () => { + it("offers the way into fullscreen while the app is inline", async () => { const onClick = vi.fn(); - render(); + render(); + + await userEvent.click( + screen.getByRole("button", { name: /enter fullscreen/i }), + ); + expect(onClick).toHaveBeenCalledOnce(); + }); + + it("offers the way back out while the app is fullscreen", async () => { + const onClick = vi.fn(); + render(); await userEvent.click( screen.getByRole("button", { name: /exit fullscreen/i }), diff --git a/platform/frontend/src/components/mcp-app/mcp-app-chrome.tsx b/platform/frontend/src/components/mcp-app/mcp-app-chrome.tsx index ad359b9909..14fa7d1846 100644 --- a/platform/frontend/src/components/mcp-app/mcp-app-chrome.tsx +++ b/platform/frontend/src/components/mcp-app/mcp-app-chrome.tsx @@ -1,6 +1,7 @@ import { AppWindow, type LucideIcon, + Maximize2, Minimize2, RefreshCw, Settings, @@ -115,17 +116,27 @@ export function McpAppSettingsButton({ onClick }: { onClick: () => void }) { ); } -export function McpAppFullscreenExitButton({ +/** + * Enter/exit fullscreen, in one control the host offers on every app surface. + * Fullscreen used to be reachable only when the guest asked for it through the + * ext-apps SDK (`ui/request-display-mode`), which apps shipped by an MCP server + * commonly do and apps authored here generally do not — so the same mode was + * available for one kind of app and not the other. The host owns the surface, so + * it offers the toggle regardless of what the guest asks for. + */ +export function McpAppFullscreenButton({ + isFullscreen, onClick, size = "sm", }: { + isFullscreen: boolean; onClick: () => void; size?: McpAppButtonSize; }) { return ( diff --git a/platform/frontend/src/components/ui/sidebar.tsx b/platform/frontend/src/components/ui/sidebar.tsx index c3184a5ddf..4e89055564 100644 --- a/platform/frontend/src/components/ui/sidebar.tsx +++ b/platform/frontend/src/components/ui/sidebar.tsx @@ -360,7 +360,12 @@ function SidebarCircleToggle({ }} className={cn( "group/circle-toggle hidden md:flex items-center justify-center", - "fixed top-1/2 z-30 h-10 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full", + // The pill straddles the sidebar's edge, so it overhangs the main + // region and any fixed overlay anchored there (a fullscreen MCP + // App) would clip its right half. z-50 keeps it whole; portalled + // dialogs share that layer but come later in the DOM, so they still + // cover it. + "fixed top-1/2 z-50 h-10 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full", // Extend the hit area beyond the 14px-wide pill to meet the 24px // minimum target size (WCAG 2.5.8). "after:absolute after:-inset-x-1.5 after:inset-y-0 after:content-['']", diff --git a/platform/frontend/src/lib/app-shell-region.ts b/platform/frontend/src/lib/app-shell-region.ts new file mode 100644 index 0000000000..fb5fd4ab54 --- /dev/null +++ b/platform/frontend/src/lib/app-shell-region.ts @@ -0,0 +1,50 @@ +/** + * Id of the app shell's `
` element — the region to the right of the + * sidebar that holds the page. It is the "skip to main content" target (WCAG + * 2.4.1) and the box a fullscreen in-app surface expands to, so the shell and + * the MCP App card read it from here instead of each spelling the literal. + */ +export const MAIN_CONTENT_ID = "main-content"; + +export type AppShellRegion = { + top: number; + left: number; + width: number; + height: number; +}; + +/** + * The element a fullscreen in-app surface should size itself to, or null on the + * chrome-less routes that render no shell (the standalone app runtime under + * `/a/`, the chat browser preview, the offline recording renderer). + */ +export function findAppShellMain(): HTMLElement | null { + if (typeof document === "undefined") return null; + return document.getElementById(MAIN_CONTENT_ID); +} + +/** + * The box a fullscreen in-app surface fills: the shell's main region, so the + * sidebar stays on screen and collapsing it stays the way to reclaim that width + * — an app taking over the viewport used to hide the navigation with no way + * back but leaving fullscreen. Falls back to the viewport where there is no + * shell to sit inside, which is already the whole screen there. + */ +export function readAppShellRegion(): AppShellRegion { + const main = findAppShellMain(); + if (!main) { + return { + top: 0, + left: 0, + width: window.innerWidth, + height: window.innerHeight, + }; + } + const rect = main.getBoundingClientRect(); + return { + top: rect.top, + left: rect.left, + width: rect.width, + height: rect.height, + }; +} diff --git a/platform/shared/hey-api/clients/api/types.gen.ts b/platform/shared/hey-api/clients/api/types.gen.ts index 9927c7915b..958b59de7c 100644 --- a/platform/shared/hey-api/clients/api/types.gen.ts +++ b/platform/shared/hey-api/clients/api/types.gen.ts @@ -20166,6 +20166,7 @@ export type CreateAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string; @@ -21258,6 +21259,7 @@ export type GetAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string; @@ -21316,6 +21318,7 @@ export type UpdateAppData = { keyId?: string; valueId?: string; }>; + openInFullscreen?: boolean; teamIds?: Array; userIds?: Array; }; @@ -21428,6 +21431,7 @@ export type UpdateAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string; @@ -21764,6 +21768,7 @@ export type EnableAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string; @@ -21904,6 +21909,7 @@ export type DisableAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string; @@ -22044,6 +22050,7 @@ export type LockAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string; @@ -22184,6 +22191,7 @@ export type UnlockAppResponses = { } | null; latestVersion: number; enabled: boolean; + openInFullscreen: boolean; locked: boolean; createdAt: string; updatedAt: string;