{
  "id": "3103a0e3-e705-4a45-b34f-27f8387d1b51",
  "prevId": "7e67373c-8e0d-4cdf-9816-8d43517eed65",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.agent": {
      "name": "agent",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "default_sub_agent_id": {
          "name": "default_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "context_config_id": {
          "name": "context_config_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "models": {
          "name": "models",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "status_updates": {
          "name": "status_updates",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "prompt": {
          "name": "prompt",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "stop_when": {
          "name": "stop_when",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "agent_project_fk": {
          "name": "agent_project_fk",
          "tableFrom": "agent",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "agent_tenant_id_project_id_id_pk": {
          "name": "agent_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.artifact_components": {
      "name": "artifact_components",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "props": {
          "name": "props",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "render": {
          "name": "render",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "artifact_components_project_fk": {
          "name": "artifact_components_project_fk",
          "tableFrom": "artifact_components",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "artifact_components_tenant_id_project_id_id_pk": {
          "name": "artifact_components_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.context_configs": {
      "name": "context_configs",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "headers_schema": {
          "name": "headers_schema",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "context_variables": {
          "name": "context_variables",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "context_configs_agent_fk": {
          "name": "context_configs_agent_fk",
          "tableFrom": "context_configs",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "context_configs_tenant_id_project_id_agent_id_id_pk": {
          "name": "context_configs_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.credential_references": {
      "name": "credential_references",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "credential_store_id": {
          "name": "credential_store_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "retrieval_params": {
          "name": "retrieval_params",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "tool_id": {
          "name": "tool_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "credential_references_project_fk": {
          "name": "credential_references_project_fk",
          "tableFrom": "credential_references",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "credential_references_tenant_id_project_id_id_pk": {
          "name": "credential_references_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "credential_references_id_unique": {
          "name": "credential_references_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "id"
          ]
        },
        "credential_references_tool_user_unique": {
          "name": "credential_references_tool_user_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tool_id",
            "user_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.data_components": {
      "name": "data_components",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "props": {
          "name": "props",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "render": {
          "name": "render",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "data_components_project_fk": {
          "name": "data_components_project_fk",
          "tableFrom": "data_components",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "data_components_tenant_id_project_id_id_pk": {
          "name": "data_components_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dataset": {
      "name": "dataset",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "dataset_project_fk": {
          "name": "dataset_project_fk",
          "tableFrom": "dataset",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dataset_tenant_id_project_id_id_pk": {
          "name": "dataset_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dataset_item": {
      "name": "dataset_item",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "dataset_id": {
          "name": "dataset_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "input": {
          "name": "input",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "expected_output": {
          "name": "expected_output",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "simulation_agent": {
          "name": "simulation_agent",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "dataset_item_dataset_fk": {
          "name": "dataset_item_dataset_fk",
          "tableFrom": "dataset_item",
          "tableTo": "dataset",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "dataset_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dataset_item_tenant_id_project_id_id_pk": {
          "name": "dataset_item_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dataset_run_config": {
      "name": "dataset_run_config",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "dataset_id": {
          "name": "dataset_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "dataset_run_config_project_fk": {
          "name": "dataset_run_config_project_fk",
          "tableFrom": "dataset_run_config",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dataset_run_config_dataset_fk": {
          "name": "dataset_run_config_dataset_fk",
          "tableFrom": "dataset_run_config",
          "tableTo": "dataset",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "dataset_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dataset_run_config_tenant_id_project_id_id_pk": {
          "name": "dataset_run_config_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dataset_run_config_agent_relations": {
      "name": "dataset_run_config_agent_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "dataset_run_config_id": {
          "name": "dataset_run_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "dataset_run_config_agent_relations_dataset_run_config_fk": {
          "name": "dataset_run_config_agent_relations_dataset_run_config_fk",
          "tableFrom": "dataset_run_config_agent_relations",
          "tableTo": "dataset_run_config",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "dataset_run_config_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dataset_run_config_agent_relations_agent_fk": {
          "name": "dataset_run_config_agent_relations_agent_fk",
          "tableFrom": "dataset_run_config_agent_relations",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dataset_run_config_agent_relations_tenant_id_project_id_id_pk": {
          "name": "dataset_run_config_agent_relations_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_job_config": {
      "name": "evaluation_job_config",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "job_filters": {
          "name": "job_filters",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "evaluation_job_config_project_fk": {
          "name": "evaluation_job_config_project_fk",
          "tableFrom": "evaluation_job_config",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "evaluation_job_config_tenant_id_project_id_id_pk": {
          "name": "evaluation_job_config_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_job_config_evaluator_relations": {
      "name": "evaluation_job_config_evaluator_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "evaluation_job_config_id": {
          "name": "evaluation_job_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "evaluator_id": {
          "name": "evaluator_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "eval_job_cfg_evaluator_rel_job_cfg_fk": {
          "name": "eval_job_cfg_evaluator_rel_job_cfg_fk",
          "tableFrom": "evaluation_job_config_evaluator_relations",
          "tableTo": "evaluation_job_config",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluation_job_config_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "eval_job_cfg_evaluator_rel_evaluator_fk": {
          "name": "eval_job_cfg_evaluator_rel_evaluator_fk",
          "tableFrom": "evaluation_job_config_evaluator_relations",
          "tableTo": "evaluator",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluator_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "eval_job_cfg_evaluator_rel_pk": {
          "name": "eval_job_cfg_evaluator_rel_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_run_config": {
      "name": "evaluation_run_config",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "evaluation_run_config_project_fk": {
          "name": "evaluation_run_config_project_fk",
          "tableFrom": "evaluation_run_config",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "evaluation_run_config_tenant_id_project_id_id_pk": {
          "name": "evaluation_run_config_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_run_config_evaluation_suite_config_relations": {
      "name": "evaluation_run_config_evaluation_suite_config_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "evaluation_run_config_id": {
          "name": "evaluation_run_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "evaluation_suite_config_id": {
          "name": "evaluation_suite_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "eval_run_cfg_eval_suite_rel_run_cfg_fk": {
          "name": "eval_run_cfg_eval_suite_rel_run_cfg_fk",
          "tableFrom": "evaluation_run_config_evaluation_suite_config_relations",
          "tableTo": "evaluation_run_config",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluation_run_config_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "eval_run_cfg_eval_suite_rel_suite_cfg_fk": {
          "name": "eval_run_cfg_eval_suite_rel_suite_cfg_fk",
          "tableFrom": "evaluation_run_config_evaluation_suite_config_relations",
          "tableTo": "evaluation_suite_config",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluation_suite_config_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "eval_run_cfg_eval_suite_cfg_rel_pk": {
          "name": "eval_run_cfg_eval_suite_cfg_rel_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_suite_config": {
      "name": "evaluation_suite_config",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "filters": {
          "name": "filters",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "sample_rate": {
          "name": "sample_rate",
          "type": "double precision",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "evaluation_suite_config_project_fk": {
          "name": "evaluation_suite_config_project_fk",
          "tableFrom": "evaluation_suite_config",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "evaluation_suite_config_tenant_id_project_id_id_pk": {
          "name": "evaluation_suite_config_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_suite_config_evaluator_relations": {
      "name": "evaluation_suite_config_evaluator_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "evaluation_suite_config_id": {
          "name": "evaluation_suite_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "evaluator_id": {
          "name": "evaluator_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "eval_suite_cfg_evaluator_rel_suite_cfg_fk": {
          "name": "eval_suite_cfg_evaluator_rel_suite_cfg_fk",
          "tableFrom": "evaluation_suite_config_evaluator_relations",
          "tableTo": "evaluation_suite_config",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluation_suite_config_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "eval_suite_cfg_evaluator_rel_evaluator_fk": {
          "name": "eval_suite_cfg_evaluator_rel_evaluator_fk",
          "tableFrom": "evaluation_suite_config_evaluator_relations",
          "tableTo": "evaluator",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluator_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "eval_suite_cfg_evaluator_rel_pk": {
          "name": "eval_suite_cfg_evaluator_rel_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluator": {
      "name": "evaluator",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "prompt": {
          "name": "prompt",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "schema": {
          "name": "schema",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "model": {
          "name": "model",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "pass_criteria": {
          "name": "pass_criteria",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "evaluator_project_fk": {
          "name": "evaluator_project_fk",
          "tableFrom": "evaluator",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "evaluator_tenant_id_project_id_id_pk": {
          "name": "evaluator_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.external_agents": {
      "name": "external_agents",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "base_url": {
          "name": "base_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "credential_reference_id": {
          "name": "credential_reference_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "external_agents_project_fk": {
          "name": "external_agents_project_fk",
          "tableFrom": "external_agents",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "external_agents_credential_reference_fk": {
          "name": "external_agents_credential_reference_fk",
          "tableFrom": "external_agents",
          "tableTo": "credential_references",
          "columnsFrom": [
            "credential_reference_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "external_agents_tenant_id_project_id_id_pk": {
          "name": "external_agents_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.function_tools": {
      "name": "function_tools",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "function_id": {
          "name": "function_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "function_tools_agent_fk": {
          "name": "function_tools_agent_fk",
          "tableFrom": "function_tools",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "function_tools_function_fk": {
          "name": "function_tools_function_fk",
          "tableFrom": "function_tools",
          "tableTo": "functions",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "function_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "function_tools_tenant_id_project_id_agent_id_id_pk": {
          "name": "function_tools_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.functions": {
      "name": "functions",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "input_schema": {
          "name": "input_schema",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "execute_code": {
          "name": "execute_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "dependencies": {
          "name": "dependencies",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "functions_project_fk": {
          "name": "functions_project_fk",
          "tableFrom": "functions",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "functions_tenant_id_project_id_id_pk": {
          "name": "functions_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.projects": {
      "name": "projects",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "models": {
          "name": "models",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "stop_when": {
          "name": "stop_when",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "projects_tenant_id_id_pk": {
          "name": "projects_tenant_id_id_pk",
          "columns": [
            "tenant_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_artifact_components": {
      "name": "sub_agent_artifact_components",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "artifact_component_id": {
          "name": "artifact_component_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_artifact_components_sub_agent_fk": {
          "name": "sub_agent_artifact_components_sub_agent_fk",
          "tableFrom": "sub_agent_artifact_components",
          "tableTo": "sub_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sub_agent_artifact_components_artifact_component_fk": {
          "name": "sub_agent_artifact_components_artifact_component_fk",
          "tableFrom": "sub_agent_artifact_components",
          "tableTo": "artifact_components",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "artifact_component_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_artifact_components_pk": {
          "name": "sub_agent_artifact_components_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_data_components": {
      "name": "sub_agent_data_components",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "data_component_id": {
          "name": "data_component_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_data_components_sub_agent_fk": {
          "name": "sub_agent_data_components_sub_agent_fk",
          "tableFrom": "sub_agent_data_components",
          "tableTo": "sub_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sub_agent_data_components_data_component_fk": {
          "name": "sub_agent_data_components_data_component_fk",
          "tableFrom": "sub_agent_data_components",
          "tableTo": "data_components",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "data_component_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_data_components_tenant_id_project_id_id_pk": {
          "name": "sub_agent_data_components_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_external_agent_relations": {
      "name": "sub_agent_external_agent_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "external_agent_id": {
          "name": "external_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "headers": {
          "name": "headers",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_external_agent_relations_sub_agent_fk": {
          "name": "sub_agent_external_agent_relations_sub_agent_fk",
          "tableFrom": "sub_agent_external_agent_relations",
          "tableTo": "sub_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sub_agent_external_agent_relations_external_agent_fk": {
          "name": "sub_agent_external_agent_relations_external_agent_fk",
          "tableFrom": "sub_agent_external_agent_relations",
          "tableTo": "external_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "external_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_external_agent_relations_pk": {
          "name": "sub_agent_external_agent_relations_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_function_tool_relations": {
      "name": "sub_agent_function_tool_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "function_tool_id": {
          "name": "function_tool_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_function_tool_relations_sub_agent_fk": {
          "name": "sub_agent_function_tool_relations_sub_agent_fk",
          "tableFrom": "sub_agent_function_tool_relations",
          "tableTo": "sub_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sub_agent_function_tool_relations_function_tool_fk": {
          "name": "sub_agent_function_tool_relations_function_tool_fk",
          "tableFrom": "sub_agent_function_tool_relations",
          "tableTo": "function_tools",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "function_tool_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_function_tool_relations_pk": {
          "name": "sub_agent_function_tool_relations_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_relations": {
      "name": "sub_agent_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "source_sub_agent_id": {
          "name": "source_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "target_sub_agent_id": {
          "name": "target_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "relation_type": {
          "name": "relation_type",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_relations_agent_fk": {
          "name": "sub_agent_relations_agent_fk",
          "tableFrom": "sub_agent_relations",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_relations_tenant_id_project_id_agent_id_id_pk": {
          "name": "sub_agent_relations_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_team_agent_relations": {
      "name": "sub_agent_team_agent_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "target_agent_id": {
          "name": "target_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "headers": {
          "name": "headers",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_team_agent_relations_sub_agent_fk": {
          "name": "sub_agent_team_agent_relations_sub_agent_fk",
          "tableFrom": "sub_agent_team_agent_relations",
          "tableTo": "sub_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sub_agent_team_agent_relations_target_agent_fk": {
          "name": "sub_agent_team_agent_relations_target_agent_fk",
          "tableFrom": "sub_agent_team_agent_relations",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "target_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_team_agent_relations_pk": {
          "name": "sub_agent_team_agent_relations_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agent_tool_relations": {
      "name": "sub_agent_tool_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "tool_id": {
          "name": "tool_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "selected_tools": {
          "name": "selected_tools",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "headers": {
          "name": "headers",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "tool_policies": {
          "name": "tool_policies",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agent_tool_relations_agent_fk": {
          "name": "sub_agent_tool_relations_agent_fk",
          "tableFrom": "sub_agent_tool_relations",
          "tableTo": "sub_agents",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id",
            "sub_agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sub_agent_tool_relations_tool_fk": {
          "name": "sub_agent_tool_relations_tool_fk",
          "tableFrom": "sub_agent_tool_relations",
          "tableTo": "tools",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "tool_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agent_tool_relations_tenant_id_project_id_agent_id_id_pk": {
          "name": "sub_agent_tool_relations_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sub_agents": {
      "name": "sub_agents",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "prompt": {
          "name": "prompt",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "conversation_history_config": {
          "name": "conversation_history_config",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{\"mode\":\"full\",\"limit\":50,\"maxOutputTokens\":4000,\"includeInternal\":false,\"messageTypes\":[\"chat\",\"tool-result\"]}'::jsonb"
        },
        "models": {
          "name": "models",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "stop_when": {
          "name": "stop_when",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sub_agents_agents_fk": {
          "name": "sub_agents_agents_fk",
          "tableFrom": "sub_agents",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sub_agents_tenant_id_project_id_agent_id_id_pk": {
          "name": "sub_agents_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.tools": {
      "name": "tools",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "config": {
          "name": "config",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "credential_reference_id": {
          "name": "credential_reference_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "credential_scope": {
          "name": "credential_scope",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true,
          "default": "'project'"
        },
        "headers": {
          "name": "headers",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "image_url": {
          "name": "image_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "capabilities": {
          "name": "capabilities",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "last_error": {
          "name": "last_error",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "tools_project_fk": {
          "name": "tools_project_fk",
          "tableFrom": "tools",
          "tableTo": "projects",
          "columnsFrom": [
            "tenant_id",
            "project_id"
          ],
          "columnsTo": [
            "tenant_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "tools_credential_reference_fk": {
          "name": "tools_credential_reference_fk",
          "tableFrom": "tools",
          "tableTo": "credential_references",
          "columnsFrom": [
            "credential_reference_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "tools_tenant_id_project_id_id_pk": {
          "name": "tools_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.triggers": {
      "name": "triggers",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "enabled": {
          "name": "enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "input_schema": {
          "name": "input_schema",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "output_transform": {
          "name": "output_transform",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "message_template": {
          "name": "message_template",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "authentication": {
          "name": "authentication",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "signing_secret": {
          "name": "signing_secret",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "triggers_agent_fk": {
          "name": "triggers_agent_fk",
          "tableFrom": "triggers",
          "tableTo": "agent",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "agent_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "triggers_tenant_id_project_id_agent_id_id_pk": {
          "name": "triggers_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}