Skip to content

The open-source app everyone uses to manage agents at work

Merge remote-tracking branch 'public-gh/master' into paperclip-subissues

Dotta6e6d67372ce2
diff --cc packages/db/src/migrations/0030_wild_lord_hawal.sql
index e19de7857a,0000000000..e19de7857a
mode 100644,000000..100644
--- a/packages/db/src/migrations/0030_wild_lord_hawal.sql
+++ b/packages/db/src/migrations/0030_wild_lord_hawal.sql
diff --cc packages/db/src/migrations/meta/0030_snapshot.json
index 0000000000,0000000000..123fe2b1e5
new file mode 100644
--- /dev/null
+++ b/packages/db/src/migrations/meta/0030_snapshot.json
@@@ -1,0 -1,0 +1,8819 @@@
++{
++ "id": "f06b5cb1-e14b-4b8b-99ed-a85879c31977",
++ "prevId": "fdb36f4e-6463-497d-b704-22d33be9b450",
++ "version": "7",
++ "dialect": "postgresql",
++ "tables": {
++ "public.activity_log": {
++ "name": "activity_log",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "actor_type": {
++ "name": "actor_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'system'"
++ },
++ "actor_id": {
++ "name": "actor_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "action": {
++ "name": "action",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "entity_type": {
++ "name": "entity_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "entity_id": {
++ "name": "entity_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "run_id": {
++ "name": "run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "details": {
++ "name": "details",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "activity_log_company_created_idx": {
++ "name": "activity_log_company_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "activity_log_run_id_idx": {
++ "name": "activity_log_run_id_idx",
++ "columns": [
++ {
++ "expression": "run_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "activity_log_entity_type_id_idx": {
++ "name": "activity_log_entity_type_id_idx",
++ "columns": [
++ {
++ "expression": "entity_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "entity_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "activity_log_company_id_companies_id_fk": {
++ "name": "activity_log_company_id_companies_id_fk",
++ "tableFrom": "activity_log",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "activity_log_agent_id_agents_id_fk": {
++ "name": "activity_log_agent_id_agents_id_fk",
++ "tableFrom": "activity_log",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "activity_log_run_id_heartbeat_runs_id_fk": {
++ "name": "activity_log_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "activity_log",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.agent_api_keys": {
++ "name": "agent_api_keys",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "name": {
++ "name": "name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "key_hash": {
++ "name": "key_hash",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "last_used_at": {
++ "name": "last_used_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "revoked_at": {
++ "name": "revoked_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": {
++ "agent_api_keys_key_hash_idx": {
++ "name": "agent_api_keys_key_hash_idx",
++ "columns": [
++ {
++ "expression": "key_hash",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "agent_api_keys_company_agent_idx": {
++ "name": "agent_api_keys_company_agent_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "agent_api_keys_agent_id_agents_id_fk": {
++ "name": "agent_api_keys_agent_id_agents_id_fk",
++ "tableFrom": "agent_api_keys",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agent_api_keys_company_id_companies_id_fk": {
++ "name": "agent_api_keys_company_id_companies_id_fk",
++ "tableFrom": "agent_api_keys",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.agent_config_revisions": {
++ "name": "agent_config_revisions",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "source": {
++ "name": "source",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'patch'"
++ },
++ "rolled_back_from_revision_id": {
++ "name": "rolled_back_from_revision_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "changed_keys": {
++ "name": "changed_keys",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'[]'::jsonb"
++ },
++ "before_config": {
++ "name": "before_config",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "after_config": {
++ "name": "after_config",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "agent_config_revisions_company_agent_created_idx": {
++ "name": "agent_config_revisions_company_agent_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "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": {}
++ },
++ "agent_config_revisions_agent_created_idx": {
++ "name": "agent_config_revisions_agent_created_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_config_revisions_company_id_companies_id_fk": {
++ "name": "agent_config_revisions_company_id_companies_id_fk",
++ "tableFrom": "agent_config_revisions",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agent_config_revisions_agent_id_agents_id_fk": {
++ "name": "agent_config_revisions_agent_id_agents_id_fk",
++ "tableFrom": "agent_config_revisions",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "agent_config_revisions_created_by_agent_id_agents_id_fk": {
++ "name": "agent_config_revisions_created_by_agent_id_agents_id_fk",
++ "tableFrom": "agent_config_revisions",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.agent_runtime_state": {
++ "name": "agent_runtime_state",
++ "schema": "",
++ "columns": {
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "adapter_type": {
++ "name": "adapter_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "session_id": {
++ "name": "session_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "state_json": {
++ "name": "state_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "last_run_id": {
++ "name": "last_run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "last_run_status": {
++ "name": "last_run_status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "total_input_tokens": {
++ "name": "total_input_tokens",
++ "type": "bigint",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "total_output_tokens": {
++ "name": "total_output_tokens",
++ "type": "bigint",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "total_cached_input_tokens": {
++ "name": "total_cached_input_tokens",
++ "type": "bigint",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "total_cost_cents": {
++ "name": "total_cost_cents",
++ "type": "bigint",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "last_error": {
++ "name": "last_error",
++ "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": {
++ "agent_runtime_state_company_agent_idx": {
++ "name": "agent_runtime_state_company_agent_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "agent_runtime_state_company_updated_idx": {
++ "name": "agent_runtime_state_company_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "agent_runtime_state_agent_id_agents_id_fk": {
++ "name": "agent_runtime_state_agent_id_agents_id_fk",
++ "tableFrom": "agent_runtime_state",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agent_runtime_state_company_id_companies_id_fk": {
++ "name": "agent_runtime_state_company_id_companies_id_fk",
++ "tableFrom": "agent_runtime_state",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.agent_task_sessions": {
++ "name": "agent_task_sessions",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "adapter_type": {
++ "name": "adapter_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "task_key": {
++ "name": "task_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "session_params_json": {
++ "name": "session_params_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "session_display_id": {
++ "name": "session_display_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "last_run_id": {
++ "name": "last_run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "last_error": {
++ "name": "last_error",
++ "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": {
++ "agent_task_sessions_company_agent_adapter_task_uniq": {
++ "name": "agent_task_sessions_company_agent_adapter_task_uniq",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "adapter_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "task_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "agent_task_sessions_company_agent_updated_idx": {
++ "name": "agent_task_sessions_company_agent_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "agent_task_sessions_company_task_updated_idx": {
++ "name": "agent_task_sessions_company_task_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "task_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "agent_task_sessions_company_id_companies_id_fk": {
++ "name": "agent_task_sessions_company_id_companies_id_fk",
++ "tableFrom": "agent_task_sessions",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agent_task_sessions_agent_id_agents_id_fk": {
++ "name": "agent_task_sessions_agent_id_agents_id_fk",
++ "tableFrom": "agent_task_sessions",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agent_task_sessions_last_run_id_heartbeat_runs_id_fk": {
++ "name": "agent_task_sessions_last_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "agent_task_sessions",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "last_run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.agent_wakeup_requests": {
++ "name": "agent_wakeup_requests",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "source": {
++ "name": "source",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "trigger_detail": {
++ "name": "trigger_detail",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "reason": {
++ "name": "reason",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "payload": {
++ "name": "payload",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'queued'"
++ },
++ "coalesced_count": {
++ "name": "coalesced_count",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "requested_by_actor_type": {
++ "name": "requested_by_actor_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "requested_by_actor_id": {
++ "name": "requested_by_actor_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "idempotency_key": {
++ "name": "idempotency_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "run_id": {
++ "name": "run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "requested_at": {
++ "name": "requested_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ },
++ "claimed_at": {
++ "name": "claimed_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "finished_at": {
++ "name": "finished_at",
++ "type": "timestamp with time zone",
++ "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()"
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "agent_wakeup_requests_company_agent_status_idx": {
++ "name": "agent_wakeup_requests_company_agent_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "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_wakeup_requests_company_requested_idx": {
++ "name": "agent_wakeup_requests_company_requested_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "requested_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "agent_wakeup_requests_agent_requested_idx": {
++ "name": "agent_wakeup_requests_agent_requested_idx",
++ "columns": [
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "requested_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "agent_wakeup_requests_company_id_companies_id_fk": {
++ "name": "agent_wakeup_requests_company_id_companies_id_fk",
++ "tableFrom": "agent_wakeup_requests",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agent_wakeup_requests_agent_id_agents_id_fk": {
++ "name": "agent_wakeup_requests_agent_id_agents_id_fk",
++ "tableFrom": "agent_wakeup_requests",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "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()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "name": {
++ "name": "name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "role": {
++ "name": "role",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'general'"
++ },
++ "title": {
++ "name": "title",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "icon": {
++ "name": "icon",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'idle'"
++ },
++ "reports_to": {
++ "name": "reports_to",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "capabilities": {
++ "name": "capabilities",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "adapter_type": {
++ "name": "adapter_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'process'"
++ },
++ "adapter_config": {
++ "name": "adapter_config",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "runtime_config": {
++ "name": "runtime_config",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "budget_monthly_cents": {
++ "name": "budget_monthly_cents",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "spent_monthly_cents": {
++ "name": "spent_monthly_cents",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "permissions": {
++ "name": "permissions",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "last_heartbeat_at": {
++ "name": "last_heartbeat_at",
++ "type": "timestamp with time zone",
++ "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": {
++ "agents_company_status_idx": {
++ "name": "agents_company_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "agents_company_reports_to_idx": {
++ "name": "agents_company_reports_to_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "reports_to",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "agents_company_id_companies_id_fk": {
++ "name": "agents_company_id_companies_id_fk",
++ "tableFrom": "agents",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "agents_reports_to_agents_id_fk": {
++ "name": "agents_reports_to_agents_id_fk",
++ "tableFrom": "agents",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "reports_to"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.approval_comments": {
++ "name": "approval_comments",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "approval_id": {
++ "name": "approval_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "author_agent_id": {
++ "name": "author_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "author_user_id": {
++ "name": "author_user_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()"
++ }
++ },
++ "indexes": {
++ "approval_comments_company_idx": {
++ "name": "approval_comments_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "approval_comments_approval_idx": {
++ "name": "approval_comments_approval_idx",
++ "columns": [
++ {
++ "expression": "approval_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "approval_comments_approval_created_idx": {
++ "name": "approval_comments_approval_created_idx",
++ "columns": [
++ {
++ "expression": "approval_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "approval_comments_company_id_companies_id_fk": {
++ "name": "approval_comments_company_id_companies_id_fk",
++ "tableFrom": "approval_comments",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "approval_comments_approval_id_approvals_id_fk": {
++ "name": "approval_comments_approval_id_approvals_id_fk",
++ "tableFrom": "approval_comments",
++ "tableTo": "approvals",
++ "columnsFrom": [
++ "approval_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "approval_comments_author_agent_id_agents_id_fk": {
++ "name": "approval_comments_author_agent_id_agents_id_fk",
++ "tableFrom": "approval_comments",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "author_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.approvals": {
++ "name": "approvals",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "type": {
++ "name": "type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "requested_by_agent_id": {
++ "name": "requested_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "requested_by_user_id": {
++ "name": "requested_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'pending'"
++ },
++ "payload": {
++ "name": "payload",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "decision_note": {
++ "name": "decision_note",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "decided_by_user_id": {
++ "name": "decided_by_user_id",
++ "type": "text",
++ "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()"
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "approvals_company_status_type_idx": {
++ "name": "approvals_company_status_type_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "approvals_company_id_companies_id_fk": {
++ "name": "approvals_company_id_companies_id_fk",
++ "tableFrom": "approvals",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "approvals_requested_by_agent_id_agents_id_fk": {
++ "name": "approvals_requested_by_agent_id_agents_id_fk",
++ "tableFrom": "approvals",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "requested_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.assets": {
++ "name": "assets",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "provider": {
++ "name": "provider",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "object_key": {
++ "name": "object_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "content_type": {
++ "name": "content_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "byte_size": {
++ "name": "byte_size",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "sha256": {
++ "name": "sha256",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "original_filename": {
++ "name": "original_filename",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_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": {
++ "assets_company_created_idx": {
++ "name": "assets_company_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "assets_company_provider_idx": {
++ "name": "assets_company_provider_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "provider",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "assets_company_object_key_uq": {
++ "name": "assets_company_object_key_uq",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "object_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "assets_company_id_companies_id_fk": {
++ "name": "assets_company_id_companies_id_fk",
++ "tableFrom": "assets",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "assets_created_by_agent_id_agents_id_fk": {
++ "name": "assets_created_by_agent_id_agents_id_fk",
++ "tableFrom": "assets",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.account": {
++ "name": "account",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "text",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "account_id": {
++ "name": "account_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "provider_id": {
++ "name": "provider_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "user_id": {
++ "name": "user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "access_token": {
++ "name": "access_token",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "refresh_token": {
++ "name": "refresh_token",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "id_token": {
++ "name": "id_token",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "access_token_expires_at": {
++ "name": "access_token_expires_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "refresh_token_expires_at": {
++ "name": "refresh_token_expires_at",
++ "type": "timestamp with time zone",
++ "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 with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ }
++ },
++ "indexes": {},
++ "foreignKeys": {
++ "account_user_id_user_id_fk": {
++ "name": "account_user_id_user_id_fk",
++ "tableFrom": "account",
++ "tableTo": "user",
++ "columnsFrom": [
++ "user_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.session": {
++ "name": "session",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "text",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "expires_at": {
++ "name": "expires_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "token": {
++ "name": "token",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "ip_address": {
++ "name": "ip_address",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "user_agent": {
++ "name": "user_agent",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "user_id": {
++ "name": "user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ }
++ },
++ "indexes": {},
++ "foreignKeys": {
++ "session_user_id_user_id_fk": {
++ "name": "session_user_id_user_id_fk",
++ "tableFrom": "session",
++ "tableTo": "user",
++ "columnsFrom": [
++ "user_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.user": {
++ "name": "user",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "text",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "name": {
++ "name": "name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "email": {
++ "name": "email",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "email_verified": {
++ "name": "email_verified",
++ "type": "boolean",
++ "primaryKey": false,
++ "notNull": true,
++ "default": false
++ },
++ "image": {
++ "name": "image",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ }
++ },
++ "indexes": {},
++ "foreignKeys": {},
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.verification": {
++ "name": "verification",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "text",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "identifier": {
++ "name": "identifier",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "value": {
++ "name": "value",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "expires_at": {
++ "name": "expires_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ }
++ },
++ "indexes": {},
++ "foreignKeys": {},
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.companies": {
++ "name": "companies",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "name": {
++ "name": "name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "description": {
++ "name": "description",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'active'"
++ },
++ "issue_prefix": {
++ "name": "issue_prefix",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'PAP'"
++ },
++ "issue_counter": {
++ "name": "issue_counter",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "budget_monthly_cents": {
++ "name": "budget_monthly_cents",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "spent_monthly_cents": {
++ "name": "spent_monthly_cents",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "require_board_approval_for_new_agents": {
++ "name": "require_board_approval_for_new_agents",
++ "type": "boolean",
++ "primaryKey": false,
++ "notNull": true,
++ "default": true
++ },
++ "brand_color": {
++ "name": "brand_color",
++ "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": {
++ "companies_issue_prefix_idx": {
++ "name": "companies_issue_prefix_idx",
++ "columns": [
++ {
++ "expression": "issue_prefix",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {},
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.company_memberships": {
++ "name": "company_memberships",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "principal_type": {
++ "name": "principal_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "principal_id": {
++ "name": "principal_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'active'"
++ },
++ "membership_role": {
++ "name": "membership_role",
++ "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": {
++ "company_memberships_company_principal_unique_idx": {
++ "name": "company_memberships_company_principal_unique_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "principal_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "principal_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "company_memberships_principal_status_idx": {
++ "name": "company_memberships_principal_status_idx",
++ "columns": [
++ {
++ "expression": "principal_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "principal_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "company_memberships_company_status_idx": {
++ "name": "company_memberships_company_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "company_memberships_company_id_companies_id_fk": {
++ "name": "company_memberships_company_id_companies_id_fk",
++ "tableFrom": "company_memberships",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.company_secret_versions": {
++ "name": "company_secret_versions",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "secret_id": {
++ "name": "secret_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "version": {
++ "name": "version",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "material": {
++ "name": "material",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "value_sha256": {
++ "name": "value_sha256",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_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
++ }
++ },
++ "indexes": {
++ "company_secret_versions_secret_idx": {
++ "name": "company_secret_versions_secret_idx",
++ "columns": [
++ {
++ "expression": "secret_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "company_secret_versions_value_sha256_idx": {
++ "name": "company_secret_versions_value_sha256_idx",
++ "columns": [
++ {
++ "expression": "value_sha256",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "company_secret_versions_secret_version_uq": {
++ "name": "company_secret_versions_secret_version_uq",
++ "columns": [
++ {
++ "expression": "secret_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "version",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "company_secret_versions_secret_id_company_secrets_id_fk": {
++ "name": "company_secret_versions_secret_id_company_secrets_id_fk",
++ "tableFrom": "company_secret_versions",
++ "tableTo": "company_secrets",
++ "columnsFrom": [
++ "secret_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "company_secret_versions_created_by_agent_id_agents_id_fk": {
++ "name": "company_secret_versions_created_by_agent_id_agents_id_fk",
++ "tableFrom": "company_secret_versions",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.company_secrets": {
++ "name": "company_secrets",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_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": "'local_encrypted'"
++ },
++ "external_ref": {
++ "name": "external_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "latest_version": {
++ "name": "latest_version",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 1
++ },
++ "description": {
++ "name": "description",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_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": {
++ "company_secrets_company_idx": {
++ "name": "company_secrets_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "company_secrets_company_provider_idx": {
++ "name": "company_secrets_company_provider_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "provider",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "company_secrets_company_name_uq": {
++ "name": "company_secrets_company_name_uq",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "name",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "company_secrets_company_id_companies_id_fk": {
++ "name": "company_secrets_company_id_companies_id_fk",
++ "tableFrom": "company_secrets",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "company_secrets_created_by_agent_id_agents_id_fk": {
++ "name": "company_secrets_created_by_agent_id_agents_id_fk",
++ "tableFrom": "company_secrets",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.cost_events": {
++ "name": "cost_events",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "project_id": {
++ "name": "project_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "goal_id": {
++ "name": "goal_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "billing_code": {
++ "name": "billing_code",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "provider": {
++ "name": "provider",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "model": {
++ "name": "model",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "input_tokens": {
++ "name": "input_tokens",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "output_tokens": {
++ "name": "output_tokens",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "cost_cents": {
++ "name": "cost_cents",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "occurred_at": {
++ "name": "occurred_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "cost_events_company_occurred_idx": {
++ "name": "cost_events_company_occurred_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "occurred_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "cost_events_company_agent_occurred_idx": {
++ "name": "cost_events_company_agent_occurred_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "occurred_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "cost_events_company_id_companies_id_fk": {
++ "name": "cost_events_company_id_companies_id_fk",
++ "tableFrom": "cost_events",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "cost_events_agent_id_agents_id_fk": {
++ "name": "cost_events_agent_id_agents_id_fk",
++ "tableFrom": "cost_events",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "cost_events_issue_id_issues_id_fk": {
++ "name": "cost_events_issue_id_issues_id_fk",
++ "tableFrom": "cost_events",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "cost_events_project_id_projects_id_fk": {
++ "name": "cost_events_project_id_projects_id_fk",
++ "tableFrom": "cost_events",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "cost_events_goal_id_goals_id_fk": {
++ "name": "cost_events_goal_id_goals_id_fk",
++ "tableFrom": "cost_events",
++ "tableTo": "goals",
++ "columnsFrom": [
++ "goal_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.document_revisions": {
++ "name": "document_revisions",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "document_id": {
++ "name": "document_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "revision_number": {
++ "name": "revision_number",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "body": {
++ "name": "body",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "change_summary": {
++ "name": "change_summary",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "document_revisions_document_revision_uq": {
++ "name": "document_revisions_document_revision_uq",
++ "columns": [
++ {
++ "expression": "document_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "revision_number",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "document_revisions_company_document_created_idx": {
++ "name": "document_revisions_company_document_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "document_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "document_revisions_company_id_companies_id_fk": {
++ "name": "document_revisions_company_id_companies_id_fk",
++ "tableFrom": "document_revisions",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "document_revisions_document_id_documents_id_fk": {
++ "name": "document_revisions_document_id_documents_id_fk",
++ "tableFrom": "document_revisions",
++ "tableTo": "documents",
++ "columnsFrom": [
++ "document_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "document_revisions_created_by_agent_id_agents_id_fk": {
++ "name": "document_revisions_created_by_agent_id_agents_id_fk",
++ "tableFrom": "document_revisions",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.documents": {
++ "name": "documents",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "title": {
++ "name": "title",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "format": {
++ "name": "format",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'markdown'"
++ },
++ "latest_body": {
++ "name": "latest_body",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "latest_revision_id": {
++ "name": "latest_revision_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "latest_revision_number": {
++ "name": "latest_revision_number",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 1
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "updated_by_agent_id": {
++ "name": "updated_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "updated_by_user_id": {
++ "name": "updated_by_user_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": {
++ "documents_company_updated_idx": {
++ "name": "documents_company_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "documents_company_created_idx": {
++ "name": "documents_company_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "documents_company_id_companies_id_fk": {
++ "name": "documents_company_id_companies_id_fk",
++ "tableFrom": "documents",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "documents_created_by_agent_id_agents_id_fk": {
++ "name": "documents_created_by_agent_id_agents_id_fk",
++ "tableFrom": "documents",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "documents_updated_by_agent_id_agents_id_fk": {
++ "name": "documents_updated_by_agent_id_agents_id_fk",
++ "tableFrom": "documents",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "updated_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.execution_workspaces": {
++ "name": "execution_workspaces",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "project_id": {
++ "name": "project_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "project_workspace_id": {
++ "name": "project_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "source_issue_id": {
++ "name": "source_issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "mode": {
++ "name": "mode",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "strategy_type": {
++ "name": "strategy_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "name": {
++ "name": "name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'active'"
++ },
++ "cwd": {
++ "name": "cwd",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "repo_url": {
++ "name": "repo_url",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "base_ref": {
++ "name": "base_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "branch_name": {
++ "name": "branch_name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "provider_type": {
++ "name": "provider_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'local_fs'"
++ },
++ "provider_ref": {
++ "name": "provider_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "derived_from_execution_workspace_id": {
++ "name": "derived_from_execution_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "last_used_at": {
++ "name": "last_used_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ },
++ "opened_at": {
++ "name": "opened_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ },
++ "closed_at": {
++ "name": "closed_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "cleanup_eligible_at": {
++ "name": "cleanup_eligible_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "cleanup_reason": {
++ "name": "cleanup_reason",
++ "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": {
++ "execution_workspaces_company_project_status_idx": {
++ "name": "execution_workspaces_company_project_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "execution_workspaces_company_project_workspace_status_idx": {
++ "name": "execution_workspaces_company_project_workspace_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_workspace_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "execution_workspaces_company_source_issue_idx": {
++ "name": "execution_workspaces_company_source_issue_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "source_issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "execution_workspaces_company_last_used_idx": {
++ "name": "execution_workspaces_company_last_used_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "last_used_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "execution_workspaces_company_branch_idx": {
++ "name": "execution_workspaces_company_branch_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "branch_name",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "execution_workspaces_company_id_companies_id_fk": {
++ "name": "execution_workspaces_company_id_companies_id_fk",
++ "tableFrom": "execution_workspaces",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "execution_workspaces_project_id_projects_id_fk": {
++ "name": "execution_workspaces_project_id_projects_id_fk",
++ "tableFrom": "execution_workspaces",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "execution_workspaces_project_workspace_id_project_workspaces_id_fk": {
++ "name": "execution_workspaces_project_workspace_id_project_workspaces_id_fk",
++ "tableFrom": "execution_workspaces",
++ "tableTo": "project_workspaces",
++ "columnsFrom": [
++ "project_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "execution_workspaces_source_issue_id_issues_id_fk": {
++ "name": "execution_workspaces_source_issue_id_issues_id_fk",
++ "tableFrom": "execution_workspaces",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "source_issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "execution_workspaces_derived_from_execution_workspace_id_execution_workspaces_id_fk": {
++ "name": "execution_workspaces_derived_from_execution_workspace_id_execution_workspaces_id_fk",
++ "tableFrom": "execution_workspaces",
++ "tableTo": "execution_workspaces",
++ "columnsFrom": [
++ "derived_from_execution_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.goals": {
++ "name": "goals",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "title": {
++ "name": "title",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "description": {
++ "name": "description",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "level": {
++ "name": "level",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'task'"
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'planned'"
++ },
++ "parent_id": {
++ "name": "parent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "owner_agent_id": {
++ "name": "owner_agent_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": {
++ "goals_company_idx": {
++ "name": "goals_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "goals_company_id_companies_id_fk": {
++ "name": "goals_company_id_companies_id_fk",
++ "tableFrom": "goals",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "goals_parent_id_goals_id_fk": {
++ "name": "goals_parent_id_goals_id_fk",
++ "tableFrom": "goals",
++ "tableTo": "goals",
++ "columnsFrom": [
++ "parent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "goals_owner_agent_id_agents_id_fk": {
++ "name": "goals_owner_agent_id_agents_id_fk",
++ "tableFrom": "goals",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "owner_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.heartbeat_run_events": {
++ "name": "heartbeat_run_events",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "bigserial",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "run_id": {
++ "name": "run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "seq": {
++ "name": "seq",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "event_type": {
++ "name": "event_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "stream": {
++ "name": "stream",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "level": {
++ "name": "level",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "color": {
++ "name": "color",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "message": {
++ "name": "message",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "payload": {
++ "name": "payload",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "heartbeat_run_events_run_seq_idx": {
++ "name": "heartbeat_run_events_run_seq_idx",
++ "columns": [
++ {
++ "expression": "run_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "seq",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "heartbeat_run_events_company_run_idx": {
++ "name": "heartbeat_run_events_company_run_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "run_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "heartbeat_run_events_company_created_idx": {
++ "name": "heartbeat_run_events_company_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "heartbeat_run_events_company_id_companies_id_fk": {
++ "name": "heartbeat_run_events_company_id_companies_id_fk",
++ "tableFrom": "heartbeat_run_events",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
++ "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "heartbeat_run_events",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "heartbeat_run_events_agent_id_agents_id_fk": {
++ "name": "heartbeat_run_events_agent_id_agents_id_fk",
++ "tableFrom": "heartbeat_run_events",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.heartbeat_runs": {
++ "name": "heartbeat_runs",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "agent_id": {
++ "name": "agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "invocation_source": {
++ "name": "invocation_source",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'on_demand'"
++ },
++ "trigger_detail": {
++ "name": "trigger_detail",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'queued'"
++ },
++ "started_at": {
++ "name": "started_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "finished_at": {
++ "name": "finished_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "error": {
++ "name": "error",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "wakeup_request_id": {
++ "name": "wakeup_request_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "exit_code": {
++ "name": "exit_code",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "signal": {
++ "name": "signal",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "usage_json": {
++ "name": "usage_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "result_json": {
++ "name": "result_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "session_id_before": {
++ "name": "session_id_before",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "session_id_after": {
++ "name": "session_id_after",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "log_store": {
++ "name": "log_store",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "log_ref": {
++ "name": "log_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "log_bytes": {
++ "name": "log_bytes",
++ "type": "bigint",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "log_sha256": {
++ "name": "log_sha256",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "log_compressed": {
++ "name": "log_compressed",
++ "type": "boolean",
++ "primaryKey": false,
++ "notNull": true,
++ "default": false
++ },
++ "stdout_excerpt": {
++ "name": "stdout_excerpt",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "stderr_excerpt": {
++ "name": "stderr_excerpt",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "error_code": {
++ "name": "error_code",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "external_run_id": {
++ "name": "external_run_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "context_snapshot": {
++ "name": "context_snapshot",
++ "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": {
++ "heartbeat_runs_company_agent_started_idx": {
++ "name": "heartbeat_runs_company_agent_started_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "started_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "heartbeat_runs_company_id_companies_id_fk": {
++ "name": "heartbeat_runs_company_id_companies_id_fk",
++ "tableFrom": "heartbeat_runs",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "heartbeat_runs_agent_id_agents_id_fk": {
++ "name": "heartbeat_runs_agent_id_agents_id_fk",
++ "tableFrom": "heartbeat_runs",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
++ "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
++ "tableFrom": "heartbeat_runs",
++ "tableTo": "agent_wakeup_requests",
++ "columnsFrom": [
++ "wakeup_request_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.instance_user_roles": {
++ "name": "instance_user_roles",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "user_id": {
++ "name": "user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "role": {
++ "name": "role",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'instance_admin'"
++ },
++ "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": {
++ "instance_user_roles_user_role_unique_idx": {
++ "name": "instance_user_roles_user_role_unique_idx",
++ "columns": [
++ {
++ "expression": "user_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "role",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "instance_user_roles_role_idx": {
++ "name": "instance_user_roles_role_idx",
++ "columns": [
++ {
++ "expression": "role",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {},
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.invites": {
++ "name": "invites",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "invite_type": {
++ "name": "invite_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'company_join'"
++ },
++ "token_hash": {
++ "name": "token_hash",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "allowed_join_types": {
++ "name": "allowed_join_types",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'both'"
++ },
++ "defaults_payload": {
++ "name": "defaults_payload",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "expires_at": {
++ "name": "expires_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "invited_by_user_id": {
++ "name": "invited_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "revoked_at": {
++ "name": "revoked_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "accepted_at": {
++ "name": "accepted_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": {
++ "invites_token_hash_unique_idx": {
++ "name": "invites_token_hash_unique_idx",
++ "columns": [
++ {
++ "expression": "token_hash",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "invites_company_invite_state_idx": {
++ "name": "invites_company_invite_state_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "invite_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "revoked_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "expires_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "invites_company_id_companies_id_fk": {
++ "name": "invites_company_id_companies_id_fk",
++ "tableFrom": "invites",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_approvals": {
++ "name": "issue_approvals",
++ "schema": "",
++ "columns": {
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "approval_id": {
++ "name": "approval_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "linked_by_agent_id": {
++ "name": "linked_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "linked_by_user_id": {
++ "name": "linked_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "issue_approvals_issue_idx": {
++ "name": "issue_approvals_issue_idx",
++ "columns": [
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_approvals_approval_idx": {
++ "name": "issue_approvals_approval_idx",
++ "columns": [
++ {
++ "expression": "approval_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_approvals_company_idx": {
++ "name": "issue_approvals_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_approvals_company_id_companies_id_fk": {
++ "name": "issue_approvals_company_id_companies_id_fk",
++ "tableFrom": "issue_approvals",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_approvals_issue_id_issues_id_fk": {
++ "name": "issue_approvals_issue_id_issues_id_fk",
++ "tableFrom": "issue_approvals",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_approvals_approval_id_approvals_id_fk": {
++ "name": "issue_approvals_approval_id_approvals_id_fk",
++ "tableFrom": "issue_approvals",
++ "tableTo": "approvals",
++ "columnsFrom": [
++ "approval_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_approvals_linked_by_agent_id_agents_id_fk": {
++ "name": "issue_approvals_linked_by_agent_id_agents_id_fk",
++ "tableFrom": "issue_approvals",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "linked_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {
++ "issue_approvals_pk": {
++ "name": "issue_approvals_pk",
++ "columns": [
++ "issue_id",
++ "approval_id"
++ ]
++ }
++ },
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_attachments": {
++ "name": "issue_attachments",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "asset_id": {
++ "name": "asset_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_comment_id": {
++ "name": "issue_comment_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": {
++ "issue_attachments_company_issue_idx": {
++ "name": "issue_attachments_company_issue_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_attachments_issue_comment_idx": {
++ "name": "issue_attachments_issue_comment_idx",
++ "columns": [
++ {
++ "expression": "issue_comment_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_attachments_asset_uq": {
++ "name": "issue_attachments_asset_uq",
++ "columns": [
++ {
++ "expression": "asset_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_attachments_company_id_companies_id_fk": {
++ "name": "issue_attachments_company_id_companies_id_fk",
++ "tableFrom": "issue_attachments",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_attachments_issue_id_issues_id_fk": {
++ "name": "issue_attachments_issue_id_issues_id_fk",
++ "tableFrom": "issue_attachments",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_attachments_asset_id_assets_id_fk": {
++ "name": "issue_attachments_asset_id_assets_id_fk",
++ "tableFrom": "issue_attachments",
++ "tableTo": "assets",
++ "columnsFrom": [
++ "asset_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_attachments_issue_comment_id_issue_comments_id_fk": {
++ "name": "issue_attachments_issue_comment_id_issue_comments_id_fk",
++ "tableFrom": "issue_attachments",
++ "tableTo": "issue_comments",
++ "columnsFrom": [
++ "issue_comment_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_comments": {
++ "name": "issue_comments",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "author_agent_id": {
++ "name": "author_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "author_user_id": {
++ "name": "author_user_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()"
++ }
++ },
++ "indexes": {
++ "issue_comments_issue_idx": {
++ "name": "issue_comments_issue_idx",
++ "columns": [
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_comments_company_idx": {
++ "name": "issue_comments_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_comments_company_issue_created_at_idx": {
++ "name": "issue_comments_company_issue_created_at_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_comments_company_author_issue_created_at_idx": {
++ "name": "issue_comments_company_author_issue_created_at_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "author_user_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_comments_company_id_companies_id_fk": {
++ "name": "issue_comments_company_id_companies_id_fk",
++ "tableFrom": "issue_comments",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_comments_issue_id_issues_id_fk": {
++ "name": "issue_comments_issue_id_issues_id_fk",
++ "tableFrom": "issue_comments",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_comments_author_agent_id_agents_id_fk": {
++ "name": "issue_comments_author_agent_id_agents_id_fk",
++ "tableFrom": "issue_comments",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "author_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_documents": {
++ "name": "issue_documents",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "document_id": {
++ "name": "document_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "key": {
++ "name": "key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "issue_documents_company_issue_key_uq": {
++ "name": "issue_documents_company_issue_key_uq",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_documents_document_uq": {
++ "name": "issue_documents_document_uq",
++ "columns": [
++ {
++ "expression": "document_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_documents_company_issue_updated_idx": {
++ "name": "issue_documents_company_issue_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_documents_company_id_companies_id_fk": {
++ "name": "issue_documents_company_id_companies_id_fk",
++ "tableFrom": "issue_documents",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_documents_issue_id_issues_id_fk": {
++ "name": "issue_documents_issue_id_issues_id_fk",
++ "tableFrom": "issue_documents",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_documents_document_id_documents_id_fk": {
++ "name": "issue_documents_document_id_documents_id_fk",
++ "tableFrom": "issue_documents",
++ "tableTo": "documents",
++ "columnsFrom": [
++ "document_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_labels": {
++ "name": "issue_labels",
++ "schema": "",
++ "columns": {
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "label_id": {
++ "name": "label_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "issue_labels_issue_idx": {
++ "name": "issue_labels_issue_idx",
++ "columns": [
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_labels_label_idx": {
++ "name": "issue_labels_label_idx",
++ "columns": [
++ {
++ "expression": "label_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_labels_company_idx": {
++ "name": "issue_labels_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_labels_issue_id_issues_id_fk": {
++ "name": "issue_labels_issue_id_issues_id_fk",
++ "tableFrom": "issue_labels",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_labels_label_id_labels_id_fk": {
++ "name": "issue_labels_label_id_labels_id_fk",
++ "tableFrom": "issue_labels",
++ "tableTo": "labels",
++ "columnsFrom": [
++ "label_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_labels_company_id_companies_id_fk": {
++ "name": "issue_labels_company_id_companies_id_fk",
++ "tableFrom": "issue_labels",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {
++ "issue_labels_pk": {
++ "name": "issue_labels_pk",
++ "columns": [
++ "issue_id",
++ "label_id"
++ ]
++ }
++ },
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_read_states": {
++ "name": "issue_read_states",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "user_id": {
++ "name": "user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "last_read_at": {
++ "name": "last_read_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": {
++ "issue_read_states_company_issue_idx": {
++ "name": "issue_read_states_company_issue_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_read_states_company_user_idx": {
++ "name": "issue_read_states_company_user_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "user_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_read_states_company_issue_user_idx": {
++ "name": "issue_read_states_company_issue_user_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "user_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_read_states_company_id_companies_id_fk": {
++ "name": "issue_read_states_company_id_companies_id_fk",
++ "tableFrom": "issue_read_states",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_read_states_issue_id_issues_id_fk": {
++ "name": "issue_read_states_issue_id_issues_id_fk",
++ "tableFrom": "issue_read_states",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issue_work_products": {
++ "name": "issue_work_products",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "project_id": {
++ "name": "project_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "execution_workspace_id": {
++ "name": "execution_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "runtime_service_id": {
++ "name": "runtime_service_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "type": {
++ "name": "type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "provider": {
++ "name": "provider",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "external_id": {
++ "name": "external_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "title": {
++ "name": "title",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "url": {
++ "name": "url",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "review_state": {
++ "name": "review_state",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'none'"
++ },
++ "is_primary": {
++ "name": "is_primary",
++ "type": "boolean",
++ "primaryKey": false,
++ "notNull": true,
++ "default": false
++ },
++ "health_status": {
++ "name": "health_status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'unknown'"
++ },
++ "summary": {
++ "name": "summary",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "metadata": {
++ "name": "metadata",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_run_id": {
++ "name": "created_by_run_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": {
++ "issue_work_products_company_issue_type_idx": {
++ "name": "issue_work_products_company_issue_type_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "issue_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_work_products_company_execution_workspace_type_idx": {
++ "name": "issue_work_products_company_execution_workspace_type_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "execution_workspace_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_work_products_company_provider_external_id_idx": {
++ "name": "issue_work_products_company_provider_external_id_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "provider",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "external_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issue_work_products_company_updated_idx": {
++ "name": "issue_work_products_company_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issue_work_products_company_id_companies_id_fk": {
++ "name": "issue_work_products_company_id_companies_id_fk",
++ "tableFrom": "issue_work_products",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issue_work_products_project_id_projects_id_fk": {
++ "name": "issue_work_products_project_id_projects_id_fk",
++ "tableFrom": "issue_work_products",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "issue_work_products_issue_id_issues_id_fk": {
++ "name": "issue_work_products_issue_id_issues_id_fk",
++ "tableFrom": "issue_work_products",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "issue_work_products_execution_workspace_id_execution_workspaces_id_fk": {
++ "name": "issue_work_products_execution_workspace_id_execution_workspaces_id_fk",
++ "tableFrom": "issue_work_products",
++ "tableTo": "execution_workspaces",
++ "columnsFrom": [
++ "execution_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "issue_work_products_runtime_service_id_workspace_runtime_services_id_fk": {
++ "name": "issue_work_products_runtime_service_id_workspace_runtime_services_id_fk",
++ "tableFrom": "issue_work_products",
++ "tableTo": "workspace_runtime_services",
++ "columnsFrom": [
++ "runtime_service_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "issue_work_products_created_by_run_id_heartbeat_runs_id_fk": {
++ "name": "issue_work_products_created_by_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "issue_work_products",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "created_by_run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.issues": {
++ "name": "issues",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "project_id": {
++ "name": "project_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "project_workspace_id": {
++ "name": "project_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "goal_id": {
++ "name": "goal_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "parent_id": {
++ "name": "parent_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
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'backlog'"
++ },
++ "priority": {
++ "name": "priority",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'medium'"
++ },
++ "assignee_agent_id": {
++ "name": "assignee_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "assignee_user_id": {
++ "name": "assignee_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "checkout_run_id": {
++ "name": "checkout_run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_run_id": {
++ "name": "execution_run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_agent_name_key": {
++ "name": "execution_agent_name_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_locked_at": {
++ "name": "execution_locked_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_agent_id": {
++ "name": "created_by_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_by_user_id": {
++ "name": "created_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "issue_number": {
++ "name": "issue_number",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "identifier": {
++ "name": "identifier",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "request_depth": {
++ "name": "request_depth",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 0
++ },
++ "billing_code": {
++ "name": "billing_code",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "assignee_adapter_overrides": {
++ "name": "assignee_adapter_overrides",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_workspace_id": {
++ "name": "execution_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_workspace_preference": {
++ "name": "execution_workspace_preference",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_workspace_settings": {
++ "name": "execution_workspace_settings",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "started_at": {
++ "name": "started_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "completed_at": {
++ "name": "completed_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "cancelled_at": {
++ "name": "cancelled_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "hidden_at": {
++ "name": "hidden_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": {
++ "issues_company_status_idx": {
++ "name": "issues_company_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_company_assignee_status_idx": {
++ "name": "issues_company_assignee_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "assignee_agent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_company_assignee_user_status_idx": {
++ "name": "issues_company_assignee_user_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "assignee_user_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_company_parent_idx": {
++ "name": "issues_company_parent_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "parent_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_company_project_idx": {
++ "name": "issues_company_project_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_company_project_workspace_idx": {
++ "name": "issues_company_project_workspace_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_workspace_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_company_execution_workspace_idx": {
++ "name": "issues_company_execution_workspace_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "execution_workspace_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "issues_identifier_idx": {
++ "name": "issues_identifier_idx",
++ "columns": [
++ {
++ "expression": "identifier",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "issues_company_id_companies_id_fk": {
++ "name": "issues_company_id_companies_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issues_project_id_projects_id_fk": {
++ "name": "issues_project_id_projects_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issues_project_workspace_id_project_workspaces_id_fk": {
++ "name": "issues_project_workspace_id_project_workspaces_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "project_workspaces",
++ "columnsFrom": [
++ "project_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "issues_goal_id_goals_id_fk": {
++ "name": "issues_goal_id_goals_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "goals",
++ "columnsFrom": [
++ "goal_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issues_parent_id_issues_id_fk": {
++ "name": "issues_parent_id_issues_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "parent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issues_assignee_agent_id_agents_id_fk": {
++ "name": "issues_assignee_agent_id_agents_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "assignee_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issues_checkout_run_id_heartbeat_runs_id_fk": {
++ "name": "issues_checkout_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "checkout_run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "issues_execution_run_id_heartbeat_runs_id_fk": {
++ "name": "issues_execution_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "execution_run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "issues_created_by_agent_id_agents_id_fk": {
++ "name": "issues_created_by_agent_id_agents_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_by_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "issues_execution_workspace_id_execution_workspaces_id_fk": {
++ "name": "issues_execution_workspace_id_execution_workspaces_id_fk",
++ "tableFrom": "issues",
++ "tableTo": "execution_workspaces",
++ "columnsFrom": [
++ "execution_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.join_requests": {
++ "name": "join_requests",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "invite_id": {
++ "name": "invite_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "request_type": {
++ "name": "request_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'pending_approval'"
++ },
++ "request_ip": {
++ "name": "request_ip",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "requesting_user_id": {
++ "name": "requesting_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "request_email_snapshot": {
++ "name": "request_email_snapshot",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "agent_name": {
++ "name": "agent_name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "adapter_type": {
++ "name": "adapter_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "capabilities": {
++ "name": "capabilities",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "agent_defaults_payload": {
++ "name": "agent_defaults_payload",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "claim_secret_hash": {
++ "name": "claim_secret_hash",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "claim_secret_expires_at": {
++ "name": "claim_secret_expires_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "claim_secret_consumed_at": {
++ "name": "claim_secret_consumed_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_agent_id": {
++ "name": "created_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "approved_by_user_id": {
++ "name": "approved_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "approved_at": {
++ "name": "approved_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "rejected_by_user_id": {
++ "name": "rejected_by_user_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "rejected_at": {
++ "name": "rejected_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": {
++ "join_requests_invite_unique_idx": {
++ "name": "join_requests_invite_unique_idx",
++ "columns": [
++ {
++ "expression": "invite_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "join_requests_company_status_type_created_idx": {
++ "name": "join_requests_company_status_type_created_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "request_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "join_requests_invite_id_invites_id_fk": {
++ "name": "join_requests_invite_id_invites_id_fk",
++ "tableFrom": "join_requests",
++ "tableTo": "invites",
++ "columnsFrom": [
++ "invite_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "join_requests_company_id_companies_id_fk": {
++ "name": "join_requests_company_id_companies_id_fk",
++ "tableFrom": "join_requests",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "join_requests_created_agent_id_agents_id_fk": {
++ "name": "join_requests_created_agent_id_agents_id_fk",
++ "tableFrom": "join_requests",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "created_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.labels": {
++ "name": "labels",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_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
++ },
++ "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": {
++ "labels_company_idx": {
++ "name": "labels_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "labels_company_name_idx": {
++ "name": "labels_company_name_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "name",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "labels_company_id_companies_id_fk": {
++ "name": "labels_company_id_companies_id_fk",
++ "tableFrom": "labels",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_company_settings": {
++ "name": "plugin_company_settings",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "enabled": {
++ "name": "enabled",
++ "type": "boolean",
++ "primaryKey": false,
++ "notNull": true,
++ "default": true
++ },
++ "settings_json": {
++ "name": "settings_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "last_error": {
++ "name": "last_error",
++ "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": {
++ "plugin_company_settings_company_idx": {
++ "name": "plugin_company_settings_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_company_settings_plugin_idx": {
++ "name": "plugin_company_settings_plugin_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_company_settings_company_plugin_uq": {
++ "name": "plugin_company_settings_company_plugin_uq",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_company_settings_company_id_companies_id_fk": {
++ "name": "plugin_company_settings_company_id_companies_id_fk",
++ "tableFrom": "plugin_company_settings",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "plugin_company_settings_plugin_id_plugins_id_fk": {
++ "name": "plugin_company_settings_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_company_settings",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_config": {
++ "name": "plugin_config",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "config_json": {
++ "name": "config_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "last_error": {
++ "name": "last_error",
++ "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": {
++ "plugin_config_plugin_id_idx": {
++ "name": "plugin_config_plugin_id_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_config_plugin_id_plugins_id_fk": {
++ "name": "plugin_config_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_config",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_entities": {
++ "name": "plugin_entities",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "entity_type": {
++ "name": "entity_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "scope_kind": {
++ "name": "scope_kind",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "scope_id": {
++ "name": "scope_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "external_id": {
++ "name": "external_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "title": {
++ "name": "title",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "data": {
++ "name": "data",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "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": {
++ "plugin_entities_plugin_idx": {
++ "name": "plugin_entities_plugin_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_entities_type_idx": {
++ "name": "plugin_entities_type_idx",
++ "columns": [
++ {
++ "expression": "entity_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_entities_scope_idx": {
++ "name": "plugin_entities_scope_idx",
++ "columns": [
++ {
++ "expression": "scope_kind",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "scope_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_entities_external_idx": {
++ "name": "plugin_entities_external_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "entity_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "external_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_entities_plugin_id_plugins_id_fk": {
++ "name": "plugin_entities_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_entities",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_job_runs": {
++ "name": "plugin_job_runs",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "job_id": {
++ "name": "job_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "trigger": {
++ "name": "trigger",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'pending'"
++ },
++ "duration_ms": {
++ "name": "duration_ms",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "error": {
++ "name": "error",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "logs": {
++ "name": "logs",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'[]'::jsonb"
++ },
++ "started_at": {
++ "name": "started_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "finished_at": {
++ "name": "finished_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": {
++ "plugin_job_runs_job_idx": {
++ "name": "plugin_job_runs_job_idx",
++ "columns": [
++ {
++ "expression": "job_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_job_runs_plugin_idx": {
++ "name": "plugin_job_runs_plugin_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_job_runs_status_idx": {
++ "name": "plugin_job_runs_status_idx",
++ "columns": [
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_job_runs_job_id_plugin_jobs_id_fk": {
++ "name": "plugin_job_runs_job_id_plugin_jobs_id_fk",
++ "tableFrom": "plugin_job_runs",
++ "tableTo": "plugin_jobs",
++ "columnsFrom": [
++ "job_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "plugin_job_runs_plugin_id_plugins_id_fk": {
++ "name": "plugin_job_runs_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_job_runs",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_jobs": {
++ "name": "plugin_jobs",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "job_key": {
++ "name": "job_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "schedule": {
++ "name": "schedule",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'active'"
++ },
++ "last_run_at": {
++ "name": "last_run_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "next_run_at": {
++ "name": "next_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": {
++ "plugin_jobs_plugin_idx": {
++ "name": "plugin_jobs_plugin_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_jobs_next_run_idx": {
++ "name": "plugin_jobs_next_run_idx",
++ "columns": [
++ {
++ "expression": "next_run_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_jobs_unique_idx": {
++ "name": "plugin_jobs_unique_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "job_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_jobs_plugin_id_plugins_id_fk": {
++ "name": "plugin_jobs_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_jobs",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_logs": {
++ "name": "plugin_logs",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "level": {
++ "name": "level",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'info'"
++ },
++ "message": {
++ "name": "message",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "meta": {
++ "name": "meta",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "created_at": {
++ "name": "created_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "plugin_logs_plugin_time_idx": {
++ "name": "plugin_logs_plugin_time_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "created_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_logs_level_idx": {
++ "name": "plugin_logs_level_idx",
++ "columns": [
++ {
++ "expression": "level",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_logs_plugin_id_plugins_id_fk": {
++ "name": "plugin_logs_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_logs",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_state": {
++ "name": "plugin_state",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "scope_kind": {
++ "name": "scope_kind",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "scope_id": {
++ "name": "scope_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "namespace": {
++ "name": "namespace",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'default'"
++ },
++ "state_key": {
++ "name": "state_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "value_json": {
++ "name": "value_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "updated_at": {
++ "name": "updated_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ }
++ },
++ "indexes": {
++ "plugin_state_plugin_scope_idx": {
++ "name": "plugin_state_plugin_scope_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "scope_kind",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_state_plugin_id_plugins_id_fk": {
++ "name": "plugin_state_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_state",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {
++ "plugin_state_unique_entry_idx": {
++ "name": "plugin_state_unique_entry_idx",
++ "nullsNotDistinct": true,
++ "columns": [
++ "plugin_id",
++ "scope_kind",
++ "scope_id",
++ "namespace",
++ "state_key"
++ ]
++ }
++ },
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugin_webhook_deliveries": {
++ "name": "plugin_webhook_deliveries",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_id": {
++ "name": "plugin_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "webhook_key": {
++ "name": "webhook_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "external_id": {
++ "name": "external_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'pending'"
++ },
++ "duration_ms": {
++ "name": "duration_ms",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "error": {
++ "name": "error",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "payload": {
++ "name": "payload",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "headers": {
++ "name": "headers",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'{}'::jsonb"
++ },
++ "started_at": {
++ "name": "started_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "finished_at": {
++ "name": "finished_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": {
++ "plugin_webhook_deliveries_plugin_idx": {
++ "name": "plugin_webhook_deliveries_plugin_idx",
++ "columns": [
++ {
++ "expression": "plugin_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_webhook_deliveries_status_idx": {
++ "name": "plugin_webhook_deliveries_status_idx",
++ "columns": [
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugin_webhook_deliveries_key_idx": {
++ "name": "plugin_webhook_deliveries_key_idx",
++ "columns": [
++ {
++ "expression": "webhook_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "plugin_webhook_deliveries_plugin_id_plugins_id_fk": {
++ "name": "plugin_webhook_deliveries_plugin_id_plugins_id_fk",
++ "tableFrom": "plugin_webhook_deliveries",
++ "tableTo": "plugins",
++ "columnsFrom": [
++ "plugin_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.plugins": {
++ "name": "plugins",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "plugin_key": {
++ "name": "plugin_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "package_name": {
++ "name": "package_name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "version": {
++ "name": "version",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "api_version": {
++ "name": "api_version",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 1
++ },
++ "categories": {
++ "name": "categories",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'[]'::jsonb"
++ },
++ "manifest_json": {
++ "name": "manifest_json",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'installed'"
++ },
++ "install_order": {
++ "name": "install_order",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "package_path": {
++ "name": "package_path",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "last_error": {
++ "name": "last_error",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "installed_at": {
++ "name": "installed_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": {
++ "plugins_plugin_key_idx": {
++ "name": "plugins_plugin_key_idx",
++ "columns": [
++ {
++ "expression": "plugin_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "plugins_status_idx": {
++ "name": "plugins_status_idx",
++ "columns": [
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {},
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.principal_permission_grants": {
++ "name": "principal_permission_grants",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "principal_type": {
++ "name": "principal_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "principal_id": {
++ "name": "principal_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "permission_key": {
++ "name": "permission_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "scope": {
++ "name": "scope",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "granted_by_user_id": {
++ "name": "granted_by_user_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": {
++ "principal_permission_grants_unique_idx": {
++ "name": "principal_permission_grants_unique_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "principal_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "principal_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "permission_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "principal_permission_grants_company_permission_idx": {
++ "name": "principal_permission_grants_company_permission_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "permission_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "principal_permission_grants_company_id_companies_id_fk": {
++ "name": "principal_permission_grants_company_id_companies_id_fk",
++ "tableFrom": "principal_permission_grants",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.project_goals": {
++ "name": "project_goals",
++ "schema": "",
++ "columns": {
++ "project_id": {
++ "name": "project_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "goal_id": {
++ "name": "goal_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "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": {
++ "project_goals_project_idx": {
++ "name": "project_goals_project_idx",
++ "columns": [
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "project_goals_goal_idx": {
++ "name": "project_goals_goal_idx",
++ "columns": [
++ {
++ "expression": "goal_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "project_goals_company_idx": {
++ "name": "project_goals_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "project_goals_project_id_projects_id_fk": {
++ "name": "project_goals_project_id_projects_id_fk",
++ "tableFrom": "project_goals",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "project_goals_goal_id_goals_id_fk": {
++ "name": "project_goals_goal_id_goals_id_fk",
++ "tableFrom": "project_goals",
++ "tableTo": "goals",
++ "columnsFrom": [
++ "goal_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "onUpdate": "no action"
++ },
++ "project_goals_company_id_companies_id_fk": {
++ "name": "project_goals_company_id_companies_id_fk",
++ "tableFrom": "project_goals",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {
++ "project_goals_project_id_goal_id_pk": {
++ "name": "project_goals_project_id_goal_id_pk",
++ "columns": [
++ "project_id",
++ "goal_id"
++ ]
++ }
++ },
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.project_workspaces": {
++ "name": "project_workspaces",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true,
++ "default": "gen_random_uuid()"
++ },
++ "company_id": {
++ "name": "company_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
++ },
++ "source_type": {
++ "name": "source_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'local_path'"
++ },
++ "cwd": {
++ "name": "cwd",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "repo_url": {
++ "name": "repo_url",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "repo_ref": {
++ "name": "repo_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "default_ref": {
++ "name": "default_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "visibility": {
++ "name": "visibility",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'default'"
++ },
++ "setup_command": {
++ "name": "setup_command",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "cleanup_command": {
++ "name": "cleanup_command",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "remote_provider": {
++ "name": "remote_provider",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "remote_workspace_ref": {
++ "name": "remote_workspace_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "shared_workspace_key": {
++ "name": "shared_workspace_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "metadata": {
++ "name": "metadata",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "is_primary": {
++ "name": "is_primary",
++ "type": "boolean",
++ "primaryKey": false,
++ "notNull": true,
++ "default": 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": {
++ "project_workspaces_company_project_idx": {
++ "name": "project_workspaces_company_project_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "project_workspaces_project_primary_idx": {
++ "name": "project_workspaces_project_primary_idx",
++ "columns": [
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "is_primary",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "project_workspaces_project_source_type_idx": {
++ "name": "project_workspaces_project_source_type_idx",
++ "columns": [
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "source_type",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "project_workspaces_company_shared_key_idx": {
++ "name": "project_workspaces_company_shared_key_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "shared_workspace_key",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "project_workspaces_project_remote_ref_idx": {
++ "name": "project_workspaces_project_remote_ref_idx",
++ "columns": [
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "remote_provider",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "remote_workspace_ref",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": true,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "project_workspaces_company_id_companies_id_fk": {
++ "name": "project_workspaces_company_id_companies_id_fk",
++ "tableFrom": "project_workspaces",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "project_workspaces_project_id_projects_id_fk": {
++ "name": "project_workspaces_project_id_projects_id_fk",
++ "tableFrom": "project_workspaces",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "cascade",
++ "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()"
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "goal_id": {
++ "name": "goal_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "name": {
++ "name": "name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "description": {
++ "name": "description",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'backlog'"
++ },
++ "lead_agent_id": {
++ "name": "lead_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "target_date": {
++ "name": "target_date",
++ "type": "date",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "color": {
++ "name": "color",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_workspace_policy": {
++ "name": "execution_workspace_policy",
++ "type": "jsonb",
++ "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": {
++ "projects_company_idx": {
++ "name": "projects_company_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "projects_company_id_companies_id_fk": {
++ "name": "projects_company_id_companies_id_fk",
++ "tableFrom": "projects",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "projects_goal_id_goals_id_fk": {
++ "name": "projects_goal_id_goals_id_fk",
++ "tableFrom": "projects",
++ "tableTo": "goals",
++ "columnsFrom": [
++ "goal_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "projects_lead_agent_id_agents_id_fk": {
++ "name": "projects_lead_agent_id_agents_id_fk",
++ "tableFrom": "projects",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "lead_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ },
++ "public.workspace_runtime_services": {
++ "name": "workspace_runtime_services",
++ "schema": "",
++ "columns": {
++ "id": {
++ "name": "id",
++ "type": "uuid",
++ "primaryKey": true,
++ "notNull": true
++ },
++ "company_id": {
++ "name": "company_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "project_id": {
++ "name": "project_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "project_workspace_id": {
++ "name": "project_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "execution_workspace_id": {
++ "name": "execution_workspace_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "issue_id": {
++ "name": "issue_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "scope_type": {
++ "name": "scope_type",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "scope_id": {
++ "name": "scope_id",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "service_name": {
++ "name": "service_name",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "status": {
++ "name": "status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "lifecycle": {
++ "name": "lifecycle",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "reuse_key": {
++ "name": "reuse_key",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "command": {
++ "name": "command",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "cwd": {
++ "name": "cwd",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "port": {
++ "name": "port",
++ "type": "integer",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "url": {
++ "name": "url",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "provider": {
++ "name": "provider",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true
++ },
++ "provider_ref": {
++ "name": "provider_ref",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "owner_agent_id": {
++ "name": "owner_agent_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "started_by_run_id": {
++ "name": "started_by_run_id",
++ "type": "uuid",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "last_used_at": {
++ "name": "last_used_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ },
++ "started_at": {
++ "name": "started_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "now()"
++ },
++ "stopped_at": {
++ "name": "stopped_at",
++ "type": "timestamp with time zone",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "stop_policy": {
++ "name": "stop_policy",
++ "type": "jsonb",
++ "primaryKey": false,
++ "notNull": false
++ },
++ "health_status": {
++ "name": "health_status",
++ "type": "text",
++ "primaryKey": false,
++ "notNull": true,
++ "default": "'unknown'"
++ },
++ "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": {
++ "workspace_runtime_services_company_workspace_status_idx": {
++ "name": "workspace_runtime_services_company_workspace_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_workspace_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "workspace_runtime_services_company_execution_workspace_status_idx": {
++ "name": "workspace_runtime_services_company_execution_workspace_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "execution_workspace_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "workspace_runtime_services_company_project_status_idx": {
++ "name": "workspace_runtime_services_company_project_status_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "project_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "status",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "workspace_runtime_services_run_idx": {
++ "name": "workspace_runtime_services_run_idx",
++ "columns": [
++ {
++ "expression": "started_by_run_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ },
++ "workspace_runtime_services_company_updated_idx": {
++ "name": "workspace_runtime_services_company_updated_idx",
++ "columns": [
++ {
++ "expression": "company_id",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ },
++ {
++ "expression": "updated_at",
++ "isExpression": false,
++ "asc": true,
++ "nulls": "last"
++ }
++ ],
++ "isUnique": false,
++ "concurrently": false,
++ "method": "btree",
++ "with": {}
++ }
++ },
++ "foreignKeys": {
++ "workspace_runtime_services_company_id_companies_id_fk": {
++ "name": "workspace_runtime_services_company_id_companies_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "companies",
++ "columnsFrom": [
++ "company_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "no action",
++ "onUpdate": "no action"
++ },
++ "workspace_runtime_services_project_id_projects_id_fk": {
++ "name": "workspace_runtime_services_project_id_projects_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "projects",
++ "columnsFrom": [
++ "project_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "workspace_runtime_services_project_workspace_id_project_workspaces_id_fk": {
++ "name": "workspace_runtime_services_project_workspace_id_project_workspaces_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "project_workspaces",
++ "columnsFrom": [
++ "project_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "workspace_runtime_services_execution_workspace_id_execution_workspaces_id_fk": {
++ "name": "workspace_runtime_services_execution_workspace_id_execution_workspaces_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "execution_workspaces",
++ "columnsFrom": [
++ "execution_workspace_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "workspace_runtime_services_issue_id_issues_id_fk": {
++ "name": "workspace_runtime_services_issue_id_issues_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "issues",
++ "columnsFrom": [
++ "issue_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "workspace_runtime_services_owner_agent_id_agents_id_fk": {
++ "name": "workspace_runtime_services_owner_agent_id_agents_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "agents",
++ "columnsFrom": [
++ "owner_agent_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ },
++ "workspace_runtime_services_started_by_run_id_heartbeat_runs_id_fk": {
++ "name": "workspace_runtime_services_started_by_run_id_heartbeat_runs_id_fk",
++ "tableFrom": "workspace_runtime_services",
++ "tableTo": "heartbeat_runs",
++ "columnsFrom": [
++ "started_by_run_id"
++ ],
++ "columnsTo": [
++ "id"
++ ],
++ "onDelete": "set null",
++ "onUpdate": "no action"
++ }
++ },
++ "compositePrimaryKeys": {},
++ "uniqueConstraints": {},
++ "policies": {},
++ "checkConstraints": {},
++ "isRLSEnabled": false
++ }
++ },
++ "enums": {},
++ "schemas": {},
++ "sequences": {},
++ "roles": {},
++ "policies": {},
++ "views": {},
++ "_meta": {
++ "columns": {},
++ "schemas": {},
++ "tables": {}
++ }
++}
diff --cc packages/db/src/migrations/meta/_journal.json
index a54279d113,b061a56abd..3388c4c665
--- a/packages/db/src/migrations/meta/_journal.json
+++ b/packages/db/src/migrations/meta/_journal.json
@@@ -208,9 -208,9 +208,16 @@@
{
"idx": 29,
"version": "7",
- "when": 1773508957274,
- "tag": "0029_modern_paper_doll",
+ "when": 1773417600000,
+ "tag": "0029_plugin_tables",
+ "breakpoints": true
++ },
++ {
++ "idx": 30,
++ "version": "7",
++ "when": 1773514110632,
++ "tag": "0030_wild_lord_hawal",
+ "breakpoints": true
}
]
-}
+}
diff --cc packages/plugins/sdk/src/testing.ts
index 0000000000,48705b4dc7..501e2cd609
mode 000000,100644..100644
--- a/packages/plugins/sdk/src/testing.ts
+++ b/packages/plugins/sdk/src/testing.ts
@@@ -1,0 -1,705 +1,708 @@@
+ import { randomUUID } from "node:crypto";
+ import type {
+ PaperclipPluginManifestV1,
+ PluginCapability,
+ PluginEventType,
+ Company,
+ Project,
+ Issue,
+ IssueComment,
+ Agent,
+ Goal,
+ } from "@paperclipai/shared";
+ import type {
+ EventFilter,
+ PluginContext,
+ PluginEntityRecord,
+ PluginEntityUpsert,
+ PluginJobContext,
+ PluginLauncherRegistration,
+ PluginEvent,
+ ScopeKey,
+ ToolResult,
+ ToolRunContext,
+ PluginWorkspace,
+ AgentSession,
+ AgentSessionEvent,
+ } from "./types.js";
+
+ export interface TestHarnessOptions {
+ /** Plugin manifest used to seed capability checks and metadata. */
+ manifest: PaperclipPluginManifestV1;
+ /** Optional capability override. Defaults to `manifest.capabilities`. */
+ capabilities?: PluginCapability[];
+ /** Initial config returned by `ctx.config.get()`. */
+ config?: Record<string, unknown>;
+ }
+
+ export interface TestHarnessLogEntry {
+ level: "info" | "warn" | "error" | "debug";
+ message: string;
+ meta?: Record<string, unknown>;
+ }
+
+ export interface TestHarness {
+ /** Fully-typed in-memory plugin context passed to `plugin.setup(ctx)`. */
+ ctx: PluginContext;
+ /** Seed host entities for `ctx.companies/projects/issues/agents/goals` reads. */
+ seed(input: {
+ companies?: Company[];
+ projects?: Project[];
+ issues?: Issue[];
+ issueComments?: IssueComment[];
+ agents?: Agent[];
+ goals?: Goal[];
+ }): void;
+ setConfig(config: Record<string, unknown>): void;
+ /** Dispatch a host or plugin event to registered handlers. */
+ emit(eventType: PluginEventType | `plugin.${string}`, payload: unknown, base?: Partial<PluginEvent>): Promise<void>;
+ /** Execute a previously-registered scheduled job handler. */
+ runJob(jobKey: string, partial?: Partial<PluginJobContext>): Promise<void>;
+ /** Invoke a `ctx.data.register(...)` handler by key. */
+ getData<T = unknown>(key: string, params?: Record<string, unknown>): Promise<T>;
+ /** Invoke a `ctx.actions.register(...)` handler by key. */
+ performAction<T = unknown>(key: string, params?: Record<string, unknown>): Promise<T>;
+ /** Execute a registered tool handler via `ctx.tools.execute(...)`. */
+ executeTool<T = ToolResult>(name: string, params: unknown, runCtx?: Partial<ToolRunContext>): Promise<T>;
+ /** Read raw in-memory state for assertions. */
+ getState(input: ScopeKey): unknown;
+ /** Simulate a streaming event arriving for an active session. */
+ simulateSessionEvent(sessionId: string, event: Omit<AgentSessionEvent, "sessionId">): void;
+ logs: TestHarnessLogEntry[];
+ activity: Array<{ message: string; entityType?: string; entityId?: string; metadata?: Record<string, unknown> }>;
+ metrics: Array<{ name: string; value: number; tags?: Record<string, string> }>;
+ }
+
+ type EventRegistration = {
+ name: PluginEventType | `plugin.${string}`;
+ filter?: EventFilter;
+ fn: (event: PluginEvent) => Promise<void>;
+ };
+
+ function normalizeScope(input: ScopeKey): Required<Pick<ScopeKey, "scopeKind" | "stateKey">> & Pick<ScopeKey, "scopeId" | "namespace"> {
+ return {
+ scopeKind: input.scopeKind,
+ scopeId: input.scopeId,
+ namespace: input.namespace ?? "default",
+ stateKey: input.stateKey,
+ };
+ }
+
+ function stateMapKey(input: ScopeKey): string {
+ const normalized = normalizeScope(input);
+ return `${normalized.scopeKind}|${normalized.scopeId ?? ""}|${normalized.namespace}|${normalized.stateKey}`;
+ }
+
+ function allowsEvent(filter: EventFilter | undefined, event: PluginEvent): boolean {
+ if (!filter) return true;
+ if (filter.companyId && filter.companyId !== String((event.payload as Record<string, unknown> | undefined)?.companyId ?? "")) return false;
+ if (filter.projectId && filter.projectId !== String((event.payload as Record<string, unknown> | undefined)?.projectId ?? "")) return false;
+ if (filter.agentId && filter.agentId !== String((event.payload as Record<string, unknown> | undefined)?.agentId ?? "")) return false;
+ return true;
+ }
+
+ function requireCapability(manifest: PaperclipPluginManifestV1, allowed: Set<PluginCapability>, capability: PluginCapability) {
+ if (allowed.has(capability)) return;
+ throw new Error(`Plugin '${manifest.id}' is missing required capability '${capability}' in test harness`);
+ }
+
+ function requireCompanyId(companyId?: string): string {
+ if (!companyId) throw new Error("companyId is required for this operation");
+ return companyId;
+ }
+
+ function isInCompany<T extends { companyId: string | null | undefined }>(
+ record: T | null | undefined,
+ companyId: string,
+ ): record is T {
+ return Boolean(record && record.companyId === companyId);
+ }
+
+ /**
+ * Create an in-memory host harness for plugin worker tests.
+ *
+ * The harness enforces declared capabilities and simulates host APIs, so tests
+ * can validate plugin behavior without spinning up the Paperclip server runtime.
+ */
+ export function createTestHarness(options: TestHarnessOptions): TestHarness {
+ const manifest = options.manifest;
+ const capabilitySet = new Set(options.capabilities ?? manifest.capabilities);
+ let currentConfig = { ...(options.config ?? {}) };
+
+ const logs: TestHarnessLogEntry[] = [];
+ const activity: TestHarness["activity"] = [];
+ const metrics: TestHarness["metrics"] = [];
+
+ const state = new Map<string, unknown>();
+ const entities = new Map<string, PluginEntityRecord>();
+ const entityExternalIndex = new Map<string, string>();
+ const companies = new Map<string, Company>();
+ const projects = new Map<string, Project>();
+ const issues = new Map<string, Issue>();
+ const issueComments = new Map<string, IssueComment[]>();
+ const agents = new Map<string, Agent>();
+ const goals = new Map<string, Goal>();
+ const projectWorkspaces = new Map<string, PluginWorkspace[]>();
+
+ const sessions = new Map<string, AgentSession>();
+ const sessionEventCallbacks = new Map<string, (event: AgentSessionEvent) => void>();
+
+ const events: EventRegistration[] = [];
+ const jobs = new Map<string, (job: PluginJobContext) => Promise<void>>();
+ const launchers = new Map<string, PluginLauncherRegistration>();
+ const dataHandlers = new Map<string, (params: Record<string, unknown>) => Promise<unknown>>();
+ const actionHandlers = new Map<string, (params: Record<string, unknown>) => Promise<unknown>>();
+ const toolHandlers = new Map<string, (params: unknown, runCtx: ToolRunContext) => Promise<ToolResult>>();
+
+ const ctx: PluginContext = {
+ manifest,
+ config: {
+ async get() {
+ return { ...currentConfig };
+ },
+ },
+ events: {
+ on(name: PluginEventType | `plugin.${string}`, filterOrFn: EventFilter | ((event: PluginEvent) => Promise<void>), maybeFn?: (event: PluginEvent) => Promise<void>): () => void {
+ requireCapability(manifest, capabilitySet, "events.subscribe");
+ let registration: EventRegistration;
+ if (typeof filterOrFn === "function") {
+ registration = { name, fn: filterOrFn };
+ } else {
+ if (!maybeFn) throw new Error("event handler is required");
+ registration = { name, filter: filterOrFn, fn: maybeFn };
+ }
+ events.push(registration);
+ return () => {
+ const idx = events.indexOf(registration);
+ if (idx !== -1) events.splice(idx, 1);
+ };
+ },
+ async emit(name, companyId, payload) {
+ requireCapability(manifest, capabilitySet, "events.emit");
+ await harness.emit(`plugin.${manifest.id}.${name}`, payload, { companyId });
+ },
+ },
+ jobs: {
+ register(key, fn) {
+ requireCapability(manifest, capabilitySet, "jobs.schedule");
+ jobs.set(key, fn);
+ },
+ },
+ launchers: {
+ register(launcher) {
+ launchers.set(launcher.id, launcher);
+ },
+ },
+ http: {
+ async fetch(url, init) {
+ requireCapability(manifest, capabilitySet, "http.outbound");
+ return fetch(url, init);
+ },
+ },
+ secrets: {
+ async resolve(secretRef) {
+ requireCapability(manifest, capabilitySet, "secrets.read-ref");
+ return `resolved:${secretRef}`;
+ },
+ },
+ activity: {
+ async log(entry) {
+ requireCapability(manifest, capabilitySet, "activity.log.write");
+ activity.push(entry);
+ },
+ },
+ state: {
+ async get(input) {
+ requireCapability(manifest, capabilitySet, "plugin.state.read");
+ return state.has(stateMapKey(input)) ? state.get(stateMapKey(input)) : null;
+ },
+ async set(input, value) {
+ requireCapability(manifest, capabilitySet, "plugin.state.write");
+ state.set(stateMapKey(input), value);
+ },
+ async delete(input) {
+ requireCapability(manifest, capabilitySet, "plugin.state.write");
+ state.delete(stateMapKey(input));
+ },
+ },
+ entities: {
+ async upsert(input: PluginEntityUpsert) {
+ const externalKey = input.externalId
+ ? `${input.entityType}|${input.scopeKind}|${input.scopeId ?? ""}|${input.externalId}`
+ : null;
+ const existingId = externalKey ? entityExternalIndex.get(externalKey) : undefined;
+ const existing = existingId ? entities.get(existingId) : undefined;
+ const now = new Date().toISOString();
+ const previousExternalKey = existing?.externalId
+ ? `${existing.entityType}|${existing.scopeKind}|${existing.scopeId ?? ""}|${existing.externalId}`
+ : null;
+ const record: PluginEntityRecord = existing
+ ? {
+ ...existing,
+ entityType: input.entityType,
+ scopeKind: input.scopeKind,
+ scopeId: input.scopeId ?? null,
+ externalId: input.externalId ?? null,
+ title: input.title ?? null,
+ status: input.status ?? null,
+ data: input.data,
+ updatedAt: now,
+ }
+ : {
+ id: randomUUID(),
+ entityType: input.entityType,
+ scopeKind: input.scopeKind,
+ scopeId: input.scopeId ?? null,
+ externalId: input.externalId ?? null,
+ title: input.title ?? null,
+ status: input.status ?? null,
+ data: input.data,
+ createdAt: now,
+ updatedAt: now,
+ };
+ entities.set(record.id, record);
+ if (previousExternalKey && previousExternalKey !== externalKey) {
+ entityExternalIndex.delete(previousExternalKey);
+ }
+ if (externalKey) entityExternalIndex.set(externalKey, record.id);
+ return record;
+ },
+ async list(query) {
+ let out = [...entities.values()];
+ if (query.entityType) out = out.filter((r) => r.entityType === query.entityType);
+ if (query.scopeKind) out = out.filter((r) => r.scopeKind === query.scopeKind);
+ if (query.scopeId) out = out.filter((r) => r.scopeId === query.scopeId);
+ if (query.externalId) out = out.filter((r) => r.externalId === query.externalId);
+ if (query.offset) out = out.slice(query.offset);
+ if (query.limit) out = out.slice(0, query.limit);
+ return out;
+ },
+ },
+ projects: {
+ async list(input) {
+ requireCapability(manifest, capabilitySet, "projects.read");
+ const companyId = requireCompanyId(input?.companyId);
+ let out = [...projects.values()];
+ out = out.filter((project) => project.companyId === companyId);
+ if (input?.offset) out = out.slice(input.offset);
+ if (input?.limit) out = out.slice(0, input.limit);
+ return out;
+ },
+ async get(projectId, companyId) {
+ requireCapability(manifest, capabilitySet, "projects.read");
+ const project = projects.get(projectId);
+ return isInCompany(project, companyId) ? project : null;
+ },
+ async listWorkspaces(projectId, companyId) {
+ requireCapability(manifest, capabilitySet, "project.workspaces.read");
+ if (!isInCompany(projects.get(projectId), companyId)) return [];
+ return projectWorkspaces.get(projectId) ?? [];
+ },
+ async getPrimaryWorkspace(projectId, companyId) {
+ requireCapability(manifest, capabilitySet, "project.workspaces.read");
+ if (!isInCompany(projects.get(projectId), companyId)) return null;
+ const workspaces = projectWorkspaces.get(projectId) ?? [];
+ return workspaces.find((workspace) => workspace.isPrimary) ?? null;
+ },
+ async getWorkspaceForIssue(issueId, companyId) {
+ requireCapability(manifest, capabilitySet, "project.workspaces.read");
+ const issue = issues.get(issueId);
+ if (!isInCompany(issue, companyId)) return null;
+ const projectId = (issue as unknown as Record<string, unknown>)?.projectId as string | undefined;
+ if (!projectId) return null;
+ if (!isInCompany(projects.get(projectId), companyId)) return null;
+ const workspaces = projectWorkspaces.get(projectId) ?? [];
+ return workspaces.find((workspace) => workspace.isPrimary) ?? null;
+ },
+ },
+ companies: {
+ async list(input) {
+ requireCapability(manifest, capabilitySet, "companies.read");
+ let out = [...companies.values()];
+ if (input?.offset) out = out.slice(input.offset);
+ if (input?.limit) out = out.slice(0, input.limit);
+ return out;
+ },
+ async get(companyId) {
+ requireCapability(manifest, capabilitySet, "companies.read");
+ return companies.get(companyId) ?? null;
+ },
+ },
+ issues: {
+ async list(input) {
+ requireCapability(manifest, capabilitySet, "issues.read");
+ const companyId = requireCompanyId(input?.companyId);
+ let out = [...issues.values()];
+ out = out.filter((issue) => issue.companyId === companyId);
+ if (input?.projectId) out = out.filter((issue) => issue.projectId === input.projectId);
+ if (input?.assigneeAgentId) out = out.filter((issue) => issue.assigneeAgentId === input.assigneeAgentId);
+ if (input?.status) out = out.filter((issue) => issue.status === input.status);
+ if (input?.offset) out = out.slice(input.offset);
+ if (input?.limit) out = out.slice(0, input.limit);
+ return out;
+ },
+ async get(issueId, companyId) {
+ requireCapability(manifest, capabilitySet, "issues.read");
+ const issue = issues.get(issueId);
+ return isInCompany(issue, companyId) ? issue : null;
+ },
+ async create(input) {
+ requireCapability(manifest, capabilitySet, "issues.create");
+ const now = new Date();
+ const record: Issue = {
+ id: randomUUID(),
+ companyId: input.companyId,
+ projectId: input.projectId ?? null,
++ projectWorkspaceId: null,
+ goalId: input.goalId ?? null,
+ parentId: input.parentId ?? null,
+ title: input.title,
+ description: input.description ?? null,
+ status: "todo",
+ priority: input.priority ?? "medium",
+ assigneeAgentId: input.assigneeAgentId ?? null,
+ assigneeUserId: null,
+ checkoutRunId: null,
+ executionRunId: null,
+ executionAgentNameKey: null,
+ executionLockedAt: null,
+ createdByAgentId: null,
+ createdByUserId: null,
+ issueNumber: null,
+ identifier: null,
+ requestDepth: 0,
+ billingCode: null,
+ assigneeAdapterOverrides: null,
++ executionWorkspaceId: null,
++ executionWorkspacePreference: null,
+ executionWorkspaceSettings: null,
+ startedAt: null,
+ completedAt: null,
+ cancelledAt: null,
+ hiddenAt: null,
+ createdAt: now,
+ updatedAt: now,
+ };
+ issues.set(record.id, record);
+ return record;
+ },
+ async update(issueId, patch, companyId) {
+ requireCapability(manifest, capabilitySet, "issues.update");
+ const record = issues.get(issueId);
+ if (!isInCompany(record, companyId)) throw new Error(`Issue not found: ${issueId}`);
+ const updated: Issue = {
+ ...record,
+ ...patch,
+ updatedAt: new Date(),
+ };
+ issues.set(issueId, updated);
+ return updated;
+ },
+ async listComments(issueId, companyId) {
+ requireCapability(manifest, capabilitySet, "issue.comments.read");
+ if (!isInCompany(issues.get(issueId), companyId)) return [];
+ return issueComments.get(issueId) ?? [];
+ },
+ async createComment(issueId, body, companyId) {
+ requireCapability(manifest, capabilitySet, "issue.comments.create");
+ const parentIssue = issues.get(issueId);
+ if (!isInCompany(parentIssue, companyId)) {
+ throw new Error(`Issue not found: ${issueId}`);
+ }
+ const now = new Date();
+ const comment: IssueComment = {
+ id: randomUUID(),
+ companyId: parentIssue.companyId,
+ issueId,
+ authorAgentId: null,
+ authorUserId: null,
+ body,
+ createdAt: now,
+ updatedAt: now,
+ };
+ const current = issueComments.get(issueId) ?? [];
+ current.push(comment);
+ issueComments.set(issueId, current);
+ return comment;
+ },
+ },
+ agents: {
+ async list(input) {
+ requireCapability(manifest, capabilitySet, "agents.read");
+ const companyId = requireCompanyId(input?.companyId);
+ let out = [...agents.values()];
+ out = out.filter((agent) => agent.companyId === companyId);
+ if (input?.status) out = out.filter((agent) => agent.status === input.status);
+ if (input?.offset) out = out.slice(input.offset);
+ if (input?.limit) out = out.slice(0, input.limit);
+ return out;
+ },
+ async get(agentId, companyId) {
+ requireCapability(manifest, capabilitySet, "agents.read");
+ const agent = agents.get(agentId);
+ return isInCompany(agent, companyId) ? agent : null;
+ },
+ async pause(agentId, companyId) {
+ requireCapability(manifest, capabilitySet, "agents.pause");
+ const cid = requireCompanyId(companyId);
+ const agent = agents.get(agentId);
+ if (!isInCompany(agent, cid)) throw new Error(`Agent not found: ${agentId}`);
+ if (agent!.status === "terminated") throw new Error("Cannot pause terminated agent");
+ const updated: Agent = { ...agent!, status: "paused", updatedAt: new Date() };
+ agents.set(agentId, updated);
+ return updated;
+ },
+ async resume(agentId, companyId) {
+ requireCapability(manifest, capabilitySet, "agents.resume");
+ const cid = requireCompanyId(companyId);
+ const agent = agents.get(agentId);
+ if (!isInCompany(agent, cid)) throw new Error(`Agent not found: ${agentId}`);
+ if (agent!.status === "terminated") throw new Error("Cannot resume terminated agent");
+ if (agent!.status === "pending_approval") throw new Error("Pending approval agents cannot be resumed");
+ const updated: Agent = { ...agent!, status: "idle", updatedAt: new Date() };
+ agents.set(agentId, updated);
+ return updated;
+ },
+ async invoke(agentId, companyId, opts) {
+ requireCapability(manifest, capabilitySet, "agents.invoke");
+ const cid = requireCompanyId(companyId);
+ const agent = agents.get(agentId);
+ if (!isInCompany(agent, cid)) throw new Error(`Agent not found: ${agentId}`);
+ if (
+ agent!.status === "paused" ||
+ agent!.status === "terminated" ||
+ agent!.status === "pending_approval"
+ ) {
+ throw new Error(`Agent is not invokable in its current state: ${agent!.status}`);
+ }
+ return { runId: randomUUID() };
+ },
+ sessions: {
+ async create(agentId, companyId, opts) {
+ requireCapability(manifest, capabilitySet, "agent.sessions.create");
+ const cid = requireCompanyId(companyId);
+ const agent = agents.get(agentId);
+ if (!isInCompany(agent, cid)) throw new Error(`Agent not found: ${agentId}`);
+ const session: AgentSession = {
+ sessionId: randomUUID(),
+ agentId,
+ companyId: cid,
+ status: "active",
+ createdAt: new Date().toISOString(),
+ };
+ sessions.set(session.sessionId, session);
+ return session;
+ },
+ async list(agentId, companyId) {
+ requireCapability(manifest, capabilitySet, "agent.sessions.list");
+ const cid = requireCompanyId(companyId);
+ return [...sessions.values()].filter(
+ (s) => s.agentId === agentId && s.companyId === cid && s.status === "active",
+ );
+ },
+ async sendMessage(sessionId, companyId, opts) {
+ requireCapability(manifest, capabilitySet, "agent.sessions.send");
+ const session = sessions.get(sessionId);
+ if (!session || session.status !== "active") throw new Error(`Session not found or closed: ${sessionId}`);
+ if (session.companyId !== companyId) throw new Error(`Session not found: ${sessionId}`);
+ if (opts.onEvent) {
+ sessionEventCallbacks.set(sessionId, opts.onEvent);
+ }
+ return { runId: randomUUID() };
+ },
+ async close(sessionId, companyId) {
+ requireCapability(manifest, capabilitySet, "agent.sessions.close");
+ const session = sessions.get(sessionId);
+ if (!session) throw new Error(`Session not found: ${sessionId}`);
+ if (session.companyId !== companyId) throw new Error(`Session not found: ${sessionId}`);
+ session.status = "closed";
+ sessionEventCallbacks.delete(sessionId);
+ },
+ },
+ },
+ goals: {
+ async list(input) {
+ requireCapability(manifest, capabilitySet, "goals.read");
+ const companyId = requireCompanyId(input?.companyId);
+ let out = [...goals.values()];
+ out = out.filter((goal) => goal.companyId === companyId);
+ if (input?.level) out = out.filter((goal) => goal.level === input.level);
+ if (input?.status) out = out.filter((goal) => goal.status === input.status);
+ if (input?.offset) out = out.slice(input.offset);
+ if (input?.limit) out = out.slice(0, input.limit);
+ return out;
+ },
+ async get(goalId, companyId) {
+ requireCapability(manifest, capabilitySet, "goals.read");
+ const goal = goals.get(goalId);
+ return isInCompany(goal, companyId) ? goal : null;
+ },
+ async create(input) {
+ requireCapability(manifest, capabilitySet, "goals.create");
+ const now = new Date();
+ const record: Goal = {
+ id: randomUUID(),
+ companyId: input.companyId,
+ title: input.title,
+ description: input.description ?? null,
+ level: input.level ?? "task",
+ status: input.status ?? "planned",
+ parentId: input.parentId ?? null,
+ ownerAgentId: input.ownerAgentId ?? null,
+ createdAt: now,
+ updatedAt: now,
+ };
+ goals.set(record.id, record);
+ return record;
+ },
+ async update(goalId, patch, companyId) {
+ requireCapability(manifest, capabilitySet, "goals.update");
+ const record = goals.get(goalId);
+ if (!isInCompany(record, companyId)) throw new Error(`Goal not found: ${goalId}`);
+ const updated: Goal = {
+ ...record,
+ ...patch,
+ updatedAt: new Date(),
+ };
+ goals.set(goalId, updated);
+ return updated;
+ },
+ },
+ data: {
+ register(key, handler) {
+ dataHandlers.set(key, handler);
+ },
+ },
+ actions: {
+ register(key, handler) {
+ actionHandlers.set(key, handler);
+ },
+ },
+ streams: (() => {
+ const channelCompanyMap = new Map<string, string>();
+ return {
+ open(channel: string, companyId: string) {
+ channelCompanyMap.set(channel, companyId);
+ },
+ emit(_channel: string, _event: unknown) {
+ // No-op in test harness — events are not forwarded
+ },
+ close(channel: string) {
+ channelCompanyMap.delete(channel);
+ },
+ };
+ })(),
+ tools: {
+ register(name, _decl, fn) {
+ requireCapability(manifest, capabilitySet, "agent.tools.register");
+ toolHandlers.set(name, fn);
+ },
+ },
+ metrics: {
+ async write(name, value, tags) {
+ requireCapability(manifest, capabilitySet, "metrics.write");
+ metrics.push({ name, value, tags });
+ },
+ },
+ logger: {
+ info(message, meta) {
+ logs.push({ level: "info", message, meta });
+ },
+ warn(message, meta) {
+ logs.push({ level: "warn", message, meta });
+ },
+ error(message, meta) {
+ logs.push({ level: "error", message, meta });
+ },
+ debug(message, meta) {
+ logs.push({ level: "debug", message, meta });
+ },
+ },
+ };
+
+ const harness: TestHarness = {
+ ctx,
+ seed(input) {
+ for (const row of input.companies ?? []) companies.set(row.id, row);
+ for (const row of input.projects ?? []) projects.set(row.id, row);
+ for (const row of input.issues ?? []) issues.set(row.id, row);
+ for (const row of input.issueComments ?? []) {
+ const list = issueComments.get(row.issueId) ?? [];
+ list.push(row);
+ issueComments.set(row.issueId, list);
+ }
+ for (const row of input.agents ?? []) agents.set(row.id, row);
+ for (const row of input.goals ?? []) goals.set(row.id, row);
+ },
+ setConfig(config) {
+ currentConfig = { ...config };
+ },
+ async emit(eventType, payload, base) {
+ const event: PluginEvent = {
+ eventId: base?.eventId ?? randomUUID(),
+ eventType,
+ companyId: base?.companyId ?? "test-company",
+ occurredAt: base?.occurredAt ?? new Date().toISOString(),
+ actorId: base?.actorId,
+ actorType: base?.actorType,
+ entityId: base?.entityId,
+ entityType: base?.entityType,
+ payload,
+ };
+
+ for (const handler of events) {
+ const exactMatch = handler.name === event.eventType;
+ const wildcardPluginAll = handler.name === "plugin.*" && String(event.eventType).startsWith("plugin.");
+ const wildcardPluginOne = String(handler.name).endsWith(".*")
+ && String(event.eventType).startsWith(String(handler.name).slice(0, -1));
+ if (!exactMatch && !wildcardPluginAll && !wildcardPluginOne) continue;
+ if (!allowsEvent(handler.filter, event)) continue;
+ await handler.fn(event);
+ }
+ },
+ async runJob(jobKey, partial = {}) {
+ const handler = jobs.get(jobKey);
+ if (!handler) throw new Error(`No job handler registered for '${jobKey}'`);
+ await handler({
+ jobKey,
+ runId: partial.runId ?? randomUUID(),
+ trigger: partial.trigger ?? "manual",
+ scheduledAt: partial.scheduledAt ?? new Date().toISOString(),
+ });
+ },
+ async getData<T = unknown>(key: string, params: Record<string, unknown> = {}) {
+ const handler = dataHandlers.get(key);
+ if (!handler) throw new Error(`No data handler registered for '${key}'`);
+ return await handler(params) as T;
+ },
+ async performAction<T = unknown>(key: string, params: Record<string, unknown> = {}) {
+ const handler = actionHandlers.get(key);
+ if (!handler) throw new Error(`No action handler registered for '${key}'`);
+ return await handler(params) as T;
+ },
+ async executeTool<T = ToolResult>(name: string, params: unknown, runCtx: Partial<ToolRunContext> = {}) {
+ const handler = toolHandlers.get(name);
+ if (!handler) throw new Error(`No tool handler registered for '${name}'`);
+ const ctxToPass: ToolRunContext = {
+ agentId: runCtx.agentId ?? "agent-test",
+ runId: runCtx.runId ?? randomUUID(),
+ companyId: runCtx.companyId ?? "company-test",
+ projectId: runCtx.projectId ?? "project-test",
+ };
+ return await handler(params, ctxToPass) as T;
+ },
+ getState(input) {
+ return state.get(stateMapKey(input));
+ },
+ simulateSessionEvent(sessionId, event) {
+ const cb = sessionEventCallbacks.get(sessionId);
+ if (!cb) throw new Error(`No active session event callback for session: ${sessionId}`);
+ cb({ ...event, sessionId });
+ },
+ logs,
+ activity,
+ metrics,
+ };
+
+ return harness;
+ }
diff --cc pnpm-lock.yaml
index 9b83d7cd18,f6820f52ec..122105c896
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@@ -249,6 -246,6 +249,180 @@@ importers
specifier: ^3.0.5
++ packages/plugins/create-paperclip-plugin:
++ dependencies:
++ '@paperclipai/plugin-sdk':
++ specifier: workspace:*
++ version: link:../sdk
++ devDependencies:
++ '@types/node':
++ specifier: ^24.6.0
++ version: 24.12.0
++ typescript:
++ specifier: ^5.7.3
++ version: 5.9.3
++
++ packages/plugins/examples/plugin-authoring-smoke-example:
++ dependencies:
++ '@paperclipai/plugin-sdk':
++ specifier: workspace:*
++ version: link:../../sdk
++ react:
++ specifier: '>=18'
++ version: 19.2.4
++ devDependencies:
++ '@rollup/plugin-node-resolve':
++ specifier: ^16.0.1
++ version: 16.0.3([email protected])
++ '@rollup/plugin-typescript':
++ specifier: ^12.1.2
++ '@types/node':
++ specifier: ^24.6.0
++ version: 24.12.0
++ '@types/react':
++ specifier: ^19.0.8
++ version: 19.2.14
++ esbuild:
++ specifier: ^0.27.3
++ version: 0.27.3
++ rollup:
++ specifier: ^4.38.0
++ version: 4.57.1
++ tslib:
++ specifier: ^2.8.1
++ version: 2.8.1
++ typescript:
++ specifier: ^5.7.3
++ version: 5.9.3
++ vitest:
++ specifier: ^3.0.5
++
++ packages/plugins/examples/plugin-file-browser-example:
++ dependencies:
++ '@codemirror/lang-javascript':
++ specifier: ^6.2.2
++ version: 6.2.4
++ '@codemirror/language':
++ specifier: ^6.11.0
++ version: 6.12.1
++ '@codemirror/state':
++ specifier: ^6.4.0
++ version: 6.5.4
++ '@codemirror/view':
++ specifier: ^6.28.0
++ version: 6.39.15
++ '@lezer/highlight':
++ specifier: ^1.2.1
++ version: 1.2.3
++ '@paperclipai/plugin-sdk':
++ specifier: workspace:*
++ version: link:../../sdk
++ codemirror:
++ specifier: ^6.0.1
++ version: 6.0.2
++ devDependencies:
++ '@types/node':
++ specifier: ^24.6.0
++ version: 24.12.0
++ '@types/react':
++ specifier: ^19.0.8
++ version: 19.2.14
++ '@types/react-dom':
++ specifier: ^19.0.3
++ version: 19.2.3(@types/[email protected])
++ esbuild:
++ specifier: ^0.27.3
++ version: 0.27.3
++ react:
++ specifier: ^19.0.0
++ version: 19.2.4
++ react-dom:
++ specifier: ^19.0.0
++ version: 19.2.4([email protected])
++ typescript:
++ specifier: ^5.7.3
++ version: 5.9.3
++
++ packages/plugins/examples/plugin-hello-world-example:
++ dependencies:
++ '@paperclipai/plugin-sdk':
++ specifier: workspace:*
++ version: link:../../sdk
++ devDependencies:
++ '@types/node':
++ specifier: ^24.6.0
++ version: 24.12.0
++ '@types/react':
++ specifier: ^19.0.8
++ version: 19.2.14
++ '@types/react-dom':
++ specifier: ^19.0.3
++ version: 19.2.3(@types/[email protected])
++ react:
++ specifier: ^19.0.0
++ version: 19.2.4
++ react-dom:
++ specifier: ^19.0.0
++ version: 19.2.4([email protected])
++ typescript:
++ specifier: ^5.7.3
++ version: 5.9.3
++
++ packages/plugins/examples/plugin-kitchen-sink-example:
++ dependencies:
++ '@paperclipai/plugin-sdk':
++ specifier: workspace:*
++ version: link:../../sdk
++ '@paperclipai/shared':
++ specifier: workspace:*
++ version: link:../../../shared
++ devDependencies:
++ '@types/node':
++ specifier: ^24.6.0
++ version: 24.12.0
++ '@types/react':
++ specifier: ^19.0.8
++ version: 19.2.14
++ '@types/react-dom':
++ specifier: ^19.0.3
++ version: 19.2.3(@types/[email protected])
++ esbuild:
++ specifier: ^0.27.3
++ version: 0.27.3
++ react:
++ specifier: ^19.0.0
++ version: 19.2.4
++ react-dom:
++ specifier: ^19.0.0
++ version: 19.2.4([email protected])
++ typescript:
++ specifier: ^5.7.3
++ version: 5.9.3
++
++ packages/plugins/sdk:
++ dependencies:
++ '@paperclipai/shared':
++ specifier: workspace:*
++ version: link:../../shared
++ react:
++ specifier: '>=18'
++ version: 19.2.4
++ zod:
++ specifier: ^3.24.2
++ version: 3.25.76
++ devDependencies:
++ '@types/node':
++ specifier: ^24.6.0
++ version: 24.12.0
++ '@types/react':
++ specifier: ^19.0.8
++ version: 19.2.14
++ typescript:
++ specifier: ^5.7.3
++ version: 5.9.3
++
packages/shared:
dependencies:
zod:
@@@ -291,12 -288,12 +465,24 @@@
'@paperclipai/db':
specifier: workspace:*
version: link:../packages/db
++ '@paperclipai/plugin-sdk':
++ specifier: workspace:*
++ version: link:../packages/plugins/sdk
'@paperclipai/shared':
specifier: workspace:*
version: link:../packages/shared
++ ajv:
++ specifier: ^8.18.0
++ version: 8.18.0
++ ajv-formats:
++ specifier: ^3.0.1
++ version: 3.0.1([email protected])
better-auth:
specifier: 1.4.18
++ chokidar:
++ specifier: ^4.0.3
++ version: 4.0.3
detect-port:
specifier: ^2.1.0
version: 2.1.0
@@@ -2439,6 -2436,6 +2625,37 @@@ packages
'@rolldown/[email protected]':
resolution: {integrity: sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==}
++ '@rollup/[email protected]':
++ resolution: {integrity: sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==}
++ engines: {node: '>=14.0.0'}
++ peerDependencies:
++ rollup: ^2.78.0||^3.0.0||^4.0.0
++ peerDependenciesMeta:
++ rollup:
++ optional: true
++
++ '@rollup/[email protected]':
++ resolution: {integrity: sha512-7DP0/p7y3t67+NabT9f8oTBFE6gGkto4SA6Np2oudYmZE/m1dt8RB0SjL1msMxFpLo631qjRCcBlAbq1ml/Big==}
++ engines: {node: '>=14.0.0'}
++ peerDependencies:
++ rollup: ^2.14.0||^3.0.0||^4.0.0
++ tslib: '*'
++ typescript: '>=3.7.0'
++ peerDependenciesMeta:
++ rollup:
++ optional: true
++ tslib:
++ optional: true
++
++ '@rollup/[email protected]':
++ resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==}
++ engines: {node: '>=14.0.0'}
++ peerDependencies:
++ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
++ peerDependenciesMeta:
++ rollup:
++ optional: true
++
'@rollup/[email protected]':
resolution: {integrity: sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==}
cpu: [arm]
@@@ -3071,6 -3068,6 +3288,9 @@@
resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==}
++ '@types/[email protected]':
++ resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
++
resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==}
@@@ -3151,6 -3148,6 +3371,17 @@@
resolution: {integrity: sha512-XNAb/a6TCqou+TufU8/u11HCu9x1gYvOoxLwtlXgIqmkrYQADVv6ljyW2zwiPhHz9R1gItAWpuDrdJMmrOBFEA==}
engines: {node: '>= 16.0.0'}
++ resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==}
++ peerDependencies:
++ ajv: ^8.0.0
++ peerDependenciesMeta:
++ ajv:
++ optional: true
++
++ resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==}
++
resolution: {integrity: sha512-vcZjxvvVoxTeR5XBNJB38oTu/7eDCZlwdz32N1eNgpyPF7j/Z7Idf+CUwQOkKKpJ7RJyjxgLHCM7vdIK0iCNMQ==}
@@@ -3364,6 -3361,6 +3595,10 @@@
resolution: {integrity: sha512-opLQzEVriiH1uUQ4Kctsd49bRoFDXGGSC4GUqj7pGyxM3RehRhvTlZJc1FL/Flew2p5uwxa1tUDWKzI4wNM8pg==}
++ resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
++ engines: {node: '>= 14.16.0'}
++
resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
@@@ -3663,6 -3660,6 +3898,10 @@@
resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}
engines: {node: '>=6'}
++ resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
++ engines: {node: '>=0.10.0'}
++
resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==}
engines: {node: '>=18'}
@@@ -3944,6 -3941,6 +4183,9 @@@
resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==}
++ resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
++
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
@@@ -3974,6 -3971,6 +4216,9 @@@
resolution: {integrity: sha512-ybA6PDXIXOXivLJK/z9e+Otk7ve13I4ckBvGO5I2RRmBU1gMHLVDJYEuJYhGwez7YNlYji2M2DvVU+a9mSFDlw==}
++ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
++
resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
engines: {node: '>=8.6.0'}
@@@ -3981,6 -3978,6 +4226,9 @@@
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
++ resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==}
++
resolution: {integrity: sha512-QNI3sAvSvaOiaMl8FYU4trnEzCwiRr8XMWgAHzlrWpTSj+QaCSvOf1h82OEP1s4hiAXhnbXSyFWCf4ldZzZRVA==}
hasBin: true
@@@ -4168,6 -4165,6 +4416,10 @@@
resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==}
++ resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
++ engines: {node: '>= 0.4'}
++
resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==}
@@@ -4196,6 -4193,6 +4448,9 @@@
engines: {node: '>=14.16'}
hasBin: true
++ resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==}
++
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
@@@ -4255,6 -4252,6 +4510,9 @@@
engines: {node: '>=6'}
hasBin: true
++ resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
++
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'}
@@@ -4745,6 -4742,6 +5003,9 @@@
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
++ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
++
resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==}
@@@ -5033,6 -5030,6 +5294,10 @@@
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
engines: {node: '>= 6'}
++ resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
++ engines: {node: '>= 14.18.0'}
++
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
engines: {node: '>= 12.13.0'}
@@@ -5049,6 -5046,6 +5314,10 @@@
resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==}
++ resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
++ engines: {node: '>=0.10.0'}
++
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
engines: {node: '>=8'}
@@@ -5056,6 -5053,6 +5325,11 @@@
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
++ resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==}
++ engines: {node: '>= 0.4'}
++ hasBin: true
++
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
@@@ -5260,6 -5257,6 +5534,10 @@@
resolution: {integrity: sha512-oK8WG9diS3DlhdUkcFn4tkNIiIbBx9lI2ClF8K+b2/m8Eyv47LSawxUzZQSNKUrVb2KsqeTDCcjAAVPYaSLVTA==}
engines: {node: '>=14.18.0'}
++ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
++ engines: {node: '>= 0.4'}
++
resolution: {integrity: sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==}
@@@ -8215,6 -8212,6 +8493,33 @@@ snapshots
'@rolldown/[email protected]': {}
++ dependencies:
++ '@rollup/pluginutils': 5.3.0([email protected])
++ '@types/resolve': 1.20.2
++ deepmerge: 4.3.1
++ is-module: 1.0.0
++ resolve: 1.22.11
++ optionalDependencies:
++ rollup: 4.57.1
++
++ dependencies:
++ '@rollup/pluginutils': 5.3.0([email protected])
++ resolve: 1.22.11
++ typescript: 5.9.3
++ optionalDependencies:
++ rollup: 4.57.1
++ tslib: 2.8.1
++
++ dependencies:
++ '@types/estree': 1.0.8
++ estree-walker: 2.0.2
++ picomatch: 4.0.3
++ optionalDependencies:
++ rollup: 4.57.1
++
'@rollup/[email protected]':
optional: true
@@@ -8937,6 -8934,6 +9242,8 @@@
dependencies:
csstype: 3.2.3
++ '@types/[email protected]': {}
++
dependencies:
'@types/node': 25.2.3
@@@ -9046,6 -9043,6 +9353,17 @@@
++ optionalDependencies:
++ ajv: 8.18.0
++
++ dependencies:
++ fast-deep-equal: 3.1.3
++ fast-uri: 3.1.0
++ json-schema-traverse: 1.0.0
++ require-from-string: 2.0.2
++
@@@ -9212,6 -9209,6 +9530,10 @@@
'@chevrotain/utils': 11.1.2
lodash-es: 4.17.23
++ dependencies:
++ readdirp: 4.1.2
++
dependencies:
clsx: 2.1.1
@@@ -9520,6 -9517,6 +9842,8 @@@
++
@@@ -9792,6 -9789,6 +10116,8 @@@
'@types/estree-jsx': 1.0.5
'@types/unist': 3.0.3
++
dependencies:
'@types/estree': 1.0.8
@@@ -9848,6 -9845,6 +10174,8 @@@
++
dependencies:
'@nodelib/fs.stat': 2.0.5
@@@ -9858,6 -9855,6 +10186,8 @@@
++
dependencies:
strnum: 2.1.2
@@@ -10060,6 -10057,6 +10390,10 @@@
is-alphabetical: 2.0.1
is-decimal: 2.0.1
++ dependencies:
++ hasown: 2.0.2
++
@@@ -10078,6 -10075,6 +10412,8 @@@
dependencies:
is-docker: 3.0.0
++
@@@ -10119,6 -10116,6 +10455,8 @@@
++
@@@ -10876,6 -10873,6 +11214,8 @@@
++
@@@ -11224,6 -11221,6 +11564,8 @@@
string_decoder: 1.3.0
util-deprecate: 1.0.2
++
@@@ -11260,10 -11257,10 +11602,18 @@@
mdast-util-to-markdown: 2.1.2
unified: 11.0.5
++
++ dependencies:
++ is-core-module: 2.16.1
++ path-parse: 1.0.7
++ supports-preserve-symlinks-flag: 1.0.0
++
@@@ -11513,6 -11510,6 +11863,8 @@@
transitivePeerDependencies:
- supports-color
++