From 0bbe43c4c046ce0d327262dad79e208609b98c3e Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 22:41:00 +0000 Subject: [PATCH 01/13] feat(db): add v2_hosts.allow_cloud_workspaces Whether a host's owner lets their cloud workspaces reach it through the relay. Defaults to false, so every existing host stays closed. A constant default on Postgres 11+ is metadata-only: no table rewrite. --- .../0190_v2_hosts_allow_cloud_workspaces.sql | 1 + packages/db/drizzle/meta/0190_snapshot.json | 17298 ++++++++++++++++ packages/db/drizzle/meta/_journal.json | 7 + packages/db/src/schema/schema.ts | 5 + 4 files changed, 17311 insertions(+) create mode 100644 packages/db/drizzle/0190_v2_hosts_allow_cloud_workspaces.sql create mode 100644 packages/db/drizzle/meta/0190_snapshot.json diff --git a/packages/db/drizzle/0190_v2_hosts_allow_cloud_workspaces.sql b/packages/db/drizzle/0190_v2_hosts_allow_cloud_workspaces.sql new file mode 100644 index 00000000000..c9ab6820968 --- /dev/null +++ b/packages/db/drizzle/0190_v2_hosts_allow_cloud_workspaces.sql @@ -0,0 +1 @@ +ALTER TABLE "v2_hosts" ADD COLUMN "allow_cloud_workspaces" boolean DEFAULT false NOT NULL; \ No newline at end of file diff --git a/packages/db/drizzle/meta/0190_snapshot.json b/packages/db/drizzle/meta/0190_snapshot.json new file mode 100644 index 00000000000..fbe82dc48c6 --- /dev/null +++ b/packages/db/drizzle/meta/0190_snapshot.json @@ -0,0 +1,17298 @@ +{ + "id": "49c27396-569a-44bb-a44a-e2a08168119d", + "prevId": "25de1116-ccf9-4f41-9b9d-a10bfe1c285c", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.actors": { + "name": "actors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "actors_user_id_users_id_fk": { + "name": "actors_user_id_users_id_fk", + "tableFrom": "actors", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "actors_agent_id_agents_id_fk": { + "name": "actors_agent_id_agents_id_fk", + "tableFrom": "actors", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "actors_user_id_unique": { + "name": "actors_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + }, + "actors_agent_id_unique": { + "name": "actors_agent_id_unique", + "nullsNotDistinct": false, + "columns": [ + "agent_id" + ] + } + }, + "policies": {}, + "checkConstraints": { + "actors_one_kind": { + "name": "actors_one_kind", + "value": "(\"actors\".\"user_id\" IS NULL) <> (\"actors\".\"agent_id\" IS NULL)" + }, + "actors_id_matches": { + "name": "actors_id_matches", + "value": "\"actors\".\"id\" = coalesce(\"actors\".\"user_id\", \"actors\".\"agent_id\")" + } + }, + "isRLSEnabled": false + }, + "public.agent_memories": { + "name": "agent_memories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_memories_agent_idx": { + "name": "agent_memories_agent_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_memories_organization_id_organizations_id_fk": { + "name": "agent_memories_organization_id_organizations_id_fk", + "tableFrom": "agent_memories", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_memories_agent_id_agents_id_fk": { + "name": "agent_memories_agent_id_agents_id_fk", + "tableFrom": "agent_memories", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_routines": { + "name": "agent_routines", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "thread_root_id": { + "name": "thread_root_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "triggers": { + "name": "triggers", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "next_run_at": { + "name": "next_run_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_run_at": { + "name": "last_run_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_routines_agent_idx": { + "name": "agent_routines_agent_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_routines_due_idx": { + "name": "agent_routines_due_idx", + "columns": [ + { + "expression": "next_run_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"agent_routines\".\"enabled\" and \"agent_routines\".\"next_run_at\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_routines_triggers_idx": { + "name": "agent_routines_triggers_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"agent_routines\".\"enabled\" and jsonb_array_length(\"agent_routines\".\"triggers\") > 0", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_routines_organization_id_organizations_id_fk": { + "name": "agent_routines_organization_id_organizations_id_fk", + "tableFrom": "agent_routines", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_routines_agent_id_agents_id_fk": { + "name": "agent_routines_agent_id_agents_id_fk", + "tableFrom": "agent_routines", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_routines_created_by_user_id_users_id_fk": { + "name": "agent_routines_created_by_user_id_users_id_fk", + "tableFrom": "agent_routines", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_routines_channel_id_channels_id_fk": { + "name": "agent_routines_channel_id_channels_id_fk", + "tableFrom": "agent_routines", + "tableTo": "channels", + "columnsFrom": [ + "channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_routines_thread_root_id_channel_messages_id_fk": { + "name": "agent_routines_thread_root_id_channel_messages_id_fk", + "tableFrom": "agent_routines", + "tableTo": "channel_messages", + "columnsFrom": [ + "thread_root_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_sessions": { + "name": "agent_sessions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "agent_session_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "thread_root_id": { + "name": "thread_root_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "parent_session_id": { + "name": "parent_session_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "agent_task_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "task_status": { + "name": "task_status", + "type": "agent_task_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructions": { + "name": "instructions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requested_by_user_id": { + "name": "requested_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_activity_at": { + "name": "last_activity_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_sessions_dm_unique": { + "name": "agent_sessions_dm_unique", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agent_sessions\".\"kind\" = 'dm'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_sessions_thread_unique": { + "name": "agent_sessions_thread_unique", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "thread_root_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agent_sessions\".\"kind\" = 'thread'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_sessions_parent_idx": { + "name": "agent_sessions_parent_idx", + "columns": [ + { + "expression": "parent_session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_sessions_task_idx": { + "name": "agent_sessions_task_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_sessions_active_writer_per_task_unique": { + "name": "agent_sessions_active_writer_per_task_unique", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agent_sessions\".\"task_id\" is not null and \"agent_sessions\".\"role\" = 'writer' and \"agent_sessions\".\"task_status\" in ('queued', 'running')", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_sessions_organization_id_organizations_id_fk": { + "name": "agent_sessions_organization_id_organizations_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_sessions_agent_id_agents_id_fk": { + "name": "agent_sessions_agent_id_agents_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_sessions_channel_id_channels_id_fk": { + "name": "agent_sessions_channel_id_channels_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "channels", + "columnsFrom": [ + "channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_sessions_thread_root_id_channel_messages_id_fk": { + "name": "agent_sessions_thread_root_id_channel_messages_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "channel_messages", + "columnsFrom": [ + "thread_root_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_sessions_user_id_users_id_fk": { + "name": "agent_sessions_user_id_users_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_sessions_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "agent_sessions_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_sessions_task_id_tasks_id_fk": { + "name": "agent_sessions_task_id_tasks_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_sessions_environment_id_environments_id_fk": { + "name": "agent_sessions_environment_id_environments_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_sessions_requested_by_user_id_users_id_fk": { + "name": "agent_sessions_requested_by_user_id_users_id_fk", + "tableFrom": "agent_sessions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "requested_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_turns": { + "name": "agent_turns", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "agent_id": { + "name": "agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "session_id": { + "name": "session_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "agent_turn_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'running'" + }, + "reason": { + "name": "reason", + "type": "agent_turn_reason", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "acting_user_id": { + "name": "acting_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "trigger_message_id": { + "name": "trigger_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "routine_id": { + "name": "routine_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "prompt_id": { + "name": "prompt_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "steer_prompt_ids": { + "name": "steer_prompt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "settled_at": { + "name": "settled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reply": { + "name": "reply", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tool_calls": { + "name": "tool_calls", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cost_micros_usd": { + "name": "cost_micros_usd", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "error_code": { + "name": "error_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "last_attempt_error": { + "name": "last_attempt_error", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "agent_turns_session_idx": { + "name": "agent_turns_session_idx", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_turns_agent_status_idx": { + "name": "agent_turns_agent_status_idx", + "columns": [ + { + "expression": "agent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_turns_one_running_per_session_idx": { + "name": "agent_turns_one_running_per_session_idx", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agent_turns\".\"status\" = 'running'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_turns_prompt_idx": { + "name": "agent_turns_prompt_idx", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "prompt_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agent_turns\".\"prompt_id\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_turns_organization_id_organizations_id_fk": { + "name": "agent_turns_organization_id_organizations_id_fk", + "tableFrom": "agent_turns", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_turns_agent_id_agents_id_fk": { + "name": "agent_turns_agent_id_agents_id_fk", + "tableFrom": "agent_turns", + "tableTo": "agents", + "columnsFrom": [ + "agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_turns_session_id_agent_sessions_id_fk": { + "name": "agent_turns_session_id_agent_sessions_id_fk", + "tableFrom": "agent_turns", + "tableTo": "agent_sessions", + "columnsFrom": [ + "session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_turns_acting_user_id_users_id_fk": { + "name": "agent_turns_acting_user_id_users_id_fk", + "tableFrom": "agent_turns", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "acting_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_turns_trigger_message_id_channel_messages_id_fk": { + "name": "agent_turns_trigger_message_id_channel_messages_id_fk", + "tableFrom": "agent_turns", + "tableTo": "channel_messages", + "columnsFrom": [ + "trigger_message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_turns_routine_id_agent_routines_id_fk": { + "name": "agent_turns_routine_id_agent_routines_id_fk", + "tableFrom": "agent_turns", + "tableTo": "agent_routines", + "columnsFrom": [ + "routine_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar": { + "name": "avatar", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"shape\":\"pebble\",\"eyes\":\"dots\",\"color\":\"#7aa7ff\"}'::jsonb" + }, + "instructions": { + "name": "instructions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "main_session_id": { + "name": "main_session_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "default_environment_id": { + "name": "default_environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "paused_at": { + "name": "paused_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agents_organization_idx": { + "name": "agents_organization_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agents_organization_id_organizations_id_fk": { + "name": "agents_organization_id_organizations_id_fk", + "tableFrom": "agents", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agents_default_environment_id_environments_id_fk": { + "name": "agents_default_environment_id_environments_id_fk", + "tableFrom": "agents", + "tableTo": "environments", + "columnsFrom": [ + "default_environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agents_created_by_user_id_users_id_fk": { + "name": "agents_created_by_user_id_users_id_fk", + "tableFrom": "agents", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.accounts": { + "name": "accounts", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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": "uuid", + "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": { + "accounts_user_id_idx": { + "name": "accounts_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "accounts_user_id_users_id_fk": { + "name": "accounts_user_id_users_id_fk", + "tableFrom": "accounts", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.apikeys": { + "name": "apikeys", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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 + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "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, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "CASE\n\t\t\t\tWHEN metadata IS NULL OR metadata = '' THEN NULL\n\t\t\t\tWHEN NOT (metadata IS JSON OBJECT) THEN NULL\n\t\t\t\tWHEN (metadata::jsonb->>'organizationId') ~* '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'\n\t\t\t\t\tTHEN (metadata::jsonb->>'organizationId')::uuid\n\t\t\t\tELSE NULL\n\t\t\tEND", + "type": "stored" + } + } + }, + "indexes": { + "apikeys_configId_idx": { + "name": "apikeys_configId_idx", + "columns": [ + { + "expression": "config_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apikeys_referenceId_idx": { + "name": "apikeys_referenceId_idx", + "columns": [ + { + "expression": "reference_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apikeys_key_idx": { + "name": "apikeys_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apikeys_organization_id_idx": { + "name": "apikeys_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "apikeys_metadata_trgm_idx": { + "name": "apikeys_metadata_trgm_idx", + "columns": [ + { + "expression": "\"metadata\" gin_trgm_ops", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.device_codes": { + "name": "device_codes", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "device_code": { + "name": "device_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_code": { + "name": "user_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_polled_at": { + "name": "last_polled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "polling_interval": { + "name": "polling_interval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.invitations": { + "name": "invitations", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "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 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "inviter_id": { + "name": "inviter_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "invitations_organization_id_idx": { + "name": "invitations_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "invitations_email_idx": { + "name": "invitations_email_idx", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "invitations_organization_id_organizations_id_fk": { + "name": "invitations_organization_id_organizations_id_fk", + "tableFrom": "invitations", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "invitations_inviter_id_users_id_fk": { + "name": "invitations_inviter_id_users_id_fk", + "tableFrom": "invitations", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "inviter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "invitations_team_id_teams_id_fk": { + "name": "invitations_team_id_teams_id_fk", + "tableFrom": "invitations", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.jwkss": { + "name": "jwkss", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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 + }, + "auth.members": { + "name": "members", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "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": "now()" + } + }, + "indexes": { + "members_organization_id_idx": { + "name": "members_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "members_user_id_idx": { + "name": "members_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "members_organization_id_organizations_id_fk": { + "name": "members_organization_id_organizations_id_fk", + "tableFrom": "members", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "members_user_id_users_id_fk": { + "name": "members_user_id_users_id_fk", + "tableFrom": "members", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.oauth_access_tokens": { + "name": "oauth_access_tokens", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "session_id": { + "name": "session_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_id": { + "name": "refresh_id", + "type": "uuid", + "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": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_access_tokens_client_id_oauth_clients_client_id_fk": { + "name": "oauth_access_tokens_client_id_oauth_clients_client_id_fk", + "tableFrom": "oauth_access_tokens", + "tableTo": "oauth_clients", + "schemaTo": "auth", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "client_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_access_tokens_session_id_sessions_id_fk": { + "name": "oauth_access_tokens_session_id_sessions_id_fk", + "tableFrom": "oauth_access_tokens", + "tableTo": "sessions", + "schemaTo": "auth", + "columnsFrom": [ + "session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "oauth_access_tokens_user_id_users_id_fk": { + "name": "oauth_access_tokens_user_id_users_id_fk", + "tableFrom": "oauth_access_tokens", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_access_tokens_refresh_id_oauth_refresh_tokens_id_fk": { + "name": "oauth_access_tokens_refresh_id_oauth_refresh_tokens_id_fk", + "tableFrom": "oauth_access_tokens", + "tableTo": "oauth_refresh_tokens", + "schemaTo": "auth", + "columnsFrom": [ + "refresh_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "oauth_access_tokens_token_unique": { + "name": "oauth_access_tokens_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.oauth_clients": { + "name": "oauth_clients", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_secret": { + "name": "client_secret", + "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 + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "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 + }, + "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 + }, + "subject_type": { + "name": "subject_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_clients_user_id_users_id_fk": { + "name": "oauth_clients_user_id_users_id_fk", + "tableFrom": "oauth_clients", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "oauth_clients_client_id_unique": { + "name": "oauth_clients_client_id_unique", + "nullsNotDistinct": false, + "columns": [ + "client_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.oauth_consents": { + "name": "oauth_consents", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_consents_client_id_oauth_clients_client_id_fk": { + "name": "oauth_consents_client_id_oauth_clients_client_id_fk", + "tableFrom": "oauth_consents", + "tableTo": "oauth_clients", + "schemaTo": "auth", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "client_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_consents_user_id_users_id_fk": { + "name": "oauth_consents_user_id_users_id_fk", + "tableFrom": "oauth_consents", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.oauth_refresh_tokens": { + "name": "oauth_refresh_tokens", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "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": false + }, + "revoked": { + "name": "revoked", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "auth_time": { + "name": "auth_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "oauth_refresh_tokens_client_id_oauth_clients_client_id_fk": { + "name": "oauth_refresh_tokens_client_id_oauth_clients_client_id_fk", + "tableFrom": "oauth_refresh_tokens", + "tableTo": "oauth_clients", + "schemaTo": "auth", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "client_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "oauth_refresh_tokens_session_id_sessions_id_fk": { + "name": "oauth_refresh_tokens_session_id_sessions_id_fk", + "tableFrom": "oauth_refresh_tokens", + "tableTo": "sessions", + "schemaTo": "auth", + "columnsFrom": [ + "session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "oauth_refresh_tokens_user_id_users_id_fk": { + "name": "oauth_refresh_tokens_user_id_users_id_fk", + "tableFrom": "oauth_refresh_tokens", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "oauth_refresh_tokens_token_unique": { + "name": "oauth_refresh_tokens_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.organizations": { + "name": "organizations", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "logo": { + "name": "logo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripe_customer_id": { + "name": "stripe_customer_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "allowed_domains": { + "name": "allowed_domains", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "task_tracker": { + "name": "task_tracker", + "type": "task_tracker", + "typeSchema": "auth", + "primaryKey": false, + "notNull": true, + "default": "'superset'" + } + }, + "indexes": { + "organizations_slug_idx": { + "name": "organizations_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organizations_allowed_domains_idx": { + "name": "organizations_allowed_domains_idx", + "columns": [ + { + "expression": "allowed_domains", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organizations_slug_unique": { + "name": "organizations_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.sessions": { + "name": "sessions", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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": "uuid", + "primaryKey": false, + "notNull": true + }, + "active_organization_id": { + "name": "active_organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "active_team_id": { + "name": "active_team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "sessions_user_id_idx": { + "name": "sessions_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "sessions_user_id_users_id_fk": { + "name": "sessions_user_id_users_id_fk", + "tableFrom": "sessions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "sessions_token_unique": { + "name": "sessions_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.team_members": { + "name": "team_members", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "team_members_team_id_idx": { + "name": "team_members_team_id_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "team_members_user_id_idx": { + "name": "team_members_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "team_members_organization_id_idx": { + "name": "team_members_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "team_members_team_user_unique": { + "name": "team_members_team_user_unique", + "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": {} + } + }, + "foreignKeys": { + "team_members_team_id_teams_id_fk": { + "name": "team_members_team_id_teams_id_fk", + "tableFrom": "team_members", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_members_user_id_users_id_fk": { + "name": "team_members_user_id_users_id_fk", + "tableFrom": "team_members", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_members_organization_id_organizations_id_fk": { + "name": "team_members_organization_id_organizations_id_fk", + "tableFrom": "team_members", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.teams": { + "name": "teams", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_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": false, + "default": "now()" + } + }, + "indexes": { + "teams_organization_id_idx": { + "name": "teams_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "teams_org_slug_unique": { + "name": "teams_org_slug_unique", + "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": { + "teams_organization_id_organizations_id_fk": { + "name": "teams_organization_id_organizations_id_fk", + "tableFrom": "teams", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.users": { + "name": "users", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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 + }, + "organization_ids": { + "name": "organization_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "last_active_organization_id": { + "name": "last_active_organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "onboarded_at": { + "name": "onboarded_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "locale": { + "name": "locale", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deletion_requested_at": { + "name": "deletion_requested_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_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": { + "users_organization_ids_idx": { + "name": "users_organization_ids_idx", + "columns": [ + { + "expression": "organization_ids", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_email_unique": { + "name": "users_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "auth.verifications": { + "name": "verifications", + "schema": "auth", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "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": { + "verifications_identifier_idx": { + "name": "verifications_identifier_idx", + "columns": [ + { + "expression": "identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.channel_members": { + "name": "channel_members", + "schema": "", + "columns": { + "channel_id": { + "name": "channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "actor_id": { + "name": "actor_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "channel_member_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "notify": { + "name": "notify", + "type": "channel_notify", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "muted": { + "name": "muted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "suppress_broadcasts": { + "name": "suppress_broadcasts", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "last_read_seq": { + "name": "last_read_seq", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "joined_at": { + "name": "joined_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "channel_members_actor_idx": { + "name": "channel_members_actor_idx", + "columns": [ + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "channel_members_channel_id_channels_id_fk": { + "name": "channel_members_channel_id_channels_id_fk", + "tableFrom": "channel_members", + "tableTo": "channels", + "columnsFrom": [ + "channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channel_members_actor_id_actors_id_fk": { + "name": "channel_members_actor_id_actors_id_fk", + "tableFrom": "channel_members", + "tableTo": "actors", + "columnsFrom": [ + "actor_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "channel_members_channel_id_actor_id_pk": { + "name": "channel_members_channel_id_actor_id_pk", + "columns": [ + "channel_id", + "actor_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.channel_message_reactions": { + "name": "channel_message_reactions", + "schema": "", + "columns": { + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "actor_id": { + "name": "actor_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "emoji": { + "name": "emoji", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "channel_message_reactions_message_id_channel_messages_id_fk": { + "name": "channel_message_reactions_message_id_channel_messages_id_fk", + "tableFrom": "channel_message_reactions", + "tableTo": "channel_messages", + "columnsFrom": [ + "message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channel_message_reactions_actor_id_actors_id_fk": { + "name": "channel_message_reactions_actor_id_actors_id_fk", + "tableFrom": "channel_message_reactions", + "tableTo": "actors", + "columnsFrom": [ + "actor_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "channel_message_reactions_message_id_actor_id_emoji_pk": { + "name": "channel_message_reactions_message_id_actor_id_emoji_pk", + "columns": [ + "message_id", + "actor_id", + "emoji" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.channel_messages": { + "name": "channel_messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "channel_id": { + "name": "channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "seq": { + "name": "seq", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "thread_root_id": { + "name": "thread_root_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "author_id": { + "name": "author_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subtype": { + "name": "subtype", + "type": "channel_message_subtype", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "inviter_id": { + "name": "inviter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mentioned_ids": { + "name": "mentioned_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::uuid[]" + }, + "broadcast": { + "name": "broadcast", + "type": "channel_broadcast", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reply_count": { + "name": "reply_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_reply_at": { + "name": "last_reply_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "edited_at": { + "name": "edited_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_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": { + "channel_messages_channel_seq_unique": { + "name": "channel_messages_channel_seq_unique", + "columns": [ + { + "expression": "channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "channel_messages_thread_idx": { + "name": "channel_messages_thread_idx", + "columns": [ + { + "expression": "thread_root_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "channel_messages_author_client_unique": { + "name": "channel_messages_author_client_unique", + "columns": [ + { + "expression": "author_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "client_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"channel_messages\".\"client_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "channel_messages_channel_id_channels_id_fk": { + "name": "channel_messages_channel_id_channels_id_fk", + "tableFrom": "channel_messages", + "tableTo": "channels", + "columnsFrom": [ + "channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channel_messages_thread_root_id_channel_messages_id_fk": { + "name": "channel_messages_thread_root_id_channel_messages_id_fk", + "tableFrom": "channel_messages", + "tableTo": "channel_messages", + "columnsFrom": [ + "thread_root_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channel_messages_author_id_actors_id_fk": { + "name": "channel_messages_author_id_actors_id_fk", + "tableFrom": "channel_messages", + "tableTo": "actors", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "channel_messages_inviter_id_actors_id_fk": { + "name": "channel_messages_inviter_id_actors_id_fk", + "tableFrom": "channel_messages", + "tableTo": "actors", + "columnsFrom": [ + "inviter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.channel_notification_prefs": { + "name": "channel_notification_prefs", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "notify": { + "name": "notify", + "type": "channel_notify", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'mentions'" + }, + "show_preview": { + "name": "show_preview", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "keywords": { + "name": "keywords", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "paused_until": { + "name": "paused_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "schedule_enabled": { + "name": "schedule_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "schedule_days": { + "name": "schedule_days", + "type": "integer[]", + "primaryKey": false, + "notNull": true, + "default": "'{0,1,2,3,4,5,6}'::integer[]" + }, + "schedule_start_minute": { + "name": "schedule_start_minute", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 480 + }, + "schedule_end_minute": { + "name": "schedule_end_minute", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1320 + }, + "time_zone": { + "name": "time_zone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dock_bounce": { + "name": "dock_bounce", + "type": "dock_bounce", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'off'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "channel_notification_prefs_user_id_users_id_fk": { + "name": "channel_notification_prefs_user_id_users_id_fk", + "tableFrom": "channel_notification_prefs", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.channel_thread_follows": { + "name": "channel_thread_follows", + "schema": "", + "columns": { + "root_id": { + "name": "root_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "actor_id": { + "name": "actor_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "following": { + "name": "following", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "last_read_seq": { + "name": "last_read_seq", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "channel_thread_follows_actor_idx": { + "name": "channel_thread_follows_actor_idx", + "columns": [ + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "channel_thread_follows_root_id_channel_messages_id_fk": { + "name": "channel_thread_follows_root_id_channel_messages_id_fk", + "tableFrom": "channel_thread_follows", + "tableTo": "channel_messages", + "columnsFrom": [ + "root_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channel_thread_follows_actor_id_actors_id_fk": { + "name": "channel_thread_follows_actor_id_actors_id_fk", + "tableFrom": "channel_thread_follows", + "tableTo": "actors", + "columnsFrom": [ + "actor_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channel_thread_follows_channel_id_channels_id_fk": { + "name": "channel_thread_follows_channel_id_channels_id_fk", + "tableFrom": "channel_thread_follows", + "tableTo": "channels", + "columnsFrom": [ + "channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "channel_thread_follows_root_id_actor_id_pk": { + "name": "channel_thread_follows_root_id_actor_id_pk", + "columns": [ + "root_id", + "actor_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.channels": { + "name": "channels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_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 + }, + "kind": { + "name": "kind", + "type": "channel_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'channel'" + }, + "visibility": { + "name": "visibility", + "type": "channel_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "last_seq": { + "name": "last_seq", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_message_at": { + "name": "last_message_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "task_project_id": { + "name": "task_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "linear_project_id": { + "name": "linear_project_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "channels_task_project_idx": { + "name": "channels_task_project_idx", + "columns": [ + { + "expression": "task_project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "channels_org_name_unique": { + "name": "channels_org_name_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"name\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"channels\".\"archived_at\" IS NULL AND \"channels\".\"kind\" = 'channel'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "channels_organization_idx": { + "name": "channels_organization_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "channels_organization_id_organizations_id_fk": { + "name": "channels_organization_id_organizations_id_fk", + "tableFrom": "channels", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "channels_created_by_user_id_users_id_fk": { + "name": "channels_created_by_user_id_users_id_fk", + "tableFrom": "channels", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "channels_task_project_id_task_projects_id_fk": { + "name": "channels_task_project_id_task_projects_id_fk", + "tableFrom": "channels", + "tableTo": "task_projects", + "columnsFrom": [ + "task_project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_installations": { + "name": "github_installations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connected_by_user_id": { + "name": "connected_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "installation_id": { + "name": "installation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "account_login": { + "name": "account_login", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "account_type": { + "name": "account_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "suspended": { + "name": "suspended", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "suspended_at": { + "name": "suspended_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_synced_at": { + "name": "last_synced_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": { + "github_installations_installation_id_idx": { + "name": "github_installations_installation_id_idx", + "columns": [ + { + "expression": "installation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_installations_organization_id_organizations_id_fk": { + "name": "github_installations_organization_id_organizations_id_fk", + "tableFrom": "github_installations", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "github_installations_connected_by_user_id_users_id_fk": { + "name": "github_installations_connected_by_user_id_users_id_fk", + "tableFrom": "github_installations", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "connected_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "github_installations_installation_id_unique": { + "name": "github_installations_installation_id_unique", + "nullsNotDistinct": false, + "columns": [ + "installation_id" + ] + }, + "github_installations_org_unique": { + "name": "github_installations_org_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_pull_requests": { + "name": "github_pull_requests", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "repository_id": { + "name": "repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "pr_number": { + "name": "pr_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "node_id": { + "name": "node_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "head_branch": { + "name": "head_branch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "head_sha": { + "name": "head_sha", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "base_branch": { + "name": "base_branch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_login": { + "name": "author_login", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_avatar_url": { + "name": "author_avatar_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_draft": { + "name": "is_draft", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "additions": { + "name": "additions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "deletions": { + "name": "deletions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "changed_files": { + "name": "changed_files", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "review_decision": { + "name": "review_decision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "checks_status": { + "name": "checks_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "checks": { + "name": "checks", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "merged_at": { + "name": "merged_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "closed_at": { + "name": "closed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_synced_at": { + "name": "last_synced_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": { + "github_pull_requests_repository_id_idx": { + "name": "github_pull_requests_repository_id_idx", + "columns": [ + { + "expression": "repository_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "github_pull_requests_state_idx": { + "name": "github_pull_requests_state_idx", + "columns": [ + { + "expression": "state", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "github_pull_requests_head_branch_idx": { + "name": "github_pull_requests_head_branch_idx", + "columns": [ + { + "expression": "head_branch", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "github_pull_requests_org_id_idx": { + "name": "github_pull_requests_org_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_pull_requests_repository_id_github_repositories_id_fk": { + "name": "github_pull_requests_repository_id_github_repositories_id_fk", + "tableFrom": "github_pull_requests", + "tableTo": "github_repositories", + "columnsFrom": [ + "repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "github_pull_requests_organization_id_organizations_id_fk": { + "name": "github_pull_requests_organization_id_organizations_id_fk", + "tableFrom": "github_pull_requests", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "github_pull_requests_repo_pr_unique": { + "name": "github_pull_requests_repo_pr_unique", + "nullsNotDistinct": false, + "columns": [ + "repository_id", + "pr_number" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_repositories": { + "name": "github_repositories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "installation_id": { + "name": "installation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "repo_id": { + "name": "repo_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "full_name": { + "name": "full_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "default_branch": { + "name": "default_branch", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'main'" + }, + "is_private": { + "name": "is_private", + "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": { + "github_repositories_installation_id_idx": { + "name": "github_repositories_installation_id_idx", + "columns": [ + { + "expression": "installation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "github_repositories_full_name_idx": { + "name": "github_repositories_full_name_idx", + "columns": [ + { + "expression": "full_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "github_repositories_org_id_idx": { + "name": "github_repositories_org_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_repositories_installation_id_github_installations_id_fk": { + "name": "github_repositories_installation_id_github_installations_id_fk", + "tableFrom": "github_repositories", + "tableTo": "github_installations", + "columnsFrom": [ + "installation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "github_repositories_organization_id_organizations_id_fk": { + "name": "github_repositories_organization_id_organizations_id_fk", + "tableFrom": "github_repositories", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "github_repositories_repo_id_unique": { + "name": "github_repositories_repo_id_unique", + "nullsNotDistinct": false, + "columns": [ + "repo_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "ingest.webhook_events": { + "name": "webhook_events", + "schema": "ingest", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "provider": { + "name": "provider", + "type": "integration_provider", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "event_type": { + "name": "event_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "processed_at": { + "name": "processed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "retry_count": { + "name": "retry_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "received_at": { + "name": "received_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "webhook_events_provider_status_idx": { + "name": "webhook_events_provider_status_idx", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "webhook_events_provider_event_id_idx": { + "name": "webhook_events_provider_event_id_idx", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "webhook_events_received_at_idx": { + "name": "webhook_events_received_at_idx", + "columns": [ + { + "expression": "received_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.leaderboard_daily": { + "name": "leaderboard_daily", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uncached_input": { + "name": "uncached_input", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cached_input": { + "name": "cached_input", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cache_write_5m": { + "name": "cache_write_5m", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cache_write_1h": { + "name": "cache_write_1h", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "output": { + "name": "output", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "reasoning_output": { + "name": "reasoning_output", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "tokens": { + "name": "tokens", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "usd_estimate": { + "name": "usd_estimate", + "type": "numeric(14, 6)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "approximate": { + "name": "approximate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "sessions": { + "name": "sessions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "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": { + "leaderboard_daily_day_idx": { + "name": "leaderboard_daily_day_idx", + "columns": [ + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "leaderboard_daily_user_day_idx": { + "name": "leaderboard_daily_user_day_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "leaderboard_daily_model_day_idx": { + "name": "leaderboard_daily_model_day_idx", + "columns": [ + { + "expression": "model", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "leaderboard_daily_user_id_public_profiles_user_id_fk": { + "name": "leaderboard_daily_user_id_public_profiles_user_id_fk", + "tableFrom": "leaderboard_daily", + "tableTo": "public_profiles", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "leaderboard_daily_identity_key": { + "name": "leaderboard_daily_identity_key", + "nullsNotDistinct": false, + "columns": [ + "user_id", + "day", + "provider", + "model", + "host_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.leaderboard_daily_factory": { + "name": "leaderboard_daily_factory", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sessions": { + "name": "sessions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "parallel_sessions": { + "name": "parallel_sessions", + "type": "numeric(6, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "agent_prs_merged": { + "name": "agent_prs_merged", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "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": { + "leaderboard_daily_factory_day_idx": { + "name": "leaderboard_daily_factory_day_idx", + "columns": [ + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "leaderboard_daily_factory_user_day_idx": { + "name": "leaderboard_daily_factory_user_day_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "leaderboard_daily_factory_user_id_public_profiles_user_id_fk": { + "name": "leaderboard_daily_factory_user_id_public_profiles_user_id_fk", + "tableFrom": "leaderboard_daily_factory", + "tableTo": "public_profiles", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "leaderboard_daily_factory_identity_key": { + "name": "leaderboard_daily_factory_identity_key", + "nullsNotDistinct": false, + "columns": [ + "user_id", + "day", + "host_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.leaderboard_participants": { + "name": "leaderboard_participants", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "handle": { + "name": "handle", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "leaderboard_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "opted_in_at": { + "name": "opted_in_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "flagged_at": { + "name": "flagged_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_published_at": { + "name": "last_published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "payload_version": { + "name": "payload_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "tokens": { + "name": "tokens", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "usd": { + "name": "usd", + "type": "numeric(20, 6)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "sessions": { + "name": "sessions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "uncached_input": { + "name": "uncached_input", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cached_input": { + "name": "cached_input", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cache_write_5m": { + "name": "cache_write_5m", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cache_write_1h": { + "name": "cache_write_1h", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "output": { + "name": "output", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "reasoning_output": { + "name": "reasoning_output", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "approximate": { + "name": "approximate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "day_range_start": { + "name": "day_range_start", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "day_range_end": { + "name": "day_range_end", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "tier": { + "name": "tier", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "tier_computed_at": { + "name": "tier_computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "active_days": { + "name": "active_days", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "axis_width": { + "name": "axis_width", + "type": "numeric(6, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "axis_depth": { + "name": "axis_depth", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "axis_output": { + "name": "axis_output", + "type": "numeric(8, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "axis_cost": { + "name": "axis_cost", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "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": { + "leaderboard_participants_tokens_idx": { + "name": "leaderboard_participants_tokens_idx", + "columns": [ + { + "expression": "tokens", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "leaderboard_participants_org_idx": { + "name": "leaderboard_participants_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "leaderboard_participants_usd_idx": { + "name": "leaderboard_participants_usd_idx", + "columns": [ + { + "expression": "usd", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "leaderboard_participants_tier_idx": { + "name": "leaderboard_participants_tier_idx", + "columns": [ + { + "expression": "tier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "leaderboard_participants_user_id_users_id_fk": { + "name": "leaderboard_participants_user_id_users_id_fk", + "tableFrom": "leaderboard_participants", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "leaderboard_participants_organization_id_organizations_id_fk": { + "name": "leaderboard_participants_organization_id_organizations_id_fk", + "tableFrom": "leaderboard_participants", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "leaderboard_participants_handle_unique": { + "name": "leaderboard_participants_handle_unique", + "nullsNotDistinct": false, + "columns": [ + "handle" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization_plugin_sources": { + "name": "organization_plugin_sources", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "repo": { + "name": "repo", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "synced_sha": { + "name": "synced_sha", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "synced_at": { + "name": "synced_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "sync_error": { + "name": "sync_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sync_problems": { + "name": "sync_problems", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "added_by_user_id": { + "name": "added_by_user_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": { + "organization_plugin_sources_organization_repo_path_unique": { + "name": "organization_plugin_sources_organization_repo_path_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "repo", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_plugin_sources_organization_id_organizations_id_fk": { + "name": "organization_plugin_sources_organization_id_organizations_id_fk", + "tableFrom": "organization_plugin_sources", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_plugin_sources_added_by_user_id_users_id_fk": { + "name": "organization_plugin_sources_added_by_user_id_users_id_fk", + "tableFrom": "organization_plugin_sources", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "added_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organization_plugin_sources_id_organization_unique": { + "name": "organization_plugin_sources_id_organization_unique", + "nullsNotDistinct": false, + "columns": [ + "id", + "organization_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization_plugins": { + "name": "organization_plugins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "manifest": { + "name": "manifest", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_fingerprint": { + "name": "source_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "install_policy": { + "name": "install_policy", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "removed_from_source_at": { + "name": "removed_from_source_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": { + "organization_plugins_organization_name_unique": { + "name": "organization_plugins_organization_name_unique", + "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": {} + }, + "organization_plugins_source_idx": { + "name": "organization_plugins_source_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_plugins_organization_id_organizations_id_fk": { + "name": "organization_plugins_organization_id_organizations_id_fk", + "tableFrom": "organization_plugins", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_plugins_source_organization_fk": { + "name": "organization_plugins_source_organization_fk", + "tableFrom": "organization_plugins", + "tableTo": "organization_plugin_sources", + "columnsFrom": [ + "source_id", + "organization_id" + ], + "columnsTo": [ + "id", + "organization_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugin_installs": { + "name": "plugin_installs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "marketplace": { + "name": "marketplace", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "plugin_name": { + "name": "plugin_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "manifest": { + "name": "manifest", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "organization_plugin_id": { + "name": "organization_plugin_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "installed_at": { + "name": "installed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "plugin_installs_user_plugin_unique": { + "name": "plugin_installs_user_plugin_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "marketplace", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "plugin_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugin_installs_user_idx": { + "name": "plugin_installs_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugin_installs_organization_plugin_idx": { + "name": "plugin_installs_organization_plugin_idx", + "columns": [ + { + "expression": "organization_plugin_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "plugin_installs_organization_id_organizations_id_fk": { + "name": "plugin_installs_organization_id_organizations_id_fk", + "tableFrom": "plugin_installs", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "plugin_installs_user_id_users_id_fk": { + "name": "plugin_installs_user_id_users_id_fk", + "tableFrom": "plugin_installs", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "plugin_installs_organization_plugin_id_organization_plugins_id_fk": { + "name": "plugin_installs_organization_plugin_id_organization_plugins_id_fk", + "tableFrom": "plugin_installs", + "tableTo": "organization_plugins", + "columnsFrom": [ + "organization_plugin_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugin_marketplaces": { + "name": "plugin_marketplaces", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_kind": { + "name": "source_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repo": { + "name": "repo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "added_at": { + "name": "added_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "plugin_marketplaces_user_name_unique": { + "name": "plugin_marketplaces_user_name_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "plugin_marketplaces_user_idx": { + "name": "plugin_marketplaces_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "plugin_marketplaces_organization_id_organizations_id_fk": { + "name": "plugin_marketplaces_organization_id_organizations_id_fk", + "tableFrom": "plugin_marketplaces", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "plugin_marketplaces_user_id_users_id_fk": { + "name": "plugin_marketplaces_user_id_users_id_fk", + "tableFrom": "plugin_marketplaces", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plugin_oauth_clients": { + "name": "plugin_oauth_clients", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "issuer": { + "name": "issuer", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "redirect_uri": { + "name": "redirect_uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_secret": { + "name": "client_secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_secret_expires_at": { + "name": "client_secret_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "registration_access_token": { + "name": "registration_access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "registration_client_uri": { + "name": "registration_client_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token_endpoint_auth_method": { + "name": "token_endpoint_auth_method", + "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": { + "plugin_oauth_clients_issuer_redirect_client_unique": { + "name": "plugin_oauth_clients_issuer_redirect_client_unique", + "columns": [ + { + "expression": "issuer", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "redirect_uri", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "client_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.handles": { + "name": "handles", + "schema": "", + "columns": { + "handle": { + "name": "handle", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "owner_type": { + "name": "owner_type", + "type": "handle_owner_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "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": { + "handles_owner_type_idx": { + "name": "handles_owner_type_idx", + "columns": [ + { + "expression": "owner_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "handles_user_id_users_id_fk": { + "name": "handles_user_id_users_id_fk", + "tableFrom": "handles", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "handles_organization_id_organizations_id_fk": { + "name": "handles_organization_id_organizations_id_fk", + "tableFrom": "handles", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "handles_user_key": { + "name": "handles_user_key", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + }, + "handles_organization_key": { + "name": "handles_organization_key", + "nullsNotDistinct": false, + "columns": [ + "organization_id" + ] + }, + "handles_user_owner_key": { + "name": "handles_user_owner_key", + "nullsNotDistinct": false, + "columns": [ + "handle", + "user_id" + ] + } + }, + "policies": {}, + "checkConstraints": { + "handles_owner_matches_type": { + "name": "handles_owner_matches_type", + "value": "(\n\t\t\t\t(\"handles\".\"owner_type\" = 'user' and \"handles\".\"user_id\" is not null and \"handles\".\"organization_id\" is null)\n\t\t\t\tor (\"handles\".\"owner_type\" = 'organization' and \"handles\".\"organization_id\" is not null and \"handles\".\"user_id\" is null)\n\t\t\t\tor (\"handles\".\"owner_type\" = 'reserved' and \"handles\".\"user_id\" is null and \"handles\".\"organization_id\" is null)\n\t\t\t)" + }, + "handles_shape": { + "name": "handles_shape", + "value": "length(\"handles\".\"handle\") between 2 and 39 and \"handles\".\"handle\" ~ '^[a-z0-9]+(-[a-z0-9]+)*$'" + } + }, + "isRLSEnabled": false + }, + "public.profile_awards": { + "name": "profile_awards", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tier": { + "name": "tier", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "value": { + "name": "value", + "type": "numeric(20, 4)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "awarded_on": { + "name": "awarded_on", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "awarded_at": { + "name": "awarded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "profile_awards_user_idx": { + "name": "profile_awards_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "profile_awards_slug_idx": { + "name": "profile_awards_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "awarded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "profile_awards_user_id_public_profiles_user_id_fk": { + "name": "profile_awards_user_id_public_profiles_user_id_fk", + "tableFrom": "profile_awards", + "tableTo": "public_profiles", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "profile_awards_identity_key": { + "name": "profile_awards_identity_key", + "nullsNotDistinct": false, + "columns": [ + "user_id", + "slug", + "tier" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.public_profiles": { + "name": "public_profiles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "handle": { + "name": "handle", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "leaderboard_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "bio": { + "name": "bio", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_handle": { + "name": "github_handle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "x_handle": { + "name": "x_handle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "website_url": { + "name": "website_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "opted_in_at": { + "name": "opted_in_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "flagged_at": { + "name": "flagged_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_published_at": { + "name": "last_published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "payload_version": { + "name": "payload_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "awards_catalog_version": { + "name": "awards_catalog_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "tokens": { + "name": "tokens", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "usd": { + "name": "usd", + "type": "numeric(20, 6)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "sessions": { + "name": "sessions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "uncached_input": { + "name": "uncached_input", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cached_input": { + "name": "cached_input", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cache_write_5m": { + "name": "cache_write_5m", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cache_write_1h": { + "name": "cache_write_1h", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "output": { + "name": "output", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "reasoning_output": { + "name": "reasoning_output", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "approximate": { + "name": "approximate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "day_range_start": { + "name": "day_range_start", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "day_range_end": { + "name": "day_range_end", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "tier": { + "name": "tier", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "tier_computed_at": { + "name": "tier_computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "active_days": { + "name": "active_days", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "axis_width": { + "name": "axis_width", + "type": "numeric(6, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "axis_depth": { + "name": "axis_depth", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "axis_output": { + "name": "axis_output", + "type": "numeric(8, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "axis_cost": { + "name": "axis_cost", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "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": { + "public_profiles_tokens_idx": { + "name": "public_profiles_tokens_idx", + "columns": [ + { + "expression": "tokens", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "public_profiles_org_idx": { + "name": "public_profiles_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "public_profiles_usd_idx": { + "name": "public_profiles_usd_idx", + "columns": [ + { + "expression": "usd", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "public_profiles_tier_idx": { + "name": "public_profiles_tier_idx", + "columns": [ + { + "expression": "tier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "public_profiles_user_id_users_id_fk": { + "name": "public_profiles_user_id_users_id_fk", + "tableFrom": "public_profiles", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "public_profiles_organization_id_organizations_id_fk": { + "name": "public_profiles_organization_id_organizations_id_fk", + "tableFrom": "public_profiles", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "public_profiles_handle_owner_fk": { + "name": "public_profiles_handle_owner_fk", + "tableFrom": "public_profiles", + "tableTo": "handles", + "columnsFrom": [ + "handle", + "user_id" + ], + "columnsTo": [ + "handle", + "user_id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "public_profiles_handle_unique": { + "name": "public_profiles_handle_unique", + "nullsNotDistinct": false, + "columns": [ + "handle" + ] + } + }, + "policies": {}, + "checkConstraints": { + "public_profiles_bio_length": { + "name": "public_profiles_bio_length", + "value": "length(\"public_profiles\".\"bio\") <= 160" + }, + "public_profiles_website_scheme": { + "name": "public_profiles_website_scheme", + "value": "\"public_profiles\".\"website_url\" is null or \"public_profiles\".\"website_url\" ~ '^https://'" + } + }, + "isRLSEnabled": false + }, + "public.agent_commands": { + "name": "agent_commands", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "target_device_id": { + "name": "target_device_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_device_type": { + "name": "target_device_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tool": { + "name": "tool", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "params": { + "name": "params", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "parent_command_id": { + "name": "parent_command_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "command_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "result": { + "name": "result", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "timeout_at": { + "name": "timeout_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "agent_commands_user_status_idx": { + "name": "agent_commands_user_status_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_commands_target_device_status_idx": { + "name": "agent_commands_target_device_status_idx", + "columns": [ + { + "expression": "target_device_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_commands_org_created_idx": { + "name": "agent_commands_org_created_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": {} + } + }, + "foreignKeys": { + "agent_commands_user_id_users_id_fk": { + "name": "agent_commands_user_id_users_id_fk", + "tableFrom": "agent_commands", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "agent_commands_organization_id_organizations_id_fk": { + "name": "agent_commands_organization_id_organizations_id_fk", + "tableFrom": "agent_commands", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_credentials": { + "name": "agent_credentials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "agent": { + "name": "agent", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "agent_credential_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "encrypted_value": { + "name": "encrypted_value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "base_url": { + "name": "base_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "account_label": { + "name": "account_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_validated_at": { + "name": "last_validated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "agent_credentials_user_id_idx": { + "name": "agent_credentials_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_credentials_user_id_users_id_fk": { + "name": "agent_credentials_user_id_users_id_fk", + "tableFrom": "agent_credentials", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "agent_credentials_user_id_agent_unique": { + "name": "agent_credentials_user_id_agent_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id", + "agent" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.attachments": { + "name": "attachments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "file_id": { + "name": "file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "parent_kind": { + "name": "parent_kind", + "type": "attachment_parent_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "attachments_file_id_idx": { + "name": "attachments_file_id_idx", + "columns": [ + { + "expression": "file_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "attachments_parent_kind_parent_id_idx": { + "name": "attachments_parent_kind_parent_id_idx", + "columns": [ + { + "expression": "parent_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "attachments_parent_path_unique": { + "name": "attachments_parent_path_unique", + "columns": [ + { + "expression": "parent_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"attachments\".\"path\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "attachments_file_id_files_id_fk": { + "name": "attachments_file_id_files_id_fk", + "tableFrom": "attachments", + "tableTo": "files", + "columnsFrom": [ + "file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.automation_events": { + "name": "automation_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "integration_connection_id": { + "name": "integration_connection_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "event_type": { + "name": "event_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_event_id": { + "name": "external_event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource_key": { + "name": "resource_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "repository_id": { + "name": "repository_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_login": { + "name": "actor_login", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_is_external": { + "name": "actor_is_external", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "webhook_event_id": { + "name": "webhook_event_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "received_at": { + "name": "received_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "dispatch_input": { + "name": "dispatch_input", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "dispatched_at": { + "name": "dispatched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "automation_events_undispatched_idx": { + "name": "automation_events_undispatched_idx", + "columns": [ + { + "expression": "received_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"automation_events\".\"dispatched_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_events_org_received_idx": { + "name": "automation_events_org_received_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "received_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_events_resource_idx": { + "name": "automation_events_resource_idx", + "columns": [ + { + "expression": "resource_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_events_received_at_idx": { + "name": "automation_events_received_at_idx", + "columns": [ + { + "expression": "received_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "automation_events_organization_id_organizations_id_fk": { + "name": "automation_events_organization_id_organizations_id_fk", + "tableFrom": "automation_events", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "automation_events_dedup_unique": { + "name": "automation_events_dedup_unique", + "nullsNotDistinct": true, + "columns": [ + "integration_connection_id", + "provider", + "external_event_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.automation_prompt_versions": { + "name": "automation_prompt_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "automation_id": { + "name": "automation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "author_user_id": { + "name": "author_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "window_bucket": { + "name": "window_bucket", + "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": { + "name": "source", + "type": "automation_prompt_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "restored_from_version_id": { + "name": "restored_from_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_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": { + "automation_prompt_versions_bucket_uniq": { + "name": "automation_prompt_versions_bucket_uniq", + "columns": [ + { + "expression": "automation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "author_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "window_bucket", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"automation_prompt_versions\".\"source\" <> 'restore'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_prompt_versions_automation_idx": { + "name": "automation_prompt_versions_automation_idx", + "columns": [ + { + "expression": "automation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "automation_prompt_versions_automation_id_automations_id_fk": { + "name": "automation_prompt_versions_automation_id_automations_id_fk", + "tableFrom": "automation_prompt_versions", + "tableTo": "automations", + "columnsFrom": [ + "automation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "automation_prompt_versions_author_user_id_users_id_fk": { + "name": "automation_prompt_versions_author_user_id_users_id_fk", + "tableFrom": "automation_prompt_versions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "author_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "automation_prompt_versions_restored_from_version_id_fk": { + "name": "automation_prompt_versions_restored_from_version_id_fk", + "tableFrom": "automation_prompt_versions", + "tableTo": "automation_prompt_versions", + "columnsFrom": [ + "restored_from_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.automation_runs": { + "name": "automation_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "automation_id": { + "name": "automation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "trigger_id": { + "name": "trigger_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scheduled_for": { + "name": "scheduled_for", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "resource_key": { + "name": "resource_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "v2_workspace_id": { + "name": "v2_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "session_kind": { + "name": "session_kind", + "type": "automation_session_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "chat_session_id": { + "name": "chat_session_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "terminal_session_id": { + "name": "terminal_session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "automation_run_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "error_code": { + "name": "error_code", + "type": "automation_run_error_code", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "dispatched_at": { + "name": "dispatched_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": { + "automation_runs_schedule_dedup_idx": { + "name": "automation_runs_schedule_dedup_idx", + "columns": [ + { + "expression": "automation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scheduled_for", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "scheduled_for IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_event_dedup_idx": { + "name": "automation_runs_event_dedup_idx", + "columns": [ + { + "expression": "trigger_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "event_id IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_inflight_resource_idx": { + "name": "automation_runs_inflight_resource_idx", + "columns": [ + { + "expression": "trigger_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "status IN ('dispatching', 'dispatched')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_history_idx": { + "name": "automation_runs_history_idx", + "columns": [ + { + "expression": "automation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_org_created_idx": { + "name": "automation_runs_org_created_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": {} + }, + "automation_runs_status_idx": { + "name": "automation_runs_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_workspace_idx": { + "name": "automation_runs_workspace_idx", + "columns": [ + { + "expression": "v2_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_cloud_workspace_idx": { + "name": "automation_runs_cloud_workspace_idx", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_runs_event_idx": { + "name": "automation_runs_event_idx", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "automation_runs_organization_id_organizations_id_fk": { + "name": "automation_runs_organization_id_organizations_id_fk", + "tableFrom": "automation_runs", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "automation_runs_trigger_id_automation_triggers_id_fk": { + "name": "automation_runs_trigger_id_automation_triggers_id_fk", + "tableFrom": "automation_runs", + "tableTo": "automation_triggers", + "columnsFrom": [ + "trigger_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "automation_runs_event_id_automation_events_id_fk": { + "name": "automation_runs_event_id_automation_events_id_fk", + "tableFrom": "automation_runs", + "tableTo": "automation_events", + "columnsFrom": [ + "event_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "automation_runs_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "automation_runs_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "automation_runs", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "automation_runs_chat_session_id_chat_sessions_id_fk": { + "name": "automation_runs_chat_session_id_chat_sessions_id_fk", + "tableFrom": "automation_runs", + "tableTo": "chat_sessions", + "columnsFrom": [ + "chat_session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "automation_runs_automation_org_fk": { + "name": "automation_runs_automation_org_fk", + "tableFrom": "automation_runs", + "tableTo": "automations", + "columnsFrom": [ + "automation_id", + "organization_id" + ], + "columnsTo": [ + "id", + "organization_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.automation_triggers": { + "name": "automation_triggers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "automation_id": { + "name": "automation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "automation_trigger_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "connection_id": { + "name": "connection_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "next_run_at": { + "name": "next_run_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "secret_hash": { + "name": "secret_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret_prefix": { + "name": "secret_prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret_rotated_at": { + "name": "secret_rotated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "automation_triggers_dispatcher_idx": { + "name": "automation_triggers_dispatcher_idx", + "columns": [ + { + "expression": "next_run_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "kind = 'schedule'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_triggers_matcher_idx": { + "name": "automation_triggers_matcher_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_triggers_automation_idx": { + "name": "automation_triggers_automation_idx", + "columns": [ + { + "expression": "automation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automation_triggers_schedule_idx": { + "name": "automation_triggers_schedule_idx", + "columns": [ + { + "expression": "automation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "kind = 'schedule'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "automation_triggers_organization_id_organizations_id_fk": { + "name": "automation_triggers_organization_id_organizations_id_fk", + "tableFrom": "automation_triggers", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "automation_triggers_automation_org_fk": { + "name": "automation_triggers_automation_org_fk", + "tableFrom": "automation_triggers", + "tableTo": "automations", + "columnsFrom": [ + "automation_id", + "organization_id" + ], + "columnsTo": [ + "id", + "organization_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "automation_triggers_kind_matches_config": { + "name": "automation_triggers_kind_matches_config", + "value": "config->>'kind' = kind::text" + } + }, + "isRLSEnabled": false + }, + "public.automations": { + "name": "automations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent": { + "name": "agent", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_host_id": { + "name": "target_host_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "v2_project_id": { + "name": "v2_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "v2_workspace_id": { + "name": "v2_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "tags": { + "name": "tags", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"automation\"]'::jsonb" + }, + "group_name": { + "name": "group_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "continue_agent_session": { + "name": "continue_agent_session", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "reuse_workspace": { + "name": "reuse_workspace", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "machine_size": { + "name": "machine_size", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "automations_owner_idx": { + "name": "automations_owner_idx", + "columns": [ + { + "expression": "owner_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "automations_organization_idx": { + "name": "automations_organization_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "automations_organization_id_organizations_id_fk": { + "name": "automations_organization_id_organizations_id_fk", + "tableFrom": "automations", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "automations_owner_user_id_users_id_fk": { + "name": "automations_owner_user_id_users_id_fk", + "tableFrom": "automations", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "owner_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "automations_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "automations_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "automations", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "automations_environment_id_environments_id_fk": { + "name": "automations_environment_id_environments_id_fk", + "tableFrom": "automations", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "automations_id_org_unique": { + "name": "automations_id_org_unique", + "nullsNotDistinct": false, + "columns": [ + "id", + "organization_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_sessions": { + "name": "chat_sessions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "v2_workspace_id": { + "name": "v2_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_active_at": { + "name": "last_active_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": { + "chat_sessions_org_idx": { + "name": "chat_sessions_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_sessions_created_by_idx": { + "name": "chat_sessions_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_sessions_last_active_idx": { + "name": "chat_sessions_last_active_idx", + "columns": [ + { + "expression": "last_active_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chat_sessions_organization_id_organizations_id_fk": { + "name": "chat_sessions_organization_id_organizations_id_fk", + "tableFrom": "chat_sessions", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "chat_sessions_created_by_users_id_fk": { + "name": "chat_sessions_created_by_users_id_fk", + "tableFrom": "chat_sessions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "chat_sessions_workspace_id_workspaces_id_fk": { + "name": "chat_sessions_workspace_id_workspaces_id_fk", + "tableFrom": "chat_sessions", + "tableTo": "workspaces", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_activity": { + "name": "cloud_workspace_activity", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "actor_kind": { + "name": "actor_kind", + "type": "actor_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event": { + "name": "event", + "type": "cloud_workspace_activity_event", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "from_name": { + "name": "from_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "to_name": { + "name": "to_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "from_visibility": { + "name": "from_visibility", + "type": "cloud_workspace_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "to_visibility": { + "name": "to_visibility", + "type": "cloud_workspace_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "target_user_id": { + "name": "target_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "target_team_id": { + "name": "target_team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "target_email": { + "name": "target_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "from_project_id": { + "name": "from_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "to_project_id": { + "name": "to_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "added_label_ids": { + "name": "added_label_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": false + }, + "removed_label_ids": { + "name": "removed_label_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": false + }, + "linked_task_id": { + "name": "linked_task_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "unlinked_task_id": { + "name": "unlinked_task_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "pr_url": { + "name": "pr_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "suggestion_id": { + "name": "suggestion_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cloud_workspace_activity_workspace_created_idx": { + "name": "cloud_workspace_activity_workspace_created_idx", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_activity_linked_task_id_idx": { + "name": "cloud_workspace_activity_linked_task_id_idx", + "columns": [ + { + "expression": "linked_task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_activity_unlinked_task_id_idx": { + "name": "cloud_workspace_activity_unlinked_task_id_idx", + "columns": [ + { + "expression": "unlinked_task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_activity_target_user_id_idx": { + "name": "cloud_workspace_activity_target_user_id_idx", + "columns": [ + { + "expression": "target_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_activity_target_team_id_idx": { + "name": "cloud_workspace_activity_target_team_id_idx", + "columns": [ + { + "expression": "target_team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_activity_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_activity_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_activity_actor_user_id_users_id_fk": { + "name": "cloud_workspace_activity_actor_user_id_users_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_target_user_id_users_id_fk": { + "name": "cloud_workspace_activity_target_user_id_users_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "target_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_target_team_id_teams_id_fk": { + "name": "cloud_workspace_activity_target_team_id_teams_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "target_team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_from_project_id_task_projects_id_fk": { + "name": "cloud_workspace_activity_from_project_id_task_projects_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "task_projects", + "columnsFrom": [ + "from_project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_to_project_id_task_projects_id_fk": { + "name": "cloud_workspace_activity_to_project_id_task_projects_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "task_projects", + "columnsFrom": [ + "to_project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_linked_task_id_tasks_id_fk": { + "name": "cloud_workspace_activity_linked_task_id_tasks_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "tasks", + "columnsFrom": [ + "linked_task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_unlinked_task_id_tasks_id_fk": { + "name": "cloud_workspace_activity_unlinked_task_id_tasks_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "tasks", + "columnsFrom": [ + "unlinked_task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_page_id_pages_id_fk": { + "name": "cloud_workspace_activity_page_id_pages_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_activity_suggestion_id_suggestions_id_fk": { + "name": "cloud_workspace_activity_suggestion_id_suggestions_id_fk", + "tableFrom": "cloud_workspace_activity", + "tableTo": "suggestions", + "columnsFrom": [ + "suggestion_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_boots": { + "name": "cloud_workspace_boots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "vercel_session_id": { + "name": "vercel_session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "memory_mb": { + "name": "memory_mb", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "vcpus": { + "name": "vcpus", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "stopped_at": { + "name": "stopped_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "lock_seq": { + "name": "lock_seq", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "lock_open": { + "name": "lock_open", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "finalized_through": { + "name": "finalized_through", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "settle_lease_until": { + "name": "settle_lease_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cloud_workspace_boots_cloud_workspace_id_idx": { + "name": "cloud_workspace_boots_cloud_workspace_id_idx", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_boots_organization_id_idx": { + "name": "cloud_workspace_boots_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_boots_open_idx": { + "name": "cloud_workspace_boots_open_idx", + "columns": [ + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"cloud_workspace_boots\".\"stopped_at\" is null or \"cloud_workspace_boots\".\"finalized_through\" is null or \"cloud_workspace_boots\".\"finalized_through\" < \"cloud_workspace_boots\".\"stopped_at\"", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_boots_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_boots_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_boots", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "cloud_workspace_boots_vercel_session_id_unique": { + "name": "cloud_workspace_boots_vercel_session_id_unique", + "nullsNotDistinct": false, + "columns": [ + "vercel_session_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_labels": { + "name": "cloud_workspace_labels", + "schema": "", + "columns": { + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cloud_workspace_labels_label_id_idx": { + "name": "cloud_workspace_labels_label_id_idx", + "columns": [ + { + "expression": "label_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_labels_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_labels_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_labels", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_labels_label_id_task_labels_id_fk": { + "name": "cloud_workspace_labels_label_id_task_labels_id_fk", + "tableFrom": "cloud_workspace_labels", + "tableTo": "task_labels", + "columnsFrom": [ + "label_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "cloud_workspace_labels_cloud_workspace_id_label_id_pk": { + "name": "cloud_workspace_labels_cloud_workspace_id_label_id_pk", + "columns": [ + "cloud_workspace_id", + "label_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_pull_requests": { + "name": "cloud_workspace_pull_requests", + "schema": "", + "columns": { + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "repository_id": { + "name": "repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "pr_number": { + "name": "pr_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "linked_at": { + "name": "linked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cloud_workspace_pull_requests_repository_id_idx": { + "name": "cloud_workspace_pull_requests_repository_id_idx", + "columns": [ + { + "expression": "repository_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_pull_requests_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_pull_requests_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_pull_requests", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_pull_requests_repository_id_github_repositories_id_fk": { + "name": "cloud_workspace_pull_requests_repository_id_github_repositories_id_fk", + "tableFrom": "cloud_workspace_pull_requests", + "tableTo": "github_repositories", + "columnsFrom": [ + "repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "cloud_workspace_pull_requests_pk": { + "name": "cloud_workspace_pull_requests_pk", + "columns": [ + "cloud_workspace_id", + "repository_id", + "pr_number" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_repositories": { + "name": "cloud_workspace_repositories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "repository_id": { + "name": "repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "cloud_workspace_repositories_cloud_workspace_id_idx": { + "name": "cloud_workspace_repositories_cloud_workspace_id_idx", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_repositories_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_repositories_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_repositories", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_repositories_repository_id_github_repositories_id_fk": { + "name": "cloud_workspace_repositories_repository_id_github_repositories_id_fk", + "tableFrom": "cloud_workspace_repositories", + "tableTo": "github_repositories", + "columnsFrom": [ + "repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "cloud_workspace_repositories_workspace_repository_unique": { + "name": "cloud_workspace_repositories_workspace_repository_unique", + "nullsNotDistinct": false, + "columns": [ + "cloud_workspace_id", + "repository_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_shares": { + "name": "cloud_workspace_shares", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "invitation_id": { + "name": "invitation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "shared_by_user_id": { + "name": "shared_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "cloud_workspace_shares_user_unique": { + "name": "cloud_workspace_shares_user_unique", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_shares_team_unique": { + "name": "cloud_workspace_shares_team_unique", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_shares_invitation_unique": { + "name": "cloud_workspace_shares_invitation_unique", + "columns": [ + { + "expression": "cloud_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "invitation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_shares_user_id_idx": { + "name": "cloud_workspace_shares_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_shares_team_id_idx": { + "name": "cloud_workspace_shares_team_id_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_shares_invitation_id_idx": { + "name": "cloud_workspace_shares_invitation_id_idx", + "columns": [ + { + "expression": "invitation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cloud_workspace_shares_shared_by_user_id_idx": { + "name": "cloud_workspace_shares_shared_by_user_id_idx", + "columns": [ + { + "expression": "shared_by_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_shares_user_id_users_id_fk": { + "name": "cloud_workspace_shares_user_id_users_id_fk", + "tableFrom": "cloud_workspace_shares", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_shares_team_id_teams_id_fk": { + "name": "cloud_workspace_shares_team_id_teams_id_fk", + "tableFrom": "cloud_workspace_shares", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_shares_invitation_id_invitations_id_fk": { + "name": "cloud_workspace_shares_invitation_id_invitations_id_fk", + "tableFrom": "cloud_workspace_shares", + "tableTo": "invitations", + "schemaTo": "auth", + "columnsFrom": [ + "invitation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_shares_shared_by_user_id_users_id_fk": { + "name": "cloud_workspace_shares_shared_by_user_id_users_id_fk", + "tableFrom": "cloud_workspace_shares", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "shared_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspace_shares_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_shares_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_shares", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "cloud_workspace_shares_one_grantee": { + "name": "cloud_workspace_shares_one_grantee", + "value": "num_nonnulls(user_id, team_id, invitation_id) = 1" + } + }, + "isRLSEnabled": false + }, + "public.cloud_workspace_tags": { + "name": "cloud_workspace_tags", + "schema": "", + "columns": { + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "cloud_workspace_tags_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_tags_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_tags", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_tags_created_by_user_id_users_id_fk": { + "name": "cloud_workspace_tags_created_by_user_id_users_id_fk", + "tableFrom": "cloud_workspace_tags", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "cloud_workspace_tags_cloud_workspace_id_tag_created_by_user_id_pk": { + "name": "cloud_workspace_tags_cloud_workspace_id_tag_created_by_user_id_pk", + "columns": [ + "cloud_workspace_id", + "tag", + "created_by_user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspace_tasks": { + "name": "cloud_workspace_tasks", + "schema": "", + "columns": { + "cloud_workspace_id": { + "name": "cloud_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "linked_by_kind": { + "name": "linked_by_kind", + "type": "actor_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "linked_by_user_id": { + "name": "linked_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cloud_workspace_tasks_task_id_idx": { + "name": "cloud_workspace_tasks_task_id_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspace_tasks_cloud_workspace_id_cloud_workspaces_id_fk": { + "name": "cloud_workspace_tasks_cloud_workspace_id_cloud_workspaces_id_fk", + "tableFrom": "cloud_workspace_tasks", + "tableTo": "cloud_workspaces", + "columnsFrom": [ + "cloud_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_tasks_task_id_tasks_id_fk": { + "name": "cloud_workspace_tasks_task_id_tasks_id_fk", + "tableFrom": "cloud_workspace_tasks", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspace_tasks_linked_by_user_id_users_id_fk": { + "name": "cloud_workspace_tasks_linked_by_user_id_users_id_fk", + "tableFrom": "cloud_workspace_tasks", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "linked_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "cloud_workspace_tasks_cloud_workspace_id_task_id_pk": { + "name": "cloud_workspace_tasks_cloud_workspace_id_task_id_pk", + "columns": [ + "cloud_workspace_id", + "task_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cloud_workspaces": { + "name": "cloud_workspaces", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "base_branch": { + "name": "base_branch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'vercel'" + }, + "provider_sandbox_id": { + "name": "provider_sandbox_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sandbox_url": { + "name": "sandbox_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "cloud_workspace_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'provisioning'" + }, + "visibility": { + "name": "visibility", + "type": "cloud_workspace_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'org'" + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "host_version": { + "name": "host_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "boot_agent_credential_digest": { + "name": "boot_agent_credential_digest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "agent_status": { + "name": "agent_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "agent_status_at": { + "name": "agent_status_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "usage_stop_at": { + "name": "usage_stop_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "machine_size": { + "name": "machine_size", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "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": { + "cloud_workspaces_organization_id_idx": { + "name": "cloud_workspaces_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cloud_workspaces_organization_id_organizations_id_fk": { + "name": "cloud_workspaces_organization_id_organizations_id_fk", + "tableFrom": "cloud_workspaces", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "cloud_workspaces_environment_id_environments_id_fk": { + "name": "cloud_workspaces_environment_id_environments_id_fk", + "tableFrom": "cloud_workspaces", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "cloud_workspaces_project_id_task_projects_id_fk": { + "name": "cloud_workspaces_project_id_task_projects_id_fk", + "tableFrom": "cloud_workspaces", + "tableTo": "task_projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cloud_workspaces_created_by_user_id_users_id_fk": { + "name": "cloud_workspaces_created_by_user_id_users_id_fk", + "tableFrom": "cloud_workspaces", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "cloud_workspaces_provider_sandbox_id_unique": { + "name": "cloud_workspaces_provider_sandbox_id_unique", + "nullsNotDistinct": false, + "columns": [ + "provider", + "provider_sandbox_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connections": { + "name": "connections", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connected_by_user_id": { + "name": "connected_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connector": { + "name": "connector", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "owner_kind": { + "name": "owner_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "auth_method": { + "name": "auth_method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token_expires_at": { + "name": "token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "issuer": { + "name": "issuer", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "resource": { + "name": "resource", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_client_id": { + "name": "oauth_client_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "external_account_id": { + "name": "external_account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_account_label": { + "name": "external_account_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "external_user_id": { + "name": "external_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "external_user_label": { + "name": "external_user_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "nickname": { + "name": "nickname", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "disconnected_at": { + "name": "disconnected_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "disconnect_reason": { + "name": "disconnect_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": { + "connections_org_connector_unique": { + "name": "connections_org_connector_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "connector", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"connections\".\"owner_kind\" = 'org'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "connections_user_connector_unique": { + "name": "connections_user_connector_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "connector", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "connected_by_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"connections\".\"owner_kind\" = 'user'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "connections_org_idx": { + "name": "connections_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "connections_user_connector_idx": { + "name": "connections_user_connector_idx", + "columns": [ + { + "expression": "connected_by_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "connector", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"connections\".\"disconnected_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "connections_external_account_idx": { + "name": "connections_external_account_idx", + "columns": [ + { + "expression": "connector", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connections_organization_id_organizations_id_fk": { + "name": "connections_organization_id_organizations_id_fk", + "tableFrom": "connections", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "connections_connected_by_user_id_users_id_fk": { + "name": "connections_connected_by_user_id_users_id_fk", + "tableFrom": "connections", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "connected_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "connections_user_identity_present": { + "name": "connections_user_identity_present", + "value": "owner_kind <> 'user' OR external_user_id IS NOT NULL" + } + }, + "isRLSEnabled": false + }, + "public.deal_redemptions": { + "name": "deal_redemptions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_redemption_id": { + "name": "external_redemption_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "deal_id": { + "name": "deal_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "company_name": { + "name": "company_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "company_batch": { + "name": "company_batch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "stripe_subscription_id": { + "name": "stripe_subscription_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "promotion_code": { + "name": "promotion_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payload": { + "name": "payload", + "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": { + "deal_redemptions_source_external_id_unique": { + "name": "deal_redemptions_source_external_id_unique", + "columns": [ + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_redemption_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "deal_redemptions_email_idx": { + "name": "deal_redemptions_email_idx", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deal_redemptions_organization_id_organizations_id_fk": { + "name": "deal_redemptions_organization_id_organizations_id_fk", + "tableFrom": "deal_redemptions", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.desktop_notices": { + "name": "desktop_notices", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "severity": { + "name": "severity", + "type": "desktop_notice_severity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "trigger": { + "name": "trigger", + "type": "desktop_notice_trigger", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'immediate'" + }, + "min_version": { + "name": "min_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "max_version": { + "name": "max_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "platforms": { + "name": "platforms", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "channels": { + "name": "channels", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "starts_at": { + "name": "starts_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "ends_at": { + "name": "ends_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cta_label": { + "name": "cta_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cta_action": { + "name": "cta_action", + "type": "desktop_notice_cta_action", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cta_url": { + "name": "cta_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dismissible": { + "name": "dismissible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "active": { + "name": "active", + "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": { + "desktop_notices_active_idx": { + "name": "desktop_notices_active_idx", + "columns": [ + { + "expression": "active", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_projects": { + "name": "environment_projects", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "environment_projects_project_id_idx": { + "name": "environment_projects_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_projects_organization_id_organizations_id_fk": { + "name": "environment_projects_organization_id_organizations_id_fk", + "tableFrom": "environment_projects", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_projects_environment_id_environments_id_fk": { + "name": "environment_projects_environment_id_environments_id_fk", + "tableFrom": "environment_projects", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environment_projects_environment_id_project_id_unique": { + "name": "environment_projects_environment_id_project_id_unique", + "nullsNotDistinct": false, + "columns": [ + "environment_id", + "project_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_repositories": { + "name": "environment_repositories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "repository_id": { + "name": "repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "environment_repositories_environment_id_idx": { + "name": "environment_repositories_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_repositories_environment_id_environments_id_fk": { + "name": "environment_repositories_environment_id_environments_id_fk", + "tableFrom": "environment_repositories", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_repositories_repository_id_github_repositories_id_fk": { + "name": "environment_repositories_repository_id_github_repositories_id_fk", + "tableFrom": "environment_repositories", + "tableTo": "github_repositories", + "columnsFrom": [ + "repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environment_repositories_environment_id_repository_id_unique": { + "name": "environment_repositories_environment_id_repository_id_unique", + "nullsNotDistinct": false, + "columns": [ + "environment_id", + "repository_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_secrets": { + "name": "environment_secrets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "encrypted_value": { + "name": "encrypted_value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sensitive": { + "name": "sensitive", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "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": { + "environment_secrets_environment_id_idx": { + "name": "environment_secrets_environment_id_idx", + "columns": [ + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "environment_secrets_organization_id_idx": { + "name": "environment_secrets_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_secrets_organization_id_organizations_id_fk": { + "name": "environment_secrets_organization_id_organizations_id_fk", + "tableFrom": "environment_secrets", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_secrets_environment_id_environments_id_fk": { + "name": "environment_secrets_environment_id_environments_id_fk", + "tableFrom": "environment_secrets", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_secrets_created_by_user_id_users_id_fk": { + "name": "environment_secrets_created_by_user_id_users_id_fk", + "tableFrom": "environment_secrets", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environment_secrets_environment_id_organization_id_key_unique": { + "name": "environment_secrets_environment_id_organization_id_key_unique", + "nullsNotDistinct": false, + "columns": [ + "environment_id", + "organization_id", + "key" + ] + } + }, + "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": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'vercel'" + }, + "source_kind": { + "name": "source_kind", + "type": "environment_source_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "source_ref": { + "name": "source_ref", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'sfo1'" + }, + "bundle_sha": { + "name": "bundle_sha", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "primary_repository_id": { + "name": "primary_repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "environment_scope", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'organization'" + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "environments_organization_id_idx": { + "name": "environments_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environments_organization_id_organizations_id_fk": { + "name": "environments_organization_id_organizations_id_fk", + "tableFrom": "environments", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environments_primary_repository_id_github_repositories_id_fk": { + "name": "environments_primary_repository_id_github_repositories_id_fk", + "tableFrom": "environments", + "tableTo": "github_repositories", + "columnsFrom": [ + "primary_repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "environments_created_by_user_id_users_id_fk": { + "name": "environments_created_by_user_id_users_id_fk", + "tableFrom": "environments", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content_type": { + "name": "content_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size_bytes": { + "name": "size_bytes", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "file_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "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": { + "files_organization_id_created_at_idx": { + "name": "files_organization_id_created_at_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "\"created_at\" desc", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "files_status_created_at_idx": { + "name": "files_status_created_at_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "files_organization_id_organizations_id_fk": { + "name": "files_organization_id_organizations_id_fk", + "tableFrom": "files", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "files_created_by_user_id_users_id_fk": { + "name": "files_created_by_user_id_users_id_fk", + "tableFrom": "files", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_user_connections": { + "name": "github_user_connections", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "github_user_id": { + "name": "github_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "login": { + "name": "login", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "encrypted_access_token": { + "name": "encrypted_access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "encrypted_refresh_token": { + "name": "encrypted_refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "github_user_connections_user_id_users_id_fk": { + "name": "github_user_connections_user_id_users_id_fk", + "tableFrom": "github_user_connections", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "github_user_connections_user_id_unique": { + "name": "github_user_connections_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.integration_connections": { + "name": "integration_connections", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "connected_by_user_id": { + "name": "connected_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "integration_provider", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token_expires_at": { + "name": "token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "disconnected_at": { + "name": "disconnected_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "disconnect_reason": { + "name": "disconnect_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "external_org_id": { + "name": "external_org_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "external_org_name": { + "name": "external_org_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "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": { + "integration_connections_org_provider_unique": { + "name": "integration_connections_org_provider_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"integration_connections\".\"provider\" <> 'google'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "integration_connections_google_user_unique": { + "name": "integration_connections_google_user_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "connected_by_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"integration_connections\".\"provider\" = 'google'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "integration_connections_slack_external_org_active_unique": { + "name": "integration_connections_slack_external_org_active_unique", + "columns": [ + { + "expression": "external_org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"integration_connections\".\"provider\" = 'slack' AND \"integration_connections\".\"disconnected_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "integration_connections_org_idx": { + "name": "integration_connections_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "integration_connections_organization_id_organizations_id_fk": { + "name": "integration_connections_organization_id_organizations_id_fk", + "tableFrom": "integration_connections", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "integration_connections_connected_by_user_id_users_id_fk": { + "name": "integration_connections_connected_by_user_id_users_id_fk", + "tableFrom": "integration_connections", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "connected_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.page_comment_reads": { + "name": "page_comment_reads", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "page_comment_reads_page_id_idx": { + "name": "page_comment_reads_page_id_idx", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_comment_reads_user_id_users_id_fk": { + "name": "page_comment_reads_user_id_users_id_fk", + "tableFrom": "page_comment_reads", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_comment_reads_page_id_pages_id_fk": { + "name": "page_comment_reads_page_id_pages_id_fk", + "tableFrom": "page_comment_reads", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "page_comment_reads_user_id_page_id_pk": { + "name": "page_comment_reads_user_id_page_id_pk", + "columns": [ + "user_id", + "page_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.page_comment_threads": { + "name": "page_comment_threads", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "page_version_id": { + "name": "page_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "anchor_kind": { + "name": "anchor_kind", + "type": "page_comment_anchor_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "intent": { + "name": "intent", + "type": "page_comment_intent", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "anchor": { + "name": "anchor", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "anchor_text": { + "name": "anchor_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "agent_activated_at": { + "name": "agent_activated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "agent_activated_by_user_id": { + "name": "agent_activated_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "resolved_at": { + "name": "resolved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "resolved_by_user_id": { + "name": "resolved_by_user_id", + "type": "uuid", + "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": { + "page_comment_threads_page_id_idx": { + "name": "page_comment_threads_page_id_idx", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_comment_threads_page_version_id_idx": { + "name": "page_comment_threads_page_version_id_idx", + "columns": [ + { + "expression": "page_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_comment_threads_open_idx": { + "name": "page_comment_threads_open_idx", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "resolved_at IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_comment_threads_page_id_pages_id_fk": { + "name": "page_comment_threads_page_id_pages_id_fk", + "tableFrom": "page_comment_threads", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_comment_threads_page_version_id_page_versions_id_fk": { + "name": "page_comment_threads_page_version_id_page_versions_id_fk", + "tableFrom": "page_comment_threads", + "tableTo": "page_versions", + "columnsFrom": [ + "page_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_comment_threads_created_by_user_id_users_id_fk": { + "name": "page_comment_threads_created_by_user_id_users_id_fk", + "tableFrom": "page_comment_threads", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "page_comment_threads_agent_activated_by_user_id_users_id_fk": { + "name": "page_comment_threads_agent_activated_by_user_id_users_id_fk", + "tableFrom": "page_comment_threads", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "agent_activated_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "page_comment_threads_resolved_by_user_id_users_id_fk": { + "name": "page_comment_threads_resolved_by_user_id_users_id_fk", + "tableFrom": "page_comment_threads", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "resolved_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "page_comment_threads_anchor_matches_kind": { + "name": "page_comment_threads_anchor_matches_kind", + "value": "(anchor_kind = 'page') = (anchor IS NULL)" + } + }, + "isRLSEnabled": false + }, + "public.page_comments": { + "name": "page_comments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "thread_id": { + "name": "thread_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "author_kind": { + "name": "author_kind", + "type": "page_comment_author_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'human'" + }, + "author_user_id": { + "name": "author_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "agent_session_id": { + "name": "agent_session_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "page_comments_thread_id_created_at_idx": { + "name": "page_comments_thread_id_created_at_idx", + "columns": [ + { + "expression": "thread_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_comments_thread_id_page_comment_threads_id_fk": { + "name": "page_comments_thread_id_page_comment_threads_id_fk", + "tableFrom": "page_comments", + "tableTo": "page_comment_threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_comments_author_user_id_users_id_fk": { + "name": "page_comments_author_user_id_users_id_fk", + "tableFrom": "page_comments", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "author_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "page_comments_agent_has_session": { + "name": "page_comments_agent_has_session", + "value": "author_kind <> 'agent' OR agent_session_id IS NOT NULL" + } + }, + "isRLSEnabled": false + }, + "public.page_reports": { + "name": "page_reports", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "reported_version": { + "name": "reported_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "details": { + "name": "details", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "page_report_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'open'" + }, + "reported_by_user_id": { + "name": "reported_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reporter_email": { + "name": "reporter_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reporter_ip_hash": { + "name": "reporter_ip_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reviewed_by_user_id": { + "name": "reviewed_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reviewed_at": { + "name": "reviewed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "review_note": { + "name": "review_note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "page_reports_status_created_at_idx": { + "name": "page_reports_status_created_at_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "\"created_at\" desc", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_reports_page_id_idx": { + "name": "page_reports_page_id_idx", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_reports_reporter_ip_hash_idx": { + "name": "page_reports_reporter_ip_hash_idx", + "columns": [ + { + "expression": "reporter_ip_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_reports_page_id_pages_id_fk": { + "name": "page_reports_page_id_pages_id_fk", + "tableFrom": "page_reports", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_reports_reported_by_user_id_users_id_fk": { + "name": "page_reports_reported_by_user_id_users_id_fk", + "tableFrom": "page_reports", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "reported_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "page_reports_reviewed_by_user_id_users_id_fk": { + "name": "page_reports_reviewed_by_user_id_users_id_fk", + "tableFrom": "page_reports", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "reviewed_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.page_shares": { + "name": "page_shares", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "invitation_id": { + "name": "invitation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "shared_by_user_id": { + "name": "shared_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "page_share_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'comment'" + } + }, + "indexes": { + "page_shares_user_unique": { + "name": "page_shares_user_unique", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_shares_team_unique": { + "name": "page_shares_team_unique", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_shares_invitation_unique": { + "name": "page_shares_invitation_unique", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "invitation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_shares_user_id_idx": { + "name": "page_shares_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_shares_team_id_idx": { + "name": "page_shares_team_id_idx", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_shares_invitation_id_idx": { + "name": "page_shares_invitation_id_idx", + "columns": [ + { + "expression": "invitation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "page_shares_shared_by_user_id_idx": { + "name": "page_shares_shared_by_user_id_idx", + "columns": [ + { + "expression": "shared_by_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_shares_user_id_users_id_fk": { + "name": "page_shares_user_id_users_id_fk", + "tableFrom": "page_shares", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_shares_team_id_teams_id_fk": { + "name": "page_shares_team_id_teams_id_fk", + "tableFrom": "page_shares", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_shares_invitation_id_invitations_id_fk": { + "name": "page_shares_invitation_id_invitations_id_fk", + "tableFrom": "page_shares", + "tableTo": "invitations", + "schemaTo": "auth", + "columnsFrom": [ + "invitation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_shares_shared_by_user_id_users_id_fk": { + "name": "page_shares_shared_by_user_id_users_id_fk", + "tableFrom": "page_shares", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "shared_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "page_shares_page_id_pages_id_fk": { + "name": "page_shares_page_id_pages_id_fk", + "tableFrom": "page_shares", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "page_shares_one_grantee": { + "name": "page_shares_one_grantee", + "value": "num_nonnulls(user_id, team_id, invitation_id) = 1" + } + }, + "isRLSEnabled": false + }, + "public.page_tool_grants": { + "name": "page_tool_grants", + "schema": "", + "columns": { + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "plugin": { + "name": "plugin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "connection_id": { + "name": "connection_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "page_tool_grants_user_id_idx": { + "name": "page_tool_grants_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_tool_grants_page_id_pages_id_fk": { + "name": "page_tool_grants_page_id_pages_id_fk", + "tableFrom": "page_tool_grants", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_tool_grants_user_id_users_id_fk": { + "name": "page_tool_grants_user_id_users_id_fk", + "tableFrom": "page_tool_grants", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "page_tool_grants_page_id_user_id_plugin_pk": { + "name": "page_tool_grants_page_id_user_id_plugin_pk", + "columns": [ + "page_id", + "user_id", + "plugin" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.page_versions": { + "name": "page_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "storage_key": { + "name": "storage_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content_type": { + "name": "content_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "page_versions_page_id_idx": { + "name": "page_versions_page_id_idx", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "page_versions_page_id_pages_id_fk": { + "name": "page_versions_page_id_pages_id_fk", + "tableFrom": "page_versions", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "page_versions_created_by_user_id_users_id_fk": { + "name": "page_versions_created_by_user_id_users_id_fk", + "tableFrom": "page_versions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "page_versions_page_id_version_unique": { + "name": "page_versions_page_id_version_unique", + "nullsNotDistinct": false, + "columns": [ + "page_id", + "version" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.pages": { + "name": "pages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "type": "page_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'just_me'" + }, + "organization_role": { + "name": "organization_role", + "type": "page_share_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'comment'" + }, + "shared_version": { + "name": "shared_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "taken_down_at": { + "name": "taken_down_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "taken_down_by_user_id": { + "name": "taken_down_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "taken_down_note": { + "name": "taken_down_note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "watched_by_agent": { + "name": "watched_by_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "watch_state": { + "name": "watch_state", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "watch_heartbeat_at": { + "name": "watch_heartbeat_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "pages_slug_unique": { + "name": "pages_slug_unique", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "pages_organization_id_created_at_id_idx": { + "name": "pages_organization_id_created_at_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "\"created_at\" desc", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "\"id\" desc", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "pages_created_by_user_id_idx": { + "name": "pages_created_by_user_id_idx", + "columns": [ + { + "expression": "created_by_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "pages_organization_id_organizations_id_fk": { + "name": "pages_organization_id_organizations_id_fk", + "tableFrom": "pages", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "pages_created_by_user_id_users_id_fk": { + "name": "pages_created_by_user_id_users_id_fk", + "tableFrom": "pages", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "pages_taken_down_by_user_id_users_id_fk": { + "name": "pages_taken_down_by_user_id_users_id_fk", + "tableFrom": "pages", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "taken_down_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "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": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "github_repository_id": { + "name": "github_repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "repo_owner": { + "name": "repo_owner", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repo_name": { + "name": "repo_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repo_url": { + "name": "repo_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "default_branch": { + "name": "default_branch", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'main'" + }, + "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": { + "projects_organization_id_idx": { + "name": "projects_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "projects_organization_id_organizations_id_fk": { + "name": "projects_organization_id_organizations_id_fk", + "tableFrom": "projects", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "projects_github_repository_id_github_repositories_id_fk": { + "name": "projects_github_repository_id_github_repositories_id_fk", + "tableFrom": "projects", + "tableTo": "github_repositories", + "columnsFrom": [ + "github_repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "projects_org_slug_unique": { + "name": "projects_org_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sandbox_bundles": { + "name": "sandbox_bundles", + "schema": "", + "columns": { + "sha": { + "name": "sha", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "image_ref": { + "name": "image_ref", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "released_at": { + "name": "released_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.submitted_prompts": { + "name": "submitted_prompts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "prompt_text": { + "name": "prompt_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "submitter_name": { + "name": "submitter_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "submitted_prompts_user_id_idx": { + "name": "submitted_prompts_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "submitted_prompts_organization_id_idx": { + "name": "submitted_prompts_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "submitted_prompts_created_at_idx": { + "name": "submitted_prompts_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "submitted_prompts_user_id_users_id_fk": { + "name": "submitted_prompts_user_id_users_id_fk", + "tableFrom": "submitted_prompts", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "submitted_prompts_organization_id_organizations_id_fk": { + "name": "submitted_prompts_organization_id_organizations_id_fk", + "tableFrom": "submitted_prompts", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subscriptions": { + "name": "subscriptions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "plan": { + "name": "plan", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reference_id": { + "name": "reference_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "stripe_customer_id": { + "name": "stripe_customer_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripe_subscription_id": { + "name": "stripe_subscription_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'incomplete'" + }, + "period_start": { + "name": "period_start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "period_end": { + "name": "period_end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "trial_start": { + "name": "trial_start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "trial_end": { + "name": "trial_end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "cancel_at_period_end": { + "name": "cancel_at_period_end", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cancel_at": { + "name": "cancel_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "canceled_at": { + "name": "canceled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "seats": { + "name": "seats", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "billing_interval": { + "name": "billing_interval", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripe_schedule_id": { + "name": "stripe_schedule_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()" + } + }, + "indexes": { + "subscriptions_reference_id_idx": { + "name": "subscriptions_reference_id_idx", + "columns": [ + { + "expression": "reference_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "subscriptions_stripe_customer_id_idx": { + "name": "subscriptions_stripe_customer_id_idx", + "columns": [ + { + "expression": "stripe_customer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "subscriptions_status_idx": { + "name": "subscriptions_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "subscriptions_reference_id_organizations_id_fk": { + "name": "subscriptions_reference_id_organizations_id_fk", + "tableFrom": "subscriptions", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "reference_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.suggestions": { + "name": "suggestions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "suggestion_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "subject_type": { + "name": "subject_type", + "type": "suggestion_entity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "object_type": { + "name": "object_type", + "type": "suggestion_entity", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "object_id": { + "name": "object_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "suggestion_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "proposed_by_kind": { + "name": "proposed_by_kind", + "type": "actor_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "proposed_by_user_id": { + "name": "proposed_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "automation_id": { + "name": "automation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "decided_by_user_id": { + "name": "decided_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "decided_at": { + "name": "decided_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": { + "suggestions_kind_subject_object_unique": { + "name": "suggestions_kind_subject_object_unique", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "subject_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "subject_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "object_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "object_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "suggestions_subject_status_idx": { + "name": "suggestions_subject_status_idx", + "columns": [ + { + "expression": "subject_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "subject_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "suggestions_organization_id_status_idx": { + "name": "suggestions_organization_id_status_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "suggestions_organization_id_organizations_id_fk": { + "name": "suggestions_organization_id_organizations_id_fk", + "tableFrom": "suggestions", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "suggestions_proposed_by_user_id_users_id_fk": { + "name": "suggestions_proposed_by_user_id_users_id_fk", + "tableFrom": "suggestions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "proposed_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "suggestions_automation_id_automations_id_fk": { + "name": "suggestions_automation_id_automations_id_fk", + "tableFrom": "suggestions", + "tableTo": "automations", + "columnsFrom": [ + "automation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "suggestions_decided_by_user_id_users_id_fk": { + "name": "suggestions_decided_by_user_id_users_id_fk", + "tableFrom": "suggestions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "decided_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_activity": { + "name": "task_activity", + "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 + }, + "actor_kind": { + "name": "actor_kind", + "type": "actor_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "from_title": { + "name": "from_title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "to_title": { + "name": "to_title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "from_status_id": { + "name": "from_status_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "to_status_id": { + "name": "to_status_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "from_priority": { + "name": "from_priority", + "type": "task_priority", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "to_priority": { + "name": "to_priority", + "type": "task_priority", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "from_assignee_id": { + "name": "from_assignee_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "to_assignee_id": { + "name": "to_assignee_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "from_project_id": { + "name": "from_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "to_project_id": { + "name": "to_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "from_channel_id": { + "name": "from_channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "to_channel_id": { + "name": "to_channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description_edited": { + "name": "description_edited", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "added_label_ids": { + "name": "added_label_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": false + }, + "removed_label_ids": { + "name": "removed_label_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "task_activity_task_created_idx": { + "name": "task_activity_task_created_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": {} + }, + "task_activity_actor_user_id_idx": { + "name": "task_activity_actor_user_id_idx", + "columns": [ + { + "expression": "actor_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_from_status_id_idx": { + "name": "task_activity_from_status_id_idx", + "columns": [ + { + "expression": "from_status_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_to_status_id_idx": { + "name": "task_activity_to_status_id_idx", + "columns": [ + { + "expression": "to_status_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_from_assignee_id_idx": { + "name": "task_activity_from_assignee_id_idx", + "columns": [ + { + "expression": "from_assignee_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_to_assignee_id_idx": { + "name": "task_activity_to_assignee_id_idx", + "columns": [ + { + "expression": "to_assignee_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_from_project_id_idx": { + "name": "task_activity_from_project_id_idx", + "columns": [ + { + "expression": "from_project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_to_project_id_idx": { + "name": "task_activity_to_project_id_idx", + "columns": [ + { + "expression": "to_project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_from_channel_id_idx": { + "name": "task_activity_from_channel_id_idx", + "columns": [ + { + "expression": "from_channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_activity_to_channel_id_idx": { + "name": "task_activity_to_channel_id_idx", + "columns": [ + { + "expression": "to_channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "task_activity_task_id_tasks_id_fk": { + "name": "task_activity_task_id_tasks_id_fk", + "tableFrom": "task_activity", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_activity_actor_user_id_users_id_fk": { + "name": "task_activity_actor_user_id_users_id_fk", + "tableFrom": "task_activity", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_from_status_id_task_statuses_id_fk": { + "name": "task_activity_from_status_id_task_statuses_id_fk", + "tableFrom": "task_activity", + "tableTo": "task_statuses", + "columnsFrom": [ + "from_status_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_to_status_id_task_statuses_id_fk": { + "name": "task_activity_to_status_id_task_statuses_id_fk", + "tableFrom": "task_activity", + "tableTo": "task_statuses", + "columnsFrom": [ + "to_status_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_from_assignee_id_users_id_fk": { + "name": "task_activity_from_assignee_id_users_id_fk", + "tableFrom": "task_activity", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "from_assignee_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_to_assignee_id_users_id_fk": { + "name": "task_activity_to_assignee_id_users_id_fk", + "tableFrom": "task_activity", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "to_assignee_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_from_project_id_task_projects_id_fk": { + "name": "task_activity_from_project_id_task_projects_id_fk", + "tableFrom": "task_activity", + "tableTo": "task_projects", + "columnsFrom": [ + "from_project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_to_project_id_task_projects_id_fk": { + "name": "task_activity_to_project_id_task_projects_id_fk", + "tableFrom": "task_activity", + "tableTo": "task_projects", + "columnsFrom": [ + "to_project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_from_channel_id_channels_id_fk": { + "name": "task_activity_from_channel_id_channels_id_fk", + "tableFrom": "task_activity", + "tableTo": "channels", + "columnsFrom": [ + "from_channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_activity_to_channel_id_channels_id_fk": { + "name": "task_activity_to_channel_id_channels_id_fk", + "tableFrom": "task_activity", + "tableTo": "channels", + "columnsFrom": [ + "to_channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_comments": { + "name": "task_comments", + "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 + }, + "author_user_id": { + "name": "author_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "parent_comment_id": { + "name": "parent_comment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "edited_at": { + "name": "edited_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "task_comments_task_created_idx": { + "name": "task_comments_task_created_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": {} + }, + "task_comments_author_user_id_idx": { + "name": "task_comments_author_user_id_idx", + "columns": [ + { + "expression": "author_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_comments_parent_comment_id_idx": { + "name": "task_comments_parent_comment_id_idx", + "columns": [ + { + "expression": "parent_comment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "task_comments_task_id_tasks_id_fk": { + "name": "task_comments_task_id_tasks_id_fk", + "tableFrom": "task_comments", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_comments_author_user_id_users_id_fk": { + "name": "task_comments_author_user_id_users_id_fk", + "tableFrom": "task_comments", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "author_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "task_comments_parent_comment_id_task_comments_id_fk": { + "name": "task_comments_parent_comment_id_task_comments_id_fk", + "tableFrom": "task_comments", + "tableTo": "task_comments", + "columnsFrom": [ + "parent_comment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_imports": { + "name": "task_imports", + "schema": "", + "columns": { + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "integration_provider", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_url": { + "name": "external_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imported_by_user_id": { + "name": "imported_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "task_imports_task_id_tasks_id_fk": { + "name": "task_imports_task_id_tasks_id_fk", + "tableFrom": "task_imports", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_imports_imported_by_user_id_users_id_fk": { + "name": "task_imports_imported_by_user_id_users_id_fk", + "tableFrom": "task_imports", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "imported_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "task_imports_org_provider_external_unique": { + "name": "task_imports_org_provider_external_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "provider", + "external_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_label_assignments": { + "name": "task_label_assignments", + "schema": "", + "columns": { + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "task_label_assignments_label_id_idx": { + "name": "task_label_assignments_label_id_idx", + "columns": [ + { + "expression": "label_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "task_label_assignments_task_id_tasks_id_fk": { + "name": "task_label_assignments_task_id_tasks_id_fk", + "tableFrom": "task_label_assignments", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_label_assignments_label_id_task_labels_id_fk": { + "name": "task_label_assignments_label_id_task_labels_id_fk", + "tableFrom": "task_label_assignments", + "tableTo": "task_labels", + "columnsFrom": [ + "label_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "task_label_assignments_task_id_label_id_pk": { + "name": "task_label_assignments_task_id_label_id_pk", + "columns": [ + "task_id", + "label_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_labels": { + "name": "task_labels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "task_labels_organization_id_name_unique": { + "name": "task_labels_organization_id_name_unique", + "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": { + "task_labels_organization_id_organizations_id_fk": { + "name": "task_labels_organization_id_organizations_id_fk", + "tableFrom": "task_labels", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_labels_team_id_teams_id_fk": { + "name": "task_labels_team_id_teams_id_fk", + "tableFrom": "task_labels", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_labels_parent_id_task_labels_id_fk": { + "name": "task_labels_parent_id_task_labels_id_fk", + "tableFrom": "task_labels", + "tableTo": "task_labels", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_project_tasks": { + "name": "task_project_tasks", + "schema": "", + "columns": { + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "task_project_tasks_project_id_idx": { + "name": "task_project_tasks_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "task_project_tasks_project_id_task_projects_id_fk": { + "name": "task_project_tasks_project_id_task_projects_id_fk", + "tableFrom": "task_project_tasks", + "tableTo": "task_projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_project_tasks_task_id_tasks_id_fk": { + "name": "task_project_tasks_task_id_tasks_id_fk", + "tableFrom": "task_project_tasks", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "task_project_tasks_task_id_unique": { + "name": "task_project_tasks_task_id_unique", + "nullsNotDistinct": false, + "columns": [ + "task_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_projects": { + "name": "task_projects", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_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 + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "task_project_state", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'planned'" + }, + "lead_user_id": { + "name": "lead_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "start_date": { + "name": "start_date", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "target_date": { + "name": "target_date", + "type": "date", + "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": { + "task_projects_organization_id_idx": { + "name": "task_projects_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "task_projects_organization_id_organizations_id_fk": { + "name": "task_projects_organization_id_organizations_id_fk", + "tableFrom": "task_projects", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_projects_lead_user_id_users_id_fk": { + "name": "task_projects_lead_user_id_users_id_fk", + "tableFrom": "task_projects", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "lead_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_sequences": { + "name": "task_sequences", + "schema": "", + "columns": { + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_number": { + "name": "last_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "task_sequences_team_id_teams_id_fk": { + "name": "task_sequences_team_id_teams_id_fk", + "tableFrom": "task_sequences", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "task_sequences_organization_id_organizations_id_fk": { + "name": "task_sequences_organization_id_organizations_id_fk", + "tableFrom": "task_sequences", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "task_sequences_organization_key_unique": { + "name": "task_sequences_organization_key_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "key" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.task_statuses": { + "name": "task_statuses", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "progress_percent": { + "name": "progress_percent", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "external_provider": { + "name": "external_provider", + "type": "integration_provider", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "external_id": { + "name": "external_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()" + } + }, + "indexes": { + "task_statuses_organization_id_idx": { + "name": "task_statuses_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "task_statuses_type_idx": { + "name": "task_statuses_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "task_statuses_organization_id_organizations_id_fk": { + "name": "task_statuses_organization_id_organizations_id_fk", + "tableFrom": "task_statuses", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "task_statuses_org_external_unique": { + "name": "task_statuses_org_external_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "external_provider", + "external_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tasks": { + "name": "tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status_id": { + "name": "status_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "priority": { + "name": "priority", + "type": "task_priority", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "assignee_id": { + "name": "assignee_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "number": { + "name": "number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "estimate": { + "name": "estimate", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "due_date": { + "name": "due_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "labels": { + "name": "labels", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pr_url": { + "name": "pr_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_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": { + "tasks_slug_idx": { + "name": "tasks_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_organization_id_idx": { + "name": "tasks_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_assignee_id_idx": { + "name": "tasks_assignee_id_idx", + "columns": [ + { + "expression": "assignee_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_creator_id_idx": { + "name": "tasks_creator_id_idx", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_status_id_idx": { + "name": "tasks_status_id_idx", + "columns": [ + { + "expression": "status_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tasks_created_at_idx": { + "name": "tasks_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tasks_status_id_task_statuses_id_fk": { + "name": "tasks_status_id_task_statuses_id_fk", + "tableFrom": "tasks", + "tableTo": "task_statuses", + "columnsFrom": [ + "status_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tasks_organization_id_organizations_id_fk": { + "name": "tasks_organization_id_organizations_id_fk", + "tableFrom": "tasks", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tasks_assignee_id_users_id_fk": { + "name": "tasks_assignee_id_users_id_fk", + "tableFrom": "tasks", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "assignee_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "tasks_creator_id_users_id_fk": { + "name": "tasks_creator_id_users_id_fk", + "tableFrom": "tasks", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tasks_team_id_teams_id_fk": { + "name": "tasks_team_id_teams_id_fk", + "tableFrom": "tasks", + "tableTo": "teams", + "schemaTo": "auth", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tasks_org_slug_unique": { + "name": "tasks_org_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "slug" + ] + }, + "tasks_team_number_unique": { + "name": "tasks_team_number_unique", + "nullsNotDistinct": false, + "columns": [ + "team_id", + "number" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_identities": { + "name": "user_identities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_scope_id": { + "name": "external_scope_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "handle": { + "name": "handle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "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": { + "user_identities_user_idx": { + "name": "user_identities_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_identities_org_provider_idx": { + "name": "user_identities_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": {} + } + }, + "foreignKeys": { + "user_identities_user_id_users_id_fk": { + "name": "user_identities_user_id_users_id_fk", + "tableFrom": "user_identities", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_identities_organization_id_organizations_id_fk": { + "name": "user_identities_organization_id_organizations_id_fk", + "tableFrom": "user_identities", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_identities_account_unique": { + "name": "user_identities_account_unique", + "nullsNotDistinct": true, + "columns": [ + "organization_id", + "provider", + "external_scope_id", + "external_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.v2_clients": { + "name": "v2_clients", + "schema": "", + "columns": { + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "machine_id": { + "name": "machine_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "v2_client_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "v2_clients_organization_id_idx": { + "name": "v2_clients_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_clients_user_id_idx": { + "name": "v2_clients_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "v2_clients_organization_id_organizations_id_fk": { + "name": "v2_clients_organization_id_organizations_id_fk", + "tableFrom": "v2_clients", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "v2_clients_user_id_users_id_fk": { + "name": "v2_clients_user_id_users_id_fk", + "tableFrom": "v2_clients", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "v2_clients_organization_id_user_id_machine_id_pk": { + "name": "v2_clients_organization_id_user_id_machine_id_pk", + "columns": [ + "organization_id", + "user_id", + "machine_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.v2_hosts": { + "name": "v2_hosts", + "schema": "", + "columns": { + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "machine_id": { + "name": "machine_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "wake_command": { + "name": "wake_command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "platform": { + "name": "platform", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "install_source": { + "name": "install_source", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "allow_cloud_workspaces": { + "name": "allow_cloud_workspaces", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "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": { + "v2_hosts_organization_id_idx": { + "name": "v2_hosts_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "v2_hosts_organization_id_organizations_id_fk": { + "name": "v2_hosts_organization_id_organizations_id_fk", + "tableFrom": "v2_hosts", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "v2_hosts_created_by_user_id_users_id_fk": { + "name": "v2_hosts_created_by_user_id_users_id_fk", + "tableFrom": "v2_hosts", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "v2_hosts_organization_id_machine_id_pk": { + "name": "v2_hosts_organization_id_machine_id_pk", + "columns": [ + "organization_id", + "machine_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.v2_projects": { + "name": "v2_projects", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repo_clone_url": { + "name": "repo_clone_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_repository_id": { + "name": "github_repository_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "icon_url": { + "name": "icon_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "v2_projects_organization_id_idx": { + "name": "v2_projects_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "v2_projects_organization_id_organizations_id_fk": { + "name": "v2_projects_organization_id_organizations_id_fk", + "tableFrom": "v2_projects", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "v2_projects_github_repository_id_github_repositories_id_fk": { + "name": "v2_projects_github_repository_id_github_repositories_id_fk", + "tableFrom": "v2_projects", + "tableTo": "github_repositories", + "columnsFrom": [ + "github_repository_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "v2_projects_org_slug_unique": { + "name": "v2_projects_org_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.v2_users_hosts": { + "name": "v2_users_hosts", + "schema": "", + "columns": { + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "v2_users_host_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "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": { + "v2_users_hosts_organization_id_idx": { + "name": "v2_users_hosts_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_users_hosts_user_id_idx": { + "name": "v2_users_hosts_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_users_hosts_host_id_idx": { + "name": "v2_users_hosts_host_id_idx", + "columns": [ + { + "expression": "host_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "v2_users_hosts_organization_id_organizations_id_fk": { + "name": "v2_users_hosts_organization_id_organizations_id_fk", + "tableFrom": "v2_users_hosts", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "v2_users_hosts_user_id_users_id_fk": { + "name": "v2_users_hosts_user_id_users_id_fk", + "tableFrom": "v2_users_hosts", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "v2_users_hosts_host_fk": { + "name": "v2_users_hosts_host_fk", + "tableFrom": "v2_users_hosts", + "tableTo": "v2_hosts", + "columnsFrom": [ + "organization_id", + "host_id" + ], + "columnsTo": [ + "organization_id", + "machine_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "v2_users_hosts_organization_id_user_id_host_id_pk": { + "name": "v2_users_hosts_organization_id_user_id_host_id_pk", + "columns": [ + "organization_id", + "user_id", + "host_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.v2_workspaces": { + "name": "v2_workspaces", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "v2_workspace_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'worktree'" + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "task_id": { + "name": "task_id", + "type": "uuid", + "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": { + "v2_workspaces_project_id_idx": { + "name": "v2_workspaces_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_workspaces_organization_id_idx": { + "name": "v2_workspaces_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_workspaces_host_id_idx": { + "name": "v2_workspaces_host_id_idx", + "columns": [ + { + "expression": "host_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_workspaces_task_id_idx": { + "name": "v2_workspaces_task_id_idx", + "columns": [ + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "v2_workspaces_one_main_per_host": { + "name": "v2_workspaces_one_main_per_host", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "host_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"v2_workspaces\".\"type\" = 'main'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "v2_workspaces_organization_id_organizations_id_fk": { + "name": "v2_workspaces_organization_id_organizations_id_fk", + "tableFrom": "v2_workspaces", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "v2_workspaces_created_by_user_id_users_id_fk": { + "name": "v2_workspaces_created_by_user_id_users_id_fk", + "tableFrom": "v2_workspaces", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "v2_workspaces_task_id_tasks_id_fk": { + "name": "v2_workspaces_task_id_tasks_id_fk", + "tableFrom": "v2_workspaces", + "tableTo": "tasks", + "columnsFrom": [ + "task_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "v2_workspaces_host_fk": { + "name": "v2_workspaces_host_fk", + "tableFrom": "v2_workspaces", + "tableTo": "v2_hosts", + "columnsFrom": [ + "organization_id", + "host_id" + ], + "columnsTo": [ + "organization_id", + "machine_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_pages": { + "name": "workspace_pages", + "schema": "", + "columns": { + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "page_id": { + "name": "page_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "entry_path": { + "name": "entry_path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_pages_workspace_id_entry_path_unique": { + "name": "workspace_pages_workspace_id_entry_path_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entry_path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_pages_page_id_idx": { + "name": "workspace_pages_page_id_idx", + "columns": [ + { + "expression": "page_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_pages_page_id_pages_id_fk": { + "name": "workspace_pages_page_id_pages_id_fk", + "tableFrom": "workspace_pages", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "workspace_pages_workspace_id_page_id_pk": { + "name": "workspace_pages_workspace_id_page_id_pk", + "columns": [ + "workspace_id", + "page_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspaces": { + "name": "workspaces", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "workspace_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_by_user_id": { + "name": "created_by_user_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": { + "workspaces_project_id_idx": { + "name": "workspaces_project_id_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspaces_organization_id_idx": { + "name": "workspaces_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspaces_type_idx": { + "name": "workspaces_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspaces_organization_id_organizations_id_fk": { + "name": "workspaces_organization_id_organizations_id_fk", + "tableFrom": "workspaces", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspaces_project_id_projects_id_fk": { + "name": "workspaces_project_id_projects_id_fk", + "tableFrom": "workspaces", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspaces_created_by_user_id_users_id_fk": { + "name": "workspaces_created_by_user_id_users_id_fk", + "tableFrom": "workspaces", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "created_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.slack_thread_sessions": { + "name": "slack_thread_sessions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "thread_ts": { + "name": "thread_ts", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "started_by_user_id": { + "name": "started_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "quiet": { + "name": "quiet", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "stop_requested_at": { + "name": "stop_requested_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_context_ts": { + "name": "last_context_ts", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "entity_log": { + "name": "entity_log", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "queued_events": { + "name": "queued_events", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "last_activity_at": { + "name": "last_activity_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "slack_thread_sessions_organization_id_organizations_id_fk": { + "name": "slack_thread_sessions_organization_id_organizations_id_fk", + "tableFrom": "slack_thread_sessions", + "tableTo": "organizations", + "schemaTo": "auth", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "slack_thread_sessions_started_by_user_id_users_id_fk": { + "name": "slack_thread_sessions_started_by_user_id_users_id_fk", + "tableFrom": "slack_thread_sessions", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "started_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "slack_thread_sessions_thread_unique": { + "name": "slack_thread_sessions_thread_unique", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "team_id", + "channel_id", + "thread_ts" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_settings": { + "name": "user_settings", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "experimental_chat": { + "name": "experimental_chat", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "user_settings_user_id_users_id_fk": { + "name": "user_settings_user_id_users_id_fk", + "tableFrom": "user_settings", + "tableTo": "users", + "schemaTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.agent_session_kind": { + "name": "agent_session_kind", + "schema": "public", + "values": [ + "dm", + "thread", + "main", + "task" + ] + }, + "public.agent_task_role": { + "name": "agent_task_role", + "schema": "public", + "values": [ + "writer", + "reviewer" + ] + }, + "public.agent_task_status": { + "name": "agent_task_status", + "schema": "public", + "values": [ + "queued", + "running", + "done", + "failed", + "stopped" + ] + }, + "public.agent_turn_reason": { + "name": "agent_turn_reason", + "schema": "public", + "values": [ + "direct_message", + "mention", + "thread_reply", + "channel_message", + "task_start", + "task_update", + "routine" + ] + }, + "public.agent_turn_status": { + "name": "agent_turn_status", + "schema": "public", + "values": [ + "running", + "completed", + "failed", + "interrupted", + "queued" + ] + }, + "auth.task_tracker": { + "name": "task_tracker", + "schema": "auth", + "values": [ + "superset", + "linear" + ] + }, + "public.channel_broadcast": { + "name": "channel_broadcast", + "schema": "public", + "values": [ + "here", + "channel", + "everyone" + ] + }, + "public.channel_kind": { + "name": "channel_kind", + "schema": "public", + "values": [ + "channel", + "dm" + ] + }, + "public.channel_member_role": { + "name": "channel_member_role", + "schema": "public", + "values": [ + "member", + "admin" + ] + }, + "public.channel_message_subtype": { + "name": "channel_message_subtype", + "schema": "public", + "values": [ + "channel_join", + "channel_leave" + ] + }, + "public.channel_notify": { + "name": "channel_notify", + "schema": "public", + "values": [ + "all", + "mentions", + "none" + ] + }, + "public.channel_visibility": { + "name": "channel_visibility", + "schema": "public", + "values": [ + "public", + "private" + ] + }, + "public.dock_bounce": { + "name": "dock_bounce", + "schema": "public", + "values": [ + "off", + "once", + "until_focused" + ] + }, + "public.handle_owner_type": { + "name": "handle_owner_type", + "schema": "public", + "values": [ + "user", + "organization", + "reserved" + ] + }, + "public.leaderboard_visibility": { + "name": "leaderboard_visibility", + "schema": "public", + "values": [ + "public", + "hidden" + ] + }, + "public.actor_kind": { + "name": "actor_kind", + "schema": "public", + "values": [ + "user", + "system" + ] + }, + "public.agent_credential_kind": { + "name": "agent_credential_kind", + "schema": "public", + "values": [ + "subscription", + "api_key" + ] + }, + "public.attachment_parent_kind": { + "name": "attachment_parent_kind", + "schema": "public", + "values": [ + "page_version", + "issue", + "doc", + "chat_session", + "comment", + "page", + "cloud_workspace", + "task_comment", + "project_description", + "channel_message" + ] + }, + "public.automation_prompt_source": { + "name": "automation_prompt_source", + "schema": "public", + "values": [ + "human", + "agent", + "restore" + ] + }, + "public.automation_run_error_code": { + "name": "automation_run_error_code", + "schema": "public", + "values": [ + "no_instructions", + "host_offline", + "agent_not_found", + "workspace_not_found", + "cloud_not_ready", + "cloud_access_denied", + "cloud_environment_unusable", + "cloud_usage_limit_reached" + ] + }, + "public.automation_run_status": { + "name": "automation_run_status", + "schema": "public", + "values": [ + "dispatching", + "dispatched", + "skipped_offline", + "dispatch_failed", + "debounced", + "rejected" + ] + }, + "public.automation_session_kind": { + "name": "automation_session_kind", + "schema": "public", + "values": [ + "chat", + "terminal" + ] + }, + "public.automation_trigger_kind": { + "name": "automation_trigger_kind", + "schema": "public", + "values": [ + "schedule", + "webhook", + "github", + "slack", + "linear", + "sentry", + "microsoft_teams", + "google_calendar", + "gmail", + "notion" + ] + }, + "public.cloud_workspace_activity_event": { + "name": "cloud_workspace_activity_event", + "schema": "public", + "values": [ + "created", + "archived", + "unarchived", + "joined", + "description_edited", + "run_finished", + "run_failed", + "shared", + "unshared" + ] + }, + "public.cloud_workspace_status": { + "name": "cloud_workspace_status", + "schema": "public", + "values": [ + "provisioning", + "ready", + "failed", + "deleted" + ] + }, + "public.cloud_workspace_visibility": { + "name": "cloud_workspace_visibility", + "schema": "public", + "values": [ + "just_me", + "org" + ] + }, + "public.command_status": { + "name": "command_status", + "schema": "public", + "values": [ + "pending", + "completed", + "failed", + "timeout" + ] + }, + "public.desktop_notice_cta_action": { + "name": "desktop_notice_cta_action", + "schema": "public", + "values": [ + "install-update", + "open-url" + ] + }, + "public.desktop_notice_severity": { + "name": "desktop_notice_severity", + "schema": "public", + "values": [ + "info", + "warning", + "blocking" + ] + }, + "public.desktop_notice_trigger": { + "name": "desktop_notice_trigger", + "schema": "public", + "values": [ + "immediate", + "pre-update", + "post-update" + ] + }, + "public.environment_scope": { + "name": "environment_scope", + "schema": "public", + "values": [ + "organization", + "personal" + ] + }, + "public.environment_source_kind": { + "name": "environment_source_kind", + "schema": "public", + "values": [ + "image", + "fork" + ] + }, + "public.file_status": { + "name": "file_status", + "schema": "public", + "values": [ + "pending", + "ready" + ] + }, + "public.integration_provider": { + "name": "integration_provider", + "schema": "public", + "values": [ + "linear", + "github", + "slack", + "sentry", + "microsoft_teams", + "google", + "notion" + ] + }, + "public.page_comment_anchor_kind": { + "name": "page_comment_anchor_kind", + "schema": "public", + "values": [ + "element", + "text", + "page" + ] + }, + "public.page_comment_author_kind": { + "name": "page_comment_author_kind", + "schema": "public", + "values": [ + "human", + "agent" + ] + }, + "public.page_comment_intent": { + "name": "page_comment_intent", + "schema": "public", + "values": [ + "delete", + "approve" + ] + }, + "public.page_report_status": { + "name": "page_report_status", + "schema": "public", + "values": [ + "open", + "upheld", + "dismissed" + ] + }, + "public.page_share_role": { + "name": "page_share_role", + "schema": "public", + "values": [ + "view", + "comment", + "edit" + ] + }, + "public.page_visibility": { + "name": "page_visibility", + "schema": "public", + "values": [ + "just_me", + "org", + "everyone" + ] + }, + "public.suggestion_entity": { + "name": "suggestion_entity", + "schema": "public", + "values": [ + "cloud_workspace", + "task", + "task_project", + "task_label", + "pull_request" + ] + }, + "public.suggestion_kind": { + "name": "suggestion_kind", + "schema": "public", + "values": [ + "set_field", + "rewrite", + "relate", + "link_task", + "add_link", + "create_task" + ] + }, + "public.suggestion_status": { + "name": "suggestion_status", + "schema": "public", + "values": [ + "pending", + "accepted", + "dismissed", + "stale", + "superseded" + ] + }, + "public.task_priority": { + "name": "task_priority", + "schema": "public", + "values": [ + "urgent", + "high", + "medium", + "low", + "none" + ] + }, + "public.task_project_state": { + "name": "task_project_state", + "schema": "public", + "values": [ + "planned", + "started", + "paused", + "completed", + "canceled" + ] + }, + "public.task_status": { + "name": "task_status", + "schema": "public", + "values": [ + "backlog", + "todo", + "planning", + "working", + "needs-feedback", + "ready-to-merge", + "completed", + "canceled" + ] + }, + "public.v2_client_type": { + "name": "v2_client_type", + "schema": "public", + "values": [ + "desktop", + "mobile", + "web" + ] + }, + "public.v2_users_host_role": { + "name": "v2_users_host_role", + "schema": "public", + "values": [ + "owner", + "member" + ] + }, + "public.v2_workspace_type": { + "name": "v2_workspace_type", + "schema": "public", + "values": [ + "main", + "worktree" + ] + }, + "public.workspace_type": { + "name": "workspace_type", + "schema": "public", + "values": [ + "local", + "cloud" + ] + } + }, + "schemas": { + "auth": "auth", + "authz": "authz", + "ingest": "ingest" + }, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "authz.melange_tuples": { + "columns": { + "subject_type": { + "name": "subject_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "relation": { + "name": "relation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "object_type": { + "name": "object_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "object_id": { + "name": "object_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "definition": "\n\t\tselect 'agent'::text as subject_type, a.id::text as subject_id, 'member'::text as relation,\n\t\t\t'organization'::text as object_type, a.organization_id::text as object_id\n\t\tfrom public.agents a where a.archived_at is null\n\t\tunion all\n\t\tselect 'agent', a.id::text, 'member', 'channel', m.channel_id::text\n\t\tfrom public.channel_members m\n\t\tjoin public.agents a on a.id = m.actor_id and a.archived_at is null\n\t\tunion all\n\t\tselect 'organization', c.organization_id::text, 'organization', 'channel', c.id::text\n\t\tfrom public.channels c where c.archived_at is null\n\t\tunion all\n\t\tselect 'agent', s.agent_id::text, 'operator', 'cloud_workspace', s.cloud_workspace_id::text\n\t\tfrom public.agent_sessions s\n\t\tjoin public.agents a on a.id = s.agent_id and a.archived_at is null\n\t\twhere s.parent_session_id is not null and s.cloud_workspace_id is not null\n\t", + "name": "melange_tuples", + "schema": "authz", + "isExisting": false, + "materialized": false + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json index ba6e63652ff..994ba728372 100644 --- a/packages/db/drizzle/meta/_journal.json +++ b/packages/db/drizzle/meta/_journal.json @@ -1331,6 +1331,13 @@ "when": 1793841262226, "tag": "0189_automation_reuse_workspace", "breakpoints": true + }, + { + "idx": 190, + "version": "7", + "when": 1793918434220, + "tag": "0190_v2_hosts_allow_cloud_workspaces", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema/schema.ts b/packages/db/src/schema/schema.ts index c4fe475f458..358f1ddd8a8 100644 --- a/packages/db/src/schema/schema.ts +++ b/packages/db/src/schema/schema.ts @@ -1468,6 +1468,11 @@ export const v2Hosts = pgTable( version: text(), platform: text(), installSource: text("install_source"), + // Whether the owner lets their cloud workspaces reach this host through + // the relay. Only `host.setCloudWorkspaceAccess` writes it. + allowCloudWorkspaces: boolean("allow_cloud_workspaces") + .notNull() + .default(false), createdByUserId: uuid("created_by_user_id").references(() => users.id, { onDelete: "set null", }), From 80deee6703515721502d8872dc9232eb51a6c25d Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 22:45:35 +0000 Subject: [PATCH 02/13] feat(api): let cloud workspaces reach hosts their owner opened A cloud workspace holds no user token, so `superset hosts list` from a box showed every host offline and `--host` calls failed as "Session expired". - host.list asks the relay for presence with a short-lived server token when the caller has no bearer (a box, or an API key). - host.setCloudWorkspaceAccess: owner-only switch for v2_hosts.allow_cloud_workspaces. Not on the sandbox allow-list, so a box cannot open a host to itself. - host.cloudWorkspaceAccess: the relay's per-call check for a box's credential: the creator has access to the host and the host is open. - The sandbox firewall adds the workspace credential on requests to the relay host too, so nothing enters the box. - host.list and host.roster report allowCloudWorkspaces (additive). --- packages/i18n/locales/cs/messages.po | 3 + packages/i18n/locales/de/messages.po | 3 + packages/i18n/locales/en/messages.po | 3 + packages/i18n/locales/es/messages.po | 3 + packages/i18n/locales/fr/messages.po | 3 + packages/i18n/locales/id/messages.po | 3 + packages/i18n/locales/it/messages.po | 3 + packages/i18n/locales/ja/messages.po | 3 + packages/i18n/locales/ko/messages.po | 3 + packages/i18n/locales/nl/messages.po | 3 + packages/i18n/locales/pl/messages.po | 3 + packages/i18n/locales/pt-BR/messages.po | 3 + packages/i18n/locales/ru/messages.po | 3 + packages/i18n/locales/tr/messages.po | 3 + packages/i18n/locales/uk/messages.po | 3 + packages/i18n/locales/vi/messages.po | 3 + packages/i18n/locales/zh-CN/messages.po | 3 + packages/i18n/locales/zh-TW/messages.po | 3 + packages/i18n/src/server-errors.ts | 6 + packages/shared/src/host-routing.test.ts | 9 ++ packages/shared/src/host-routing.ts | 12 +- .../src/lib/sandbox/api-credential.test.ts | 7 ++ .../trpc/src/lib/sandbox/api-credential.ts | 1 + .../trpc/src/lib/sandbox/credentials.test.ts | 33 +++++ packages/trpc/src/lib/sandbox/credentials.ts | 12 ++ packages/trpc/src/router/host/host.ts | 115 ++++++++++++++++-- packages/trpc/src/router/host/management.ts | 1 + 27 files changed, 236 insertions(+), 14 deletions(-) diff --git a/packages/i18n/locales/cs/messages.po b/packages/i18n/locales/cs/messages.po index 504847f7e80..7dfd60b9032 100644 --- a/packages/i18n/locales/cs/messages.po +++ b/packages/i18n/locales/cs/messages.po @@ -13269,6 +13269,9 @@ msgstr "Komentář může upravit jen jeho autor" msgid "Only the author can edit a comment" msgstr "Komentář může upravit jen jeho autor" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Cloudovým pracovním prostorům může přístup povolit jen vlastník hosta" + msgid "Only the host owner can set its wake command" msgstr "Příkaz k probuzení může nastavit jen vlastník hosta" diff --git a/packages/i18n/locales/de/messages.po b/packages/i18n/locales/de/messages.po index 87b30e68ab4..27781e0e159 100644 --- a/packages/i18n/locales/de/messages.po +++ b/packages/i18n/locales/de/messages.po @@ -13269,6 +13269,9 @@ msgstr "Nur die verfassende Person kann einen Kommentar ändern" msgid "Only the author can edit a comment" msgstr "Nur der Autor kann einen Kommentar bearbeiten" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Nur der Besitzer des Hosts kann Cloud-Arbeitsbereichen den Zugriff erlauben" + msgid "Only the host owner can set its wake command" msgstr "Nur der Host-Inhaber kann dessen Wake-Befehl setzen" diff --git a/packages/i18n/locales/en/messages.po b/packages/i18n/locales/en/messages.po index da5c3952f1d..d2a4f597874 100644 --- a/packages/i18n/locales/en/messages.po +++ b/packages/i18n/locales/en/messages.po @@ -13269,6 +13269,9 @@ msgstr "Only the author can change a comment" msgid "Only the author can edit a comment" msgstr "Only the author can edit a comment" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Only the host owner can let cloud workspaces reach it" + msgid "Only the host owner can set its wake command" msgstr "Only the host owner can set its wake command" diff --git a/packages/i18n/locales/es/messages.po b/packages/i18n/locales/es/messages.po index 3997ac1fa85..12480073ef2 100644 --- a/packages/i18n/locales/es/messages.po +++ b/packages/i18n/locales/es/messages.po @@ -13269,6 +13269,9 @@ msgstr "Solo el autor puede cambiar un comentario" msgid "Only the author can edit a comment" msgstr "Solo el autor puede editar un comentario" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Solo el propietario del host puede permitir que los espacios de trabajo en la nube accedan a él" + msgid "Only the host owner can set its wake command" msgstr "Solo el propietario del host puede definir su comando de arranque" diff --git a/packages/i18n/locales/fr/messages.po b/packages/i18n/locales/fr/messages.po index dfde4801db6..24fff231bd5 100644 --- a/packages/i18n/locales/fr/messages.po +++ b/packages/i18n/locales/fr/messages.po @@ -13269,6 +13269,9 @@ msgstr "Seul l’auteur peut modifier un commentaire" msgid "Only the author can edit a comment" msgstr "Seul l'auteur peut modifier un commentaire" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Seul le propriétaire de l'hôte peut autoriser les espaces de travail cloud à y accéder" + msgid "Only the host owner can set its wake command" msgstr "Seul le propriétaire de l'hôte peut définir sa commande de réveil" diff --git a/packages/i18n/locales/id/messages.po b/packages/i18n/locales/id/messages.po index 75283300f5e..6854f7bf2d1 100644 --- a/packages/i18n/locales/id/messages.po +++ b/packages/i18n/locales/id/messages.po @@ -13269,6 +13269,9 @@ msgstr "Hanya penulis yang bisa mengubah komentar" msgid "Only the author can edit a comment" msgstr "Hanya penulis yang bisa mengedit komentar" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Hanya pemilik host yang bisa mengizinkan workspace cloud menjangkaunya" + msgid "Only the host owner can set its wake command" msgstr "Hanya pemilik host yang bisa menyetel perintah wake-nya" diff --git a/packages/i18n/locales/it/messages.po b/packages/i18n/locales/it/messages.po index 3bf76ac5d3b..6dc23be632e 100644 --- a/packages/i18n/locales/it/messages.po +++ b/packages/i18n/locales/it/messages.po @@ -13269,6 +13269,9 @@ msgstr "Solo l’autore può modificare un commento" msgid "Only the author can edit a comment" msgstr "Solo l'autore può modificare un commento" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Solo il proprietario dell'host può consentire ai workspace cloud di raggiungerlo" + msgid "Only the host owner can set its wake command" msgstr "Solo il proprietario dell'host può impostarne il comando di risveglio" diff --git a/packages/i18n/locales/ja/messages.po b/packages/i18n/locales/ja/messages.po index a164b613366..ee11f3439ef 100644 --- a/packages/i18n/locales/ja/messages.po +++ b/packages/i18n/locales/ja/messages.po @@ -13269,6 +13269,9 @@ msgstr "コメントを変更できるのは作成者だけです" msgid "Only the author can edit a comment" msgstr "コメントを編集できるのは投稿者のみです" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "クラウドワークスペースからのアクセスを許可できるのはホストのオーナーだけです" + msgid "Only the host owner can set its wake command" msgstr "ウェイクコマンドを設定できるのはホストのオーナーのみです" diff --git a/packages/i18n/locales/ko/messages.po b/packages/i18n/locales/ko/messages.po index 47470daa78f..7129cb7cf97 100644 --- a/packages/i18n/locales/ko/messages.po +++ b/packages/i18n/locales/ko/messages.po @@ -13269,6 +13269,9 @@ msgstr "작성자만 댓글을 변경할 수 있습니다" msgid "Only the author can edit a comment" msgstr "작성자만 코멘트를 수정할 수 있습니다" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "호스트 소유자만 클라우드 워크스페이스의 접근을 허용할 수 있습니다" + msgid "Only the host owner can set its wake command" msgstr "호스트 소유자만 wake 명령을 설정할 수 있습니다" diff --git a/packages/i18n/locales/nl/messages.po b/packages/i18n/locales/nl/messages.po index aacfb7a4722..ca6b4ee7591 100644 --- a/packages/i18n/locales/nl/messages.po +++ b/packages/i18n/locales/nl/messages.po @@ -13269,6 +13269,9 @@ msgstr "Alleen de auteur kan een reactie wijzigen" msgid "Only the author can edit a comment" msgstr "Alleen de auteur kan een opmerking bewerken" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Alleen de eigenaar van de host kan cloudwerkruimtes er toegang toe geven" + msgid "Only the host owner can set its wake command" msgstr "Alleen de eigenaar van de host kan het wake-commando instellen" diff --git a/packages/i18n/locales/pl/messages.po b/packages/i18n/locales/pl/messages.po index 744593f1039..bf477bccfcb 100644 --- a/packages/i18n/locales/pl/messages.po +++ b/packages/i18n/locales/pl/messages.po @@ -13269,6 +13269,9 @@ msgstr "Tylko autor może zmienić komentarz" msgid "Only the author can edit a comment" msgstr "Tylko autor może edytować komentarz" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Tylko właściciel hosta może zezwolić obszarom roboczym w chmurze na dostęp do niego" + msgid "Only the host owner can set its wake command" msgstr "Tylko właściciel hosta może ustawić polecenie wybudzania" diff --git a/packages/i18n/locales/pt-BR/messages.po b/packages/i18n/locales/pt-BR/messages.po index 63c9a26d53b..9c18d09f799 100644 --- a/packages/i18n/locales/pt-BR/messages.po +++ b/packages/i18n/locales/pt-BR/messages.po @@ -13269,6 +13269,9 @@ msgstr "Somente o autor pode alterar um comentário" msgid "Only the author can edit a comment" msgstr "Só a pessoa autora pode editar um comentário" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Só o dono do host pode permitir que áreas de trabalho na nuvem o acessem" + msgid "Only the host owner can set its wake command" msgstr "Só o proprietário do host pode definir o comando de wake dele" diff --git a/packages/i18n/locales/ru/messages.po b/packages/i18n/locales/ru/messages.po index 3c3b9ab31bd..daa0318af84 100644 --- a/packages/i18n/locales/ru/messages.po +++ b/packages/i18n/locales/ru/messages.po @@ -13269,6 +13269,9 @@ msgstr "Изменить комментарий может только авто msgid "Only the author can edit a comment" msgstr "Изменить комментарий может только автор" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Разрешить облачным рабочим областям доступ к хосту может только его владелец" + msgid "Only the host owner can set its wake command" msgstr "Задать команду пробуждения может только владелец хоста" diff --git a/packages/i18n/locales/tr/messages.po b/packages/i18n/locales/tr/messages.po index 9d899be9e35..b1df8d0a7f2 100644 --- a/packages/i18n/locales/tr/messages.po +++ b/packages/i18n/locales/tr/messages.po @@ -13269,6 +13269,9 @@ msgstr "Yorumu yalnızca yazarı değiştirebilir" msgid "Only the author can edit a comment" msgstr "Bir yorumu yalnızca yazarı düzenleyebilir" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Bulut çalışma alanlarının erişimine yalnızca host'un sahibi izin verebilir" + msgid "Only the host owner can set its wake command" msgstr "Uyandırma komutunu yalnızca host sahibi ayarlayabilir" diff --git a/packages/i18n/locales/uk/messages.po b/packages/i18n/locales/uk/messages.po index d2d321659e4..d737ce0fabd 100644 --- a/packages/i18n/locales/uk/messages.po +++ b/packages/i18n/locales/uk/messages.po @@ -13263,6 +13263,9 @@ msgstr "Лише автор може змінити коментар" msgid "Only the author can edit a comment" msgstr "Лише автор може редагувати коментар" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Дозволити хмарним робочим просторам доступ до хоста може лише його власник" + msgid "Only the host owner can set its wake command" msgstr "Лише власник хоста може задати для нього команду пробудження" diff --git a/packages/i18n/locales/vi/messages.po b/packages/i18n/locales/vi/messages.po index 7b3e74b3254..513f740fd28 100644 --- a/packages/i18n/locales/vi/messages.po +++ b/packages/i18n/locales/vi/messages.po @@ -13269,6 +13269,9 @@ msgstr "Chỉ tác giả mới có thể sửa bình luận" msgid "Only the author can edit a comment" msgstr "Chỉ tác giả mới sửa được bình luận" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "Chỉ chủ sở hữu host mới có thể cho phép workspace cloud truy cập" + msgid "Only the host owner can set its wake command" msgstr "Chỉ chủ sở hữu host mới đặt được lệnh đánh thức" diff --git a/packages/i18n/locales/zh-CN/messages.po b/packages/i18n/locales/zh-CN/messages.po index 5980ab758fa..3a059098d1b 100644 --- a/packages/i18n/locales/zh-CN/messages.po +++ b/packages/i18n/locales/zh-CN/messages.po @@ -13269,6 +13269,9 @@ msgstr "只有作者可以修改评论" msgid "Only the author can edit a comment" msgstr "只有作者才能编辑评论" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "只有主机所有者可以允许云端工作区访问它" + msgid "Only the host owner can set its wake command" msgstr "只有主机所有者才能设置其唤醒命令" diff --git a/packages/i18n/locales/zh-TW/messages.po b/packages/i18n/locales/zh-TW/messages.po index 13b1a4e62ce..14c322f4c65 100644 --- a/packages/i18n/locales/zh-TW/messages.po +++ b/packages/i18n/locales/zh-TW/messages.po @@ -13269,6 +13269,9 @@ msgstr "只有作者可以修改留言" msgid "Only the author can edit a comment" msgstr "只有作者才能編輯評論" +msgid "Only the host owner can let cloud workspaces reach it" +msgstr "只有主機擁有者可以允許雲端工作區存取它" + msgid "Only the host owner can set its wake command" msgstr "只有主機擁有者才能設定其喚醒命令" diff --git a/packages/i18n/src/server-errors.ts b/packages/i18n/src/server-errors.ts index 54ee85d2997..1640878c899 100644 --- a/packages/i18n/src/server-errors.ts +++ b/packages/i18n/src/server-errors.ts @@ -574,6 +574,12 @@ export const serverErrorMessages: Record< message: "Not a member of this organization", }), ), + "serverError.host.onlyTheHostOwnerCanAllowCloudWorkspaces": () => + i18n._( + msg({ + message: "Only the host owner can let cloud workspaces reach it", + }), + ), "serverError.host.onlyTheHostOwnerCanSet": () => i18n._( msg({ diff --git a/packages/shared/src/host-routing.test.ts b/packages/shared/src/host-routing.test.ts index 539489bedfa..8c6794284d7 100644 --- a/packages/shared/src/host-routing.test.ts +++ b/packages/shared/src/host-routing.test.ts @@ -28,4 +28,13 @@ describe("buildUpstreamHeaders", () => { expect(headers["x-superset-user-id"]).toBe("user-1"); }); + + test("a cloud workspace's credential never reaches the host", () => { + const headers = buildUpstreamHeaders( + new Headers({ "x-superset-sandbox-credential": "ws-1.secret" }), + "user-1", + ); + + expect(headers).toEqual({ "x-superset-user-id": "user-1" }); + }); }); diff --git a/packages/shared/src/host-routing.ts b/packages/shared/src/host-routing.ts index 5da514c2120..1b3a23e9660 100644 --- a/packages/shared/src/host-routing.ts +++ b/packages/shared/src/host-routing.ts @@ -1,3 +1,5 @@ +import { SANDBOX_API_CREDENTIAL_HEADER } from "./sandbox-gate"; + /** * Routing key the relay uses to identify a host service tunnel. The same * physical machine can be a host in multiple orgs, so machineId alone is @@ -54,13 +56,19 @@ export function buildUpstreamHeaders( ): Record { const headers: Record = {}; for (const [key, value] of incoming.entries()) { - if (key === "host" || key === "authorization") continue; - if (key === SUPERSET_USER_ID_HEADER) continue; + if (NEVER_FORWARDED_HEADERS.has(key)) continue; headers[key] = value; } headers[SUPERSET_USER_ID_HEADER] = userId; return headers; } +const NEVER_FORWARDED_HEADERS = new Set([ + "host", + "authorization", + SANDBOX_API_CREDENTIAL_HEADER, + SUPERSET_USER_ID_HEADER, +]); + /** The host id for the cloud. A cloud workspace has no `v2_hosts` row. */ export const CLOUD_HOST_ID = "cloud"; diff --git a/packages/trpc/src/lib/sandbox/api-credential.test.ts b/packages/trpc/src/lib/sandbox/api-credential.test.ts index d591406c9db..504514fcd12 100644 --- a/packages/trpc/src/lib/sandbox/api-credential.test.ts +++ b/packages/trpc/src/lib/sandbox/api-credential.test.ts @@ -10,4 +10,11 @@ describe("SANDBOX_ALLOWED_PROCEDURES", () => { ); expect(unknown).toEqual([]); }); + + test("never lets a box open a host to itself", () => { + expect(SANDBOX_ALLOWED_PROCEDURES.has("host.setCloudWorkspaceAccess")).toBe( + false, + ); + expect(SANDBOX_ALLOWED_PROCEDURES.has("host.ensure")).toBe(false); + }); }); diff --git a/packages/trpc/src/lib/sandbox/api-credential.ts b/packages/trpc/src/lib/sandbox/api-credential.ts index b7dde932f2f..e4eb045e011 100644 --- a/packages/trpc/src/lib/sandbox/api-credential.ts +++ b/packages/trpc/src/lib/sandbox/api-credential.ts @@ -46,6 +46,7 @@ export const SANDBOX_ALLOWED_PROCEDURES: ReadonlySet = new Set([ "environment.list", "environment.secrets.list", "githubUser.get", + "host.cloudWorkspaceAccess", "host.list", "host.relayEndpoint", "integration.github.getInstallation", diff --git a/packages/trpc/src/lib/sandbox/credentials.test.ts b/packages/trpc/src/lib/sandbox/credentials.test.ts index bda48d5004f..6ed7519b820 100644 --- a/packages/trpc/src/lib/sandbox/credentials.test.ts +++ b/packages/trpc/src/lib/sandbox/credentials.test.ts @@ -20,6 +20,11 @@ const rules = ( policy: Awaited>["networkPolicy"], ) => (policy as Policy).allow; +function restore(key: string, value: string | undefined): void { + if (value === undefined) delete process.env[key]; + else process.env[key] = value; +} + const WORKSPACE_ID = "11111111-2222-4333-8444-555555555555"; const author = { name: "Ada", email: "ada@example.com" }; @@ -132,6 +137,34 @@ describe("deriveSandboxCredentials", () => { expect(JSON.stringify(managedEnv)).not.toContain("ghs_token"); }); + test("the relay gets the same workspace credential as the API", async () => { + const saved = { + api: process.env.NEXT_PUBLIC_API_URL, + relay: process.env.RELAY_URL, + }; + process.env.NEXT_PUBLIC_API_URL = "https://api.example.com"; + process.env.RELAY_URL = "https://relay.example.com"; + try { + const { networkPolicy } = await deriveSandboxCredentials({ + workspaceId: WORKSPACE_ID, + environmentEnv: {}, + userAgentEnv: {}, + githubToken: null, + gitAuthor: author, + }); + const allow = rules(networkPolicy); + expect(allow["relay.example.com"]).toEqual(allow["api.example.com"]); + expect( + allow["relay.example.com"]?.[0]?.transform[0]?.headers[ + "x-superset-sandbox-credential" + ], + ).toStartWith(`${WORKSPACE_ID}.`); + } finally { + restore("NEXT_PUBLIC_API_URL", saved.api); + restore("RELAY_URL", saved.relay); + } + }); + test("brokered names in the environment's variables never reach the box", async () => { const { managedEnv } = await deriveSandboxCredentials({ workspaceId: WORKSPACE_ID, diff --git a/packages/trpc/src/lib/sandbox/credentials.ts b/packages/trpc/src/lib/sandbox/credentials.ts index 949c26f7d3f..0271706cd67 100644 --- a/packages/trpc/src/lib/sandbox/credentials.ts +++ b/packages/trpc/src/lib/sandbox/credentials.ts @@ -46,6 +46,14 @@ export interface SandboxCredentialInputs { gitAuthor: GitAuthor; } +function relayHost(): string | null { + try { + return new URL(env.RELAY_URL).host; + } catch { + return null; + } +} + export interface GitAuthor { name: string; email: string; @@ -310,6 +318,10 @@ export async function deriveSandboxCredentials( // PDEV_TOKEN keeps pdev from asking `superset auth`, which a box refuses. allow[PDEV_ROUTER_HOST] = boxCredential; managedEnv.PDEV_TOKEN = SANDBOX_CREDENTIAL_PLACEHOLDER; + // The firewall refuses WebSocket upgrades on a host it rewrites, so a + // box reaches hosts over HTTP only. + const relay = relayHost(); + if (relay) allow[relay] = boxCredential; } // The catch-all keeps the rest of the internet reachable; without it a diff --git a/packages/trpc/src/router/host/host.ts b/packages/trpc/src/router/host/host.ts index 8c2ac9a2316..7d846abfda6 100644 --- a/packages/trpc/src/router/host/host.ts +++ b/packages/trpc/src/router/host/host.ts @@ -1,3 +1,4 @@ +import { mintUserJwt } from "@superset/auth/server"; import { db, dbWs } from "@superset/db/client"; import { members, users, v2Hosts, v2UsersHosts } from "@superset/db/schema"; import { @@ -103,6 +104,7 @@ export const hostRouter = { version: v2Hosts.version, platform: v2Hosts.platform, installSource: v2Hosts.installSource, + allowCloudWorkspaces: v2Hosts.allowCloudWorkspaces, }) .from(v2Hosts) .innerJoin( @@ -119,18 +121,22 @@ export const hostRouter = { ), ); - // The relay's Durable Objects are the presence authority. Callers' - // own bearer token is forwarded for the access checks. - const bearer = ctx.headers.get("authorization")?.slice("Bearer ".length); - const presence = bearer - ? await fetchRelayPresence( - env.RELAY_URL, - bearer, - rows.map((row) => - buildHostRoutingKey(row.organizationId, row.machineId), - ), - ) - : null; + // A cloud workspace or an API key sends no bearer the relay accepts. + const bearer = + ctx.headers.get("authorization")?.slice("Bearer ".length) || + (await mintUserJwt({ + userId: ctx.principal.userId, + organizationIds: [input.organizationId], + scope: "automation-presence", + ttlSeconds: 60, + })); + const presence = await fetchRelayPresence( + env.RELAY_URL, + bearer, + rows.map((row) => + buildHostRoutingKey(row.organizationId, row.machineId), + ), + ); return rows.map((row) => ({ id: row.machineId, @@ -143,6 +149,7 @@ export const hostRouter = { version: row.version, platform: row.platform, installSource: row.installSource, + allowCloudWorkspaces: row.allowCloudWorkspaces, })); }), @@ -268,6 +275,46 @@ export const hostRouter = { return { allowed, paidPlan }; }), + // Called by the relay with the box's firewall-added credential. + cloudWorkspaceAccess: personProcedure + .input(z.object({ hostId: z.string().min(1) })) + .query(async ({ ctx, input }) => { + const box = ctx.sandboxCaller; + const parsed = parseHostRoutingKey(input.hostId); + if (!box || parsed?.organizationId !== box.organizationId) { + return { allowed: false as const, reason: "no_access" as const }; + } + const [row] = await db + .select({ allowCloudWorkspaces: v2Hosts.allowCloudWorkspaces }) + .from(v2UsersHosts) + .innerJoin( + v2Hosts, + and( + eq(v2Hosts.organizationId, v2UsersHosts.organizationId), + eq(v2Hosts.machineId, v2UsersHosts.hostId), + ), + ) + .where( + and( + eq(v2UsersHosts.userId, box.userId), + eq(v2UsersHosts.organizationId, parsed.organizationId), + eq(v2UsersHosts.hostId, parsed.machineId), + ), + ) + .limit(1); + if (!row) { + return { allowed: false as const, reason: "no_access" as const }; + } + if (!row.allowCloudWorkspaces) { + return { allowed: false as const, reason: "host_closed" as const }; + } + return { + allowed: true as const, + userId: box.userId, + workspaceId: box.workspaceId, + }; + }), + setWakeCommand: personProcedure .input( z.object({ @@ -315,4 +362,48 @@ export const hostRouter = { ); return { success: true }; }), + + // Never add to SANDBOX_ALLOWED_PROCEDURES: a box must not open a host to itself. + setCloudWorkspaceAccess: personProcedure + .input( + z.object({ + organizationId: z.string().uuid(), + machineId: z.string().min(1), + allowed: z.boolean(), + }), + ) + .mutation(async ({ ctx, input }) => { + if (!(await isMember(ctx, input.organizationId))) { + throw userError({ + code: "FORBIDDEN", + message: "No access to this host", + i18nKey: "serverError.host.noAccessToThisHost", + }); + } + if ( + !(await isHostOwner( + input.organizationId, + input.machineId, + ctx.principal.userId, + )) + ) { + throw userError({ + code: "FORBIDDEN", + message: "Only the host owner can let cloud workspaces reach it", + i18nKey: "serverError.host.onlyTheHostOwnerCanAllowCloudWorkspaces", + }); + } + + await db + .update(v2Hosts) + .set({ allowCloudWorkspaces: input.allowed }) + .where( + and( + eq(v2Hosts.organizationId, input.organizationId), + eq(v2Hosts.machineId, input.machineId), + ), + ); + nudge(input.organizationId, "hosts"); + return { allowed: input.allowed }; + }), } satisfies TRPCRouterRecord; diff --git a/packages/trpc/src/router/host/management.ts b/packages/trpc/src/router/host/management.ts index 2f610b40441..ece7e0e4901 100644 --- a/packages/trpc/src/router/host/management.ts +++ b/packages/trpc/src/router/host/management.ts @@ -96,6 +96,7 @@ export const hostManagementRouter = { version: v2Hosts.version, platform: v2Hosts.platform, installSource: v2Hosts.installSource, + allowCloudWorkspaces: v2Hosts.allowCloudWorkspaces, }) .from(v2Hosts) .innerJoin( From 5fc716a14200ade0a878df1eb7aa004dae7fccd9 Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 22:45:35 +0000 Subject: [PATCH 03/13] feat(relay): accept a cloud workspace's credential for opted-in hosts With no bearer and the firewall-added workspace credential, the relay asks the API on every call whether the box may reach this host, and refuses with a message that says so when the host is closed. A box gets HTTP only: the firewall refuses WebSocket upgrades on hosts it rewrites, and a stream would outlive the per-call check. The credential never reaches the host. --- apps/relay/src/access.ts | 48 +++++++++++++- apps/relay/src/api-client.ts | 11 +++- apps/relay/src/host-tunnel.ts | 1 + apps/relay/src/index.test.ts | 95 +++++++++++++++++++++++++++- apps/relay/src/index.ts | 59 ++++++++++++++++- docs/cloud-sandbox-considerations.md | 13 ++++ docs/cloud-sandbox-mismatches.md | 13 ++++ 7 files changed, 233 insertions(+), 7 deletions(-) diff --git a/apps/relay/src/access.ts b/apps/relay/src/access.ts index 0aec02b4902..2fc1db883cc 100644 --- a/apps/relay/src/access.ts +++ b/apps/relay/src/access.ts @@ -1,6 +1,6 @@ import { parseHostRoutingKey } from "@superset/shared/host-routing"; import type { AuthContext } from "@superset/shared/verify-jwt"; -import { createApiClient } from "./api-client"; +import { createApiClient, createSandboxApiClient } from "./api-client"; export const ALLOWED_TTL_MS = 15 * 60 * 1000; export const DENIED_TTL_MS = 30 * 1000; @@ -16,6 +16,7 @@ export function isServerPresenceScope(scope: string | undefined): boolean { export interface Caller { userId: string; token: string; + preAuthorized?: true; } export function callerOf(auth: AuthContext, token: string): Caller { @@ -26,6 +27,7 @@ export type AccessDenial = | "invalid_host" | "not_in_org" | "not_registered" + | "cloud_workspaces_off" | "error"; export type AccessResult = { ok: true } | { ok: false; reason: AccessDenial }; @@ -37,6 +39,8 @@ export function accessDenialMessage(reason: AccessDenial): string { return "not a member of this org"; case "not_registered": return "host not registered to this account - run `superset start` on it with this org"; + case "cloud_workspaces_off": + return "this host does not accept cloud workspaces - its owner can allow it in the host's settings"; case "invalid_host": return "invalid host id"; default: @@ -87,3 +91,45 @@ export async function checkHostAccessForRegister( return { ok: false, reason: "error" }; } } + +export type CloudWorkspaceAccess = + | { ok: true; userId: string; workspaceId: string } + | { ok: false; reason: AccessDenial } + | { ok: false; reason: "unauthorized" }; + +// Not cached: turning the host's setting off must stop the next call. +export async function checkCloudWorkspaceAccess( + credential: string, + hostId: string, + apiUrl: string, +): Promise { + if (!parseHostRoutingKey(hostId)) { + return { ok: false, reason: "invalid_host" }; + } + try { + const result = await createSandboxApiClient( + credential, + apiUrl, + ).host.cloudWorkspaceAccess.query({ hostId }); + if (result.allowed) { + return { + ok: true, + userId: result.userId, + workspaceId: result.workspaceId, + }; + } + return { + ok: false, + reason: + result.reason === "host_closed" + ? "cloud_workspaces_off" + : "not_registered", + }; + } catch (error) { + const code = (error as { data?: { code?: string } }).data?.code; + return { + ok: false, + reason: code === "UNAUTHORIZED" ? "unauthorized" : "error", + }; + } +} diff --git a/apps/relay/src/api-client.ts b/apps/relay/src/api-client.ts index 386e70a2110..28b61328326 100644 --- a/apps/relay/src/api-client.ts +++ b/apps/relay/src/api-client.ts @@ -1,14 +1,23 @@ +import { SANDBOX_API_CREDENTIAL_HEADER } from "@superset/shared/sandbox-gate"; import type { AppRouter } from "@superset/trpc"; import { createTRPCClient, httpBatchLink } from "@trpc/client"; import SuperJSON from "superjson"; export function createApiClient(token: string, apiUrl: string) { + return createClient({ Authorization: `Bearer ${token}` }, apiUrl); +} + +export function createSandboxApiClient(credential: string, apiUrl: string) { + return createClient({ [SANDBOX_API_CREDENTIAL_HEADER]: credential }, apiUrl); +} + +function createClient(headers: Record, apiUrl: string) { return createTRPCClient({ links: [ httpBatchLink({ url: `${apiUrl}/api/trpc`, transformer: SuperJSON, - headers: () => ({ Authorization: `Bearer ${token}` }), + headers: () => headers, }), ], }); diff --git a/apps/relay/src/host-tunnel.ts b/apps/relay/src/host-tunnel.ts index f2810cb86c9..362911c499c 100644 --- a/apps/relay/src/host-tunnel.ts +++ b/apps/relay/src/host-tunnel.ts @@ -161,6 +161,7 @@ export class HostTunnel extends Server { } private async authorize(caller: Caller): Promise { + if (caller.preAuthorized) return "allowed"; const key = `access:${caller.userId}`; const cached = await this.ctx.storage.get(key); if (cached && cached.expiresAt > Date.now()) { diff --git a/apps/relay/src/index.test.ts b/apps/relay/src/index.test.ts index f3cd4b0c4bd..02810e3354a 100644 --- a/apps/relay/src/index.test.ts +++ b/apps/relay/src/index.test.ts @@ -2,9 +2,15 @@ import { afterAll, beforeEach, expect, test } from "bun:test"; import relay from "./index"; -type ProxiedRequest = { method: string; pathWithQuery: string }; +type ProxiedRequest = { + method: string; + pathWithQuery: string; + headers?: Record; +}; const proxied: ProxiedRequest[] = []; +const proxiedHeaders: Record[] = []; +let boxAccess: unknown = { allowed: false, reason: "host_closed" }; const tunnel = { setName: async () => {}, @@ -13,6 +19,7 @@ const tunnel = { method: request.method, pathWithQuery: request.pathWithQuery, }); + proxiedHeaders.push(request.headers ?? {}); return { ok: true, status: 200, @@ -39,7 +46,29 @@ const jwk = { }; const jwks = Bun.serve({ port: 0, - fetch: () => Response.json({ keys: [jwk] }), + fetch: (request) => { + const url = new URL(request.url); + if (url.pathname.startsWith("/api/trpc/host.cloudWorkspaceAccess")) { + if (request.headers.get("x-superset-sandbox-credential") !== "ws-1.ok") { + return Response.json( + [ + { + error: { + json: { + message: "no", + code: -32001, + data: { code: "UNAUTHORIZED", httpStatus: 401 }, + }, + }, + }, + ], + { status: 401 }, + ); + } + return Response.json([{ result: { data: { json: boxAccess } } }]); + } + return Response.json({ keys: [jwk] }); + }, }); const apiUrl = `http://localhost:${jwks.port}`; @@ -47,6 +76,8 @@ afterAll(() => jwks.stop(true)); beforeEach(() => { proxied.length = 0; + proxiedHeaders.length = 0; + boxAccess = { allowed: false, reason: "host_closed" }; }); const hostId = "org-1:machine-1"; @@ -176,3 +207,63 @@ test("rejects a stream path that a percent-encoded host id leaks into", async () expect(response.status).toBe(400); }); + +function callAsBox( + path: string, + init: { credential?: string; headers?: Record } = {}, +) { + return call(path, { + method: "POST", + authorized: false, + headers: { + "x-superset-sandbox-credential": init.credential ?? "ws-1.ok", + ...init.headers, + }, + }); +} + +test("a cloud workspace reaches a host that allowed it, and its credential stays at the relay", async () => { + boxAccess = { allowed: true, userId: "user-1", workspaceId: "ws-1" }; + + const response = await callAsBox("/trpc/workspace.list"); + + expect(response.status).toBe(200); + expect(proxied).toEqual([ + { method: "POST", pathWithQuery: "/trpc/workspace.list" }, + ]); + expect(proxiedHeaders[0]?.["x-superset-user-id"]).toBe("user-1"); + expect(proxiedHeaders[0]?.["x-superset-sandbox-credential"]).toBeUndefined(); +}); + +test("a cloud workspace is refused by a host that did not allow it, and told why", async () => { + const response = await callAsBox("/trpc/workspace.list"); + + expect(response.status).toBe(403); + expect(JSON.stringify(await response.json())).toContain( + "does not accept cloud workspaces", + ); + expect(proxied).toEqual([]); +}); + +test("a credential the API does not accept is unauthorized", async () => { + const response = await callAsBox("/trpc/workspace.list", { + credential: "ws-1.forged", + }); + + expect(response.status).toBe(401); + expect(proxied).toEqual([]); +}); + +test("a cloud workspace cannot open a stream, even to a host that allowed it", async () => { + boxAccess = { allowed: true, userId: "user-1", workspaceId: "ws-1" }; + + const response = await call("/terminal/t1", { + authorized: false, + headers: { + "x-superset-sandbox-credential": "ws-1.ok", + Upgrade: "websocket", + }, + }); + + expect(response.status).toBe(403); +}); diff --git a/apps/relay/src/index.ts b/apps/relay/src/index.ts index 139e62c0add..322f4fea6ea 100644 --- a/apps/relay/src/index.ts +++ b/apps/relay/src/index.ts @@ -3,6 +3,7 @@ import { buildUpstreamHeaders, parseHostRoutingKey, } from "@superset/shared/host-routing"; +import { SANDBOX_API_CREDENTIAL_HEADER } from "@superset/shared/sandbox-gate"; import { RELAY_CLOSE } from "@superset/shared/tunnel-protocol"; import { type AuthContext, verifyJWT } from "@superset/shared/verify-jwt"; import type { Context, MiddlewareHandler } from "hono"; @@ -14,6 +15,7 @@ import { accessDenialMessage, type Caller, callerOf, + checkCloudWorkspaceAccess, checkHostAccessForRegister, checkOrgAccess, isServerPresenceScope, @@ -81,12 +83,22 @@ type Denial = { status: 401 | 403 | 500; message: string }; // host's object's decision, made inside each call it serves; a host's own // control connect is the exception, checked against the API here because its // object may not exist yet. +type Authenticated = { + auth: AuthContext; + token: string; + cloudWorkspaceId?: string; +}; + async function authenticate( c: Context, hostId: string, purpose: "register" | "reach", -): Promise<{ auth: AuthContext; token: string } | Denial> { +): Promise { const token = extractToken(c); + const boxCredential = c.req.header(SANDBOX_API_CREDENTIAL_HEADER); + if (!token && boxCredential && purpose === "reach") { + return authenticateCloudWorkspace(c, hostId, boxCredential); + } if (!token) return { status: 401, message: "Unauthorized" }; const auth = await verifyJWT(token, c.env.NEXT_PUBLIC_API_URL); if (!auth) return { status: 401, message: "Unauthorized" }; @@ -103,6 +115,34 @@ async function authenticate( return { auth, token }; } +// A box holds no token; its firewall adds the workspace credential. +async function authenticateCloudWorkspace( + c: Context, + hostId: string, + credential: string, +): Promise { + const access = await checkCloudWorkspaceAccess( + credential, + hostId, + c.env.NEXT_PUBLIC_API_URL, + ); + if (!access.ok) { + return access.reason === "unauthorized" + ? { status: 401, message: "Unauthorized" } + : denial(access.reason); + } + const organizationId = parseHostRoutingKey(hostId)?.organizationId ?? ""; + return { + auth: { + sub: access.userId, + organizationIds: [organizationId], + teamIds: [], + }, + token: "", + cloudWorkspaceId: access.workspaceId, + }; +} + function denial(reason: AccessDenial): Denial { const message = `Forbidden: ${accessDenialMessage(reason)}`; // "error" means the access check itself failed (API unreachable), not a @@ -231,7 +271,7 @@ app.get("/hosts/:hostId/_whoowns", async (c) => { } const stub = await tunnelStub(c, hostId); if (!stub) return c.json({ error: "Host not connected" }, 503); - const connected = await stub.isConnected(callerOf(result.auth, result.token)); + const connected = await stub.isConnected(callerFor(result)); if (connected.access !== "allowed") { const refused = accessDenial(connected.access); return c.json({ error: refused.message }, refused.status); @@ -262,12 +302,25 @@ const authMiddleware: MiddlewareHandler = async (c, next) => { } return c.json({ error: result.message }, result.status); } + // A stream would outlive the per-call access check. + if (result.cloudWorkspaceId && isWsUpgrade(c)) { + return c.json( + { error: "Forbidden: a cloud workspace can only make HTTP calls" }, + 403, + ); + } c.set("auth", result.auth); - c.set("caller", callerOf(result.auth, result.token)); + c.set("caller", callerFor(result)); c.set("hostId", hostId); return next(); }; +function callerFor(result: Authenticated): Caller { + return result.cloudWorkspaceId + ? { userId: result.auth.sub, token: "", preAuthorized: true } + : callerOf(result.auth, result.token); +} + app.use("/hosts/:hostId/*", authMiddleware); const proxyHostHttp = async ( diff --git a/docs/cloud-sandbox-considerations.md b/docs/cloud-sandbox-considerations.md index dbb22a6d39f..9166b08a257 100644 --- a/docs/cloud-sandbox-considerations.md +++ b/docs/cloud-sandbox-considerations.md @@ -126,6 +126,19 @@ itself and the workspaces its organization shares, in `loadReadyWorkspace`, `loadVisibleWorkspace` and `delete` together; a check on one of them is bypassed through the others. +**A box reaches its creator's own hosts, when a host allows it. Accepted +(opt-in).** The firewall adds the workspace credential on requests to the +relay as well as the API, and the relay asks `host.cloudWorkspaceAccess` on +every call. A host is reachable only if the creator has access to it and its +owner turned on "Allow my cloud workspaces to reach this host" +(`v2_hosts.allow_cloud_workspaces`, set by `host.setCloudWorkspaceAccess`, +which a box cannot call). The API is the only lock: host-service does not know +the call came from a box, so a wrong value in that column opens the host. Once +on, anything in any box the creator made can drive that host as them, +including a prompt-injected agent. Off by default; turning it off stops the +next call. Only HTTP gets through: the firewall refuses WebSocket upgrades on a +host it rewrites, and the relay refuses them from a box. + **A sandbox has exactly one gate, and it is ours.** A sandbox's own port is a public URL that clients never see; they reach a workspace through the sandbox gate (`apps/gate`), which verifies a ticket the API signed diff --git a/docs/cloud-sandbox-mismatches.md b/docs/cloud-sandbox-mismatches.md index c4bdc89109e..4f40db71b5c 100644 --- a/docs/cloud-sandbox-mismatches.md +++ b/docs/cloud-sandbox-mismatches.md @@ -72,6 +72,19 @@ the filesystem snapshot with no processes, so host-service is started again) and extends a running one so it never hits the idle stop while someone is in it. `resolveSandboxAddress` is the one place that knows the difference. +**A box reaches other hosts only through the relay, and only if they allow +it.** The CLI assumed its bearer is a user token the relay accepts. A box has +no bearer: its credential is a header the firewall adds, so `--host` calls +used to fail as "Session expired" while `auth whoami` worked, and `host.list` +showed every host offline because it forwarded the caller's absent bearer for +presence. Now `host.list` mints a server presence token when the caller has no +bearer, the firewall adds the workspace credential for the relay host too, and +the relay checks it with the API per call. A host is reachable only when its +owner allowed cloud workspaces on the host's settings page; otherwise the call +fails with a message that says so. Only HTTP calls work: the firewall refuses +WebSocket upgrades on a host whose headers it rewrites, so live terminal +streams from a box to a host do not. + **A box's agent status doesn't come from the box.** A host row's dot is a live subscription to that host's terminal bindings; the sidebar deliberately opens no such socket to a sandbox, since holding one keeps the VM awake all From b6d5aae333a24eed6832c1e1862e8650a54cee2f Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 22:48:52 +0000 Subject: [PATCH 04/13] feat(desktop): switch to let your cloud workspaces reach a host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings → Hosts → [host] → Cloud workspaces, shown to the host's owner on every host they own. It calls host.setCloudWorkspaceAccess behind a confirm dialog that spells out the risk; nothing restarts, and turning it off stops the next call from a box. --- .../components/HostSettings/HostSettings.tsx | 19 +++++ .../CloudWorkspaceAccessSection.tsx | 48 ++++++++++++ .../CloudWorkspaceAccessSwitch.tsx | 58 ++++++++++++++ .../CloudWorkspaceAccessConfirmDialog.tsx | 76 +++++++++++++++++++ .../index.ts | 1 + .../CloudWorkspaceAccessSwitch/index.ts | 1 + .../CloudWorkspaceAccessSection/index.ts | 1 + .../utils/settings-search/settings-search.ts | 19 +++++ packages/i18n/locales/cs/messages.po | 21 +++++ packages/i18n/locales/de/messages.po | 21 +++++ packages/i18n/locales/en/messages.po | 21 +++++ packages/i18n/locales/es/messages.po | 21 +++++ packages/i18n/locales/fr/messages.po | 21 +++++ packages/i18n/locales/id/messages.po | 21 +++++ packages/i18n/locales/it/messages.po | 21 +++++ packages/i18n/locales/ja/messages.po | 21 +++++ packages/i18n/locales/ko/messages.po | 21 +++++ packages/i18n/locales/nl/messages.po | 21 +++++ packages/i18n/locales/pl/messages.po | 21 +++++ packages/i18n/locales/pt-BR/messages.po | 21 +++++ packages/i18n/locales/ru/messages.po | 21 +++++ packages/i18n/locales/tr/messages.po | 21 +++++ packages/i18n/locales/uk/messages.po | 21 +++++ packages/i18n/locales/vi/messages.po | 21 +++++ packages/i18n/locales/zh-CN/messages.po | 21 +++++ packages/i18n/locales/zh-TW/messages.po | 21 +++++ 26 files changed, 601 insertions(+) create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/index.ts create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/index.ts create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/index.ts diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/HostSettings.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/HostSettings.tsx index b35cd166a4c..2770bcf8e26 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/HostSettings.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/HostSettings.tsx @@ -16,6 +16,7 @@ import { HighlightText } from "renderer/routes/_authenticated/settings/component import { useSettingsSearchQuery } from "renderer/stores/settings-state"; import type { CandidateRow } from "./components/AddMemberDropdown"; import { AddMemberDropdown } from "./components/AddMemberDropdown"; +import { CloudWorkspaceAccessSection } from "./components/CloudWorkspaceAccessSection"; import { DeleteHostSection } from "./components/DeleteHostSection"; import { HostHeader } from "./components/HostHeader"; import { HostServiceSection } from "./components/HostServiceSection"; @@ -210,6 +211,24 @@ export function HostSettings({ hostId }: HostSettingsProps) { )} + {isOwner && host.organizationId && ( +
+

+ +

+ +
+ )} +
diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx new file mode 100644 index 00000000000..e24c6432105 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx @@ -0,0 +1,48 @@ +import { Trans, useLingui } from "@lingui/react/macro"; +import { Label } from "@superset/ui/label"; +import { HighlightText } from "renderer/routes/_authenticated/settings/components/HighlightText"; +import { useSettingsSearchQuery } from "renderer/stores/settings-state"; +import { CloudWorkspaceAccessSwitch } from "./components/CloudWorkspaceAccessSwitch"; + +interface CloudWorkspaceAccessSectionProps { + organizationId: string; + machineId: string; + allowed: boolean; +} + +export function CloudWorkspaceAccessSection({ + organizationId, + machineId, + allowed, +}: CloudWorkspaceAccessSectionProps) { + const { t } = useLingui(); + const searchQuery = useSettingsSearchQuery(); + + return ( +
+
+ +

+ + Agents in your cloud workspaces can then run commands like{" "} + --host against this host. The host must be reachable + through the relay. + +

+
+ +
+ ); +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx new file mode 100644 index 00000000000..e9e90872d8e --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx @@ -0,0 +1,58 @@ +import { useLingui } from "@lingui/react/macro"; +import { toast } from "@superset/ui/sonner"; +import { Switch } from "@superset/ui/switch"; +import { useState } from "react"; +import { cloudTrpc } from "renderer/lib/cloud-trpc"; +import { CloudWorkspaceAccessConfirmDialog } from "./components/CloudWorkspaceAccessConfirmDialog"; + +interface CloudWorkspaceAccessSwitchProps { + id: string; + organizationId: string; + machineId: string; + allowed: boolean; +} + +export function CloudWorkspaceAccessSwitch({ + id, + organizationId, + machineId, + allowed, +}: CloudWorkspaceAccessSwitchProps) { + const { t } = useLingui(); + const utils = cloudTrpc.useUtils(); + const setAccess = cloudTrpc.host.setCloudWorkspaceAccess.useMutation({ + onSettled: () => utils.host.roster.invalidate(), + }); + const [confirmTarget, setConfirmTarget] = useState(null); + + const runToggle = (next: boolean) => { + toast.promise( + setAccess.mutateAsync({ organizationId, machineId, allowed: next }), + { + loading: t({ message: "Saving…" }), + success: () => t({ message: "Setting saved" }), + error: (err: Error) => + err.message ?? t({ message: "Failed to update setting" }), + }, + ); + }; + + return ( + <> + + setConfirmTarget(null)} + onConfirm={() => { + if (confirmTarget !== null) runToggle(confirmTarget); + setConfirmTarget(null); + }} + /> + + ); +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx new file mode 100644 index 00000000000..70e6a6b1f19 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx @@ -0,0 +1,76 @@ +import { Trans } from "@lingui/react/macro"; +import { + AlertDialog, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, +} from "@superset/ui/alert-dialog"; +import { Button } from "@superset/ui/button"; + +interface CloudWorkspaceAccessConfirmDialogProps { + /** Null while closed. */ + targetEnabled: boolean | null; + onCancel: () => void; + onConfirm: () => void; +} + +export function CloudWorkspaceAccessConfirmDialog({ + targetEnabled, + onCancel, + onConfirm, +}: CloudWorkspaceAccessConfirmDialogProps) { + return ( + !open && onCancel()} + > + + + + {targetEnabled ? ( + Let your cloud workspaces reach this host? + ) : ( + Stop your cloud workspaces reaching this host? + )} + + +
+ {targetEnabled ? ( +

+ + Anything running in a cloud workspace you created can then + create workspaces, start agents, and run commands on this + host, including an agent following instructions it found in + a web page or a repository. Turn this on only if you need + it. + +

+ ) : ( +

+ + Your cloud workspaces will no longer be able to reach this + host. + +

+ )} +
+
+
+ + + + +
+
+ ); +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/index.ts b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/index.ts new file mode 100644 index 00000000000..042cae6bd10 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/index.ts @@ -0,0 +1 @@ +export { CloudWorkspaceAccessConfirmDialog } from "./CloudWorkspaceAccessConfirmDialog"; diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/index.ts b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/index.ts new file mode 100644 index 00000000000..8d35a9abe77 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/index.ts @@ -0,0 +1 @@ +export { CloudWorkspaceAccessSwitch } from "./CloudWorkspaceAccessSwitch"; diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/index.ts b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/index.ts new file mode 100644 index 00000000000..5d52e6827ea --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/index.ts @@ -0,0 +1 @@ +export { CloudWorkspaceAccessSection } from "./CloudWorkspaceAccessSection"; diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts b/apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts index 4189ead2313..949cd5eef00 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts @@ -111,6 +111,7 @@ export const SETTING_ITEM_ID = { "security-expose-host-service-via-relay", HOST_MEMBERS: "host-members", + HOST_ALLOW_CLOUD_WORKSPACES: "host-allow-cloud-workspaces", ENVIRONMENTS_LIST: "environments-list", AGENT_ACCOUNTS: "agent-accounts", CONNECTIONS: "connections", @@ -274,6 +275,7 @@ export const SETTING_ITEM_VARIANT: Record = { [SETTING_ITEM_ID.MOBILE_APP]: "shared", [SETTING_ITEM_ID.HOST_MEMBERS]: "shared", + [SETTING_ITEM_ID.HOST_ALLOW_CLOUD_WORKSPACES]: "shared", [SETTING_ITEM_ID.ENVIRONMENTS_LIST]: "v2", [SETTING_ITEM_ID.AGENT_ACCOUNTS]: "v2", [SETTING_ITEM_ID.CONNECTIONS]: "v2", @@ -1912,6 +1914,23 @@ export const SETTINGS_ITEMS: SettingsItem[] = [ "attack surface", ], }, + { + id: SETTING_ITEM_ID.HOST_ALLOW_CLOUD_WORKSPACES, + section: "hosts", + title: "Allow my cloud workspaces to reach this host", + description: + "Lets agents in your cloud workspaces call a host you own through the relay", + keywords: [ + "security", + "cloud", + "cloud workspace", + "sandbox", + "relay", + "remote", + "--host", + "agent", + ], + }, { id: SETTING_ITEM_ID.AGENT_ACCOUNTS, section: "agentAccounts", diff --git a/packages/i18n/locales/cs/messages.po b/packages/i18n/locales/cs/messages.po index 7dfd60b9032..ac172d09081 100644 --- a/packages/i18n/locales/cs/messages.po +++ b/packages/i18n/locales/cs/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agenti nemají přístup k nástrojům {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agenti dokončí rutinní tickety bez zásahu uprostřed úkolu." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agenti ve vašich cloudových pracovních prostorech pak mohou na tomto hostu spouštět příkazy jako <0>--host. Host musí být dostupný přes relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agenti pracují dál v cloudu. Pracovní prostor znovu otevřete na počítači, iPhonu nebo iPadu." @@ -2566,6 +2569,9 @@ msgstr "Povolit pro relaci" msgid "Allow microphone access to use dictation" msgstr "Pro diktování povolte přístup k mikrofonu" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Povolit mým cloudovým pracovním prostorům přístup k tomuto hostu" + msgid "Allow remote access to this device via relay" msgstr "Povolit vzdálený přístup k tomuto zařízení přes relay" @@ -2825,6 +2831,9 @@ msgstr "cokoli" msgid "Anything else? (optional)" msgstr "Ještě něco? (nepovinné)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Cokoli, co běží v cloudovém pracovním prostoru, který jste vytvořili, pak může na tomto hostu vytvářet pracovní prostory, spouštět agenty a provádět příkazy, včetně agenta, který se řídí pokyny nalezenými na webové stránce nebo v repozitáři. Zapněte to, jen pokud to potřebujete." + msgid "Anywhere" msgstr "Kdekoli" @@ -10833,6 +10842,9 @@ msgstr "Povolit agentovi používat vaše přihlášení z {browserName}?" msgid "Let the agent drive." msgstr "Nechte agenta řídit." +msgid "Let your cloud workspaces reach this host?" +msgstr "Povolit vašim cloudovým pracovním prostorům přístup k tomuto hostu?" + msgid "Lets your organization list and clone repositories" msgstr "Umožňuje organizaci vypisovat a klonovat repozitáře" @@ -18548,6 +18560,9 @@ msgstr "Přestat sledovat" msgid "Stop workspace run command" msgstr "Zastavit spouštěcí příkaz pracovního prostoru" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Zakázat vašim cloudovým pracovním prostorům přístup k tomuto hostu?" + msgid "stopped" msgstr "zastaveno" @@ -20403,6 +20418,9 @@ msgstr "Proměňte rutinní práci v agenty, kteří běží podle plánu nebo p msgid "Turn Fast mode on or off" msgstr "Zapnout nebo vypnout rychlý režim" +msgid "Turn off" +msgstr "Vypnout" + msgid "Turn off manual mode" msgstr "Vypnout ruční režim" @@ -22061,6 +22079,9 @@ msgstr "Vaše změny" msgid "Your changes will be lost if you don't save them." msgstr "Pokud změny neuložíte, budou ztraceny." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Vaše cloudové pracovní prostory už k tomuto hostu nebudou mít přístup." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Váš kód zůstává ve výchozím stavu lokálně a připojené služby máte výslovně pod kontrolou." diff --git a/packages/i18n/locales/de/messages.po b/packages/i18n/locales/de/messages.po index 27781e0e159..d64fcd62b7c 100644 --- a/packages/i18n/locales/de/messages.po +++ b/packages/i18n/locales/de/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agenten können die Tools von {0} nicht erreichen" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agenten erledigen Routine-Tickets ohne Eingriff mitten in der Aufgabe." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agenten in deinen Cloud-Arbeitsbereichen können dann Befehle wie <0>--host auf diesem Host ausführen. Der Host muss über den Relay erreichbar sein." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agenten arbeiten in der Cloud weiter. Öffne den Arbeitsbereich wieder auf dem Desktop, iPhone oder iPad." @@ -2566,6 +2569,9 @@ msgstr "Für diese Sitzung erlauben" msgid "Allow microphone access to use dictation" msgstr "Erlaube den Mikrofonzugriff, um zu diktieren" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Meinen Cloud-Arbeitsbereichen Zugriff auf diesen Host erlauben" + msgid "Allow remote access to this device via relay" msgstr "Fernzugriff auf dieses Gerät über den Relay erlauben" @@ -2825,6 +2831,9 @@ msgstr "beliebig" msgid "Anything else? (optional)" msgstr "Noch etwas? (optional)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Alles, was in einem von dir erstellten Cloud-Arbeitsbereich läuft, kann dann auf diesem Host Arbeitsbereiche erstellen, Agenten starten und Befehle ausführen – auch ein Agent, der Anweisungen aus einer Webseite oder einem Repository folgt. Schalte das nur ein, wenn du es brauchst." + msgid "Anywhere" msgstr "Überall" @@ -10833,6 +10842,9 @@ msgstr "Einen Agenten deine angemeldeten {browserName}-Sitzungen nutzen lassen?" msgid "Let the agent drive." msgstr "Lass den Agenten steuern." +msgid "Let your cloud workspaces reach this host?" +msgstr "Deinen Cloud-Arbeitsbereichen Zugriff auf diesen Host erlauben?" + msgid "Lets your organization list and clone repositories" msgstr "Erlaubt deiner Organisation, Repositories aufzulisten und zu klonen" @@ -18548,6 +18560,9 @@ msgstr "Nicht mehr beobachten" msgid "Stop workspace run command" msgstr "Run-Befehl des Arbeitsbereichs stoppen" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Den Zugriff deiner Cloud-Arbeitsbereiche auf diesen Host beenden?" + msgid "stopped" msgstr "gestoppt" @@ -20403,6 +20418,9 @@ msgstr "Mach aus Routinearbeit Agenten, die nach Zeitplan oder bei einem Ereigni msgid "Turn Fast mode on or off" msgstr "Schnellmodus ein- oder ausschalten" +msgid "Turn off" +msgstr "Ausschalten" + msgid "Turn off manual mode" msgstr "Manuellen Modus ausschalten" @@ -22061,6 +22079,9 @@ msgstr "Deine Änderungen" msgid "Your changes will be lost if you don't save them." msgstr "Deine Änderungen gehen verloren, wenn du sie nicht speicherst." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Deine Cloud-Arbeitsbereiche können nicht mehr auf diesen Host zugreifen." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Dein Code bleibt standardmäßig lokal, mit ausdrücklicher Kontrolle über verbundene Dienste." diff --git a/packages/i18n/locales/en/messages.po b/packages/i18n/locales/en/messages.po index d2a4f597874..0760731b260 100644 --- a/packages/i18n/locales/en/messages.po +++ b/packages/i18n/locales/en/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agents cannot reach {0}'s tools" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agents complete routine tickets with no mid-task intervention." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." @@ -2566,6 +2569,9 @@ msgstr "Allow for session" msgid "Allow microphone access to use dictation" msgstr "Allow microphone access to use dictation" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Allow my cloud workspaces to reach this host" + msgid "Allow remote access to this device via relay" msgstr "Allow remote access to this device via relay" @@ -2825,6 +2831,9 @@ msgstr "anything" msgid "Anything else? (optional)" msgstr "Anything else? (optional)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." + msgid "Anywhere" msgstr "Anywhere" @@ -10833,6 +10842,9 @@ msgstr "Let an agent use your {browserName} logins?" msgid "Let the agent drive." msgstr "Let the agent drive." +msgid "Let your cloud workspaces reach this host?" +msgstr "Let your cloud workspaces reach this host?" + msgid "Lets your organization list and clone repositories" msgstr "Lets your organization list and clone repositories" @@ -18548,6 +18560,9 @@ msgstr "Stop watching" msgid "Stop workspace run command" msgstr "Stop workspace run command" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Stop your cloud workspaces reaching this host?" + msgid "stopped" msgstr "stopped" @@ -20403,6 +20418,9 @@ msgstr "Turn chores into agents that run on a schedule or when an event comes in msgid "Turn Fast mode on or off" msgstr "Turn Fast mode on or off" +msgid "Turn off" +msgstr "Turn off" + msgid "Turn off manual mode" msgstr "Turn off manual mode" @@ -22061,6 +22079,9 @@ msgstr "Your changes" msgid "Your changes will be lost if you don't save them." msgstr "Your changes will be lost if you don't save them." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Your cloud workspaces will no longer be able to reach this host." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Your code stays local by default, with explicit control over connected services." diff --git a/packages/i18n/locales/es/messages.po b/packages/i18n/locales/es/messages.po index 12480073ef2..f89e4914cb3 100644 --- a/packages/i18n/locales/es/messages.po +++ b/packages/i18n/locales/es/messages.po @@ -2323,6 +2323,9 @@ msgstr "Los agentes no pueden acceder a las herramientas de {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Los agentes completan tickets rutinarios sin intervención a mitad de la tarea." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Los agentes de tus espacios de trabajo en la nube podrán ejecutar comandos como <0>--host en este host. El host debe estar accesible a través del relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Los agentes siguen trabajando en la nube. Vuelve a abrir el espacio de trabajo desde el escritorio, el iPhone o el iPad." @@ -2566,6 +2569,9 @@ msgstr "Permitir en esta sesión" msgid "Allow microphone access to use dictation" msgstr "Permitir el acceso al micrófono para usar el dictado" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Permitir que mis espacios de trabajo en la nube accedan a este host" + msgid "Allow remote access to this device via relay" msgstr "Permitir el acceso remoto a este dispositivo a través del relay" @@ -2825,6 +2831,9 @@ msgstr "cualquier cosa" msgid "Anything else? (optional)" msgstr "¿Algo más? (opcional)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Cualquier cosa que se ejecute en un espacio de trabajo en la nube que hayas creado podrá crear espacios de trabajo, iniciar agentes y ejecutar comandos en este host, incluido un agente que siga instrucciones que encontró en una página web o un repositorio. Actívalo solo si lo necesitas." + msgid "Anywhere" msgstr "En cualquier lugar" @@ -10833,6 +10842,9 @@ msgstr "¿Permitir que un agente use tus sesiones de {browserName}?" msgid "Let the agent drive." msgstr "Deja que el agente lo maneje." +msgid "Let your cloud workspaces reach this host?" +msgstr "¿Permitir que tus espacios de trabajo en la nube accedan a este host?" + msgid "Lets your organization list and clone repositories" msgstr "Permite a tu organización listar y clonar repositorios" @@ -18548,6 +18560,9 @@ msgstr "Dejar de observar" msgid "Stop workspace run command" msgstr "Detener el comando de ejecución del espacio de trabajo" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "¿Impedir que tus espacios de trabajo en la nube accedan a este host?" + msgid "stopped" msgstr "detenido" @@ -20403,6 +20418,9 @@ msgstr "Convierte las tareas rutinarias en agentes que se ejecutan de forma prog msgid "Turn Fast mode on or off" msgstr "Activar o desactivar el modo rápido" +msgid "Turn off" +msgstr "Desactivar" + msgid "Turn off manual mode" msgstr "Desactivar el modo manual" @@ -22061,6 +22079,9 @@ msgstr "Tus cambios" msgid "Your changes will be lost if you don't save them." msgstr "Perderás los cambios si no los guardas." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Tus espacios de trabajo en la nube ya no podrán acceder a este host." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Tu código se queda en local por defecto, con control explícito sobre los servicios conectados." diff --git a/packages/i18n/locales/fr/messages.po b/packages/i18n/locales/fr/messages.po index 24fff231bd5..44106c178f7 100644 --- a/packages/i18n/locales/fr/messages.po +++ b/packages/i18n/locales/fr/messages.po @@ -2323,6 +2323,9 @@ msgstr "Les agents ne peuvent pas accéder aux outils de {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Les agents terminent les tickets courants sans intervention en cours de tâche." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Les agents de vos espaces de travail cloud pourront alors lancer des commandes comme <0>--host sur cet hôte. L'hôte doit être joignable via le relais." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Les agents continuent de travailler dans le cloud. Rouvrez l'espace de travail depuis le bureau, l'iPhone ou l'iPad." @@ -2566,6 +2569,9 @@ msgstr "Autoriser pour la session" msgid "Allow microphone access to use dictation" msgstr "Autorisez l'accès au microphone pour utiliser la dictée" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Autoriser mes espaces de travail cloud à accéder à cet hôte" + msgid "Allow remote access to this device via relay" msgstr "Autoriser l'accès distant à cet appareil via le relais" @@ -2825,6 +2831,9 @@ msgstr "n'importe quoi" msgid "Anything else? (optional)" msgstr "Autre chose ? (facultatif)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Tout ce qui s'exécute dans un espace de travail cloud que vous avez créé pourra alors créer des espaces de travail, démarrer des agents et lancer des commandes sur cet hôte, y compris un agent qui suit des instructions trouvées dans une page web ou un dépôt. N'activez cette option que si vous en avez besoin." + msgid "Anywhere" msgstr "Partout" @@ -10833,6 +10842,9 @@ msgstr "Autoriser un agent à utiliser vos connexions {browserName} ?" msgid "Let the agent drive." msgstr "Laissez l'agent piloter." +msgid "Let your cloud workspaces reach this host?" +msgstr "Autoriser vos espaces de travail cloud à accéder à cet hôte ?" + msgid "Lets your organization list and clone repositories" msgstr "Permet à votre organisation de lister et cloner des dépôts" @@ -18548,6 +18560,9 @@ msgstr "Arrêter la surveillance" msgid "Stop workspace run command" msgstr "Arrêter la commande d'exécution de l'espace de travail" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Empêcher vos espaces de travail cloud d'accéder à cet hôte ?" + msgid "stopped" msgstr "arrêté" @@ -20403,6 +20418,9 @@ msgstr "Transformez les corvées en agents qui s'exécutent selon une planificat msgid "Turn Fast mode on or off" msgstr "Activer ou désactiver le mode rapide" +msgid "Turn off" +msgstr "Désactiver" + msgid "Turn off manual mode" msgstr "Désactiver le mode manuel" @@ -22061,6 +22079,9 @@ msgstr "Vos modifications" msgid "Your changes will be lost if you don't save them." msgstr "Vos modifications seront perdues si vous ne les enregistrez pas." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Vos espaces de travail cloud ne pourront plus accéder à cet hôte." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Votre code reste local par défaut, avec un contrôle explicite sur les services connectés." diff --git a/packages/i18n/locales/id/messages.po b/packages/i18n/locales/id/messages.po index 6854f7bf2d1..b90a3e4a250 100644 --- a/packages/i18n/locales/id/messages.po +++ b/packages/i18n/locales/id/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agen tidak dapat menjangkau alat {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agen menyelesaikan tiket rutin tanpa intervensi di tengah tugas." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agen di workspace cloud Anda lalu bisa menjalankan perintah seperti <0>--host di host ini. Host harus bisa dijangkau melalui relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agen tetap bekerja di cloud. Buka lagi workspace dari desktop, iPhone, atau iPad." @@ -2566,6 +2569,9 @@ msgstr "Izinkan untuk sesi ini" msgid "Allow microphone access to use dictation" msgstr "Izinkan akses mikrofon untuk memakai dikte" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Izinkan workspace cloud saya menjangkau host ini" + msgid "Allow remote access to this device via relay" msgstr "Izinkan akses jarak jauh ke perangkat ini melalui relay" @@ -2825,6 +2831,9 @@ msgstr "apa saja" msgid "Anything else? (optional)" msgstr "Ada lagi? (opsional)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Apa pun yang berjalan di workspace cloud yang Anda buat lalu bisa membuat workspace, memulai agen, dan menjalankan perintah di host ini, termasuk agen yang mengikuti instruksi yang ditemukannya di halaman web atau repositori. Aktifkan hanya jika Anda membutuhkannya." + msgid "Anywhere" msgstr "Di mana saja" @@ -10833,6 +10842,9 @@ msgstr "Izinkan agen memakai login {browserName} Anda?" msgid "Let the agent drive." msgstr "Biarkan agen yang mengemudi." +msgid "Let your cloud workspaces reach this host?" +msgstr "Izinkan workspace cloud Anda menjangkau host ini?" + msgid "Lets your organization list and clone repositories" msgstr "Memungkinkan organisasi Anda menampilkan dan mengkloning repositori" @@ -18548,6 +18560,9 @@ msgstr "Berhenti memantau" msgid "Stop workspace run command" msgstr "Hentikan perintah run workspace" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Hentikan akses workspace cloud Anda ke host ini?" + msgid "stopped" msgstr "berhenti" @@ -20403,6 +20418,9 @@ msgstr "Ubah pekerjaan rutin menjadi agen yang berjalan sesuai jadwal atau saat msgid "Turn Fast mode on or off" msgstr "Aktifkan atau nonaktifkan mode cepat" +msgid "Turn off" +msgstr "Matikan" + msgid "Turn off manual mode" msgstr "Matikan mode manual" @@ -22061,6 +22079,9 @@ msgstr "Perubahan Anda" msgid "Your changes will be lost if you don't save them." msgstr "Perubahan Anda akan hilang kalau tidak disimpan." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Workspace cloud Anda tidak akan bisa lagi menjangkau host ini." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Kode Anda tetap lokal secara bawaan, dengan kendali eksplisit atas layanan yang terhubung." diff --git a/packages/i18n/locales/it/messages.po b/packages/i18n/locales/it/messages.po index 6dc23be632e..f07bc871ab9 100644 --- a/packages/i18n/locales/it/messages.po +++ b/packages/i18n/locales/it/messages.po @@ -2323,6 +2323,9 @@ msgstr "Gli agenti non possono raggiungere gli strumenti di {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Gli agenti completano i ticket di routine senza interventi a metà task." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Gli agenti nei tuoi workspace cloud potranno eseguire comandi come <0>--host su questo host. L'host deve essere raggiungibile tramite il relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Gli agenti continuano a lavorare nel cloud. Riapri lo spazio di lavoro da desktop, iPhone o iPad." @@ -2566,6 +2569,9 @@ msgstr "Consenti per la sessione" msgid "Allow microphone access to use dictation" msgstr "Consenti l'accesso al microfono per usare la dettatura" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Consenti ai miei workspace cloud di raggiungere questo host" + msgid "Allow remote access to this device via relay" msgstr "Consenti l'accesso remoto a questo dispositivo tramite relay" @@ -2825,6 +2831,9 @@ msgstr "qualsiasi cosa" msgid "Anything else? (optional)" msgstr "Altro? (facoltativo)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Qualsiasi cosa in esecuzione in un workspace cloud che hai creato potrà creare workspace, avviare agenti ed eseguire comandi su questo host, incluso un agente che segue istruzioni trovate in una pagina web o in un repository. Attivalo solo se ti serve." + msgid "Anywhere" msgstr "Ovunque" @@ -10833,6 +10842,9 @@ msgstr "Consentire a un agente di usare i tuoi accessi di {browserName}?" msgid "Let the agent drive." msgstr "Lascia guidare l'agente." +msgid "Let your cloud workspaces reach this host?" +msgstr "Consentire ai tuoi workspace cloud di raggiungere questo host?" + msgid "Lets your organization list and clone repositories" msgstr "Consente alla tua organizzazione di elencare e clonare i repository" @@ -18548,6 +18560,9 @@ msgstr "Smetti di osservare" msgid "Stop workspace run command" msgstr "Arresta il comando di esecuzione del workspace" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Impedire ai tuoi workspace cloud di raggiungere questo host?" + msgid "stopped" msgstr "arrestato" @@ -20403,6 +20418,9 @@ msgstr "Trasforma le attività ripetitive in agenti che girano secondo una piani msgid "Turn Fast mode on or off" msgstr "Attiva o disattiva la modalità veloce" +msgid "Turn off" +msgstr "Disattiva" + msgid "Turn off manual mode" msgstr "Disattiva la modalità manuale" @@ -22061,6 +22079,9 @@ msgstr "Le tue modifiche" msgid "Your changes will be lost if you don't save them." msgstr "Le tue modifiche andranno perse se non le salvi." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "I tuoi workspace cloud non potranno più raggiungere questo host." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Il tuo codice resta locale per impostazione predefinita, con controllo esplicito sui servizi collegati." diff --git a/packages/i18n/locales/ja/messages.po b/packages/i18n/locales/ja/messages.po index ee11f3439ef..cb775363636 100644 --- a/packages/i18n/locales/ja/messages.po +++ b/packages/i18n/locales/ja/messages.po @@ -2323,6 +2323,9 @@ msgstr "エージェントは {0} のツールにアクセスできません" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "エージェントが定型チケットを途中の介入なしに完了する。" +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "クラウドワークスペースのエージェントが、このホストに対して <0>--host などのコマンドを実行できるようになります。ホストにリレー経由で接続できる必要があります。" + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "エージェントはクラウドで動き続けます。デスクトップ、iPhone、iPad からワークスペースをもう一度開けます。" @@ -2566,6 +2569,9 @@ msgstr "セッション中は許可" msgid "Allow microphone access to use dictation" msgstr "音声入力を使うにはマイクへのアクセスを許可してください" +msgid "Allow my cloud workspaces to reach this host" +msgstr "クラウドワークスペースからこのホストへのアクセスを許可" + msgid "Allow remote access to this device via relay" msgstr "リレー経由でこのデバイスへのリモートアクセスを許可" @@ -2825,6 +2831,9 @@ msgstr "何でも" msgid "Anything else? (optional)" msgstr "他にありますか?(任意)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "あなたが作成したクラウドワークスペースで動くものはすべて、このホストでワークスペースの作成、エージェントの起動、コマンドの実行ができるようになります。Web ページやリポジトリで見つけた指示に従うエージェントも含まれます。必要な場合にのみオンにしてください。" + msgid "Anywhere" msgstr "すべての場所" @@ -10833,6 +10842,9 @@ msgstr "エージェントに {browserName} のログインを使わせますか msgid "Let the agent drive." msgstr "エージェントに操作させる。" +msgid "Let your cloud workspaces reach this host?" +msgstr "クラウドワークスペースからこのホストへのアクセスを許可しますか?" + msgid "Lets your organization list and clone repositories" msgstr "組織がリポジトリを一覧表示してクローンできるようにします" @@ -18548,6 +18560,9 @@ msgstr "監視を停止" msgid "Stop workspace run command" msgstr "ワークスペースの実行コマンドを停止" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "クラウドワークスペースからこのホストへのアクセスを停止しますか?" + msgid "stopped" msgstr "停止" @@ -20403,6 +20418,9 @@ msgstr "定型作業を、スケジュールやイベントの発生で動くエ msgid "Turn Fast mode on or off" msgstr "高速モードのオン/オフを切り替え" +msgid "Turn off" +msgstr "オフにする" + msgid "Turn off manual mode" msgstr "手動モードをオフにする" @@ -22061,6 +22079,9 @@ msgstr "編集中の内容" msgid "Your changes will be lost if you don't save them." msgstr "保存しないと変更は失われます。" +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "クラウドワークスペースからこのホストにアクセスできなくなります。" + msgid "Your code stays local by default, with explicit control over connected services." msgstr "コードは既定でローカルに留まり、連携するサービスは明示的に制御できます。" diff --git a/packages/i18n/locales/ko/messages.po b/packages/i18n/locales/ko/messages.po index 7129cb7cf97..25553002310 100644 --- a/packages/i18n/locales/ko/messages.po +++ b/packages/i18n/locales/ko/messages.po @@ -2323,6 +2323,9 @@ msgstr "에이전트가 {0}의 도구에 접근할 수 없습니다" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "에이전트가 작업 중간 개입 없이 일상적인 티켓을 완료합니다." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "이후 클라우드 워크스페이스의 에이전트가 이 호스트에 대해 <0>--host 같은 명령을 실행할 수 있습니다. 호스트는 릴레이를 통해 접근할 수 있어야 합니다." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "에이전트는 클라우드에서 계속 작업합니다. 데스크톱, iPhone, iPad에서 워크스페이스를 다시 열 수 있습니다." @@ -2566,6 +2569,9 @@ msgstr "세션 동안 허용" msgid "Allow microphone access to use dictation" msgstr "받아쓰기를 사용하려면 마이크 접근을 허용하세요" +msgid "Allow my cloud workspaces to reach this host" +msgstr "내 클라우드 워크스페이스가 이 호스트에 접근하도록 허용" + msgid "Allow remote access to this device via relay" msgstr "릴레이를 통해 이 기기에 원격 액세스 허용" @@ -2825,6 +2831,9 @@ msgstr "모든 내용" msgid "Anything else? (optional)" msgstr "그 밖에 알려줄 내용이 있나요? (선택)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "직접 만든 클라우드 워크스페이스에서 실행되는 모든 것이 이 호스트에서 워크스페이스를 만들고, 에이전트를 시작하고, 명령을 실행할 수 있게 됩니다. 웹 페이지나 저장소에서 찾은 지시를 따르는 에이전트도 포함됩니다. 필요할 때만 켜세요." + msgid "Anywhere" msgstr "모든 위치" @@ -10833,6 +10842,9 @@ msgstr "에이전트가 {browserName} 로그인을 사용하도록 허용할까 msgid "Let the agent drive." msgstr "에이전트가 조작하게 하세요." +msgid "Let your cloud workspaces reach this host?" +msgstr "클라우드 워크스페이스가 이 호스트에 접근하도록 허용할까요?" + msgid "Lets your organization list and clone repositories" msgstr "조직이 리포지토리를 나열하고 복제할 수 있게 합니다" @@ -18548,6 +18560,9 @@ msgstr "감시 중지" msgid "Stop workspace run command" msgstr "워크스페이스 실행 명령 중지" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "클라우드 워크스페이스의 이 호스트 접근을 중지할까요?" + msgid "stopped" msgstr "중지됨" @@ -20403,6 +20418,9 @@ msgstr "반복 작업을 일정에 따라 또는 이벤트가 발생할 때 실 msgid "Turn Fast mode on or off" msgstr "빠른 모드 켜기 또는 끄기" +msgid "Turn off" +msgstr "끄기" + msgid "Turn off manual mode" msgstr "수동 모드 끄기" @@ -22061,6 +22079,9 @@ msgstr "내 변경 내용" msgid "Your changes will be lost if you don't save them." msgstr "저장하지 않으면 변경 사항이 사라집니다." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "클라우드 워크스페이스가 더 이상 이 호스트에 접근할 수 없습니다." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "코드는 기본적으로 로컬에 머물고, 연결된 서비스는 명시적으로 통제합니다." diff --git a/packages/i18n/locales/nl/messages.po b/packages/i18n/locales/nl/messages.po index ca6b4ee7591..bcbe86258d0 100644 --- a/packages/i18n/locales/nl/messages.po +++ b/packages/i18n/locales/nl/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agents kunnen de tools van {0} niet bereiken" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agents voltooien routinetickets zonder tussentijds ingrijpen." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agents in je cloudwerkruimtes kunnen dan opdrachten zoals <0>--host op deze host uitvoeren. De host moet bereikbaar zijn via de relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agents blijven werken in de cloud. Open de werkruimte opnieuw op desktop, iPhone of iPad." @@ -2566,6 +2569,9 @@ msgstr "Toestaan voor deze sessie" msgid "Allow microphone access to use dictation" msgstr "Geef toegang tot de microfoon om te dicteren" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Mijn cloudwerkruimtes toegang geven tot deze host" + msgid "Allow remote access to this device via relay" msgstr "Externe toegang tot dit apparaat via de relay toestaan" @@ -2825,6 +2831,9 @@ msgstr "wat dan ook" msgid "Anything else? (optional)" msgstr "Nog iets? (optioneel)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Alles wat draait in een cloudwerkruimte die je hebt gemaakt, kan dan op deze host werkruimtes aanmaken, agents starten en opdrachten uitvoeren, ook een agent die instructies volgt die hij op een webpagina of in een repository vond. Zet dit alleen aan als je het nodig hebt." + msgid "Anywhere" msgstr "Overal" @@ -10833,6 +10842,9 @@ msgstr "Een agent je {browserName}-aanmeldingen laten gebruiken?" msgid "Let the agent drive." msgstr "Laat de agent sturen." +msgid "Let your cloud workspaces reach this host?" +msgstr "Je cloudwerkruimtes toegang geven tot deze host?" + msgid "Lets your organization list and clone repositories" msgstr "Laat je organisatie repositories weergeven en klonen" @@ -18548,6 +18560,9 @@ msgstr "Stoppen met volgen" msgid "Stop workspace run command" msgstr "Run-commando van werkruimte stoppen" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "De toegang van je cloudwerkruimtes tot deze host stoppen?" + msgid "stopped" msgstr "gestopt" @@ -20403,6 +20418,9 @@ msgstr "Maak van routineklussen agents die op een schema draaien of wanneer er e msgid "Turn Fast mode on or off" msgstr "Snelle modus in- of uitschakelen" +msgid "Turn off" +msgstr "Uitzetten" + msgid "Turn off manual mode" msgstr "Handmatige modus uitzetten" @@ -22061,6 +22079,9 @@ msgstr "Jouw wijzigingen" msgid "Your changes will be lost if you don't save them." msgstr "Je wijzigingen gaan verloren als je ze niet opslaat." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Je cloudwerkruimtes hebben geen toegang meer tot deze host." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Je code blijft standaard lokaal, met expliciete controle over gekoppelde diensten." diff --git a/packages/i18n/locales/pl/messages.po b/packages/i18n/locales/pl/messages.po index bf477bccfcb..484fb87126d 100644 --- a/packages/i18n/locales/pl/messages.po +++ b/packages/i18n/locales/pl/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agenci nie mają dostępu do narzędzi {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agenci kończą rutynowe zgłoszenia bez interwencji w trakcie zadania." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agenci w Twoich obszarach roboczych w chmurze będą mogli uruchamiać na tym hoście polecenia takie jak <0>--host. Host musi być osiągalny przez przekaźnik." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agenci pracują dalej w chmurze. Otwórz obszar roboczy ponownie na komputerze, iPhonie lub iPadzie." @@ -2566,6 +2569,9 @@ msgstr "Zezwól na czas sesji" msgid "Allow microphone access to use dictation" msgstr "Zezwól na dostęp do mikrofonu, aby korzystać z dyktowania" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Zezwól moim obszarom roboczym w chmurze na dostęp do tego hosta" + msgid "Allow remote access to this device via relay" msgstr "Zezwól na zdalny dostęp do tego urządzenia przez przekaźnik" @@ -2825,6 +2831,9 @@ msgstr "cokolwiek" msgid "Anything else? (optional)" msgstr "Coś jeszcze? (opcjonalnie)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Wszystko, co działa w utworzonym przez Ciebie obszarze roboczym w chmurze, będzie mogło tworzyć obszary robocze, uruchamiać agentów i wykonywać polecenia na tym hoście — w tym agent wykonujący instrukcje znalezione na stronie internetowej lub w repozytorium. Włącz to tylko wtedy, gdy jest potrzebne." + msgid "Anywhere" msgstr "Wszędzie" @@ -10833,6 +10842,9 @@ msgstr "Pozwolić agentowi używać Twoich zalogowanych sesji z {browserName}?" msgid "Let the agent drive." msgstr "Pozwól agentowi działać." +msgid "Let your cloud workspaces reach this host?" +msgstr "Zezwolić Twoim obszarom roboczym w chmurze na dostęp do tego hosta?" + msgid "Lets your organization list and clone repositories" msgstr "Pozwala organizacji wyświetlać i klonować repozytoria" @@ -18548,6 +18560,9 @@ msgstr "Przestań obserwować" msgid "Stop workspace run command" msgstr "Zatrzymaj polecenie uruchamiania obszaru roboczego" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Zablokować Twoim obszarom roboczym w chmurze dostęp do tego hosta?" + msgid "stopped" msgstr "zatrzymana" @@ -20403,6 +20418,9 @@ msgstr "Zamień rutynowe zadania w agentów, którzy działają według harmonog msgid "Turn Fast mode on or off" msgstr "Włącz lub wyłącz tryb szybki" +msgid "Turn off" +msgstr "Wyłącz" + msgid "Turn off manual mode" msgstr "Wyłącz tryb ręczny" @@ -22061,6 +22079,9 @@ msgstr "Twoje zmiany" msgid "Your changes will be lost if you don't save them." msgstr "Twoje zmiany zostaną utracone, jeśli ich nie zapiszesz." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Twoje obszary robocze w chmurze nie będą już miały dostępu do tego hosta." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Twój kod domyślnie zostaje lokalnie, z jawną kontrolą nad podłączonymi usługami." diff --git a/packages/i18n/locales/pt-BR/messages.po b/packages/i18n/locales/pt-BR/messages.po index 9c18d09f799..9ab58300949 100644 --- a/packages/i18n/locales/pt-BR/messages.po +++ b/packages/i18n/locales/pt-BR/messages.po @@ -2323,6 +2323,9 @@ msgstr "Os agentes não conseguem acessar as ferramentas de {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Os agentes concluem tickets rotineiros sem intervenção no meio da tarefa." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Os agentes nas suas áreas de trabalho na nuvem poderão executar comandos como <0>--host neste host. O host precisa estar acessível pelo relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Os agentes continuam trabalhando na nuvem. Abra a área de trabalho de novo no desktop, iPhone ou iPad." @@ -2566,6 +2569,9 @@ msgstr "Permitir nesta sessão" msgid "Allow microphone access to use dictation" msgstr "Permita o acesso ao microfone para usar o ditado" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Permitir que minhas áreas de trabalho na nuvem acessem este host" + msgid "Allow remote access to this device via relay" msgstr "Permitir acesso remoto a este dispositivo via relay" @@ -2825,6 +2831,9 @@ msgstr "qualquer coisa" msgid "Anything else? (optional)" msgstr "Mais alguma coisa? (opcional)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Qualquer coisa executada em uma área de trabalho na nuvem que você criou poderá criar áreas de trabalho, iniciar agentes e executar comandos neste host, incluindo um agente que siga instruções encontradas em uma página da web ou em um repositório. Ative somente se precisar." + msgid "Anywhere" msgstr "Em qualquer lugar" @@ -10833,6 +10842,9 @@ msgstr "Permitir que um agente use seus logins do {browserName}?" msgid "Let the agent drive." msgstr "Deixe o agente conduzir." +msgid "Let your cloud workspaces reach this host?" +msgstr "Permitir que suas áreas de trabalho na nuvem acessem este host?" + msgid "Lets your organization list and clone repositories" msgstr "Permite que sua organização liste e clone repositórios" @@ -18548,6 +18560,9 @@ msgstr "Parar de observar" msgid "Stop workspace run command" msgstr "Parar o comando de execução da área de trabalho" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Impedir que suas áreas de trabalho na nuvem acessem este host?" + msgid "stopped" msgstr "parado" @@ -20403,6 +20418,9 @@ msgstr "Transforme tarefas rotineiras em agentes que rodam por agenda ou quando msgid "Turn Fast mode on or off" msgstr "Ativar ou desativar o modo rápido" +msgid "Turn off" +msgstr "Desativar" + msgid "Turn off manual mode" msgstr "Desativar o modo manual" @@ -22061,6 +22079,9 @@ msgstr "Suas alterações" msgid "Your changes will be lost if you don't save them." msgstr "Suas alterações serão perdidas se você não salvar." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Suas áreas de trabalho na nuvem não poderão mais acessar este host." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Seu código fica local por padrão, com controle explícito sobre os serviços conectados." diff --git a/packages/i18n/locales/ru/messages.po b/packages/i18n/locales/ru/messages.po index daa0318af84..3886aa2057b 100644 --- a/packages/i18n/locales/ru/messages.po +++ b/packages/i18n/locales/ru/messages.po @@ -2323,6 +2323,9 @@ msgstr "Агенты не могут получить доступ к инстр msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Агенты закрывают рутинные тикеты без вмешательства по ходу задачи." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Агенты в ваших облачных рабочих областях смогут запускать на этом хосте команды вроде <0>--host. Хост должен быть доступен через реле." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Агенты продолжают работать в облаке. Снова откройте рабочую область на компьютере, iPhone или iPad." @@ -2566,6 +2569,9 @@ msgstr "Разрешить на сессию" msgid "Allow microphone access to use dictation" msgstr "Разрешите доступ к микрофону, чтобы использовать диктовку" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Разрешить моим облачным рабочим областям доступ к этому хосту" + msgid "Allow remote access to this device via relay" msgstr "Разрешить удалённый доступ к этому устройству через реле" @@ -2825,6 +2831,9 @@ msgstr "что угодно" msgid "Anything else? (optional)" msgstr "Что-нибудь ещё? (необязательно)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Всё, что работает в созданной вами облачной рабочей области, сможет создавать рабочие области, запускать агентов и выполнять команды на этом хосте — в том числе агент, который следует инструкциям, найденным на веб-странице или в репозитории. Включайте, только если это нужно." + msgid "Anywhere" msgstr "Везде" @@ -10833,6 +10842,9 @@ msgstr "Разрешить агенту использовать ваши вхо msgid "Let the agent drive." msgstr "Пусть агент управляет." +msgid "Let your cloud workspaces reach this host?" +msgstr "Разрешить вашим облачным рабочим областям доступ к этому хосту?" + msgid "Lets your organization list and clone repositories" msgstr "Позволяет организации видеть и клонировать репозитории" @@ -18548,6 +18560,9 @@ msgstr "Прекратить отслеживание" msgid "Stop workspace run command" msgstr "Остановить команду запуска рабочей области" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Закрыть вашим облачным рабочим областям доступ к этому хосту?" + msgid "stopped" msgstr "остановлена" @@ -20403,6 +20418,9 @@ msgstr "Превратите рутину в агентов, которые за msgid "Turn Fast mode on or off" msgstr "Включить или выключить быстрый режим" +msgid "Turn off" +msgstr "Выключить" + msgid "Turn off manual mode" msgstr "Отключить ручной режим" @@ -22061,6 +22079,9 @@ msgstr "Ваши изменения" msgid "Your changes will be lost if you don't save them." msgstr "Изменения будут потеряны, если их не сохранить." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Ваши облачные рабочие области больше не смогут получить доступ к этому хосту." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Ваш код по умолчанию остаётся локальным, с явным контролем над подключёнными сервисами." diff --git a/packages/i18n/locales/tr/messages.po b/packages/i18n/locales/tr/messages.po index b1df8d0a7f2..47b6b9105f9 100644 --- a/packages/i18n/locales/tr/messages.po +++ b/packages/i18n/locales/tr/messages.po @@ -2323,6 +2323,9 @@ msgstr "Ajanlar {0} araçlarına erişemiyor" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Ajanlar rutin biletleri görev ortasında müdahale olmadan tamamlar." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Bulut çalışma alanlarındaki ajanlar bu host üzerinde <0>--host gibi komutlar çalıştırabilir. Host'a röle üzerinden erişilebilmesi gerekir." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Ajanlar bulutta çalışmaya devam eder. Çalışma alanını masaüstünden, iPhone'dan veya iPad'den yeniden açın." @@ -2566,6 +2569,9 @@ msgstr "Oturum boyunca izin ver" msgid "Allow microphone access to use dictation" msgstr "Sesle yazmak için mikrofon erişimine izin verin" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Bulut çalışma alanlarımın bu host'a erişmesine izin ver" + msgid "Allow remote access to this device via relay" msgstr "Bu cihaza röle üzerinden uzaktan erişime izin ver" @@ -2825,6 +2831,9 @@ msgstr "herhangi bir şey" msgid "Anything else? (optional)" msgstr "Başka bir şey var mı? (isteğe bağlı)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Oluşturduğunuz bir bulut çalışma alanında çalışan her şey bu host üzerinde çalışma alanı oluşturabilir, ajan başlatabilir ve komut çalıştırabilir; bir web sayfasında veya depoda bulduğu talimatları izleyen bir ajan da buna dahildir. Yalnızca ihtiyacınız varsa açın." + msgid "Anywhere" msgstr "Her yerde" @@ -10833,6 +10842,9 @@ msgstr "Bir ajanın {browserName} oturumlarınızı kullanmasına izin verilsin msgid "Let the agent drive." msgstr "Ajan kullansın." +msgid "Let your cloud workspaces reach this host?" +msgstr "Bulut çalışma alanlarınızın bu host'a erişmesine izin verilsin mi?" + msgid "Lets your organization list and clone repositories" msgstr "Kuruluşunuzun depoları listelemesine ve klonlamasına izin verir" @@ -18548,6 +18560,9 @@ msgstr "İzlemeyi durdur" msgid "Stop workspace run command" msgstr "Çalışma alanı çalıştırma komutunu durdur" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Bulut çalışma alanlarınızın bu host'a erişimi durdurulsun mu?" + msgid "stopped" msgstr "durduruldu" @@ -20403,6 +20418,9 @@ msgstr "Rutin işleri zamanlamayla veya bir olay geldiğinde çalışan ajanlara msgid "Turn Fast mode on or off" msgstr "Hızlı modu aç veya kapat" +msgid "Turn off" +msgstr "Kapat" + msgid "Turn off manual mode" msgstr "Manuel modu kapat" @@ -22061,6 +22079,9 @@ msgstr "Değişiklikleriniz" msgid "Your changes will be lost if you don't save them." msgstr "Kaydetmezseniz değişiklikleriniz kaybolur." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Bulut çalışma alanlarınız artık bu host'a erişemeyecek." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Kodunuz varsayılan olarak yerelde kalır; bağlı hizmetler üzerinde açık denetiminiz olur." diff --git a/packages/i18n/locales/uk/messages.po b/packages/i18n/locales/uk/messages.po index d737ce0fabd..cf5fabe95ba 100644 --- a/packages/i18n/locales/uk/messages.po +++ b/packages/i18n/locales/uk/messages.po @@ -2317,6 +2317,9 @@ msgstr "Агенти не мають доступу до інструменті msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Агенти виконують рутинні тікети без втручання під час роботи." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Агенти у ваших хмарних робочих просторах зможуть запускати на цьому хості команди на кшталт <0>--host. Хост має бути доступним через релей." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Агенти працюють далі в хмарі. Знову відкрийте робочий простір на комп'ютері, iPhone або iPad." @@ -2560,6 +2563,9 @@ msgstr "Дозволити на сеанс" msgid "Allow microphone access to use dictation" msgstr "Дозвольте доступ до мікрофона, щоб використовувати диктування" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Дозволити моїм хмарним робочим просторам доступ до цього хоста" + msgid "Allow remote access to this device via relay" msgstr "Дозволити віддалений доступ до цього пристрою через релей" @@ -2819,6 +2825,9 @@ msgstr "будь-що" msgid "Anything else? (optional)" msgstr "Щось іще? (необов'язково)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Усе, що працює у створеному вами хмарному робочому просторі, зможе створювати робочі простори, запускати агентів і виконувати команди на цьому хості — зокрема агент, що виконує інструкції, знайдені на вебсторінці чи в репозиторії. Вмикайте, лише якщо це потрібно." + msgid "Anywhere" msgstr "Будь-де" @@ -10827,6 +10836,9 @@ msgstr "Дозволити агенту використовувати сеан msgid "Let the agent drive." msgstr "Віддайте кермо агенту." +msgid "Let your cloud workspaces reach this host?" +msgstr "Дозволити вашим хмарним робочим просторам доступ до цього хоста?" + msgid "Lets your organization list and clone repositories" msgstr "Дає вашій організації змогу переглядати й клонувати репозиторії" @@ -18542,6 +18554,9 @@ msgstr "Припинити стеження" msgid "Stop workspace run command" msgstr "Зупинити команду запуску робочого простору" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Закрити вашим хмарним робочим просторам доступ до цього хоста?" + msgid "stopped" msgstr "зупинено" @@ -20397,6 +20412,9 @@ msgstr "Перетворіть рутинні справи на агентів, msgid "Turn Fast mode on or off" msgstr "Увімкнути або вимкнути швидкий режим" +msgid "Turn off" +msgstr "Вимкнути" + msgid "Turn off manual mode" msgstr "Вимкнути ручний режим" @@ -22055,6 +22073,9 @@ msgstr "Ваші зміни" msgid "Your changes will be lost if you don't save them." msgstr "Якщо не зберегти зміни, їх буде втрачено." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Ваші хмарні робочі простори більше не матимуть доступу до цього хоста." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "За замовчуванням ваш код залишається локально, а підключеними сервісами ви керуєте явно." diff --git a/packages/i18n/locales/vi/messages.po b/packages/i18n/locales/vi/messages.po index 513f740fd28..fbe2b1763dd 100644 --- a/packages/i18n/locales/vi/messages.po +++ b/packages/i18n/locales/vi/messages.po @@ -2323,6 +2323,9 @@ msgstr "Agent không thể truy cập các công cụ của {0}" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "Agent hoàn thành các ticket thường ngày mà không cần can thiệp giữa chừng." +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "Agent trong các workspace cloud của bạn khi đó có thể chạy các lệnh như <0>--host trên host này. Host phải truy cập được qua relay." + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "Agent tiếp tục làm việc trên đám mây. Mở lại không gian làm việc từ máy tính, iPhone hoặc iPad." @@ -2566,6 +2569,9 @@ msgstr "Cho phép trong phiên này" msgid "Allow microphone access to use dictation" msgstr "Cho phép truy cập micro để dùng đọc chính tả" +msgid "Allow my cloud workspaces to reach this host" +msgstr "Cho phép workspace cloud của tôi truy cập host này" + msgid "Allow remote access to this device via relay" msgstr "Cho phép truy cập từ xa vào thiết bị này qua relay" @@ -2825,6 +2831,9 @@ msgstr "bất kỳ điều gì" msgid "Anything else? (optional)" msgstr "Còn gì nữa không? (không bắt buộc)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "Mọi thứ chạy trong một workspace cloud do bạn tạo khi đó đều có thể tạo workspace, khởi động agent và chạy lệnh trên host này, kể cả một agent làm theo chỉ dẫn mà nó tìm thấy trong một trang web hoặc một repository. Chỉ bật khi bạn cần." + msgid "Anywhere" msgstr "Mọi nơi" @@ -10833,6 +10842,9 @@ msgstr "Cho phép agent dùng thông tin đăng nhập {browserName} của bạn msgid "Let the agent drive." msgstr "Để agent điều khiển." +msgid "Let your cloud workspaces reach this host?" +msgstr "Cho phép workspace cloud của bạn truy cập host này?" + msgid "Lets your organization list and clone repositories" msgstr "Cho phép tổ chức của bạn liệt kê và clone repository" @@ -18548,6 +18560,9 @@ msgstr "Ngừng theo dõi" msgid "Stop workspace run command" msgstr "Dừng lệnh chạy của workspace" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "Ngừng cho workspace cloud của bạn truy cập host này?" + msgid "stopped" msgstr "đã dừng" @@ -20403,6 +20418,9 @@ msgstr "Biến việc lặt vặt thành agent chạy theo lịch hoặc khi có msgid "Turn Fast mode on or off" msgstr "Bật hoặc tắt chế độ nhanh" +msgid "Turn off" +msgstr "Tắt" + msgid "Turn off manual mode" msgstr "Tắt chế độ thủ công" @@ -22061,6 +22079,9 @@ msgstr "Các thay đổi của bạn" msgid "Your changes will be lost if you don't save them." msgstr "Thay đổi của bạn sẽ mất nếu không lưu." +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "Workspace cloud của bạn sẽ không thể truy cập host này nữa." + msgid "Your code stays local by default, with explicit control over connected services." msgstr "Code của bạn mặc định ở lại cục bộ, với quyền kiểm soát rõ ràng đối với các dịch vụ đã kết nối." diff --git a/packages/i18n/locales/zh-CN/messages.po b/packages/i18n/locales/zh-CN/messages.po index 3a059098d1b..b68f4066ee5 100644 --- a/packages/i18n/locales/zh-CN/messages.po +++ b/packages/i18n/locales/zh-CN/messages.po @@ -2323,6 +2323,9 @@ msgstr "智能体无法访问 {0} 的工具" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "智能体无需中途干预即可完成常规工单。" +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "之后,你的云端工作区中的智能体就可以对此主机运行 <0>--host 等命令。该主机必须能通过中继访问。" + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "智能体在云端持续工作。可在桌面端、iPhone 或 iPad 上重新打开工作区。" @@ -2566,6 +2569,9 @@ msgstr "本次会话内允许" msgid "Allow microphone access to use dictation" msgstr "请允许麦克风访问以使用语音输入" +msgid "Allow my cloud workspaces to reach this host" +msgstr "允许我的云端工作区访问此主机" + msgid "Allow remote access to this device via relay" msgstr "允许通过中继远程访问本设备" @@ -2825,6 +2831,9 @@ msgstr "任意内容" msgid "Anything else? (optional)" msgstr "还有别的吗?(选填)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "你创建的云端工作区中运行的任何程序都将可以在此主机上创建工作区、启动智能体和运行命令,包括按照网页或代码仓库中的指令行事的智能体。请仅在需要时开启。" + msgid "Anywhere" msgstr "所有位置" @@ -10833,6 +10842,9 @@ msgstr "允许智能体使用你的 {browserName} 登录信息吗?" msgid "Let the agent drive." msgstr "让智能体来操作。" +msgid "Let your cloud workspaces reach this host?" +msgstr "允许你的云端工作区访问此主机?" + msgid "Lets your organization list and clone repositories" msgstr "允许你的组织列出并克隆仓库" @@ -18548,6 +18560,9 @@ msgstr "停止关注" msgid "Stop workspace run command" msgstr "停止工作区运行命令" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "停止你的云端工作区访问此主机?" + msgid "stopped" msgstr "已停止" @@ -20403,6 +20418,9 @@ msgstr "把日常杂务交给按计划或在事件到来时运行的智能体: msgid "Turn Fast mode on or off" msgstr "开启或关闭快速模式" +msgid "Turn off" +msgstr "关闭" + msgid "Turn off manual mode" msgstr "关闭手动模式" @@ -22061,6 +22079,9 @@ msgstr "你的更改" msgid "Your changes will be lost if you don't save them." msgstr "如果不保存,你的更改将会丢失。" +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "你的云端工作区将无法再访问此主机。" + msgid "Your code stays local by default, with explicit control over connected services." msgstr "你的代码默认留在本地,连接哪些服务由你明确决定。" diff --git a/packages/i18n/locales/zh-TW/messages.po b/packages/i18n/locales/zh-TW/messages.po index 14c322f4c65..5bfaa023273 100644 --- a/packages/i18n/locales/zh-TW/messages.po +++ b/packages/i18n/locales/zh-TW/messages.po @@ -2323,6 +2323,9 @@ msgstr "代理程式無法存取 {0} 的工具" msgid "Agents complete routine tickets with no mid-task intervention." msgstr "代理程式無需中途干預即可完成常規工單。" +msgid "Agents in your cloud workspaces can then run commands like <0>--host against this host. The host must be reachable through the relay." +msgstr "之後,你的雲端工作區中的代理程式就能對此主機執行 <0>--host 等指令。此主機必須能透過中繼存取。" + msgid "Agents keep working in the cloud. Open the workspace again from desktop, iPhone, or iPad." msgstr "代理程式會在雲端持續工作。可在桌面版、iPhone 或 iPad 上重新開啟工作區。" @@ -2566,6 +2569,9 @@ msgstr "本次會話內允許" msgid "Allow microphone access to use dictation" msgstr "請允許麥克風存取以使用語音輸入" +msgid "Allow my cloud workspaces to reach this host" +msgstr "允許我的雲端工作區存取此主機" + msgid "Allow remote access to this device via relay" msgstr "允許透過中繼遠端存取此裝置" @@ -2825,6 +2831,9 @@ msgstr "任意內容" msgid "Anything else? (optional)" msgstr "還有其他嗎?(選填)" +msgid "Anything running in a cloud workspace you created can then create workspaces, start agents, and run commands on this host, including an agent following instructions it found in a web page or a repository. Turn this on only if you need it." +msgstr "你建立的雲端工作區中執行的任何程式都將能在此主機上建立工作區、啟動代理程式並執行指令,包括依照網頁或儲存庫中的指示行事的代理程式。請只在需要時開啟。" + msgid "Anywhere" msgstr "所有位置" @@ -10833,6 +10842,9 @@ msgstr "允許代理程式使用你的 {browserName} 登入資訊嗎?" msgid "Let the agent drive." msgstr "讓代理程式來操作。" +msgid "Let your cloud workspaces reach this host?" +msgstr "允許你的雲端工作區存取此主機?" + msgid "Lets your organization list and clone repositories" msgstr "讓你的組織能列出並複製儲存庫" @@ -18548,6 +18560,9 @@ msgstr "停止關注" msgid "Stop workspace run command" msgstr "停止工作區執行命令" +msgid "Stop your cloud workspaces reaching this host?" +msgstr "停止你的雲端工作區存取此主機?" + msgid "stopped" msgstr "已停止" @@ -20403,6 +20418,9 @@ msgstr "把例行雜務交給依排程或在事件發生時執行的代理程式 msgid "Turn Fast mode on or off" msgstr "開啟或關閉快速模式" +msgid "Turn off" +msgstr "關閉" + msgid "Turn off manual mode" msgstr "關閉手動模式" @@ -22061,6 +22079,9 @@ msgstr "你的變更" msgid "Your changes will be lost if you don't save them." msgstr "如果不儲存,你的更改將會丟失。" +msgid "Your cloud workspaces will no longer be able to reach this host." +msgstr "你的雲端工作區將無法再存取此主機。" + msgid "Your code stays local by default, with explicit control over connected services." msgstr "你的程式碼預設留在本地,連線哪些服務由你明確決定。" From 8471ca35c71cf6444c689efe7b9216ba37468178 Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 22:48:52 +0000 Subject: [PATCH 05/13] fix(cli): call a host from a cloud workspace without a bearer A box has no user token. Sending `Authorization: Bearer ` with nothing in it made the relay answer 401, which the CLI showed as "Session expired". With no bearer the firewall-added workspace credential is what the relay checks. --- .../lib/host-target/resolveHostTarget.test.ts | 35 +++++++++++++++++++ .../src/lib/host-target/resolveHostTarget.ts | 5 ++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 packages/cli/src/lib/host-target/resolveHostTarget.test.ts diff --git a/packages/cli/src/lib/host-target/resolveHostTarget.test.ts b/packages/cli/src/lib/host-target/resolveHostTarget.test.ts new file mode 100644 index 00000000000..cdda40f395e --- /dev/null +++ b/packages/cli/src/lib/host-target/resolveHostTarget.test.ts @@ -0,0 +1,35 @@ +import { afterAll, describe, expect, test } from "bun:test"; +import type { ApiClient } from "../api-client"; +import { resolveHostTarget } from "./resolveHostTarget"; + +const seen: Headers[] = []; +const relay = Bun.serve({ + port: 0, + fetch: (request) => { + seen.push(request.headers); + return Response.json([{ result: { data: { json: [] } } }]); + }, +}); +afterAll(() => relay.stop(true)); + +const api = { + host: { + relayEndpoint: { query: async () => ({ url: relay.url.origin }) }, + }, +} as unknown as ApiClient; + +describe("resolveHostTarget", () => { + test("a cloud workspace calls the relay with no bearer, so its firewall-added credential is what counts", async () => { + const target = await resolveHostTarget({ + requestedHostId: "some-other-host", + organizationId: "1c0587c9-a74c-423c-ae40-b97296ad9b27", + userJwt: "", + api, + }); + + await target.client.workspace.list.query(); + + expect(target.kind).toBe("remote"); + expect(seen.at(-1)?.get("authorization")).toBeNull(); + }); +}); diff --git a/packages/cli/src/lib/host-target/resolveHostTarget.ts b/packages/cli/src/lib/host-target/resolveHostTarget.ts index 6d1d397ec4c..07cae58246e 100644 --- a/packages/cli/src/lib/host-target/resolveHostTarget.ts +++ b/packages/cli/src/lib/host-target/resolveHostTarget.ts @@ -101,8 +101,11 @@ export async function resolveHostTarget( httpBatchLink({ url: `${relayUrl}/hosts/${routingKey}/trpc`, transformer: SuperJSON, + // A cloud workspace has no bearer; its firewall adds its credential. headers: { - Authorization: `Bearer ${options.userJwt}`, + ...(options.userJwt + ? { Authorization: `Bearer ${options.userJwt}` } + : {}), "x-superset-client-machine-id": localHostId, }, }), From fc191ba582bb4d73ff9c749abd668d6b5613e585 Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:20:54 +0000 Subject: [PATCH 06/13] fix(mobile): give the sandbox host row allowCloudWorkspaces host.roster rows now carry allowCloudWorkspaces, and the row mobile builds for a cloud workspace's own sandbox has to match. A sandbox is not a host its owner opened, so false. --- apps/mobile/hooks/useWorkspaceHost/useWorkspaceHost.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/mobile/hooks/useWorkspaceHost/useWorkspaceHost.ts b/apps/mobile/hooks/useWorkspaceHost/useWorkspaceHost.ts index 11655414aec..0d10cbf2823 100644 --- a/apps/mobile/hooks/useWorkspaceHost/useWorkspaceHost.ts +++ b/apps/mobile/hooks/useWorkspaceHost/useWorkspaceHost.ts @@ -127,6 +127,7 @@ export function useWorkspaceHost( version: null, platform: null, installSource: null, + allowCloudWorkspaces: false, // A sandbox is reachable or it isn't; there is no offline // device behind it to report on. isOnline: true, From 8d377c3ef1bb92ded2d10b36eef8714d2ccb2a6e Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:35:45 +0000 Subject: [PATCH 07/13] chore(db): drop a forward reference from the allow_cloud_workspaces comment --- packages/db/src/schema/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/src/schema/schema.ts b/packages/db/src/schema/schema.ts index 358f1ddd8a8..f37339c0a51 100644 --- a/packages/db/src/schema/schema.ts +++ b/packages/db/src/schema/schema.ts @@ -1469,7 +1469,7 @@ export const v2Hosts = pgTable( platform: text(), installSource: text("install_source"), // Whether the owner lets their cloud workspaces reach this host through - // the relay. Only `host.setCloudWorkspaceAccess` writes it. + // the relay. allowCloudWorkspaces: boolean("allow_cloud_workspaces") .notNull() .default(false), From 5cd743c2f9baecfeb989c66c19516a13c1080129 Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:38:36 +0000 Subject: [PATCH 08/13] fix(api): only the host owner's cloud workspaces reach an opened host host.cloudWorkspaceAccess matched any v2_users_hosts row, so once an owner opened a host, the boxes of every member they had added could drive it too. The decision is now a pure function that requires the owner role, with tests for owner, member, closed, cross-org and non-box callers. Also use the catalog's existing German term for host owner. --- docs/cloud-sandbox-considerations.md | 4 +- packages/i18n/locales/de/messages.po | 2 +- .../host/cloud-workspace-access.test.ts | 67 +++++++++++++++++++ .../src/router/host/cloud-workspace-access.ts | 37 ++++++++++ packages/trpc/src/router/host/host.ts | 67 +++++++++---------- 5 files changed, 138 insertions(+), 39 deletions(-) create mode 100644 packages/trpc/src/router/host/cloud-workspace-access.test.ts create mode 100644 packages/trpc/src/router/host/cloud-workspace-access.ts diff --git a/docs/cloud-sandbox-considerations.md b/docs/cloud-sandbox-considerations.md index 9166b08a257..3ea7d616bdf 100644 --- a/docs/cloud-sandbox-considerations.md +++ b/docs/cloud-sandbox-considerations.md @@ -129,8 +129,8 @@ bypassed through the others. **A box reaches its creator's own hosts, when a host allows it. Accepted (opt-in).** The firewall adds the workspace credential on requests to the relay as well as the API, and the relay asks `host.cloudWorkspaceAccess` on -every call. A host is reachable only if the creator has access to it and its -owner turned on "Allow my cloud workspaces to reach this host" +every call. A host is reachable only if the creator owns it (a member's box is +refused) and turned on "Allow my cloud workspaces to reach this host" (`v2_hosts.allow_cloud_workspaces`, set by `host.setCloudWorkspaceAccess`, which a box cannot call). The API is the only lock: host-service does not know the call came from a box, so a wrong value in that column opens the host. Once diff --git a/packages/i18n/locales/de/messages.po b/packages/i18n/locales/de/messages.po index 27781e0e159..d1fcd4c59f4 100644 --- a/packages/i18n/locales/de/messages.po +++ b/packages/i18n/locales/de/messages.po @@ -13270,7 +13270,7 @@ msgid "Only the author can edit a comment" msgstr "Nur der Autor kann einen Kommentar bearbeiten" msgid "Only the host owner can let cloud workspaces reach it" -msgstr "Nur der Besitzer des Hosts kann Cloud-Arbeitsbereichen den Zugriff erlauben" +msgstr "Nur der Host-Inhaber kann Cloud-Arbeitsbereichen den Zugriff erlauben" msgid "Only the host owner can set its wake command" msgstr "Nur der Host-Inhaber kann dessen Wake-Befehl setzen" diff --git a/packages/trpc/src/router/host/cloud-workspace-access.test.ts b/packages/trpc/src/router/host/cloud-workspace-access.test.ts new file mode 100644 index 00000000000..bc71e5cfa9a --- /dev/null +++ b/packages/trpc/src/router/host/cloud-workspace-access.test.ts @@ -0,0 +1,67 @@ +import { describe, expect, mock, test } from "bun:test"; +import { + decideCloudWorkspaceAccess, + type HostAsSeenByCreator, +} from "./cloud-workspace-access"; + +const box = { workspaceId: "ws-1", organizationId: "org-1", userId: "user-1" }; +const hostId = "org-1:machine-1"; + +const finding = (host: HostAsSeenByCreator | null) => mock(async () => host); + +describe("decideCloudWorkspaceAccess", () => { + test("lets the creator's box into a host they own and opened", async () => { + expect( + await decideCloudWorkspaceAccess( + box, + hostId, + finding({ role: "owner", allowCloudWorkspaces: true }), + ), + ).toEqual({ allowed: true, userId: "user-1", workspaceId: "ws-1" }); + }); + + test("refuses a host its owner has not opened", async () => { + expect( + await decideCloudWorkspaceAccess( + box, + hostId, + finding({ role: "owner", allowCloudWorkspaces: false }), + ), + ).toEqual({ allowed: false, reason: "host_closed" }); + }); + + test("refuses a host the creator is only a member of, even when it is open", async () => { + expect( + await decideCloudWorkspaceAccess( + box, + hostId, + finding({ role: "member", allowCloudWorkspaces: true }), + ), + ).toEqual({ allowed: false, reason: "no_access" }); + }); + + test("refuses a host the creator has no access to", async () => { + expect( + await decideCloudWorkspaceAccess(box, hostId, finding(null)), + ).toEqual({ allowed: false, reason: "no_access" }); + }); + + test("refuses a host in another organization without looking it up", async () => { + const findHost = finding({ role: "owner", allowCloudWorkspaces: true }); + + expect( + await decideCloudWorkspaceAccess(box, "org-2:machine-1", findHost), + ).toEqual({ allowed: false, reason: "no_access" }); + expect(findHost).not.toHaveBeenCalled(); + }); + + test("refuses a caller that is not a cloud workspace", async () => { + expect( + await decideCloudWorkspaceAccess( + null, + hostId, + finding({ role: "owner", allowCloudWorkspaces: true }), + ), + ).toEqual({ allowed: false, reason: "no_access" }); + }); +}); diff --git a/packages/trpc/src/router/host/cloud-workspace-access.ts b/packages/trpc/src/router/host/cloud-workspace-access.ts new file mode 100644 index 00000000000..cf44b36c777 --- /dev/null +++ b/packages/trpc/src/router/host/cloud-workspace-access.ts @@ -0,0 +1,37 @@ +import { parseHostRoutingKey } from "@superset/shared/host-routing"; +import type { SandboxCaller } from "../../lib/sandbox/api-credential"; + +export interface HostAsSeenByCreator { + role: string; + allowCloudWorkspaces: boolean; +} + +export type CloudWorkspaceAccess = + | { allowed: true; userId: string; workspaceId: string } + | { allowed: false; reason: "no_access" | "host_closed" }; + +/** Only the creator's own hosts: a member's switch is not theirs to flip. */ +export async function decideCloudWorkspaceAccess( + box: SandboxCaller | null, + hostId: string, + findHost: (where: { + userId: string; + organizationId: string; + machineId: string; + }) => Promise, +): Promise { + const parsed = parseHostRoutingKey(hostId); + if (!box || !parsed || parsed.organizationId !== box.organizationId) { + return { allowed: false, reason: "no_access" }; + } + const host = await findHost({ + userId: box.userId, + organizationId: parsed.organizationId, + machineId: parsed.machineId, + }); + if (host?.role !== "owner") return { allowed: false, reason: "no_access" }; + if (!host.allowCloudWorkspaces) { + return { allowed: false, reason: "host_closed" }; + } + return { allowed: true, userId: box.userId, workspaceId: box.workspaceId }; +} diff --git a/packages/trpc/src/router/host/host.ts b/packages/trpc/src/router/host/host.ts index 7d846abfda6..bbd050033b4 100644 --- a/packages/trpc/src/router/host/host.ts +++ b/packages/trpc/src/router/host/host.ts @@ -16,6 +16,7 @@ import { isMember } from "../../lib/cloud-guards"; import { nudge } from "../../lib/realtime"; import { fetchRelayPresence } from "../../lib/relay-presence"; import { personProcedure, userError } from "../../trpc"; +import { decideCloudWorkspaceAccess } from "./cloud-workspace-access"; import { registerHost } from "./registration"; import { authorizeHostUpdate, @@ -278,42 +279,36 @@ export const hostRouter = { // Called by the relay with the box's firewall-added credential. cloudWorkspaceAccess: personProcedure .input(z.object({ hostId: z.string().min(1) })) - .query(async ({ ctx, input }) => { - const box = ctx.sandboxCaller; - const parsed = parseHostRoutingKey(input.hostId); - if (!box || parsed?.organizationId !== box.organizationId) { - return { allowed: false as const, reason: "no_access" as const }; - } - const [row] = await db - .select({ allowCloudWorkspaces: v2Hosts.allowCloudWorkspaces }) - .from(v2UsersHosts) - .innerJoin( - v2Hosts, - and( - eq(v2Hosts.organizationId, v2UsersHosts.organizationId), - eq(v2Hosts.machineId, v2UsersHosts.hostId), - ), - ) - .where( - and( - eq(v2UsersHosts.userId, box.userId), - eq(v2UsersHosts.organizationId, parsed.organizationId), - eq(v2UsersHosts.hostId, parsed.machineId), - ), - ) - .limit(1); - if (!row) { - return { allowed: false as const, reason: "no_access" as const }; - } - if (!row.allowCloudWorkspaces) { - return { allowed: false as const, reason: "host_closed" as const }; - } - return { - allowed: true as const, - userId: box.userId, - workspaceId: box.workspaceId, - }; - }), + .query(({ ctx, input }) => + decideCloudWorkspaceAccess( + ctx.sandboxCaller, + input.hostId, + async ({ userId, organizationId, machineId }) => { + const [row] = await db + .select({ + role: v2UsersHosts.role, + allowCloudWorkspaces: v2Hosts.allowCloudWorkspaces, + }) + .from(v2UsersHosts) + .innerJoin( + v2Hosts, + and( + eq(v2Hosts.organizationId, v2UsersHosts.organizationId), + eq(v2Hosts.machineId, v2UsersHosts.hostId), + ), + ) + .where( + and( + eq(v2UsersHosts.userId, userId), + eq(v2UsersHosts.organizationId, organizationId), + eq(v2UsersHosts.hostId, machineId), + ), + ) + .limit(1); + return row ?? null; + }, + ), + ), setWakeCommand: personProcedure .input( From a65d1b409eb725a092da665d40a972c7f0769e27 Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:38:36 +0000 Subject: [PATCH 09/13] fix(relay): refuse bad box calls before asking the API, and keep outages retryable - A box's WebSocket upgrade and a credential that is not the shape the API mints are refused without an API round trip. - A failed access check (API unreachable) is INTERNAL_SERVER_ERROR on the host tRPC routes, not UNAUTHORIZED, so callers retry instead of treating it as an auth failure. --- apps/relay/src/access.ts | 6 ++++++ apps/relay/src/index.test.ts | 40 ++++++++++++++++++++++++++++++++---- apps/relay/src/index.ts | 20 ++++++++++-------- 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/apps/relay/src/access.ts b/apps/relay/src/access.ts index 2fc1db883cc..9619720a943 100644 --- a/apps/relay/src/access.ts +++ b/apps/relay/src/access.ts @@ -97,6 +97,9 @@ export type CloudWorkspaceAccess = | { ok: false; reason: AccessDenial } | { ok: false; reason: "unauthorized" }; +// `.`, as the API mints it. +const SANDBOX_CREDENTIAL_SHAPE = /^[0-9a-f-]{36}\.[A-Za-z0-9_-]{43}$/; + // Not cached: turning the host's setting off must stop the next call. export async function checkCloudWorkspaceAccess( credential: string, @@ -106,6 +109,9 @@ export async function checkCloudWorkspaceAccess( if (!parseHostRoutingKey(hostId)) { return { ok: false, reason: "invalid_host" }; } + if (!SANDBOX_CREDENTIAL_SHAPE.test(credential)) { + return { ok: false, reason: "unauthorized" }; + } try { const result = await createSandboxApiClient( credential, diff --git a/apps/relay/src/index.test.ts b/apps/relay/src/index.test.ts index 02810e3354a..93d1415a139 100644 --- a/apps/relay/src/index.test.ts +++ b/apps/relay/src/index.test.ts @@ -11,6 +11,10 @@ type ProxiedRequest = { const proxied: ProxiedRequest[] = []; const proxiedHeaders: Record[] = []; let boxAccess: unknown = { allowed: false, reason: "host_closed" }; +let apiDown = false; +let apiCalls = 0; +const BOX_CREDENTIAL = `11111111-2222-4333-8444-555555555555.${"a".repeat(43)}`; +const FORGED_CREDENTIAL = `11111111-2222-4333-8444-555555555555.${"b".repeat(43)}`; const tunnel = { setName: async () => {}, @@ -49,7 +53,11 @@ const jwks = Bun.serve({ fetch: (request) => { const url = new URL(request.url); if (url.pathname.startsWith("/api/trpc/host.cloudWorkspaceAccess")) { - if (request.headers.get("x-superset-sandbox-credential") !== "ws-1.ok") { + apiCalls++; + if (apiDown) return new Response("down", { status: 502 }); + if ( + request.headers.get("x-superset-sandbox-credential") !== BOX_CREDENTIAL + ) { return Response.json( [ { @@ -78,6 +86,8 @@ beforeEach(() => { proxied.length = 0; proxiedHeaders.length = 0; boxAccess = { allowed: false, reason: "host_closed" }; + apiDown = false; + apiCalls = 0; }); const hostId = "org-1:machine-1"; @@ -216,7 +226,7 @@ function callAsBox( method: "POST", authorized: false, headers: { - "x-superset-sandbox-credential": init.credential ?? "ws-1.ok", + "x-superset-sandbox-credential": init.credential ?? BOX_CREDENTIAL, ...init.headers, }, }); @@ -247,7 +257,7 @@ test("a cloud workspace is refused by a host that did not allow it, and told why test("a credential the API does not accept is unauthorized", async () => { const response = await callAsBox("/trpc/workspace.list", { - credential: "ws-1.forged", + credential: FORGED_CREDENTIAL, }); expect(response.status).toBe(401); @@ -260,10 +270,32 @@ test("a cloud workspace cannot open a stream, even to a host that allowed it", a const response = await call("/terminal/t1", { authorized: false, headers: { - "x-superset-sandbox-credential": "ws-1.ok", + "x-superset-sandbox-credential": BOX_CREDENTIAL, Upgrade: "websocket", }, }); expect(response.status).toBe(403); + expect(apiCalls).toBe(0); +}); + +test("a malformed credential is unauthorized without asking the API", async () => { + const response = await callAsBox("/trpc/workspace.list", { + credential: "anything", + }); + + expect(response.status).toBe(401); + expect(apiCalls).toBe(0); +}); + +test("an API outage during the box's access check is a server error, not an auth failure", async () => { + apiDown = true; + + const response = await callAsBox("/trpc/workspace.list"); + + expect(response.status).toBe(500); + expect(JSON.stringify(await response.json())).toContain( + "INTERNAL_SERVER_ERROR", + ); + expect(proxied).toEqual([]); }); diff --git a/apps/relay/src/index.ts b/apps/relay/src/index.ts index 322f4fea6ea..4356f0492a5 100644 --- a/apps/relay/src/index.ts +++ b/apps/relay/src/index.ts @@ -97,6 +97,13 @@ async function authenticate( const token = extractToken(c); const boxCredential = c.req.header(SANDBOX_API_CREDENTIAL_HEADER); if (!token && boxCredential && purpose === "reach") { + // A stream would outlive the per-call access check. + if (isWsUpgrade(c)) { + return { + status: 403, + message: "Forbidden: a cloud workspace can only make HTTP calls", + }; + } return authenticateCloudWorkspace(c, hostId, boxCredential); } if (!token) return { status: 401, message: "Unauthorized" }; @@ -296,19 +303,16 @@ const authMiddleware: MiddlewareHandler = async (c, next) => { return trpcErrorResponse( c, router, - result.status === 403 ? "FORBIDDEN" : "UNAUTHORIZED", + result.status === 403 + ? "FORBIDDEN" + : result.status === 500 + ? "INTERNAL_SERVER_ERROR" + : "UNAUTHORIZED", result.message, ); } return c.json({ error: result.message }, result.status); } - // A stream would outlive the per-call access check. - if (result.cloudWorkspaceId && isWsUpgrade(c)) { - return c.json( - { error: "Forbidden: a cloud workspace can only make HTTP calls" }, - 403, - ); - } c.set("auth", result.auth); c.set("caller", callerFor(result)); c.set("hostId", hostId); From f41d68cfae2386260fc3918c816afb1eb7034cea Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:41:23 +0000 Subject: [PATCH 10/13] fix(desktop): translated errors, a steady confirm dialog, and clearer copy - The switch shows errorMessage(err), so the server's i18nKey for the owner-only refusal is used instead of raw English. - The confirm dialog keeps open/closed apart from its content, so closing "Allow" no longer flips to the "Turn off" text during the fade-out. - "use --host to run commands on this host" instead of calling a flag a command, retranslated; a more idiomatic Dutch title. - Settings search finds the switch under host, hosts, access and owner. --- .../CloudWorkspaceAccessSection.tsx | 6 +++--- .../CloudWorkspaceAccessSwitch.tsx | 20 ++++++++++++------- .../CloudWorkspaceAccessConfirmDialog.tsx | 16 +++++++-------- .../utils/settings-search/settings-search.ts | 4 ++++ packages/i18n/locales/cs/messages.po | 4 ++-- packages/i18n/locales/de/messages.po | 4 ++-- packages/i18n/locales/en/messages.po | 4 ++-- packages/i18n/locales/es/messages.po | 4 ++-- packages/i18n/locales/fr/messages.po | 4 ++-- packages/i18n/locales/id/messages.po | 4 ++-- packages/i18n/locales/it/messages.po | 4 ++-- packages/i18n/locales/ja/messages.po | 4 ++-- packages/i18n/locales/ko/messages.po | 4 ++-- packages/i18n/locales/nl/messages.po | 6 +++--- packages/i18n/locales/pl/messages.po | 4 ++-- packages/i18n/locales/pt-BR/messages.po | 4 ++-- packages/i18n/locales/ru/messages.po | 4 ++-- packages/i18n/locales/tr/messages.po | 4 ++-- packages/i18n/locales/uk/messages.po | 4 ++-- packages/i18n/locales/vi/messages.po | 4 ++-- packages/i18n/locales/zh-CN/messages.po | 4 ++-- packages/i18n/locales/zh-TW/messages.po | 4 ++-- 22 files changed, 64 insertions(+), 56 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx index e24c6432105..e9bc842f4f9 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/CloudWorkspaceAccessSection.tsx @@ -31,9 +31,9 @@ export function CloudWorkspaceAccessSection({

- Agents in your cloud workspaces can then run commands like{" "} - --host against this host. The host must be reachable - through the relay. + Agents in your cloud workspaces can then use --host to + run commands on this host. The host must be reachable through the + relay.

diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx index e9e90872d8e..e0dbc7f3525 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/CloudWorkspaceAccessSwitch.tsx @@ -1,4 +1,5 @@ import { useLingui } from "@lingui/react/macro"; +import { errorMessage } from "@superset/i18n/errors"; import { toast } from "@superset/ui/sonner"; import { Switch } from "@superset/ui/switch"; import { useState } from "react"; @@ -23,7 +24,8 @@ export function CloudWorkspaceAccessSwitch({ const setAccess = cloudTrpc.host.setCloudWorkspaceAccess.useMutation({ onSettled: () => utils.host.roster.invalidate(), }); - const [confirmTarget, setConfirmTarget] = useState(null); + const [confirmOpen, setConfirmOpen] = useState(false); + const [confirmTarget, setConfirmTarget] = useState(false); const runToggle = (next: boolean) => { toast.promise( @@ -31,8 +33,8 @@ export function CloudWorkspaceAccessSwitch({ { loading: t({ message: "Saving…" }), success: () => t({ message: "Setting saved" }), - error: (err: Error) => - err.message ?? t({ message: "Failed to update setting" }), + error: (err: unknown) => + errorMessage(err, t({ message: "Failed to update setting" })), }, ); }; @@ -42,15 +44,19 @@ export function CloudWorkspaceAccessSwitch({ { + setConfirmTarget(next); + setConfirmOpen(true); + }} disabled={setAccess.isPending} /> setConfirmTarget(null)} + onOpenChange={setConfirmOpen} onConfirm={() => { - if (confirmTarget !== null) runToggle(confirmTarget); - setConfirmTarget(null); + setConfirmOpen(false); + runToggle(confirmTarget); }} /> diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx index 70e6a6b1f19..be475055aa4 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/hosts/$hostId/components/HostSettings/components/CloudWorkspaceAccessSection/components/CloudWorkspaceAccessSwitch/components/CloudWorkspaceAccessConfirmDialog/CloudWorkspaceAccessConfirmDialog.tsx @@ -10,22 +10,20 @@ import { import { Button } from "@superset/ui/button"; interface CloudWorkspaceAccessConfirmDialogProps { - /** Null while closed. */ - targetEnabled: boolean | null; - onCancel: () => void; + open: boolean; + targetEnabled: boolean; + onOpenChange: (open: boolean) => void; onConfirm: () => void; } export function CloudWorkspaceAccessConfirmDialog({ + open, targetEnabled, - onCancel, + onOpenChange, onConfirm, }: CloudWorkspaceAccessConfirmDialogProps) { return ( - !open && onCancel()} - > + @@ -59,7 +57,7 @@ export function CloudWorkspaceAccessConfirmDialog({ -