spb/worthdoing Public
Autonomous investigation agent that discovers, challenges, and ranks things genuinely worth doing — Claude + Firecrawl, Next.js 16, PostgreSQL
TypeScript 91.5%
SQL 5.8%
CSS 2.2%
1{2 "id": "30e8c5da-5037-4134-ac88-6072424064fd",3 "prevId": "49f14a86-25bb-4d42-9edd-e69115c7a650",4 "version": "7",5 "dialect": "postgresql",6 "tables": {7 "public.agent_events": {8 "name": "agent_events",9 "schema": "",10 "columns": {11 "id": {12 "name": "id",13 "type": "bigserial",14 "primaryKey": true,15 "notNull": true16 },17 "investigation_id": {18 "name": "investigation_id",19 "type": "uuid",20 "primaryKey": false,21 "notNull": true22 },23 "seq": {24 "name": "seq",25 "type": "integer",26 "primaryKey": false,27 "notNull": true28 },29 "type": {30 "name": "type",31 "type": "text",32 "primaryKey": false,33 "notNull": true34 },35 "payload": {36 "name": "payload",37 "type": "jsonb",38 "primaryKey": false,39 "notNull": true40 },41 "created_at": {42 "name": "created_at",43 "type": "timestamp with time zone",44 "primaryKey": false,45 "notNull": true,46 "default": "now()"47 }48 },49 "indexes": {50 "agent_events_seq_idx": {51 "name": "agent_events_seq_idx",52 "columns": [53 {54 "expression": "investigation_id",55 "isExpression": false,56 "asc": true,57 "nulls": "last"58 },59 {60 "expression": "seq",61 "isExpression": false,62 "asc": true,63 "nulls": "last"64 }65 ],66 "isUnique": true,67 "concurrently": false,68 "method": "btree",69 "with": {}70 }71 },72 "foreignKeys": {73 "agent_events_investigation_id_investigations_id_fk": {74 "name": "agent_events_investigation_id_investigations_id_fk",75 "tableFrom": "agent_events",76 "tableTo": "investigations",77 "columnsFrom": [78 "investigation_id"79 ],80 "columnsTo": [81 "id"82 ],83 "onDelete": "cascade",84 "onUpdate": "no action"85 }86 },87 "compositePrimaryKeys": {},88 "uniqueConstraints": {},89 "policies": {},90 "checkConstraints": {},91 "isRLSEnabled": false92 },93 "public.claims": {94 "name": "claims",95 "schema": "",96 "columns": {97 "id": {98 "name": "id",99 "type": "uuid",100 "primaryKey": true,101 "notNull": true,102 "default": "gen_random_uuid()"103 },104 "investigation_id": {105 "name": "investigation_id",106 "type": "uuid",107 "primaryKey": false,108 "notNull": true109 },110 "text": {111 "name": "text",112 "type": "text",113 "primaryKey": false,114 "notNull": true115 },116 "status": {117 "name": "status",118 "type": "text",119 "primaryKey": false,120 "notNull": true,121 "default": "'open'"122 },123 "confidence": {124 "name": "confidence",125 "type": "real",126 "primaryKey": false,127 "notNull": true,128 "default": 0.5129 },130 "created_at": {131 "name": "created_at",132 "type": "timestamp with time zone",133 "primaryKey": false,134 "notNull": true,135 "default": "now()"136 }137 },138 "indexes": {139 "claims_investigation_idx": {140 "name": "claims_investigation_idx",141 "columns": [142 {143 "expression": "investigation_id",144 "isExpression": false,145 "asc": true,146 "nulls": "last"147 }148 ],149 "isUnique": false,150 "concurrently": false,151 "method": "btree",152 "with": {}153 }154 },155 "foreignKeys": {156 "claims_investigation_id_investigations_id_fk": {157 "name": "claims_investigation_id_investigations_id_fk",158 "tableFrom": "claims",159 "tableTo": "investigations",160 "columnsFrom": [161 "investigation_id"162 ],163 "columnsTo": [164 "id"165 ],166 "onDelete": "cascade",167 "onUpdate": "no action"168 }169 },170 "compositePrimaryKeys": {},171 "uniqueConstraints": {},172 "policies": {},173 "checkConstraints": {},174 "isRLSEnabled": false175 },176 "public.competitors": {177 "name": "competitors",178 "schema": "",179 "columns": {180 "id": {181 "name": "id",182 "type": "uuid",183 "primaryKey": true,184 "notNull": true,185 "default": "gen_random_uuid()"186 },187 "name": {188 "name": "name",189 "type": "text",190 "primaryKey": false,191 "notNull": true192 },193 "url": {194 "name": "url",195 "type": "text",196 "primaryKey": false,197 "notNull": false198 },199 "description": {200 "name": "description",201 "type": "text",202 "primaryKey": false,203 "notNull": false204 },205 "created_at": {206 "name": "created_at",207 "type": "timestamp with time zone",208 "primaryKey": false,209 "notNull": true,210 "default": "now()"211 }212 },213 "indexes": {214 "competitors_name_idx": {215 "name": "competitors_name_idx",216 "columns": [217 {218 "expression": "name",219 "isExpression": false,220 "asc": true,221 "nulls": "last"222 }223 ],224 "isUnique": true,225 "concurrently": false,226 "method": "btree",227 "with": {}228 }229 },230 "foreignKeys": {},231 "compositePrimaryKeys": {},232 "uniqueConstraints": {},233 "policies": {},234 "checkConstraints": {},235 "isRLSEnabled": false236 },237 "public.evidence": {238 "name": "evidence",239 "schema": "",240 "columns": {241 "id": {242 "name": "id",243 "type": "uuid",244 "primaryKey": true,245 "notNull": true,246 "default": "gen_random_uuid()"247 },248 "investigation_id": {249 "name": "investigation_id",250 "type": "uuid",251 "primaryKey": false,252 "notNull": true253 },254 "source_id": {255 "name": "source_id",256 "type": "uuid",257 "primaryKey": false,258 "notNull": true259 },260 "claim_id": {261 "name": "claim_id",262 "type": "uuid",263 "primaryKey": false,264 "notNull": false265 },266 "kind": {267 "name": "kind",268 "type": "text",269 "primaryKey": false,270 "notNull": true271 },272 "quote": {273 "name": "quote",274 "type": "text",275 "primaryKey": false,276 "notNull": true277 },278 "summary": {279 "name": "summary",280 "type": "text",281 "primaryKey": false,282 "notNull": true283 },284 "strength": {285 "name": "strength",286 "type": "real",287 "primaryKey": false,288 "notNull": true,289 "default": 0.5290 },291 "fingerprint": {292 "name": "fingerprint",293 "type": "text",294 "primaryKey": false,295 "notNull": true296 },297 "created_at": {298 "name": "created_at",299 "type": "timestamp with time zone",300 "primaryKey": false,301 "notNull": true,302 "default": "now()"303 }304 },305 "indexes": {306 "evidence_investigation_idx": {307 "name": "evidence_investigation_idx",308 "columns": [309 {310 "expression": "investigation_id",311 "isExpression": false,312 "asc": true,313 "nulls": "last"314 }315 ],316 "isUnique": false,317 "concurrently": false,318 "method": "btree",319 "with": {}320 },321 "evidence_fingerprint_idx": {322 "name": "evidence_fingerprint_idx",323 "columns": [324 {325 "expression": "investigation_id",326 "isExpression": false,327 "asc": true,328 "nulls": "last"329 },330 {331 "expression": "fingerprint",332 "isExpression": false,333 "asc": true,334 "nulls": "last"335 }336 ],337 "isUnique": true,338 "concurrently": false,339 "method": "btree",340 "with": {}341 }342 },343 "foreignKeys": {344 "evidence_investigation_id_investigations_id_fk": {345 "name": "evidence_investigation_id_investigations_id_fk",346 "tableFrom": "evidence",347 "tableTo": "investigations",348 "columnsFrom": [349 "investigation_id"350 ],351 "columnsTo": [352 "id"353 ],354 "onDelete": "cascade",355 "onUpdate": "no action"356 },357 "evidence_source_id_sources_id_fk": {358 "name": "evidence_source_id_sources_id_fk",359 "tableFrom": "evidence",360 "tableTo": "sources",361 "columnsFrom": [362 "source_id"363 ],364 "columnsTo": [365 "id"366 ],367 "onDelete": "no action",368 "onUpdate": "no action"369 },370 "evidence_claim_id_claims_id_fk": {371 "name": "evidence_claim_id_claims_id_fk",372 "tableFrom": "evidence",373 "tableTo": "claims",374 "columnsFrom": [375 "claim_id"376 ],377 "columnsTo": [378 "id"379 ],380 "onDelete": "no action",381 "onUpdate": "no action"382 }383 },384 "compositePrimaryKeys": {},385 "uniqueConstraints": {},386 "policies": {},387 "checkConstraints": {},388 "isRLSEnabled": false389 },390 "public.hypotheses": {391 "name": "hypotheses",392 "schema": "",393 "columns": {394 "id": {395 "name": "id",396 "type": "uuid",397 "primaryKey": true,398 "notNull": true,399 "default": "gen_random_uuid()"400 },401 "investigation_id": {402 "name": "investigation_id",403 "type": "uuid",404 "primaryKey": false,405 "notNull": true406 },407 "parent_hypothesis_id": {408 "name": "parent_hypothesis_id",409 "type": "uuid",410 "primaryKey": false,411 "notNull": false412 },413 "title": {414 "name": "title",415 "type": "text",416 "primaryKey": false,417 "notNull": true418 },419 "statement": {420 "name": "statement",421 "type": "text",422 "primaryKey": false,423 "notNull": true424 },425 "status": {426 "name": "status",427 "type": "text",428 "primaryKey": false,429 "notNull": true,430 "default": "'proposed'"431 },432 "confidence": {433 "name": "confidence",434 "type": "real",435 "primaryKey": false,436 "notNull": true,437 "default": 0.5438 },439 "rationale": {440 "name": "rationale",441 "type": "text",442 "primaryKey": false,443 "notNull": false444 },445 "adversarial_checked": {446 "name": "adversarial_checked",447 "type": "boolean",448 "primaryKey": false,449 "notNull": true,450 "default": false451 },452 "created_at": {453 "name": "created_at",454 "type": "timestamp with time zone",455 "primaryKey": false,456 "notNull": true,457 "default": "now()"458 },459 "updated_at": {460 "name": "updated_at",461 "type": "timestamp with time zone",462 "primaryKey": false,463 "notNull": true,464 "default": "now()"465 }466 },467 "indexes": {468 "hypotheses_investigation_idx": {469 "name": "hypotheses_investigation_idx",470 "columns": [471 {472 "expression": "investigation_id",473 "isExpression": false,474 "asc": true,475 "nulls": "last"476 }477 ],478 "isUnique": false,479 "concurrently": false,480 "method": "btree",481 "with": {}482 }483 },484 "foreignKeys": {485 "hypotheses_investigation_id_investigations_id_fk": {486 "name": "hypotheses_investigation_id_investigations_id_fk",487 "tableFrom": "hypotheses",488 "tableTo": "investigations",489 "columnsFrom": [490 "investigation_id"491 ],492 "columnsTo": [493 "id"494 ],495 "onDelete": "cascade",496 "onUpdate": "no action"497 }498 },499 "compositePrimaryKeys": {},500 "uniqueConstraints": {},501 "policies": {},502 "checkConstraints": {},503 "isRLSEnabled": false504 },505 "public.hypothesis_evidence": {506 "name": "hypothesis_evidence",507 "schema": "",508 "columns": {509 "hypothesis_id": {510 "name": "hypothesis_id",511 "type": "uuid",512 "primaryKey": false,513 "notNull": true514 },515 "evidence_id": {516 "name": "evidence_id",517 "type": "uuid",518 "primaryKey": false,519 "notNull": true520 },521 "relation": {522 "name": "relation",523 "type": "text",524 "primaryKey": false,525 "notNull": true526 },527 "weight": {528 "name": "weight",529 "type": "real",530 "primaryKey": false,531 "notNull": true,532 "default": 0.5533 }534 },535 "indexes": {},536 "foreignKeys": {537 "hypothesis_evidence_hypothesis_id_hypotheses_id_fk": {538 "name": "hypothesis_evidence_hypothesis_id_hypotheses_id_fk",539 "tableFrom": "hypothesis_evidence",540 "tableTo": "hypotheses",541 "columnsFrom": [542 "hypothesis_id"543 ],544 "columnsTo": [545 "id"546 ],547 "onDelete": "cascade",548 "onUpdate": "no action"549 },550 "hypothesis_evidence_evidence_id_evidence_id_fk": {551 "name": "hypothesis_evidence_evidence_id_evidence_id_fk",552 "tableFrom": "hypothesis_evidence",553 "tableTo": "evidence",554 "columnsFrom": [555 "evidence_id"556 ],557 "columnsTo": [558 "id"559 ],560 "onDelete": "cascade",561 "onUpdate": "no action"562 }563 },564 "compositePrimaryKeys": {565 "hypothesis_evidence_hypothesis_id_evidence_id_pk": {566 "name": "hypothesis_evidence_hypothesis_id_evidence_id_pk",567 "columns": [568 "hypothesis_id",569 "evidence_id"570 ]571 }572 },573 "uniqueConstraints": {},574 "policies": {},575 "checkConstraints": {},576 "isRLSEnabled": false577 },578 "public.investigation_steps": {579 "name": "investigation_steps",580 "schema": "",581 "columns": {582 "id": {583 "name": "id",584 "type": "uuid",585 "primaryKey": true,586 "notNull": true,587 "default": "gen_random_uuid()"588 },589 "investigation_id": {590 "name": "investigation_id",591 "type": "uuid",592 "primaryKey": false,593 "notNull": true594 },595 "step_number": {596 "name": "step_number",597 "type": "integer",598 "primaryKey": false,599 "notNull": true600 },601 "model": {602 "name": "model",603 "type": "text",604 "primaryKey": false,605 "notNull": true606 },607 "input_tokens": {608 "name": "input_tokens",609 "type": "integer",610 "primaryKey": false,611 "notNull": true,612 "default": 0613 },614 "output_tokens": {615 "name": "output_tokens",616 "type": "integer",617 "primaryKey": false,618 "notNull": true,619 "default": 0620 },621 "cost_usd": {622 "name": "cost_usd",623 "type": "real",624 "primaryKey": false,625 "notNull": true,626 "default": 0627 },628 "latency_ms": {629 "name": "latency_ms",630 "type": "integer",631 "primaryKey": false,632 "notNull": true,633 "default": 0634 },635 "tool_name": {636 "name": "tool_name",637 "type": "text",638 "primaryKey": false,639 "notNull": false640 },641 "tool_args": {642 "name": "tool_args",643 "type": "jsonb",644 "primaryKey": false,645 "notNull": false646 },647 "tool_result_summary": {648 "name": "tool_result_summary",649 "type": "text",650 "primaryKey": false,651 "notNull": false652 },653 "decision_summary": {654 "name": "decision_summary",655 "type": "text",656 "primaryKey": false,657 "notNull": false658 },659 "error": {660 "name": "error",661 "type": "text",662 "primaryKey": false,663 "notNull": false664 },665 "created_at": {666 "name": "created_at",667 "type": "timestamp with time zone",668 "primaryKey": false,669 "notNull": true,670 "default": "now()"671 }672 },673 "indexes": {674 "steps_investigation_idx": {675 "name": "steps_investigation_idx",676 "columns": [677 {678 "expression": "investigation_id",679 "isExpression": false,680 "asc": true,681 "nulls": "last"682 },683 {684 "expression": "step_number",685 "isExpression": false,686 "asc": true,687 "nulls": "last"688 }689 ],690 "isUnique": false,691 "concurrently": false,692 "method": "btree",693 "with": {}694 }695 },696 "foreignKeys": {697 "investigation_steps_investigation_id_investigations_id_fk": {698 "name": "investigation_steps_investigation_id_investigations_id_fk",699 "tableFrom": "investigation_steps",700 "tableTo": "investigations",701 "columnsFrom": [702 "investigation_id"703 ],704 "columnsTo": [705 "id"706 ],707 "onDelete": "cascade",708 "onUpdate": "no action"709 }710 },711 "compositePrimaryKeys": {},712 "uniqueConstraints": {},713 "policies": {},714 "checkConstraints": {},715 "isRLSEnabled": false716 },717 "public.investigations": {718 "name": "investigations",719 "schema": "",720 "columns": {721 "id": {722 "name": "id",723 "type": "uuid",724 "primaryKey": true,725 "notNull": true,726 "default": "gen_random_uuid()"727 },728 "user_id": {729 "name": "user_id",730 "type": "uuid",731 "primaryKey": false,732 "notNull": false733 },734 "objective": {735 "name": "objective",736 "type": "text",737 "primaryKey": false,738 "notNull": true739 },740 "status": {741 "name": "status",742 "type": "text",743 "primaryKey": false,744 "notNull": true,745 "default": "'pending'"746 },747 "phase": {748 "name": "phase",749 "type": "text",750 "primaryKey": false,751 "notNull": true,752 "default": "'scouting'"753 },754 "stop_reason": {755 "name": "stop_reason",756 "type": "text",757 "primaryKey": false,758 "notNull": false759 },760 "conclusion": {761 "name": "conclusion",762 "type": "text",763 "primaryKey": false,764 "notNull": false765 },766 "outcome": {767 "name": "outcome",768 "type": "text",769 "primaryKey": false,770 "notNull": false771 },772 "budget": {773 "name": "budget",774 "type": "jsonb",775 "primaryKey": false,776 "notNull": true777 },778 "budget_used": {779 "name": "budget_used",780 "type": "jsonb",781 "primaryKey": false,782 "notNull": true783 },784 "prompt_version": {785 "name": "prompt_version",786 "type": "text",787 "primaryKey": false,788 "notNull": true789 },790 "tool_schema_version": {791 "name": "tool_schema_version",792 "type": "text",793 "primaryKey": false,794 "notNull": true795 },796 "model": {797 "name": "model",798 "type": "text",799 "primaryKey": false,800 "notNull": true801 },802 "error": {803 "name": "error",804 "type": "text",805 "primaryKey": false,806 "notNull": false807 },808 "created_at": {809 "name": "created_at",810 "type": "timestamp with time zone",811 "primaryKey": false,812 "notNull": true,813 "default": "now()"814 },815 "started_at": {816 "name": "started_at",817 "type": "timestamp with time zone",818 "primaryKey": false,819 "notNull": false820 },821 "completed_at": {822 "name": "completed_at",823 "type": "timestamp with time zone",824 "primaryKey": false,825 "notNull": false826 }827 },828 "indexes": {829 "investigations_status_idx": {830 "name": "investigations_status_idx",831 "columns": [832 {833 "expression": "status",834 "isExpression": false,835 "asc": true,836 "nulls": "last"837 }838 ],839 "isUnique": false,840 "concurrently": false,841 "method": "btree",842 "with": {}843 },844 "investigations_created_idx": {845 "name": "investigations_created_idx",846 "columns": [847 {848 "expression": "created_at",849 "isExpression": false,850 "asc": true,851 "nulls": "last"852 }853 ],854 "isUnique": false,855 "concurrently": false,856 "method": "btree",857 "with": {}858 }859 },860 "foreignKeys": {861 "investigations_user_id_users_id_fk": {862 "name": "investigations_user_id_users_id_fk",863 "tableFrom": "investigations",864 "tableTo": "users",865 "columnsFrom": [866 "user_id"867 ],868 "columnsTo": [869 "id"870 ],871 "onDelete": "no action",872 "onUpdate": "no action"873 }874 },875 "compositePrimaryKeys": {},876 "uniqueConstraints": {},877 "policies": {},878 "checkConstraints": {},879 "isRLSEnabled": false880 },881 "public.opportunities": {882 "name": "opportunities",883 "schema": "",884 "columns": {885 "id": {886 "name": "id",887 "type": "uuid",888 "primaryKey": true,889 "notNull": true,890 "default": "gen_random_uuid()"891 },892 "investigation_id": {893 "name": "investigation_id",894 "type": "uuid",895 "primaryKey": false,896 "notNull": true897 },898 "hypothesis_id": {899 "name": "hypothesis_id",900 "type": "uuid",901 "primaryKey": false,902 "notNull": false903 },904 "title": {905 "name": "title",906 "type": "text",907 "primaryKey": false,908 "notNull": true909 },910 "summary": {911 "name": "summary",912 "type": "text",913 "primaryKey": false,914 "notNull": true915 },916 "problem": {917 "name": "problem",918 "type": "text",919 "primaryKey": false,920 "notNull": true921 },922 "why_now": {923 "name": "why_now",924 "type": "text",925 "primaryKey": false,926 "notNull": true927 },928 "risks": {929 "name": "risks",930 "type": "text",931 "primaryKey": false,932 "notNull": true933 },934 "skeptic_case": {935 "name": "skeptic_case",936 "type": "text",937 "primaryKey": false,938 "notNull": true939 },940 "report_md": {941 "name": "report_md",942 "type": "text",943 "primaryKey": false,944 "notNull": false945 },946 "status": {947 "name": "status",948 "type": "text",949 "primaryKey": false,950 "notNull": true,951 "default": "'candidate'"952 },953 "worth_score": {954 "name": "worth_score",955 "type": "real",956 "primaryKey": false,957 "notNull": false958 },959 "evidence_confidence": {960 "name": "evidence_confidence",961 "type": "real",962 "primaryKey": false,963 "notNull": false964 },965 "created_at": {966 "name": "created_at",967 "type": "timestamp with time zone",968 "primaryKey": false,969 "notNull": true,970 "default": "now()"971 },972 "updated_at": {973 "name": "updated_at",974 "type": "timestamp with time zone",975 "primaryKey": false,976 "notNull": true,977 "default": "now()"978 }979 },980 "indexes": {981 "opportunities_investigation_idx": {982 "name": "opportunities_investigation_idx",983 "columns": [984 {985 "expression": "investigation_id",986 "isExpression": false,987 "asc": true,988 "nulls": "last"989 }990 ],991 "isUnique": false,992 "concurrently": false,993 "method": "btree",994 "with": {}995 },996 "opportunities_score_idx": {997 "name": "opportunities_score_idx",998 "columns": [999 {1000 "expression": "worth_score",1001 "isExpression": false,1002 "asc": true,1003 "nulls": "last"1004 }1005 ],1006 "isUnique": false,1007 "concurrently": false,1008 "method": "btree",1009 "with": {}1010 }1011 },1012 "foreignKeys": {1013 "opportunities_investigation_id_investigations_id_fk": {1014 "name": "opportunities_investigation_id_investigations_id_fk",1015 "tableFrom": "opportunities",1016 "tableTo": "investigations",1017 "columnsFrom": [1018 "investigation_id"1019 ],1020 "columnsTo": [1021 "id"1022 ],1023 "onDelete": "cascade",1024 "onUpdate": "no action"1025 },1026 "opportunities_hypothesis_id_hypotheses_id_fk": {1027 "name": "opportunities_hypothesis_id_hypotheses_id_fk",1028 "tableFrom": "opportunities",1029 "tableTo": "hypotheses",1030 "columnsFrom": [1031 "hypothesis_id"1032 ],1033 "columnsTo": [1034 "id"1035 ],1036 "onDelete": "no action",1037 "onUpdate": "no action"1038 }1039 },1040 "compositePrimaryKeys": {},1041 "uniqueConstraints": {},1042 "policies": {},1043 "checkConstraints": {},1044 "isRLSEnabled": false1045 },1046 "public.opportunity_competitors": {1047 "name": "opportunity_competitors",1048 "schema": "",1049 "columns": {1050 "opportunity_id": {1051 "name": "opportunity_id",1052 "type": "uuid",1053 "primaryKey": false,1054 "notNull": true1055 },1056 "competitor_id": {1057 "name": "competitor_id",1058 "type": "uuid",1059 "primaryKey": false,1060 "notNull": true1061 },1062 "note": {1063 "name": "note",1064 "type": "text",1065 "primaryKey": false,1066 "notNull": false1067 }1068 },1069 "indexes": {},1070 "foreignKeys": {1071 "opportunity_competitors_opportunity_id_opportunities_id_fk": {1072 "name": "opportunity_competitors_opportunity_id_opportunities_id_fk",1073 "tableFrom": "opportunity_competitors",1074 "tableTo": "opportunities",1075 "columnsFrom": [1076 "opportunity_id"1077 ],1078 "columnsTo": [1079 "id"1080 ],1081 "onDelete": "cascade",1082 "onUpdate": "no action"1083 },1084 "opportunity_competitors_competitor_id_competitors_id_fk": {1085 "name": "opportunity_competitors_competitor_id_competitors_id_fk",1086 "tableFrom": "opportunity_competitors",1087 "tableTo": "competitors",1088 "columnsFrom": [1089 "competitor_id"1090 ],1091 "columnsTo": [1092 "id"1093 ],1094 "onDelete": "cascade",1095 "onUpdate": "no action"1096 }1097 },1098 "compositePrimaryKeys": {1099 "opportunity_competitors_opportunity_id_competitor_id_pk": {1100 "name": "opportunity_competitors_opportunity_id_competitor_id_pk",1101 "columns": [1102 "opportunity_id",1103 "competitor_id"1104 ]1105 }1106 },1107 "uniqueConstraints": {},1108 "policies": {},1109 "checkConstraints": {},1110 "isRLSEnabled": false1111 },1112 "public.opportunity_evidence": {1113 "name": "opportunity_evidence",1114 "schema": "",1115 "columns": {1116 "opportunity_id": {1117 "name": "opportunity_id",1118 "type": "uuid",1119 "primaryKey": false,1120 "notNull": true1121 },1122 "evidence_id": {1123 "name": "evidence_id",1124 "type": "uuid",1125 "primaryKey": false,1126 "notNull": true1127 },1128 "role": {1129 "name": "role",1130 "type": "text",1131 "primaryKey": false,1132 "notNull": true,1133 "default": "'context'"1134 }1135 },1136 "indexes": {},1137 "foreignKeys": {1138 "opportunity_evidence_opportunity_id_opportunities_id_fk": {1139 "name": "opportunity_evidence_opportunity_id_opportunities_id_fk",1140 "tableFrom": "opportunity_evidence",1141 "tableTo": "opportunities",1142 "columnsFrom": [1143 "opportunity_id"1144 ],1145 "columnsTo": [1146 "id"1147 ],1148 "onDelete": "cascade",1149 "onUpdate": "no action"1150 },1151 "opportunity_evidence_evidence_id_evidence_id_fk": {1152 "name": "opportunity_evidence_evidence_id_evidence_id_fk",1153 "tableFrom": "opportunity_evidence",1154 "tableTo": "evidence",1155 "columnsFrom": [1156 "evidence_id"1157 ],1158 "columnsTo": [1159 "id"1160 ],1161 "onDelete": "cascade",1162 "onUpdate": "no action"1163 }1164 },1165 "compositePrimaryKeys": {1166 "opportunity_evidence_opportunity_id_evidence_id_pk": {1167 "name": "opportunity_evidence_opportunity_id_evidence_id_pk",1168 "columns": [1169 "opportunity_id",1170 "evidence_id"1171 ]1172 }1173 },1174 "uniqueConstraints": {},1175 "policies": {},1176 "checkConstraints": {},1177 "isRLSEnabled": false1178 },1179 "public.opportunity_scores": {1180 "name": "opportunity_scores",1181 "schema": "",1182 "columns": {1183 "id": {1184 "name": "id",1185 "type": "uuid",1186 "primaryKey": true,1187 "notNull": true,1188 "default": "gen_random_uuid()"1189 },1190 "opportunity_id": {1191 "name": "opportunity_id",1192 "type": "uuid",1193 "primaryKey": false,1194 "notNull": true1195 },1196 "dimension": {1197 "name": "dimension",1198 "type": "text",1199 "primaryKey": false,1200 "notNull": true1201 },1202 "score": {1203 "name": "score",1204 "type": "real",1205 "primaryKey": false,1206 "notNull": true1207 },1208 "confidence": {1209 "name": "confidence",1210 "type": "real",1211 "primaryKey": false,1212 "notNull": true1213 },1214 "reasoning": {1215 "name": "reasoning",1216 "type": "text",1217 "primaryKey": false,1218 "notNull": true1219 },1220 "evidence_ids": {1221 "name": "evidence_ids",1222 "type": "jsonb",1223 "primaryKey": false,1224 "notNull": true1225 },1226 "created_at": {1227 "name": "created_at",1228 "type": "timestamp with time zone",1229 "primaryKey": false,1230 "notNull": true,1231 "default": "now()"1232 }1233 },1234 "indexes": {1235 "opportunity_scores_dim_idx": {1236 "name": "opportunity_scores_dim_idx",1237 "columns": [1238 {1239 "expression": "opportunity_id",1240 "isExpression": false,1241 "asc": true,1242 "nulls": "last"1243 },1244 {1245 "expression": "dimension",1246 "isExpression": false,1247 "asc": true,1248 "nulls": "last"1249 }1250 ],1251 "isUnique": true,1252 "concurrently": false,1253 "method": "btree",1254 "with": {}1255 }1256 },1257 "foreignKeys": {1258 "opportunity_scores_opportunity_id_opportunities_id_fk": {1259 "name": "opportunity_scores_opportunity_id_opportunities_id_fk",1260 "tableFrom": "opportunity_scores",1261 "tableTo": "opportunities",1262 "columnsFrom": [1263 "opportunity_id"1264 ],1265 "columnsTo": [1266 "id"1267 ],1268 "onDelete": "cascade",1269 "onUpdate": "no action"1270 }1271 },1272 "compositePrimaryKeys": {},1273 "uniqueConstraints": {},1274 "policies": {},1275 "checkConstraints": {},1276 "isRLSEnabled": false1277 },1278 "public.saved_opportunities": {1279 "name": "saved_opportunities",1280 "schema": "",1281 "columns": {1282 "user_id": {1283 "name": "user_id",1284 "type": "uuid",1285 "primaryKey": false,1286 "notNull": true1287 },1288 "opportunity_id": {1289 "name": "opportunity_id",1290 "type": "uuid",1291 "primaryKey": false,1292 "notNull": true1293 },1294 "created_at": {1295 "name": "created_at",1296 "type": "timestamp with time zone",1297 "primaryKey": false,1298 "notNull": true,1299 "default": "now()"1300 }1301 },1302 "indexes": {},1303 "foreignKeys": {1304 "saved_opportunities_user_id_users_id_fk": {1305 "name": "saved_opportunities_user_id_users_id_fk",1306 "tableFrom": "saved_opportunities",1307 "tableTo": "users",1308 "columnsFrom": [1309 "user_id"1310 ],1311 "columnsTo": [1312 "id"1313 ],1314 "onDelete": "cascade",1315 "onUpdate": "no action"1316 },1317 "saved_opportunities_opportunity_id_opportunities_id_fk": {1318 "name": "saved_opportunities_opportunity_id_opportunities_id_fk",1319 "tableFrom": "saved_opportunities",1320 "tableTo": "opportunities",1321 "columnsFrom": [1322 "opportunity_id"1323 ],1324 "columnsTo": [1325 "id"1326 ],1327 "onDelete": "cascade",1328 "onUpdate": "no action"1329 }1330 },1331 "compositePrimaryKeys": {1332 "saved_opportunities_user_id_opportunity_id_pk": {1333 "name": "saved_opportunities_user_id_opportunity_id_pk",1334 "columns": [1335 "user_id",1336 "opportunity_id"1337 ]1338 }1339 },1340 "uniqueConstraints": {},1341 "policies": {},1342 "checkConstraints": {},1343 "isRLSEnabled": false1344 },1345 "public.searches": {1346 "name": "searches",1347 "schema": "",1348 "columns": {1349 "id": {1350 "name": "id",1351 "type": "uuid",1352 "primaryKey": true,1353 "notNull": true,1354 "default": "gen_random_uuid()"1355 },1356 "investigation_id": {1357 "name": "investigation_id",1358 "type": "uuid",1359 "primaryKey": false,1360 "notNull": true1361 },1362 "query": {1363 "name": "query",1364 "type": "text",1365 "primaryKey": false,1366 "notNull": true1367 },1368 "intent": {1369 "name": "intent",1370 "type": "text",1371 "primaryKey": false,1372 "notNull": false1373 },1374 "provider": {1375 "name": "provider",1376 "type": "text",1377 "primaryKey": false,1378 "notNull": true,1379 "default": "'firecrawl'"1380 },1381 "result_count": {1382 "name": "result_count",1383 "type": "integer",1384 "primaryKey": false,1385 "notNull": true,1386 "default": 01387 },1388 "results": {1389 "name": "results",1390 "type": "jsonb",1391 "primaryKey": false,1392 "notNull": true1393 },1394 "created_at": {1395 "name": "created_at",1396 "type": "timestamp with time zone",1397 "primaryKey": false,1398 "notNull": true,1399 "default": "now()"1400 }1401 },1402 "indexes": {1403 "searches_investigation_idx": {1404 "name": "searches_investigation_idx",1405 "columns": [1406 {1407 "expression": "investigation_id",1408 "isExpression": false,1409 "asc": true,1410 "nulls": "last"1411 }1412 ],1413 "isUnique": false,1414 "concurrently": false,1415 "method": "btree",1416 "with": {}1417 }1418 },1419 "foreignKeys": {1420 "searches_investigation_id_investigations_id_fk": {1421 "name": "searches_investigation_id_investigations_id_fk",1422 "tableFrom": "searches",1423 "tableTo": "investigations",1424 "columnsFrom": [1425 "investigation_id"1426 ],1427 "columnsTo": [1428 "id"1429 ],1430 "onDelete": "cascade",1431 "onUpdate": "no action"1432 }1433 },1434 "compositePrimaryKeys": {},1435 "uniqueConstraints": {},1436 "policies": {},1437 "checkConstraints": {},1438 "isRLSEnabled": false1439 },1440 "public.source_contents": {1441 "name": "source_contents",1442 "schema": "",1443 "columns": {1444 "id": {1445 "name": "id",1446 "type": "uuid",1447 "primaryKey": true,1448 "notNull": true,1449 "default": "gen_random_uuid()"1450 },1451 "source_id": {1452 "name": "source_id",1453 "type": "uuid",1454 "primaryKey": false,1455 "notNull": true1456 },1457 "content_hash": {1458 "name": "content_hash",1459 "type": "text",1460 "primaryKey": false,1461 "notNull": true1462 },1463 "markdown": {1464 "name": "markdown",1465 "type": "text",1466 "primaryKey": false,1467 "notNull": true1468 },1469 "http_status": {1470 "name": "http_status",1471 "type": "integer",1472 "primaryKey": false,1473 "notNull": false1474 },1475 "word_count": {1476 "name": "word_count",1477 "type": "integer",1478 "primaryKey": false,1479 "notNull": true,1480 "default": 01481 },1482 "retrieved_at": {1483 "name": "retrieved_at",1484 "type": "timestamp with time zone",1485 "primaryKey": false,1486 "notNull": true,1487 "default": "now()"1488 }1489 },1490 "indexes": {1491 "source_contents_source_idx": {1492 "name": "source_contents_source_idx",1493 "columns": [1494 {1495 "expression": "source_id",1496 "isExpression": false,1497 "asc": true,1498 "nulls": "last"1499 },1500 {1501 "expression": "retrieved_at",1502 "isExpression": false,1503 "asc": true,1504 "nulls": "last"1505 }1506 ],1507 "isUnique": false,1508 "concurrently": false,1509 "method": "btree",1510 "with": {}1511 },1512 "source_contents_hash_idx": {1513 "name": "source_contents_hash_idx",1514 "columns": [1515 {1516 "expression": "content_hash",1517 "isExpression": false,1518 "asc": true,1519 "nulls": "last"1520 }1521 ],1522 "isUnique": false,1523 "concurrently": false,1524 "method": "btree",1525 "with": {}1526 }1527 },1528 "foreignKeys": {1529 "source_contents_source_id_sources_id_fk": {1530 "name": "source_contents_source_id_sources_id_fk",1531 "tableFrom": "source_contents",1532 "tableTo": "sources",1533 "columnsFrom": [1534 "source_id"1535 ],1536 "columnsTo": [1537 "id"1538 ],1539 "onDelete": "cascade",1540 "onUpdate": "no action"1541 }1542 },1543 "compositePrimaryKeys": {},1544 "uniqueConstraints": {},1545 "policies": {},1546 "checkConstraints": {},1547 "isRLSEnabled": false1548 },1549 "public.sources": {1550 "name": "sources",1551 "schema": "",1552 "columns": {1553 "id": {1554 "name": "id",1555 "type": "uuid",1556 "primaryKey": true,1557 "notNull": true,1558 "default": "gen_random_uuid()"1559 },1560 "url": {1561 "name": "url",1562 "type": "text",1563 "primaryKey": false,1564 "notNull": true1565 },1566 "canonical_url": {1567 "name": "canonical_url",1568 "type": "text",1569 "primaryKey": false,1570 "notNull": true1571 },1572 "domain": {1573 "name": "domain",1574 "type": "text",1575 "primaryKey": false,1576 "notNull": true1577 },1578 "title": {1579 "name": "title",1580 "type": "text",1581 "primaryKey": false,1582 "notNull": false1583 },1584 "description": {1585 "name": "description",1586 "type": "text",1587 "primaryKey": false,1588 "notNull": false1589 },1590 "first_seen_investigation_id": {1591 "name": "first_seen_investigation_id",1592 "type": "uuid",1593 "primaryKey": false,1594 "notNull": false1595 },1596 "created_at": {1597 "name": "created_at",1598 "type": "timestamp with time zone",1599 "primaryKey": false,1600 "notNull": true,1601 "default": "now()"1602 }1603 },1604 "indexes": {1605 "sources_canonical_idx": {1606 "name": "sources_canonical_idx",1607 "columns": [1608 {1609 "expression": "canonical_url",1610 "isExpression": false,1611 "asc": true,1612 "nulls": "last"1613 }1614 ],1615 "isUnique": true,1616 "concurrently": false,1617 "method": "btree",1618 "with": {}1619 },1620 "sources_domain_idx": {1621 "name": "sources_domain_idx",1622 "columns": [1623 {1624 "expression": "domain",1625 "isExpression": false,1626 "asc": true,1627 "nulls": "last"1628 }1629 ],1630 "isUnique": false,1631 "concurrently": false,1632 "method": "btree",1633 "with": {}1634 }1635 },1636 "foreignKeys": {1637 "sources_first_seen_investigation_id_investigations_id_fk": {1638 "name": "sources_first_seen_investigation_id_investigations_id_fk",1639 "tableFrom": "sources",1640 "tableTo": "investigations",1641 "columnsFrom": [1642 "first_seen_investigation_id"1643 ],1644 "columnsTo": [1645 "id"1646 ],1647 "onDelete": "no action",1648 "onUpdate": "no action"1649 }1650 },1651 "compositePrimaryKeys": {},1652 "uniqueConstraints": {},1653 "policies": {},1654 "checkConstraints": {},1655 "isRLSEnabled": false1656 },1657 "public.users": {1658 "name": "users",1659 "schema": "",1660 "columns": {1661 "id": {1662 "name": "id",1663 "type": "uuid",1664 "primaryKey": true,1665 "notNull": true,1666 "default": "gen_random_uuid()"1667 },1668 "email": {1669 "name": "email",1670 "type": "text",1671 "primaryKey": false,1672 "notNull": false1673 },1674 "name": {1675 "name": "name",1676 "type": "text",1677 "primaryKey": false,1678 "notNull": false1679 },1680 "created_at": {1681 "name": "created_at",1682 "type": "timestamp with time zone",1683 "primaryKey": false,1684 "notNull": true,1685 "default": "now()"1686 }1687 },1688 "indexes": {},1689 "foreignKeys": {},1690 "compositePrimaryKeys": {},1691 "uniqueConstraints": {1692 "users_email_unique": {1693 "name": "users_email_unique",1694 "nullsNotDistinct": false,1695 "columns": [1696 "email"1697 ]1698 }1699 },1700 "policies": {},1701 "checkConstraints": {},1702 "isRLSEnabled": false1703 }1704 },1705 "enums": {},1706 "schemas": {},1707 "sequences": {},1708 "roles": {},1709 "policies": {},1710 "views": {},1711 "_meta": {1712 "columns": {},1713 "schemas": {},1714 "tables": {}1715 }1716}