@panorama-ai/gateway 2.30.211 → 2.31.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +59 -63
  2. package/dist/cli-args.d.ts +0 -2
  3. package/dist/cli-args.d.ts.map +1 -1
  4. package/dist/cli-args.js +0 -8
  5. package/dist/cli-args.js.map +1 -1
  6. package/dist/cli-providers/types.d.ts +1 -1
  7. package/dist/cli-providers/types.d.ts.map +1 -1
  8. package/dist/database.types.d.ts +1974 -1024
  9. package/dist/database.types.d.ts.map +1 -1
  10. package/dist/database.types.js.map +1 -1
  11. package/dist/drive-sync/config.d.ts +14 -0
  12. package/dist/drive-sync/config.d.ts.map +1 -0
  13. package/dist/drive-sync/config.js +45 -0
  14. package/dist/drive-sync/config.js.map +1 -0
  15. package/dist/drive-sync/drive-sync-filesystem.d.ts +39 -0
  16. package/dist/drive-sync/drive-sync-filesystem.d.ts.map +1 -0
  17. package/dist/drive-sync/drive-sync-filesystem.js +434 -0
  18. package/dist/drive-sync/drive-sync-filesystem.js.map +1 -0
  19. package/dist/drive-sync/drive-sync-planner.d.ts +76 -0
  20. package/dist/drive-sync/drive-sync-planner.d.ts.map +1 -0
  21. package/dist/drive-sync/drive-sync-planner.js +363 -0
  22. package/dist/drive-sync/drive-sync-planner.js.map +1 -0
  23. package/dist/drive-sync/drive-sync-remote-planner.d.ts +52 -0
  24. package/dist/drive-sync/drive-sync-remote-planner.d.ts.map +1 -0
  25. package/dist/drive-sync/drive-sync-remote-planner.js +77 -0
  26. package/dist/drive-sync/drive-sync-remote-planner.js.map +1 -0
  27. package/dist/drive-sync/drive-sync-scheduler.d.ts +51 -0
  28. package/dist/drive-sync/drive-sync-scheduler.d.ts.map +1 -0
  29. package/dist/drive-sync/drive-sync-scheduler.js +304 -0
  30. package/dist/drive-sync/drive-sync-scheduler.js.map +1 -0
  31. package/dist/drive-sync/drive-sync-state-applier.d.ts +84 -0
  32. package/dist/drive-sync/drive-sync-state-applier.d.ts.map +1 -0
  33. package/dist/drive-sync/drive-sync-state-applier.js +153 -0
  34. package/dist/drive-sync/drive-sync-state-applier.js.map +1 -0
  35. package/dist/drive-sync/drive-sync-transfer.d.ts +86 -0
  36. package/dist/drive-sync/drive-sync-transfer.d.ts.map +1 -0
  37. package/dist/drive-sync/drive-sync-transfer.js +245 -0
  38. package/dist/drive-sync/drive-sync-transfer.js.map +1 -0
  39. package/dist/drive-sync/drive-sync.d.ts +433 -0
  40. package/dist/drive-sync/drive-sync.d.ts.map +1 -0
  41. package/dist/drive-sync/drive-sync.js +1677 -0
  42. package/dist/drive-sync/drive-sync.js.map +1 -0
  43. package/dist/{managed-runtime → drive-sync}/runtime-utils.d.ts +2 -2
  44. package/dist/drive-sync/runtime-utils.d.ts.map +1 -0
  45. package/dist/{managed-runtime → drive-sync}/runtime-utils.js +1 -1
  46. package/dist/drive-sync/runtime-utils.js.map +1 -0
  47. package/dist/finalize-subagent-run.d.ts +2 -1
  48. package/dist/finalize-subagent-run.d.ts.map +1 -1
  49. package/dist/finalize-subagent-run.js.map +1 -1
  50. package/dist/gateway-local-runtime.d.ts +7 -1
  51. package/dist/gateway-local-runtime.d.ts.map +1 -1
  52. package/dist/gateway-local-runtime.js +26 -5
  53. package/dist/gateway-local-runtime.js.map +1 -1
  54. package/dist/gateway-state.d.ts +4 -0
  55. package/dist/gateway-state.d.ts.map +1 -1
  56. package/dist/gateway-state.js +6 -2
  57. package/dist/gateway-state.js.map +1 -1
  58. package/dist/index.js +4102 -2409
  59. package/dist/index.js.map +4 -4
  60. package/dist/local-runtime/drive-sync-supervisor.d.ts +14 -0
  61. package/dist/local-runtime/drive-sync-supervisor.d.ts.map +1 -0
  62. package/dist/local-runtime/drive-sync-supervisor.js +79 -0
  63. package/dist/local-runtime/drive-sync-supervisor.js.map +1 -0
  64. package/dist/local-runtime/shutdown-supervisor.d.ts +1 -0
  65. package/dist/local-runtime/shutdown-supervisor.d.ts.map +1 -1
  66. package/dist/local-runtime/shutdown-supervisor.js +5 -2
  67. package/dist/local-runtime/shutdown-supervisor.js.map +1 -1
  68. package/dist/subagent-adapters/types.d.ts +1 -1
  69. package/dist/subagent-adapters/types.d.ts.map +1 -1
  70. package/dist/subagent-output-persistence.d.ts +1 -1
  71. package/dist/subagent-output-persistence.d.ts.map +1 -1
  72. package/dist/subagent-output-persistence.js +1 -1
  73. package/dist/subagent-output-persistence.js.map +1 -1
  74. package/package.json +6 -6
  75. package/dist/managed-runtime/config.d.ts +0 -20
  76. package/dist/managed-runtime/config.d.ts.map +0 -1
  77. package/dist/managed-runtime/config.js +0 -80
  78. package/dist/managed-runtime/config.js.map +0 -1
  79. package/dist/managed-runtime/control-client.d.ts +0 -66
  80. package/dist/managed-runtime/control-client.d.ts.map +0 -1
  81. package/dist/managed-runtime/control-client.js +0 -142
  82. package/dist/managed-runtime/control-client.js.map +0 -1
  83. package/dist/managed-runtime/dependencies.d.ts +0 -17
  84. package/dist/managed-runtime/dependencies.d.ts.map +0 -1
  85. package/dist/managed-runtime/dependencies.js +0 -28
  86. package/dist/managed-runtime/dependencies.js.map +0 -1
  87. package/dist/managed-runtime/execution-dispatcher.d.ts +0 -25
  88. package/dist/managed-runtime/execution-dispatcher.d.ts.map +0 -1
  89. package/dist/managed-runtime/execution-dispatcher.js +0 -155
  90. package/dist/managed-runtime/execution-dispatcher.js.map +0 -1
  91. package/dist/managed-runtime/heartbeat.d.ts +0 -7
  92. package/dist/managed-runtime/heartbeat.d.ts.map +0 -1
  93. package/dist/managed-runtime/heartbeat.js +0 -44
  94. package/dist/managed-runtime/heartbeat.js.map +0 -1
  95. package/dist/managed-runtime/host-state.d.ts +0 -15
  96. package/dist/managed-runtime/host-state.d.ts.map +0 -1
  97. package/dist/managed-runtime/host-state.js +0 -50
  98. package/dist/managed-runtime/host-state.js.map +0 -1
  99. package/dist/managed-runtime/realtime.d.ts +0 -25
  100. package/dist/managed-runtime/realtime.d.ts.map +0 -1
  101. package/dist/managed-runtime/realtime.js +0 -189
  102. package/dist/managed-runtime/realtime.js.map +0 -1
  103. package/dist/managed-runtime/runtime-utils.d.ts.map +0 -1
  104. package/dist/managed-runtime/runtime-utils.js.map +0 -1
  105. package/dist/managed-runtime/shell-execution.d.ts +0 -33
  106. package/dist/managed-runtime/shell-execution.d.ts.map +0 -1
  107. package/dist/managed-runtime/shell-execution.js +0 -186
  108. package/dist/managed-runtime/shell-execution.js.map +0 -1
  109. package/dist/managed-runtime/step-result.d.ts +0 -22
  110. package/dist/managed-runtime/step-result.d.ts.map +0 -1
  111. package/dist/managed-runtime/step-result.js +0 -252
  112. package/dist/managed-runtime/step-result.js.map +0 -1
  113. package/dist/managed-runtime/wake-signal.d.ts +0 -5
  114. package/dist/managed-runtime/wake-signal.d.ts.map +0 -1
  115. package/dist/managed-runtime/wake-signal.js +0 -29
  116. package/dist/managed-runtime/wake-signal.js.map +0 -1
  117. package/dist/managed-runtime.d.ts +0 -8
  118. package/dist/managed-runtime.d.ts.map +0 -1
  119. package/dist/managed-runtime.js +0 -224
  120. package/dist/managed-runtime.js.map +0 -1
@@ -529,7 +529,6 @@ export type Database = {
529
529
  id: string;
530
530
  job_id: string;
531
531
  metadata: Json;
532
- runtime: string;
533
532
  started_at: string;
534
533
  status: string;
535
534
  summary_long: string | null;
@@ -546,7 +545,6 @@ export type Database = {
546
545
  id?: string;
547
546
  job_id: string;
548
547
  metadata?: Json;
549
- runtime?: string;
550
548
  started_at?: string;
551
549
  status?: string;
552
550
  summary_long?: string | null;
@@ -563,7 +561,6 @@ export type Database = {
563
561
  id?: string;
564
562
  job_id?: string;
565
563
  metadata?: Json;
566
- runtime?: string;
567
564
  started_at?: string;
568
565
  status?: string;
569
566
  summary_long?: string | null;
@@ -815,13 +812,19 @@ export type Database = {
815
812
  Row: {
816
813
  created_at: string;
817
814
  created_by: string | null;
815
+ creation_mode: string;
818
816
  description: string | null;
819
817
  enabled_tools: string[];
820
818
  id: string;
821
819
  instructions: string | null;
822
820
  name: string;
823
821
  objective: string | null;
822
+ rationalization_error: string | null;
823
+ rationalization_metadata: Json;
824
+ rationalization_status: string;
825
+ rationalized_at: string | null;
824
826
  settings: Json;
827
+ source_agent_id: string | null;
825
828
  subscriptions: Json;
826
829
  team_id: string;
827
830
  updated_at: string;
@@ -829,13 +832,19 @@ export type Database = {
829
832
  Insert: {
830
833
  created_at?: string;
831
834
  created_by?: string | null;
835
+ creation_mode?: string;
832
836
  description?: string | null;
833
837
  enabled_tools?: string[];
834
838
  id?: string;
835
839
  instructions?: string | null;
836
840
  name: string;
837
841
  objective?: string | null;
842
+ rationalization_error?: string | null;
843
+ rationalization_metadata?: Json;
844
+ rationalization_status?: string;
845
+ rationalized_at?: string | null;
838
846
  settings?: Json;
847
+ source_agent_id?: string | null;
839
848
  subscriptions?: Json;
840
849
  team_id: string;
841
850
  updated_at?: string;
@@ -843,18 +852,38 @@ export type Database = {
843
852
  Update: {
844
853
  created_at?: string;
845
854
  created_by?: string | null;
855
+ creation_mode?: string;
846
856
  description?: string | null;
847
857
  enabled_tools?: string[];
848
858
  id?: string;
849
859
  instructions?: string | null;
850
860
  name?: string;
851
861
  objective?: string | null;
862
+ rationalization_error?: string | null;
863
+ rationalization_metadata?: Json;
864
+ rationalization_status?: string;
865
+ rationalized_at?: string | null;
852
866
  settings?: Json;
867
+ source_agent_id?: string | null;
853
868
  subscriptions?: Json;
854
869
  team_id?: string;
855
870
  updated_at?: string;
856
871
  };
857
872
  Relationships: [
873
+ {
874
+ foreignKeyName: "agent_templates_source_agent_id_fkey";
875
+ columns: ["source_agent_id"];
876
+ isOneToOne: false;
877
+ referencedRelation: "agent_full";
878
+ referencedColumns: ["id"];
879
+ },
880
+ {
881
+ foreignKeyName: "agent_templates_source_agent_id_fkey";
882
+ columns: ["source_agent_id"];
883
+ isOneToOne: false;
884
+ referencedRelation: "agents";
885
+ referencedColumns: ["id"];
886
+ },
858
887
  {
859
888
  foreignKeyName: "agent_templates_team_id_fkey";
860
889
  columns: ["team_id"];
@@ -997,7 +1026,6 @@ export type Database = {
997
1026
  };
998
1027
  agents: {
999
1028
  Row: {
1000
- agent_runtime: string;
1001
1029
  agent_state: string;
1002
1030
  created_at: string;
1003
1031
  created_by: string;
@@ -1020,7 +1048,6 @@ export type Database = {
1020
1048
  wake_generation: number;
1021
1049
  };
1022
1050
  Insert: {
1023
- agent_runtime?: string;
1024
1051
  agent_state?: string;
1025
1052
  created_at?: string;
1026
1053
  created_by: string;
@@ -1043,7 +1070,6 @@ export type Database = {
1043
1070
  wake_generation?: number;
1044
1071
  };
1045
1072
  Update: {
1046
- agent_runtime?: string;
1047
1073
  agent_state?: string;
1048
1074
  created_at?: string;
1049
1075
  created_by?: string;
@@ -1647,11 +1673,218 @@ export type Database = {
1647
1673
  }
1648
1674
  ];
1649
1675
  };
1676
+ drive_change_batch_paths: {
1677
+ Row: {
1678
+ batch_id: string;
1679
+ change_type: string | null;
1680
+ created_at: string;
1681
+ drive_id: string;
1682
+ entry_type: string | null;
1683
+ from_path: string | null;
1684
+ id: string;
1685
+ path: string;
1686
+ scope: string;
1687
+ to_path: string | null;
1688
+ version_id: string | null;
1689
+ };
1690
+ Insert: {
1691
+ batch_id: string;
1692
+ change_type?: string | null;
1693
+ created_at?: string;
1694
+ drive_id: string;
1695
+ entry_type?: string | null;
1696
+ from_path?: string | null;
1697
+ id?: string;
1698
+ path: string;
1699
+ scope?: string;
1700
+ to_path?: string | null;
1701
+ version_id?: string | null;
1702
+ };
1703
+ Update: {
1704
+ batch_id?: string;
1705
+ change_type?: string | null;
1706
+ created_at?: string;
1707
+ drive_id?: string;
1708
+ entry_type?: string | null;
1709
+ from_path?: string | null;
1710
+ id?: string;
1711
+ path?: string;
1712
+ scope?: string;
1713
+ to_path?: string | null;
1714
+ version_id?: string | null;
1715
+ };
1716
+ Relationships: [
1717
+ {
1718
+ foreignKeyName: "drive_change_batch_paths_batch_id_fkey";
1719
+ columns: ["batch_id"];
1720
+ isOneToOne: false;
1721
+ referencedRelation: "drive_change_batches";
1722
+ referencedColumns: ["id"];
1723
+ },
1724
+ {
1725
+ foreignKeyName: "drive_change_batch_paths_drive_id_fkey";
1726
+ columns: ["drive_id"];
1727
+ isOneToOne: false;
1728
+ referencedRelation: "team_resources";
1729
+ referencedColumns: ["id"];
1730
+ },
1731
+ {
1732
+ foreignKeyName: "drive_change_batch_paths_version_id_fkey";
1733
+ columns: ["version_id"];
1734
+ isOneToOne: false;
1735
+ referencedRelation: "drive_entry_versions";
1736
+ referencedColumns: ["id"];
1737
+ }
1738
+ ];
1739
+ };
1740
+ drive_change_batches: {
1741
+ Row: {
1742
+ actor_agent_id: string | null;
1743
+ completed_at: string;
1744
+ confidence: string;
1745
+ counters: Json;
1746
+ created_at: string;
1747
+ drive_id: string;
1748
+ id: string;
1749
+ observation_metadata: Json;
1750
+ sequence: number;
1751
+ source_operation: string;
1752
+ source_operation_id: string;
1753
+ source_type: string;
1754
+ subscription_notified_at: string | null;
1755
+ summary: string;
1756
+ };
1757
+ Insert: {
1758
+ actor_agent_id?: string | null;
1759
+ completed_at?: string;
1760
+ confidence?: string;
1761
+ counters?: Json;
1762
+ created_at?: string;
1763
+ drive_id: string;
1764
+ id?: string;
1765
+ observation_metadata?: Json;
1766
+ sequence?: number;
1767
+ source_operation: string;
1768
+ source_operation_id: string;
1769
+ source_type: string;
1770
+ subscription_notified_at?: string | null;
1771
+ summary: string;
1772
+ };
1773
+ Update: {
1774
+ actor_agent_id?: string | null;
1775
+ completed_at?: string;
1776
+ confidence?: string;
1777
+ counters?: Json;
1778
+ created_at?: string;
1779
+ drive_id?: string;
1780
+ id?: string;
1781
+ observation_metadata?: Json;
1782
+ sequence?: number;
1783
+ source_operation?: string;
1784
+ source_operation_id?: string;
1785
+ source_type?: string;
1786
+ subscription_notified_at?: string | null;
1787
+ summary?: string;
1788
+ };
1789
+ Relationships: [
1790
+ {
1791
+ foreignKeyName: "drive_change_batches_drive_id_fkey";
1792
+ columns: ["drive_id"];
1793
+ isOneToOne: false;
1794
+ referencedRelation: "team_resources";
1795
+ referencedColumns: ["id"];
1796
+ }
1797
+ ];
1798
+ };
1799
+ drive_conflicts: {
1800
+ Row: {
1801
+ base_version_id: string | null;
1802
+ candidate_version_id: string | null;
1803
+ created_at: string;
1804
+ current_version_id: string | null;
1805
+ details: Json;
1806
+ drive_id: string;
1807
+ entry_id: string | null;
1808
+ id: string;
1809
+ path: string;
1810
+ source_operation_id: string | null;
1811
+ source_type: string;
1812
+ status: string;
1813
+ updated_at: string;
1814
+ };
1815
+ Insert: {
1816
+ base_version_id?: string | null;
1817
+ candidate_version_id?: string | null;
1818
+ created_at?: string;
1819
+ current_version_id?: string | null;
1820
+ details?: Json;
1821
+ drive_id: string;
1822
+ entry_id?: string | null;
1823
+ id?: string;
1824
+ path: string;
1825
+ source_operation_id?: string | null;
1826
+ source_type?: string;
1827
+ status?: string;
1828
+ updated_at?: string;
1829
+ };
1830
+ Update: {
1831
+ base_version_id?: string | null;
1832
+ candidate_version_id?: string | null;
1833
+ created_at?: string;
1834
+ current_version_id?: string | null;
1835
+ details?: Json;
1836
+ drive_id?: string;
1837
+ entry_id?: string | null;
1838
+ id?: string;
1839
+ path?: string;
1840
+ source_operation_id?: string | null;
1841
+ source_type?: string;
1842
+ status?: string;
1843
+ updated_at?: string;
1844
+ };
1845
+ Relationships: [
1846
+ {
1847
+ foreignKeyName: "drive_conflicts_base_version_id_fkey";
1848
+ columns: ["base_version_id"];
1849
+ isOneToOne: false;
1850
+ referencedRelation: "drive_entry_versions";
1851
+ referencedColumns: ["id"];
1852
+ },
1853
+ {
1854
+ foreignKeyName: "drive_conflicts_candidate_version_id_fkey";
1855
+ columns: ["candidate_version_id"];
1856
+ isOneToOne: false;
1857
+ referencedRelation: "drive_entry_versions";
1858
+ referencedColumns: ["id"];
1859
+ },
1860
+ {
1861
+ foreignKeyName: "drive_conflicts_current_version_id_fkey";
1862
+ columns: ["current_version_id"];
1863
+ isOneToOne: false;
1864
+ referencedRelation: "drive_entry_versions";
1865
+ referencedColumns: ["id"];
1866
+ },
1867
+ {
1868
+ foreignKeyName: "drive_conflicts_drive_id_fkey";
1869
+ columns: ["drive_id"];
1870
+ isOneToOne: false;
1871
+ referencedRelation: "team_resources";
1872
+ referencedColumns: ["id"];
1873
+ },
1874
+ {
1875
+ foreignKeyName: "drive_conflicts_entry_id_fkey";
1876
+ columns: ["entry_id"];
1877
+ isOneToOne: false;
1878
+ referencedRelation: "drive_entries";
1879
+ referencedColumns: ["id"];
1880
+ }
1881
+ ];
1882
+ };
1650
1883
  drive_entries: {
1651
1884
  Row: {
1652
- content: string | null;
1653
1885
  content_sha256: string | null;
1654
1886
  created_at: string;
1887
+ current_version_id: string | null;
1655
1888
  drive_id: string;
1656
1889
  entry_type: string;
1657
1890
  id: string;
@@ -1664,9 +1897,9 @@ export type Database = {
1664
1897
  updated_at: string;
1665
1898
  };
1666
1899
  Insert: {
1667
- content?: string | null;
1668
1900
  content_sha256?: string | null;
1669
1901
  created_at?: string;
1902
+ current_version_id?: string | null;
1670
1903
  drive_id: string;
1671
1904
  entry_type: string;
1672
1905
  id?: string;
@@ -1679,9 +1912,9 @@ export type Database = {
1679
1912
  updated_at?: string;
1680
1913
  };
1681
1914
  Update: {
1682
- content?: string | null;
1683
1915
  content_sha256?: string | null;
1684
1916
  created_at?: string;
1917
+ current_version_id?: string | null;
1685
1918
  drive_id?: string;
1686
1919
  entry_type?: string;
1687
1920
  id?: string;
@@ -1694,6 +1927,13 @@ export type Database = {
1694
1927
  updated_at?: string;
1695
1928
  };
1696
1929
  Relationships: [
1930
+ {
1931
+ foreignKeyName: "drive_entries_current_version_id_fkey";
1932
+ columns: ["current_version_id"];
1933
+ isOneToOne: false;
1934
+ referencedRelation: "drive_entry_versions";
1935
+ referencedColumns: ["id"];
1936
+ },
1697
1937
  {
1698
1938
  foreignKeyName: "drive_entries_drive_id_fkey";
1699
1939
  columns: ["drive_id"];
@@ -1703,111 +1943,522 @@ export type Database = {
1703
1943
  }
1704
1944
  ];
1705
1945
  };
1706
- external_connections: {
1946
+ drive_entry_versions: {
1707
1947
  Row: {
1708
- agent_id: string | null;
1709
- consecutive_failures: number | null;
1948
+ content: string | null;
1949
+ content_sha256: string;
1710
1950
  created_at: string;
1711
1951
  created_by: string | null;
1712
- credentials: Json | null;
1952
+ drive_id: string;
1953
+ entry_id: string | null;
1713
1954
  id: string;
1714
- last_error: string | null;
1715
- last_sync_at: string | null;
1716
- last_token_refresh_at: string | null;
1717
- provider: string;
1718
- provider_id: string | null;
1719
- status: string;
1720
- status_changed_at: string | null;
1721
- status_reason: string | null;
1722
- team_id: string;
1723
- token_expires_at: string | null;
1724
- updated_at: string;
1725
- webhook_config: Json | null;
1955
+ metadata: Json;
1956
+ mime_type: string | null;
1957
+ path: string;
1958
+ size_bytes: number;
1959
+ source_operation: string;
1960
+ source_operation_id: string | null;
1961
+ source_type: string;
1962
+ storage_backend: string;
1963
+ storage_key: string | null;
1726
1964
  };
1727
1965
  Insert: {
1728
- agent_id?: string | null;
1729
- consecutive_failures?: number | null;
1966
+ content?: string | null;
1967
+ content_sha256: string;
1730
1968
  created_at?: string;
1731
1969
  created_by?: string | null;
1732
- credentials?: Json | null;
1970
+ drive_id: string;
1971
+ entry_id?: string | null;
1733
1972
  id?: string;
1734
- last_error?: string | null;
1735
- last_sync_at?: string | null;
1736
- last_token_refresh_at?: string | null;
1737
- provider: string;
1738
- provider_id?: string | null;
1739
- status?: string;
1740
- status_changed_at?: string | null;
1741
- status_reason?: string | null;
1742
- team_id: string;
1743
- token_expires_at?: string | null;
1744
- updated_at?: string;
1745
- webhook_config?: Json | null;
1973
+ metadata?: Json;
1974
+ mime_type?: string | null;
1975
+ path: string;
1976
+ size_bytes?: number;
1977
+ source_operation?: string;
1978
+ source_operation_id?: string | null;
1979
+ source_type?: string;
1980
+ storage_backend?: string;
1981
+ storage_key?: string | null;
1746
1982
  };
1747
1983
  Update: {
1748
- agent_id?: string | null;
1749
- consecutive_failures?: number | null;
1984
+ content?: string | null;
1985
+ content_sha256?: string;
1750
1986
  created_at?: string;
1751
1987
  created_by?: string | null;
1752
- credentials?: Json | null;
1988
+ drive_id?: string;
1989
+ entry_id?: string | null;
1753
1990
  id?: string;
1754
- last_error?: string | null;
1755
- last_sync_at?: string | null;
1756
- last_token_refresh_at?: string | null;
1757
- provider?: string;
1758
- provider_id?: string | null;
1759
- status?: string;
1760
- status_changed_at?: string | null;
1761
- status_reason?: string | null;
1762
- team_id?: string;
1763
- token_expires_at?: string | null;
1764
- updated_at?: string;
1765
- webhook_config?: Json | null;
1991
+ metadata?: Json;
1992
+ mime_type?: string | null;
1993
+ path?: string;
1994
+ size_bytes?: number;
1995
+ source_operation?: string;
1996
+ source_operation_id?: string | null;
1997
+ source_type?: string;
1998
+ storage_backend?: string;
1999
+ storage_key?: string | null;
1766
2000
  };
1767
2001
  Relationships: [
1768
2002
  {
1769
- foreignKeyName: "external_connections_agent_id_fkey";
1770
- columns: ["agent_id"];
1771
- isOneToOne: false;
1772
- referencedRelation: "agent_full";
1773
- referencedColumns: ["id"];
1774
- },
1775
- {
1776
- foreignKeyName: "external_connections_agent_id_fkey";
1777
- columns: ["agent_id"];
2003
+ foreignKeyName: "drive_entry_versions_drive_id_fkey";
2004
+ columns: ["drive_id"];
1778
2005
  isOneToOne: false;
1779
- referencedRelation: "agents";
2006
+ referencedRelation: "team_resources";
1780
2007
  referencedColumns: ["id"];
1781
2008
  },
1782
2009
  {
1783
- foreignKeyName: "external_connections_team_id_fkey";
1784
- columns: ["team_id"];
2010
+ foreignKeyName: "drive_entry_versions_entry_id_fkey";
2011
+ columns: ["entry_id"];
1785
2012
  isOneToOne: false;
1786
- referencedRelation: "teams";
2013
+ referencedRelation: "drive_entries";
1787
2014
  referencedColumns: ["id"];
1788
2015
  }
1789
2016
  ];
1790
2017
  };
1791
- external_connections_public: {
2018
+ drive_object_cleanup_queue: {
1792
2019
  Row: {
1793
- agent_id: string | null;
2020
+ attempt_count: number;
1794
2021
  created_at: string;
1795
- created_by: string | null;
2022
+ drive_id: string | null;
1796
2023
  id: string;
2024
+ last_attempt_at: string | null;
1797
2025
  last_error: string | null;
1798
- last_sync_at: string | null;
1799
- provider: string;
1800
- provider_id: string | null;
2026
+ next_attempt_at: string;
2027
+ reason: string;
1801
2028
  status: string;
1802
- status_changed_at: string | null;
1803
- status_reason: string | null;
1804
- team_id: string;
2029
+ storage_key: string;
1805
2030
  updated_at: string;
1806
2031
  };
1807
2032
  Insert: {
1808
- agent_id?: string | null;
1809
- created_at: string;
1810
- created_by?: string | null;
2033
+ attempt_count?: number;
2034
+ created_at?: string;
2035
+ drive_id?: string | null;
2036
+ id?: string;
2037
+ last_attempt_at?: string | null;
2038
+ last_error?: string | null;
2039
+ next_attempt_at?: string;
2040
+ reason?: string;
2041
+ status?: string;
2042
+ storage_key: string;
2043
+ updated_at?: string;
2044
+ };
2045
+ Update: {
2046
+ attempt_count?: number;
2047
+ created_at?: string;
2048
+ drive_id?: string | null;
2049
+ id?: string;
2050
+ last_attempt_at?: string | null;
2051
+ last_error?: string | null;
2052
+ next_attempt_at?: string;
2053
+ reason?: string;
2054
+ status?: string;
2055
+ storage_key?: string;
2056
+ updated_at?: string;
2057
+ };
2058
+ Relationships: [];
2059
+ };
2060
+ drive_sync_clients: {
2061
+ Row: {
2062
+ agent_id: string | null;
2063
+ client_key: string;
2064
+ created_at: string;
2065
+ display_name: string | null;
2066
+ host_id: string | null;
2067
+ id: string;
2068
+ metadata: Json;
2069
+ status: string;
2070
+ team_id: string;
2071
+ updated_at: string;
2072
+ vm_id: string | null;
2073
+ };
2074
+ Insert: {
2075
+ agent_id?: string | null;
2076
+ client_key: string;
2077
+ created_at?: string;
2078
+ display_name?: string | null;
2079
+ host_id?: string | null;
2080
+ id?: string;
2081
+ metadata?: Json;
2082
+ status?: string;
2083
+ team_id: string;
2084
+ updated_at?: string;
2085
+ vm_id?: string | null;
2086
+ };
2087
+ Update: {
2088
+ agent_id?: string | null;
2089
+ client_key?: string;
2090
+ created_at?: string;
2091
+ display_name?: string | null;
2092
+ host_id?: string | null;
2093
+ id?: string;
2094
+ metadata?: Json;
2095
+ status?: string;
2096
+ team_id?: string;
2097
+ updated_at?: string;
2098
+ vm_id?: string | null;
2099
+ };
2100
+ Relationships: [
2101
+ {
2102
+ foreignKeyName: "drive_sync_clients_agent_id_fkey";
2103
+ columns: ["agent_id"];
2104
+ isOneToOne: false;
2105
+ referencedRelation: "agent_full";
2106
+ referencedColumns: ["id"];
2107
+ },
2108
+ {
2109
+ foreignKeyName: "drive_sync_clients_agent_id_fkey";
2110
+ columns: ["agent_id"];
2111
+ isOneToOne: false;
2112
+ referencedRelation: "agents";
2113
+ referencedColumns: ["id"];
2114
+ },
2115
+ {
2116
+ foreignKeyName: "drive_sync_clients_team_id_fkey";
2117
+ columns: ["team_id"];
2118
+ isOneToOne: false;
2119
+ referencedRelation: "teams";
2120
+ referencedColumns: ["id"];
2121
+ },
2122
+ {
2123
+ foreignKeyName: "drive_sync_clients_vm_id_fkey";
2124
+ columns: ["vm_id"];
2125
+ isOneToOne: false;
2126
+ referencedRelation: "team_resources";
2127
+ referencedColumns: ["id"];
2128
+ }
2129
+ ];
2130
+ };
2131
+ drive_sync_cursors: {
2132
+ Row: {
2133
+ created_at: string;
2134
+ drive_id: string;
2135
+ id: string;
2136
+ last_batch_sequence: number;
2137
+ last_error: string | null;
2138
+ last_success_at: string | null;
2139
+ metadata: Json;
2140
+ status: string;
2141
+ sync_client_id: string;
2142
+ updated_at: string;
2143
+ };
2144
+ Insert: {
2145
+ created_at?: string;
2146
+ drive_id: string;
2147
+ id?: string;
2148
+ last_batch_sequence?: number;
2149
+ last_error?: string | null;
2150
+ last_success_at?: string | null;
2151
+ metadata?: Json;
2152
+ status?: string;
2153
+ sync_client_id: string;
2154
+ updated_at?: string;
2155
+ };
2156
+ Update: {
2157
+ created_at?: string;
2158
+ drive_id?: string;
2159
+ id?: string;
2160
+ last_batch_sequence?: number;
2161
+ last_error?: string | null;
2162
+ last_success_at?: string | null;
2163
+ metadata?: Json;
2164
+ status?: string;
2165
+ sync_client_id?: string;
2166
+ updated_at?: string;
2167
+ };
2168
+ Relationships: [
2169
+ {
2170
+ foreignKeyName: "drive_sync_cursors_drive_id_fkey";
2171
+ columns: ["drive_id"];
2172
+ isOneToOne: false;
2173
+ referencedRelation: "team_resources";
2174
+ referencedColumns: ["id"];
2175
+ },
2176
+ {
2177
+ foreignKeyName: "drive_sync_cursors_sync_client_id_fkey";
2178
+ columns: ["sync_client_id"];
2179
+ isOneToOne: false;
2180
+ referencedRelation: "drive_sync_clients";
2181
+ referencedColumns: ["id"];
2182
+ }
2183
+ ];
2184
+ };
2185
+ drive_sync_status_reports: {
2186
+ Row: {
2187
+ created_at: string;
2188
+ drive_id: string;
2189
+ id: string;
2190
+ last_applied_batch_count: number;
2191
+ last_applied_path_count: number;
2192
+ last_batch_sequence: number | null;
2193
+ last_deferred_file_count: number;
2194
+ last_error: string | null;
2195
+ last_reason: string | null;
2196
+ last_remote_conflict_count: number;
2197
+ last_success_at: string | null;
2198
+ last_sync_at: string;
2199
+ last_uploaded_applied_count: number;
2200
+ last_uploaded_batch_count: number;
2201
+ last_uploaded_change_count: number;
2202
+ last_uploaded_conflict_count: number;
2203
+ last_uploaded_rejected_count: number;
2204
+ last_uploaded_unsupported_count: number;
2205
+ metadata: Json;
2206
+ status: string;
2207
+ sync_client_id: string;
2208
+ updated_at: string;
2209
+ };
2210
+ Insert: {
2211
+ created_at?: string;
2212
+ drive_id: string;
2213
+ id?: string;
2214
+ last_applied_batch_count?: number;
2215
+ last_applied_path_count?: number;
2216
+ last_batch_sequence?: number | null;
2217
+ last_deferred_file_count?: number;
2218
+ last_error?: string | null;
2219
+ last_reason?: string | null;
2220
+ last_remote_conflict_count?: number;
2221
+ last_success_at?: string | null;
2222
+ last_sync_at?: string;
2223
+ last_uploaded_applied_count?: number;
2224
+ last_uploaded_batch_count?: number;
2225
+ last_uploaded_change_count?: number;
2226
+ last_uploaded_conflict_count?: number;
2227
+ last_uploaded_rejected_count?: number;
2228
+ last_uploaded_unsupported_count?: number;
2229
+ metadata?: Json;
2230
+ status?: string;
2231
+ sync_client_id: string;
2232
+ updated_at?: string;
2233
+ };
2234
+ Update: {
2235
+ created_at?: string;
2236
+ drive_id?: string;
2237
+ id?: string;
2238
+ last_applied_batch_count?: number;
2239
+ last_applied_path_count?: number;
2240
+ last_batch_sequence?: number | null;
2241
+ last_deferred_file_count?: number;
2242
+ last_error?: string | null;
2243
+ last_reason?: string | null;
2244
+ last_remote_conflict_count?: number;
2245
+ last_success_at?: string | null;
2246
+ last_sync_at?: string;
2247
+ last_uploaded_applied_count?: number;
2248
+ last_uploaded_batch_count?: number;
2249
+ last_uploaded_change_count?: number;
2250
+ last_uploaded_conflict_count?: number;
2251
+ last_uploaded_rejected_count?: number;
2252
+ last_uploaded_unsupported_count?: number;
2253
+ metadata?: Json;
2254
+ status?: string;
2255
+ sync_client_id?: string;
2256
+ updated_at?: string;
2257
+ };
2258
+ Relationships: [
2259
+ {
2260
+ foreignKeyName: "drive_sync_status_reports_drive_id_fkey";
2261
+ columns: ["drive_id"];
2262
+ isOneToOne: false;
2263
+ referencedRelation: "team_resources";
2264
+ referencedColumns: ["id"];
2265
+ },
2266
+ {
2267
+ foreignKeyName: "drive_sync_status_reports_sync_client_id_fkey";
2268
+ columns: ["sync_client_id"];
2269
+ isOneToOne: false;
2270
+ referencedRelation: "drive_sync_clients";
2271
+ referencedColumns: ["id"];
2272
+ }
2273
+ ];
2274
+ };
2275
+ drive_uploads: {
2276
+ Row: {
2277
+ committed_version_id: string | null;
2278
+ content_sha256: string | null;
2279
+ created_at: string;
2280
+ drive_id: string;
2281
+ entry_id: string | null;
2282
+ expires_at: string;
2283
+ id: string;
2284
+ metadata: Json;
2285
+ mime_type: string | null;
2286
+ path: string;
2287
+ size_bytes: number | null;
2288
+ source_operation_id: string | null;
2289
+ source_type: string;
2290
+ status: string;
2291
+ storage_backend: string;
2292
+ storage_key: string | null;
2293
+ updated_at: string;
2294
+ };
2295
+ Insert: {
2296
+ committed_version_id?: string | null;
2297
+ content_sha256?: string | null;
2298
+ created_at?: string;
2299
+ drive_id: string;
2300
+ entry_id?: string | null;
2301
+ expires_at?: string;
2302
+ id?: string;
2303
+ metadata?: Json;
2304
+ mime_type?: string | null;
2305
+ path: string;
2306
+ size_bytes?: number | null;
2307
+ source_operation_id?: string | null;
2308
+ source_type?: string;
2309
+ status?: string;
2310
+ storage_backend?: string;
2311
+ storage_key?: string | null;
2312
+ updated_at?: string;
2313
+ };
2314
+ Update: {
2315
+ committed_version_id?: string | null;
2316
+ content_sha256?: string | null;
2317
+ created_at?: string;
2318
+ drive_id?: string;
2319
+ entry_id?: string | null;
2320
+ expires_at?: string;
2321
+ id?: string;
2322
+ metadata?: Json;
2323
+ mime_type?: string | null;
2324
+ path?: string;
2325
+ size_bytes?: number | null;
2326
+ source_operation_id?: string | null;
2327
+ source_type?: string;
2328
+ status?: string;
2329
+ storage_backend?: string;
2330
+ storage_key?: string | null;
2331
+ updated_at?: string;
2332
+ };
2333
+ Relationships: [
2334
+ {
2335
+ foreignKeyName: "drive_uploads_committed_version_id_fkey";
2336
+ columns: ["committed_version_id"];
2337
+ isOneToOne: false;
2338
+ referencedRelation: "drive_entry_versions";
2339
+ referencedColumns: ["id"];
2340
+ },
2341
+ {
2342
+ foreignKeyName: "drive_uploads_drive_id_fkey";
2343
+ columns: ["drive_id"];
2344
+ isOneToOne: false;
2345
+ referencedRelation: "team_resources";
2346
+ referencedColumns: ["id"];
2347
+ },
2348
+ {
2349
+ foreignKeyName: "drive_uploads_entry_id_fkey";
2350
+ columns: ["entry_id"];
2351
+ isOneToOne: false;
2352
+ referencedRelation: "drive_entries";
2353
+ referencedColumns: ["id"];
2354
+ }
2355
+ ];
2356
+ };
2357
+ external_connections: {
2358
+ Row: {
2359
+ agent_id: string | null;
2360
+ consecutive_failures: number | null;
2361
+ created_at: string;
2362
+ created_by: string | null;
2363
+ credentials: Json | null;
2364
+ id: string;
2365
+ last_error: string | null;
2366
+ last_sync_at: string | null;
2367
+ last_token_refresh_at: string | null;
2368
+ provider: string;
2369
+ provider_id: string | null;
2370
+ status: string;
2371
+ status_changed_at: string | null;
2372
+ status_reason: string | null;
2373
+ team_id: string;
2374
+ token_expires_at: string | null;
2375
+ updated_at: string;
2376
+ webhook_config: Json | null;
2377
+ };
2378
+ Insert: {
2379
+ agent_id?: string | null;
2380
+ consecutive_failures?: number | null;
2381
+ created_at?: string;
2382
+ created_by?: string | null;
2383
+ credentials?: Json | null;
2384
+ id?: string;
2385
+ last_error?: string | null;
2386
+ last_sync_at?: string | null;
2387
+ last_token_refresh_at?: string | null;
2388
+ provider: string;
2389
+ provider_id?: string | null;
2390
+ status?: string;
2391
+ status_changed_at?: string | null;
2392
+ status_reason?: string | null;
2393
+ team_id: string;
2394
+ token_expires_at?: string | null;
2395
+ updated_at?: string;
2396
+ webhook_config?: Json | null;
2397
+ };
2398
+ Update: {
2399
+ agent_id?: string | null;
2400
+ consecutive_failures?: number | null;
2401
+ created_at?: string;
2402
+ created_by?: string | null;
2403
+ credentials?: Json | null;
2404
+ id?: string;
2405
+ last_error?: string | null;
2406
+ last_sync_at?: string | null;
2407
+ last_token_refresh_at?: string | null;
2408
+ provider?: string;
2409
+ provider_id?: string | null;
2410
+ status?: string;
2411
+ status_changed_at?: string | null;
2412
+ status_reason?: string | null;
2413
+ team_id?: string;
2414
+ token_expires_at?: string | null;
2415
+ updated_at?: string;
2416
+ webhook_config?: Json | null;
2417
+ };
2418
+ Relationships: [
2419
+ {
2420
+ foreignKeyName: "external_connections_agent_id_fkey";
2421
+ columns: ["agent_id"];
2422
+ isOneToOne: false;
2423
+ referencedRelation: "agent_full";
2424
+ referencedColumns: ["id"];
2425
+ },
2426
+ {
2427
+ foreignKeyName: "external_connections_agent_id_fkey";
2428
+ columns: ["agent_id"];
2429
+ isOneToOne: false;
2430
+ referencedRelation: "agents";
2431
+ referencedColumns: ["id"];
2432
+ },
2433
+ {
2434
+ foreignKeyName: "external_connections_team_id_fkey";
2435
+ columns: ["team_id"];
2436
+ isOneToOne: false;
2437
+ referencedRelation: "teams";
2438
+ referencedColumns: ["id"];
2439
+ }
2440
+ ];
2441
+ };
2442
+ external_connections_public: {
2443
+ Row: {
2444
+ agent_id: string | null;
2445
+ created_at: string;
2446
+ created_by: string | null;
2447
+ id: string;
2448
+ last_error: string | null;
2449
+ last_sync_at: string | null;
2450
+ provider: string;
2451
+ provider_id: string | null;
2452
+ status: string;
2453
+ status_changed_at: string | null;
2454
+ status_reason: string | null;
2455
+ team_id: string;
2456
+ updated_at: string;
2457
+ };
2458
+ Insert: {
2459
+ agent_id?: string | null;
2460
+ created_at: string;
2461
+ created_by?: string | null;
1811
2462
  id: string;
1812
2463
  last_error?: string | null;
1813
2464
  last_sync_at?: string | null;
@@ -2157,482 +2808,119 @@ export type Database = {
2157
2808
  entity_id?: string | null;
2158
2809
  id?: string;
2159
2810
  last_alerted_at?: string | null;
2160
- team_id?: string;
2161
- };
2162
- Relationships: [
2163
- {
2164
- foreignKeyName: "health_alert_state_team_id_fkey";
2165
- columns: ["team_id"];
2166
- isOneToOne: false;
2167
- referencedRelation: "teams";
2168
- referencedColumns: ["id"];
2169
- }
2170
- ];
2171
- };
2172
- internal_domains: {
2173
- Row: {
2174
- added_at: string | null;
2175
- domain: string;
2176
- };
2177
- Insert: {
2178
- added_at?: string | null;
2179
- domain: string;
2180
- };
2181
- Update: {
2182
- added_at?: string | null;
2183
- domain?: string;
2184
- };
2185
- Relationships: [];
2186
- };
2187
- internal_users: {
2188
- Row: {
2189
- added_at: string | null;
2190
- email: string;
2191
- };
2192
- Insert: {
2193
- added_at?: string | null;
2194
- email: string;
2195
- };
2196
- Update: {
2197
- added_at?: string | null;
2198
- email?: string;
2199
- };
2200
- Relationships: [];
2201
- };
2202
- landing_support_requests: {
2203
- Row: {
2204
- created_at: string;
2205
- email: string;
2206
- email_domain: string;
2207
- id: string;
2208
- ip_address: unknown;
2209
- message: string;
2210
- referrer: string | null;
2211
- source_path: string;
2212
- status: string;
2213
- user_agent: string | null;
2214
- };
2215
- Insert: {
2216
- created_at?: string;
2217
- email: string;
2218
- email_domain: string;
2219
- id?: string;
2220
- ip_address?: unknown;
2221
- message: string;
2222
- referrer?: string | null;
2223
- source_path: string;
2224
- status?: string;
2225
- user_agent?: string | null;
2226
- };
2227
- Update: {
2228
- created_at?: string;
2229
- email?: string;
2230
- email_domain?: string;
2231
- id?: string;
2232
- ip_address?: unknown;
2233
- message?: string;
2234
- referrer?: string | null;
2235
- source_path?: string;
2236
- status?: string;
2237
- user_agent?: string | null;
2238
- };
2239
- Relationships: [];
2240
- };
2241
- landing_waitlist_signups: {
2242
- Row: {
2243
- created_at: string;
2244
- email: string;
2245
- email_domain: string;
2246
- id: string;
2247
- ip_address: unknown;
2248
- referrer: string | null;
2249
- source_path: string;
2250
- user_agent: string | null;
2251
- };
2252
- Insert: {
2253
- created_at?: string;
2254
- email: string;
2255
- email_domain: string;
2256
- id?: string;
2257
- ip_address?: unknown;
2258
- referrer?: string | null;
2259
- source_path: string;
2260
- user_agent?: string | null;
2261
- };
2262
- Update: {
2263
- created_at?: string;
2264
- email?: string;
2265
- email_domain?: string;
2266
- id?: string;
2267
- ip_address?: unknown;
2268
- referrer?: string | null;
2269
- source_path?: string;
2270
- user_agent?: string | null;
2271
- };
2272
- Relationships: [];
2273
- };
2274
- linux_agent_executions: {
2275
- Row: {
2276
- agent_id: string;
2277
- claim_token: string | null;
2278
- claimed_by: string | null;
2279
- command: string;
2280
- completed_at: string | null;
2281
- control_signal: string | null;
2282
- created_at: string;
2283
- cycle_id: string | null;
2284
- dispatched_at: string | null;
2285
- duration_ms: number | null;
2286
- error: string | null;
2287
- exit_code: number | null;
2288
- host_attempt_generation: number | null;
2289
- host_id: string | null;
2290
- id: string;
2291
- metadata: Json;
2292
- requested_at: string;
2293
- run_id: string | null;
2294
- run_step_id: string | null;
2295
- started_at: string | null;
2296
- status: string;
2297
- stderr: string | null;
2298
- stderr_bytes: number;
2299
- stderr_overflow_ref: string | null;
2300
- stderr_preview: string | null;
2301
- stdout: string | null;
2302
- stdout_bytes: number;
2303
- stdout_overflow_ref: string | null;
2304
- stdout_preview: string | null;
2305
- updated_at: string;
2306
- worker_job_id: string | null;
2307
- };
2308
- Insert: {
2309
- agent_id: string;
2310
- claim_token?: string | null;
2311
- claimed_by?: string | null;
2312
- command: string;
2313
- completed_at?: string | null;
2314
- control_signal?: string | null;
2315
- created_at?: string;
2316
- cycle_id?: string | null;
2317
- dispatched_at?: string | null;
2318
- duration_ms?: number | null;
2319
- error?: string | null;
2320
- exit_code?: number | null;
2321
- host_attempt_generation?: number | null;
2322
- host_id?: string | null;
2323
- id?: string;
2324
- metadata?: Json;
2325
- requested_at?: string;
2326
- run_id?: string | null;
2327
- run_step_id?: string | null;
2328
- started_at?: string | null;
2329
- status?: string;
2330
- stderr?: string | null;
2331
- stderr_bytes?: number;
2332
- stderr_overflow_ref?: string | null;
2333
- stderr_preview?: string | null;
2334
- stdout?: string | null;
2335
- stdout_bytes?: number;
2336
- stdout_overflow_ref?: string | null;
2337
- stdout_preview?: string | null;
2338
- updated_at?: string;
2339
- worker_job_id?: string | null;
2340
- };
2341
- Update: {
2342
- agent_id?: string;
2343
- claim_token?: string | null;
2344
- claimed_by?: string | null;
2345
- command?: string;
2346
- completed_at?: string | null;
2347
- control_signal?: string | null;
2348
- created_at?: string;
2349
- cycle_id?: string | null;
2350
- dispatched_at?: string | null;
2351
- duration_ms?: number | null;
2352
- error?: string | null;
2353
- exit_code?: number | null;
2354
- host_attempt_generation?: number | null;
2355
- host_id?: string | null;
2356
- id?: string;
2357
- metadata?: Json;
2358
- requested_at?: string;
2359
- run_id?: string | null;
2360
- run_step_id?: string | null;
2361
- started_at?: string | null;
2362
- status?: string;
2363
- stderr?: string | null;
2364
- stderr_bytes?: number;
2365
- stderr_overflow_ref?: string | null;
2366
- stderr_preview?: string | null;
2367
- stdout?: string | null;
2368
- stdout_bytes?: number;
2369
- stdout_overflow_ref?: string | null;
2370
- stdout_preview?: string | null;
2371
- updated_at?: string;
2372
- worker_job_id?: string | null;
2373
- };
2374
- Relationships: [
2375
- {
2376
- foreignKeyName: "linux_agent_executions_agent_id_fkey";
2377
- columns: ["agent_id"];
2378
- isOneToOne: false;
2379
- referencedRelation: "agent_full";
2380
- referencedColumns: ["id"];
2381
- },
2382
- {
2383
- foreignKeyName: "linux_agent_executions_agent_id_fkey";
2384
- columns: ["agent_id"];
2385
- isOneToOne: false;
2386
- referencedRelation: "agents";
2387
- referencedColumns: ["id"];
2388
- },
2389
- {
2390
- foreignKeyName: "linux_agent_executions_cycle_id_fkey";
2391
- columns: ["cycle_id"];
2392
- isOneToOne: false;
2393
- referencedRelation: "agent_cycles";
2394
- referencedColumns: ["id"];
2395
- },
2396
- {
2397
- foreignKeyName: "linux_agent_executions_cycle_id_fkey";
2398
- columns: ["cycle_id"];
2399
- isOneToOne: false;
2400
- referencedRelation: "debug_cycle_facts";
2401
- referencedColumns: ["cycle_id"];
2402
- },
2403
- {
2404
- foreignKeyName: "linux_agent_executions_host_id_fkey";
2405
- columns: ["host_id"];
2406
- isOneToOne: false;
2407
- referencedRelation: "linux_agent_hosts";
2408
- referencedColumns: ["id"];
2409
- },
2410
- {
2411
- foreignKeyName: "linux_agent_executions_run_id_fkey";
2412
- columns: ["run_id"];
2413
- isOneToOne: false;
2414
- referencedRelation: "agent_cycle_runs";
2415
- referencedColumns: ["id"];
2416
- },
2417
- {
2418
- foreignKeyName: "linux_agent_executions_run_id_fkey";
2419
- columns: ["run_id"];
2420
- isOneToOne: false;
2421
- referencedRelation: "debug_cycle_facts";
2422
- referencedColumns: ["run_id"];
2423
- },
2424
- {
2425
- foreignKeyName: "linux_agent_executions_run_id_fkey";
2426
- columns: ["run_id"];
2427
- isOneToOne: false;
2428
- referencedRelation: "debug_tool_call_facts";
2429
- referencedColumns: ["run_id"];
2430
- },
2811
+ team_id?: string;
2812
+ };
2813
+ Relationships: [
2431
2814
  {
2432
- foreignKeyName: "linux_agent_executions_run_step_id_fkey";
2433
- columns: ["run_step_id"];
2815
+ foreignKeyName: "health_alert_state_team_id_fkey";
2816
+ columns: ["team_id"];
2434
2817
  isOneToOne: false;
2435
- referencedRelation: "agent_cycle_run_steps";
2818
+ referencedRelation: "teams";
2436
2819
  referencedColumns: ["id"];
2437
- },
2438
- {
2439
- foreignKeyName: "linux_agent_executions_run_step_id_fkey";
2440
- columns: ["run_step_id"];
2441
- isOneToOne: false;
2442
- referencedRelation: "debug_tool_call_facts";
2443
- referencedColumns: ["step_id"];
2444
2820
  }
2445
2821
  ];
2446
2822
  };
2447
- linux_agent_hosts: {
2823
+ internal_domains: {
2824
+ Row: {
2825
+ added_at: string | null;
2826
+ domain: string;
2827
+ };
2828
+ Insert: {
2829
+ added_at?: string | null;
2830
+ domain: string;
2831
+ };
2832
+ Update: {
2833
+ added_at?: string | null;
2834
+ domain?: string;
2835
+ };
2836
+ Relationships: [];
2837
+ };
2838
+ internal_users: {
2839
+ Row: {
2840
+ added_at: string | null;
2841
+ email: string;
2842
+ };
2843
+ Insert: {
2844
+ added_at?: string | null;
2845
+ email: string;
2846
+ };
2847
+ Update: {
2848
+ added_at?: string | null;
2849
+ email?: string;
2850
+ };
2851
+ Relationships: [];
2852
+ };
2853
+ landing_support_requests: {
2448
2854
  Row: {
2449
- agent_id: string;
2450
- allocation_state: string;
2451
- attempt_generation: number;
2452
- cli_auth_token_created_at: string | null;
2453
- cli_auth_token_hash: string | null;
2454
2855
  created_at: string;
2455
- desired_power_state: string;
2456
- error: string | null;
2457
- host_control_token_created_at: string | null;
2458
- host_control_token_hash: string | null;
2459
- host_identifier: string | null;
2856
+ email: string;
2857
+ email_domain: string;
2460
2858
  id: string;
2461
- image_ref: string | null;
2462
- last_heartbeat_at: string | null;
2463
- metadata: Json;
2464
- provider: string;
2465
- provisioning_started_at: string | null;
2466
- ready_at: string | null;
2467
- runtime_id: string | null;
2468
- runtime_state: string;
2469
- started_at: string | null;
2859
+ ip_address: unknown;
2860
+ message: string;
2861
+ referrer: string | null;
2862
+ source_path: string;
2470
2863
  status: string;
2471
- stopped_at: string | null;
2472
- updated_at: string;
2864
+ user_agent: string | null;
2473
2865
  };
2474
2866
  Insert: {
2475
- agent_id: string;
2476
- allocation_state?: string;
2477
- attempt_generation?: number;
2478
- cli_auth_token_created_at?: string | null;
2479
- cli_auth_token_hash?: string | null;
2480
2867
  created_at?: string;
2481
- desired_power_state?: string;
2482
- error?: string | null;
2483
- host_control_token_created_at?: string | null;
2484
- host_control_token_hash?: string | null;
2485
- host_identifier?: string | null;
2868
+ email: string;
2869
+ email_domain: string;
2486
2870
  id?: string;
2487
- image_ref?: string | null;
2488
- last_heartbeat_at?: string | null;
2489
- metadata?: Json;
2490
- provider?: string;
2491
- provisioning_started_at?: string | null;
2492
- ready_at?: string | null;
2493
- runtime_id?: string | null;
2494
- runtime_state?: string;
2495
- started_at?: string | null;
2871
+ ip_address?: unknown;
2872
+ message: string;
2873
+ referrer?: string | null;
2874
+ source_path: string;
2496
2875
  status?: string;
2497
- stopped_at?: string | null;
2498
- updated_at?: string;
2876
+ user_agent?: string | null;
2499
2877
  };
2500
2878
  Update: {
2501
- agent_id?: string;
2502
- allocation_state?: string;
2503
- attempt_generation?: number;
2504
- cli_auth_token_created_at?: string | null;
2505
- cli_auth_token_hash?: string | null;
2506
2879
  created_at?: string;
2507
- desired_power_state?: string;
2508
- error?: string | null;
2509
- host_control_token_created_at?: string | null;
2510
- host_control_token_hash?: string | null;
2511
- host_identifier?: string | null;
2880
+ email?: string;
2881
+ email_domain?: string;
2512
2882
  id?: string;
2513
- image_ref?: string | null;
2514
- last_heartbeat_at?: string | null;
2515
- metadata?: Json;
2516
- provider?: string;
2517
- provisioning_started_at?: string | null;
2518
- ready_at?: string | null;
2519
- runtime_id?: string | null;
2520
- runtime_state?: string;
2521
- started_at?: string | null;
2883
+ ip_address?: unknown;
2884
+ message?: string;
2885
+ referrer?: string | null;
2886
+ source_path?: string;
2522
2887
  status?: string;
2523
- stopped_at?: string | null;
2524
- updated_at?: string;
2888
+ user_agent?: string | null;
2525
2889
  };
2526
- Relationships: [
2527
- {
2528
- foreignKeyName: "linux_agent_hosts_agent_id_fkey";
2529
- columns: ["agent_id"];
2530
- isOneToOne: true;
2531
- referencedRelation: "agent_full";
2532
- referencedColumns: ["id"];
2533
- },
2534
- {
2535
- foreignKeyName: "linux_agent_hosts_agent_id_fkey";
2536
- columns: ["agent_id"];
2537
- isOneToOne: true;
2538
- referencedRelation: "agents";
2539
- referencedColumns: ["id"];
2540
- }
2541
- ];
2890
+ Relationships: [];
2542
2891
  };
2543
- linux_host_operations: {
2892
+ landing_waitlist_signups: {
2544
2893
  Row: {
2545
- agent_id: string;
2546
- attempt_count: number;
2547
- canceled_at: string | null;
2548
- completed_at: string | null;
2549
2894
  created_at: string;
2550
- error: string | null;
2551
- host_id: string;
2895
+ email: string;
2896
+ email_domain: string;
2552
2897
  id: string;
2553
- idempotency_key: string;
2554
- lease_acquired_at: string | null;
2555
- lease_expires_at: string | null;
2556
- lease_owner: string | null;
2557
- operation_type: string;
2558
- reason: string;
2559
- request_payload: Json;
2560
- requested_by: string | null;
2561
- result_payload: Json | null;
2562
- stale_at: string | null;
2563
- started_at: string | null;
2564
- status: string;
2565
- updated_at: string;
2898
+ ip_address: unknown;
2899
+ referrer: string | null;
2900
+ source_path: string;
2901
+ user_agent: string | null;
2566
2902
  };
2567
2903
  Insert: {
2568
- agent_id: string;
2569
- attempt_count?: number;
2570
- canceled_at?: string | null;
2571
- completed_at?: string | null;
2572
2904
  created_at?: string;
2573
- error?: string | null;
2574
- host_id: string;
2905
+ email: string;
2906
+ email_domain: string;
2575
2907
  id?: string;
2576
- idempotency_key: string;
2577
- lease_acquired_at?: string | null;
2578
- lease_expires_at?: string | null;
2579
- lease_owner?: string | null;
2580
- operation_type: string;
2581
- reason: string;
2582
- request_payload?: Json;
2583
- requested_by?: string | null;
2584
- result_payload?: Json | null;
2585
- stale_at?: string | null;
2586
- started_at?: string | null;
2587
- status?: string;
2588
- updated_at?: string;
2908
+ ip_address?: unknown;
2909
+ referrer?: string | null;
2910
+ source_path: string;
2911
+ user_agent?: string | null;
2589
2912
  };
2590
2913
  Update: {
2591
- agent_id?: string;
2592
- attempt_count?: number;
2593
- canceled_at?: string | null;
2594
- completed_at?: string | null;
2595
2914
  created_at?: string;
2596
- error?: string | null;
2597
- host_id?: string;
2915
+ email?: string;
2916
+ email_domain?: string;
2598
2917
  id?: string;
2599
- idempotency_key?: string;
2600
- lease_acquired_at?: string | null;
2601
- lease_expires_at?: string | null;
2602
- lease_owner?: string | null;
2603
- operation_type?: string;
2604
- reason?: string;
2605
- request_payload?: Json;
2606
- requested_by?: string | null;
2607
- result_payload?: Json | null;
2608
- stale_at?: string | null;
2609
- started_at?: string | null;
2610
- status?: string;
2611
- updated_at?: string;
2918
+ ip_address?: unknown;
2919
+ referrer?: string | null;
2920
+ source_path?: string;
2921
+ user_agent?: string | null;
2612
2922
  };
2613
- Relationships: [
2614
- {
2615
- foreignKeyName: "linux_host_operations_agent_id_fkey";
2616
- columns: ["agent_id"];
2617
- isOneToOne: false;
2618
- referencedRelation: "agent_full";
2619
- referencedColumns: ["id"];
2620
- },
2621
- {
2622
- foreignKeyName: "linux_host_operations_agent_id_fkey";
2623
- columns: ["agent_id"];
2624
- isOneToOne: false;
2625
- referencedRelation: "agents";
2626
- referencedColumns: ["id"];
2627
- },
2628
- {
2629
- foreignKeyName: "linux_host_operations_host_id_fkey";
2630
- columns: ["host_id"];
2631
- isOneToOne: false;
2632
- referencedRelation: "linux_agent_hosts";
2633
- referencedColumns: ["id"];
2634
- }
2635
- ];
2923
+ Relationships: [];
2636
2924
  };
2637
2925
  log_embeddings: {
2638
2926
  Row: {
@@ -3070,32 +3358,102 @@ export type Database = {
3070
3358
  foreignKeyName: "messages_cycle_id_fkey";
3071
3359
  columns: ["cycle_id"];
3072
3360
  isOneToOne: false;
3073
- referencedRelation: "debug_cycle_facts";
3074
- referencedColumns: ["cycle_id"];
3361
+ referencedRelation: "debug_cycle_facts";
3362
+ referencedColumns: ["cycle_id"];
3363
+ },
3364
+ {
3365
+ foreignKeyName: "messages_team_id_fkey";
3366
+ columns: ["team_id"];
3367
+ isOneToOne: false;
3368
+ referencedRelation: "teams";
3369
+ referencedColumns: ["id"];
3370
+ }
3371
+ ];
3372
+ };
3373
+ model_cache_entries: {
3374
+ Row: {
3375
+ agent_id: string;
3376
+ cache_strategy: string;
3377
+ created_at: string;
3378
+ expires_at: string | null;
3379
+ id: string;
3380
+ last_used_at: string;
3381
+ metadata: Json;
3382
+ model_id: string;
3383
+ prefix_chars: number;
3384
+ prefix_hash: string;
3385
+ prefix_tokens_estimate: number | null;
3386
+ provider_cache_name: string;
3387
+ provider_model_id: string;
3388
+ purpose: string;
3389
+ tools_hash: string;
3390
+ updated_at: string;
3391
+ };
3392
+ Insert: {
3393
+ agent_id: string;
3394
+ cache_strategy: string;
3395
+ created_at?: string;
3396
+ expires_at?: string | null;
3397
+ id?: string;
3398
+ last_used_at?: string;
3399
+ metadata?: Json;
3400
+ model_id: string;
3401
+ prefix_chars: number;
3402
+ prefix_hash: string;
3403
+ prefix_tokens_estimate?: number | null;
3404
+ provider_cache_name: string;
3405
+ provider_model_id: string;
3406
+ purpose: string;
3407
+ tools_hash?: string;
3408
+ updated_at?: string;
3409
+ };
3410
+ Update: {
3411
+ agent_id?: string;
3412
+ cache_strategy?: string;
3413
+ created_at?: string;
3414
+ expires_at?: string | null;
3415
+ id?: string;
3416
+ last_used_at?: string;
3417
+ metadata?: Json;
3418
+ model_id?: string;
3419
+ prefix_chars?: number;
3420
+ prefix_hash?: string;
3421
+ prefix_tokens_estimate?: number | null;
3422
+ provider_cache_name?: string;
3423
+ provider_model_id?: string;
3424
+ purpose?: string;
3425
+ tools_hash?: string;
3426
+ updated_at?: string;
3427
+ };
3428
+ Relationships: [
3429
+ {
3430
+ foreignKeyName: "model_cache_entries_agent_id_fkey";
3431
+ columns: ["agent_id"];
3432
+ isOneToOne: false;
3433
+ referencedRelation: "agent_full";
3434
+ referencedColumns: ["id"];
3075
3435
  },
3076
3436
  {
3077
- foreignKeyName: "messages_team_id_fkey";
3078
- columns: ["team_id"];
3437
+ foreignKeyName: "model_cache_entries_agent_id_fkey";
3438
+ columns: ["agent_id"];
3079
3439
  isOneToOne: false;
3080
- referencedRelation: "teams";
3440
+ referencedRelation: "agents";
3081
3441
  referencedColumns: ["id"];
3082
3442
  }
3083
3443
  ];
3084
3444
  };
3085
- model_cache_entries: {
3445
+ model_cache_entry_creation_claims: {
3086
3446
  Row: {
3087
3447
  agent_id: string;
3088
3448
  cache_strategy: string;
3449
+ claim_token: string;
3450
+ claimed_by: string | null;
3089
3451
  created_at: string;
3090
- expires_at: string | null;
3091
3452
  id: string;
3092
- last_used_at: string;
3453
+ lease_expires_at: string;
3093
3454
  metadata: Json;
3094
3455
  model_id: string;
3095
- prefix_chars: number;
3096
3456
  prefix_hash: string;
3097
- prefix_tokens_estimate: number | null;
3098
- provider_cache_name: string;
3099
3457
  provider_model_id: string;
3100
3458
  purpose: string;
3101
3459
  tools_hash: string;
@@ -3104,16 +3462,14 @@ export type Database = {
3104
3462
  Insert: {
3105
3463
  agent_id: string;
3106
3464
  cache_strategy: string;
3465
+ claim_token?: string;
3466
+ claimed_by?: string | null;
3107
3467
  created_at?: string;
3108
- expires_at?: string | null;
3109
3468
  id?: string;
3110
- last_used_at?: string;
3469
+ lease_expires_at: string;
3111
3470
  metadata?: Json;
3112
3471
  model_id: string;
3113
- prefix_chars: number;
3114
3472
  prefix_hash: string;
3115
- prefix_tokens_estimate?: number | null;
3116
- provider_cache_name: string;
3117
3473
  provider_model_id: string;
3118
3474
  purpose: string;
3119
3475
  tools_hash?: string;
@@ -3122,16 +3478,14 @@ export type Database = {
3122
3478
  Update: {
3123
3479
  agent_id?: string;
3124
3480
  cache_strategy?: string;
3481
+ claim_token?: string;
3482
+ claimed_by?: string | null;
3125
3483
  created_at?: string;
3126
- expires_at?: string | null;
3127
3484
  id?: string;
3128
- last_used_at?: string;
3485
+ lease_expires_at?: string;
3129
3486
  metadata?: Json;
3130
3487
  model_id?: string;
3131
- prefix_chars?: number;
3132
3488
  prefix_hash?: string;
3133
- prefix_tokens_estimate?: number | null;
3134
- provider_cache_name?: string;
3135
3489
  provider_model_id?: string;
3136
3490
  purpose?: string;
3137
3491
  tools_hash?: string;
@@ -3139,14 +3493,14 @@ export type Database = {
3139
3493
  };
3140
3494
  Relationships: [
3141
3495
  {
3142
- foreignKeyName: "model_cache_entries_agent_id_fkey";
3496
+ foreignKeyName: "model_cache_entry_creation_claims_agent_id_fkey";
3143
3497
  columns: ["agent_id"];
3144
3498
  isOneToOne: false;
3145
3499
  referencedRelation: "agent_full";
3146
3500
  referencedColumns: ["id"];
3147
3501
  },
3148
3502
  {
3149
- foreignKeyName: "model_cache_entries_agent_id_fkey";
3503
+ foreignKeyName: "model_cache_entry_creation_claims_agent_id_fkey";
3150
3504
  columns: ["agent_id"];
3151
3505
  isOneToOne: false;
3152
3506
  referencedRelation: "agents";
@@ -3541,6 +3895,170 @@ export type Database = {
3541
3895
  };
3542
3896
  Relationships: [];
3543
3897
  };
3898
+ resource_operation_chunks: {
3899
+ Row: {
3900
+ accepted_at: string;
3901
+ chunk_index: number;
3902
+ counters: Json;
3903
+ created_at: string;
3904
+ id: string;
3905
+ metadata: Json;
3906
+ operation_id: string;
3907
+ path_cover: Json;
3908
+ result: Json;
3909
+ team_resource_id: string;
3910
+ updated_at: string;
3911
+ };
3912
+ Insert: {
3913
+ accepted_at?: string;
3914
+ chunk_index: number;
3915
+ counters?: Json;
3916
+ created_at?: string;
3917
+ id?: string;
3918
+ metadata?: Json;
3919
+ operation_id: string;
3920
+ path_cover?: Json;
3921
+ result?: Json;
3922
+ team_resource_id: string;
3923
+ updated_at?: string;
3924
+ };
3925
+ Update: {
3926
+ accepted_at?: string;
3927
+ chunk_index?: number;
3928
+ counters?: Json;
3929
+ created_at?: string;
3930
+ id?: string;
3931
+ metadata?: Json;
3932
+ operation_id?: string;
3933
+ path_cover?: Json;
3934
+ result?: Json;
3935
+ team_resource_id?: string;
3936
+ updated_at?: string;
3937
+ };
3938
+ Relationships: [
3939
+ {
3940
+ foreignKeyName: "resource_operation_chunks_operation_id_fkey";
3941
+ columns: ["operation_id"];
3942
+ isOneToOne: false;
3943
+ referencedRelation: "resource_operations";
3944
+ referencedColumns: ["id"];
3945
+ },
3946
+ {
3947
+ foreignKeyName: "resource_operation_chunks_team_resource_id_fkey";
3948
+ columns: ["team_resource_id"];
3949
+ isOneToOne: false;
3950
+ referencedRelation: "team_resources";
3951
+ referencedColumns: ["id"];
3952
+ }
3953
+ ];
3954
+ };
3955
+ resource_operations: {
3956
+ Row: {
3957
+ accepted_chunk_count: number;
3958
+ actor_agent_id: string | null;
3959
+ counters: Json;
3960
+ created_at: string;
3961
+ emitted_at: string | null;
3962
+ error: string | null;
3963
+ expected_chunk_count: number | null;
3964
+ failed_at: string | null;
3965
+ finalized_at: string | null;
3966
+ id: string;
3967
+ metadata: Json;
3968
+ path_cover: Json;
3969
+ payload_fingerprint: string;
3970
+ resource_type: string;
3971
+ result: Json;
3972
+ source_operation: string;
3973
+ source_operation_id: string;
3974
+ source_type: string;
3975
+ status: string;
3976
+ summary: string | null;
3977
+ team_id: string;
3978
+ team_resource_id: string;
3979
+ updated_at: string;
3980
+ };
3981
+ Insert: {
3982
+ accepted_chunk_count?: number;
3983
+ actor_agent_id?: string | null;
3984
+ counters?: Json;
3985
+ created_at?: string;
3986
+ emitted_at?: string | null;
3987
+ error?: string | null;
3988
+ expected_chunk_count?: number | null;
3989
+ failed_at?: string | null;
3990
+ finalized_at?: string | null;
3991
+ id?: string;
3992
+ metadata?: Json;
3993
+ path_cover?: Json;
3994
+ payload_fingerprint: string;
3995
+ resource_type: string;
3996
+ result?: Json;
3997
+ source_operation: string;
3998
+ source_operation_id: string;
3999
+ source_type: string;
4000
+ status?: string;
4001
+ summary?: string | null;
4002
+ team_id: string;
4003
+ team_resource_id: string;
4004
+ updated_at?: string;
4005
+ };
4006
+ Update: {
4007
+ accepted_chunk_count?: number;
4008
+ actor_agent_id?: string | null;
4009
+ counters?: Json;
4010
+ created_at?: string;
4011
+ emitted_at?: string | null;
4012
+ error?: string | null;
4013
+ expected_chunk_count?: number | null;
4014
+ failed_at?: string | null;
4015
+ finalized_at?: string | null;
4016
+ id?: string;
4017
+ metadata?: Json;
4018
+ path_cover?: Json;
4019
+ payload_fingerprint?: string;
4020
+ resource_type?: string;
4021
+ result?: Json;
4022
+ source_operation?: string;
4023
+ source_operation_id?: string;
4024
+ source_type?: string;
4025
+ status?: string;
4026
+ summary?: string | null;
4027
+ team_id?: string;
4028
+ team_resource_id?: string;
4029
+ updated_at?: string;
4030
+ };
4031
+ Relationships: [
4032
+ {
4033
+ foreignKeyName: "resource_operations_actor_agent_id_fkey";
4034
+ columns: ["actor_agent_id"];
4035
+ isOneToOne: false;
4036
+ referencedRelation: "agent_full";
4037
+ referencedColumns: ["id"];
4038
+ },
4039
+ {
4040
+ foreignKeyName: "resource_operations_actor_agent_id_fkey";
4041
+ columns: ["actor_agent_id"];
4042
+ isOneToOne: false;
4043
+ referencedRelation: "agents";
4044
+ referencedColumns: ["id"];
4045
+ },
4046
+ {
4047
+ foreignKeyName: "resource_operations_team_id_fkey";
4048
+ columns: ["team_id"];
4049
+ isOneToOne: false;
4050
+ referencedRelation: "teams";
4051
+ referencedColumns: ["id"];
4052
+ },
4053
+ {
4054
+ foreignKeyName: "resource_operations_team_resource_id_fkey";
4055
+ columns: ["team_resource_id"];
4056
+ isOneToOne: false;
4057
+ referencedRelation: "team_resources";
4058
+ referencedColumns: ["id"];
4059
+ }
4060
+ ];
4061
+ };
3544
4062
  runtime_billable_intervals: {
3545
4063
  Row: {
3546
4064
  created_at: string;
@@ -4195,58 +4713,6 @@ export type Database = {
4195
4713
  }
4196
4714
  ];
4197
4715
  };
4198
- stored_resource_locks: {
4199
- Row: {
4200
- agent_id: string | null;
4201
- expires_at: string;
4202
- id: string;
4203
- locked_at: string;
4204
- resource_name: string;
4205
- team_id: string | null;
4206
- user_id: string;
4207
- };
4208
- Insert: {
4209
- agent_id?: string | null;
4210
- expires_at: string;
4211
- id?: string;
4212
- locked_at?: string;
4213
- resource_name: string;
4214
- team_id?: string | null;
4215
- user_id: string;
4216
- };
4217
- Update: {
4218
- agent_id?: string | null;
4219
- expires_at?: string;
4220
- id?: string;
4221
- locked_at?: string;
4222
- resource_name?: string;
4223
- team_id?: string | null;
4224
- user_id?: string;
4225
- };
4226
- Relationships: [
4227
- {
4228
- foreignKeyName: "stored_resource_locks_agent_id_agents_id_fk";
4229
- columns: ["agent_id"];
4230
- isOneToOne: false;
4231
- referencedRelation: "agent_full";
4232
- referencedColumns: ["id"];
4233
- },
4234
- {
4235
- foreignKeyName: "stored_resource_locks_agent_id_agents_id_fk";
4236
- columns: ["agent_id"];
4237
- isOneToOne: false;
4238
- referencedRelation: "agents";
4239
- referencedColumns: ["id"];
4240
- },
4241
- {
4242
- foreignKeyName: "stored_resource_locks_team_id_fkey";
4243
- columns: ["team_id"];
4244
- isOneToOne: false;
4245
- referencedRelation: "teams";
4246
- referencedColumns: ["id"];
4247
- }
4248
- ];
4249
- };
4250
4716
  stored_resources: {
4251
4717
  Row: {
4252
4718
  agent_id: string | null;
@@ -4261,6 +4727,7 @@ export type Database = {
4261
4727
  scope: string;
4262
4728
  size_bytes: number | null;
4263
4729
  team_id: string;
4730
+ team_resource_id: string | null;
4264
4731
  updated_at: string;
4265
4732
  version_created_at: string;
4266
4733
  version_id: string;
@@ -4278,6 +4745,7 @@ export type Database = {
4278
4745
  scope?: string;
4279
4746
  size_bytes?: number | null;
4280
4747
  team_id: string;
4748
+ team_resource_id?: string | null;
4281
4749
  updated_at?: string;
4282
4750
  version_created_at?: string;
4283
4751
  version_id?: string;
@@ -4295,6 +4763,7 @@ export type Database = {
4295
4763
  scope?: string;
4296
4764
  size_bytes?: number | null;
4297
4765
  team_id?: string;
4766
+ team_resource_id?: string | null;
4298
4767
  updated_at?: string;
4299
4768
  version_created_at?: string;
4300
4769
  version_id?: string;
@@ -4320,6 +4789,13 @@ export type Database = {
4320
4789
  isOneToOne: false;
4321
4790
  referencedRelation: "agents";
4322
4791
  referencedColumns: ["id"];
4792
+ },
4793
+ {
4794
+ foreignKeyName: "stored_resources_team_resource_id_fkey";
4795
+ columns: ["team_resource_id"];
4796
+ isOneToOne: false;
4797
+ referencedRelation: "team_resources";
4798
+ referencedColumns: ["id"];
4323
4799
  }
4324
4800
  ];
4325
4801
  };
@@ -5291,13 +5767,13 @@ export type Database = {
5291
5767
  created_at: string;
5292
5768
  id: string;
5293
5769
  include_in_state: boolean;
5770
+ managed_by_resource_id: string | null;
5294
5771
  poll_config: Json | null;
5295
5772
  poll_consecutive_failures: number | null;
5296
5773
  poll_disabled_at: string | null;
5297
5774
  poll_interval_seconds: number | null;
5298
5775
  poll_last_at: string | null;
5299
5776
  poll_next_at: string | null;
5300
- subscription_origin: string;
5301
5777
  subscription_path: string;
5302
5778
  team_resource_id: string;
5303
5779
  updated_at: string;
@@ -5308,13 +5784,13 @@ export type Database = {
5308
5784
  created_at?: string;
5309
5785
  id?: string;
5310
5786
  include_in_state?: boolean;
5787
+ managed_by_resource_id?: string | null;
5311
5788
  poll_config?: Json | null;
5312
5789
  poll_consecutive_failures?: number | null;
5313
5790
  poll_disabled_at?: string | null;
5314
5791
  poll_interval_seconds?: number | null;
5315
5792
  poll_last_at?: string | null;
5316
5793
  poll_next_at?: string | null;
5317
- subscription_origin?: string;
5318
5794
  subscription_path?: string;
5319
5795
  team_resource_id: string;
5320
5796
  updated_at?: string;
@@ -5325,13 +5801,13 @@ export type Database = {
5325
5801
  created_at?: string;
5326
5802
  id?: string;
5327
5803
  include_in_state?: boolean;
5804
+ managed_by_resource_id?: string | null;
5328
5805
  poll_config?: Json | null;
5329
5806
  poll_consecutive_failures?: number | null;
5330
5807
  poll_disabled_at?: string | null;
5331
5808
  poll_interval_seconds?: number | null;
5332
5809
  poll_last_at?: string | null;
5333
5810
  poll_next_at?: string | null;
5334
- subscription_origin?: string;
5335
5811
  subscription_path?: string;
5336
5812
  team_resource_id?: string;
5337
5813
  updated_at?: string;
@@ -5352,6 +5828,13 @@ export type Database = {
5352
5828
  referencedRelation: "agents";
5353
5829
  referencedColumns: ["id"];
5354
5830
  },
5831
+ {
5832
+ foreignKeyName: "team_resource_subscriptions_managed_by_resource_id_fkey";
5833
+ columns: ["managed_by_resource_id"];
5834
+ isOneToOne: false;
5835
+ referencedRelation: "team_resources";
5836
+ referencedColumns: ["id"];
5837
+ },
5355
5838
  {
5356
5839
  foreignKeyName: "team_resource_subscriptions_team_resource_id_fkey";
5357
5840
  columns: ["team_resource_id"];
@@ -5782,116 +6265,23 @@ export type Database = {
5782
6265
  };
5783
6266
  Update: {
5784
6267
  configuration?: Json;
5785
- created_at?: string;
5786
- id?: string;
5787
- rate_limit_per_day?: number | null;
5788
- rate_limit_per_minute?: number | null;
5789
- scope?: string;
5790
- scope_id?: string | null;
5791
- secrets?: Json | null;
5792
- tool_id?: string;
5793
- updated_at?: string;
5794
- usage_quota?: number | null;
5795
- };
5796
- Relationships: [
5797
- {
5798
- foreignKeyName: "tool_configurations_tool_id_tools_id_fk";
5799
- columns: ["tool_id"];
5800
- isOneToOne: false;
5801
- referencedRelation: "tools";
5802
- referencedColumns: ["id"];
5803
- }
5804
- ];
5805
- };
5806
- tool_invocations: {
5807
- Row: {
5808
- agent_id: string;
5809
- completed_at: string | null;
5810
- created_at: string;
5811
- cycle_id: string | null;
5812
- host_attempt_generation: number | null;
5813
- host_id: string | null;
5814
- id: string;
5815
- input: Json;
5816
- metadata: Json;
5817
- result: Json | null;
5818
- source: string;
5819
- started_at: string | null;
5820
- status: string;
5821
- system_error: string | null;
5822
- tool_id: string;
5823
- tool_name: string;
5824
- };
5825
- Insert: {
5826
- agent_id: string;
5827
- completed_at?: string | null;
5828
- created_at?: string;
5829
- cycle_id?: string | null;
5830
- host_attempt_generation?: number | null;
5831
- host_id?: string | null;
5832
- id?: string;
5833
- input?: Json;
5834
- metadata?: Json;
5835
- result?: Json | null;
5836
- source?: string;
5837
- started_at?: string | null;
5838
- status?: string;
5839
- system_error?: string | null;
5840
- tool_id: string;
5841
- tool_name: string;
5842
- };
5843
- Update: {
5844
- agent_id?: string;
5845
- completed_at?: string | null;
5846
- created_at?: string;
5847
- cycle_id?: string | null;
5848
- host_attempt_generation?: number | null;
5849
- host_id?: string | null;
5850
- id?: string;
5851
- input?: Json;
5852
- metadata?: Json;
5853
- result?: Json | null;
5854
- source?: string;
5855
- started_at?: string | null;
5856
- status?: string;
5857
- system_error?: string | null;
6268
+ created_at?: string;
6269
+ id?: string;
6270
+ rate_limit_per_day?: number | null;
6271
+ rate_limit_per_minute?: number | null;
6272
+ scope?: string;
6273
+ scope_id?: string | null;
6274
+ secrets?: Json | null;
5858
6275
  tool_id?: string;
5859
- tool_name?: string;
6276
+ updated_at?: string;
6277
+ usage_quota?: number | null;
5860
6278
  };
5861
6279
  Relationships: [
5862
6280
  {
5863
- foreignKeyName: "tool_invocations_agent_id_fkey";
5864
- columns: ["agent_id"];
5865
- isOneToOne: false;
5866
- referencedRelation: "agent_full";
5867
- referencedColumns: ["id"];
5868
- },
5869
- {
5870
- foreignKeyName: "tool_invocations_agent_id_fkey";
5871
- columns: ["agent_id"];
5872
- isOneToOne: false;
5873
- referencedRelation: "agents";
5874
- referencedColumns: ["id"];
5875
- },
5876
- {
5877
- foreignKeyName: "tool_invocations_cycle_id_fkey";
5878
- columns: ["cycle_id"];
5879
- isOneToOne: false;
5880
- referencedRelation: "agent_cycles";
5881
- referencedColumns: ["id"];
5882
- },
5883
- {
5884
- foreignKeyName: "tool_invocations_cycle_id_fkey";
5885
- columns: ["cycle_id"];
5886
- isOneToOne: false;
5887
- referencedRelation: "debug_cycle_facts";
5888
- referencedColumns: ["cycle_id"];
5889
- },
5890
- {
5891
- foreignKeyName: "tool_invocations_host_id_fkey";
5892
- columns: ["host_id"];
6281
+ foreignKeyName: "tool_configurations_tool_id_tools_id_fk";
6282
+ columns: ["tool_id"];
5893
6283
  isOneToOne: false;
5894
- referencedRelation: "linux_agent_hosts";
6284
+ referencedRelation: "tools";
5895
6285
  referencedColumns: ["id"];
5896
6286
  }
5897
6287
  ];
@@ -6840,6 +7230,68 @@ export type Database = {
6840
7230
  }
6841
7231
  ];
6842
7232
  };
7233
+ workflow_start_requests: {
7234
+ Row: {
7235
+ attempt_count: number;
7236
+ completed_at: string | null;
7237
+ created_at: string;
7238
+ dedupe_key: string;
7239
+ id: string;
7240
+ last_error: string | null;
7241
+ payload: Json;
7242
+ request_kind: string;
7243
+ started_at: string | null;
7244
+ status: string;
7245
+ task_queue: string;
7246
+ team_id: string | null;
7247
+ updated_at: string;
7248
+ workflow_id: string;
7249
+ workflow_type: string;
7250
+ };
7251
+ Insert: {
7252
+ attempt_count?: number;
7253
+ completed_at?: string | null;
7254
+ created_at?: string;
7255
+ dedupe_key: string;
7256
+ id?: string;
7257
+ last_error?: string | null;
7258
+ payload?: Json;
7259
+ request_kind: string;
7260
+ started_at?: string | null;
7261
+ status?: string;
7262
+ task_queue: string;
7263
+ team_id?: string | null;
7264
+ updated_at?: string;
7265
+ workflow_id: string;
7266
+ workflow_type: string;
7267
+ };
7268
+ Update: {
7269
+ attempt_count?: number;
7270
+ completed_at?: string | null;
7271
+ created_at?: string;
7272
+ dedupe_key?: string;
7273
+ id?: string;
7274
+ last_error?: string | null;
7275
+ payload?: Json;
7276
+ request_kind?: string;
7277
+ started_at?: string | null;
7278
+ status?: string;
7279
+ task_queue?: string;
7280
+ team_id?: string | null;
7281
+ updated_at?: string;
7282
+ workflow_id?: string;
7283
+ workflow_type?: string;
7284
+ };
7285
+ Relationships: [
7286
+ {
7287
+ foreignKeyName: "workflow_start_requests_team_id_fkey";
7288
+ columns: ["team_id"];
7289
+ isOneToOne: false;
7290
+ referencedRelation: "teams";
7291
+ referencedColumns: ["id"];
7292
+ }
7293
+ ];
7294
+ };
6843
7295
  };
6844
7296
  Views: {
6845
7297
  agent_cycle_cache_stats: {
@@ -6936,7 +7388,6 @@ export type Database = {
6936
7388
  agent_full: {
6937
7389
  Row: {
6938
7390
  action_summary: string | null;
6939
- agent_runtime: string | null;
6940
7391
  agent_state: string | null;
6941
7392
  auto_model_selection: boolean | null;
6942
7393
  context: string | null;
@@ -7087,7 +7538,6 @@ export type Database = {
7087
7538
  Row: {
7088
7539
  agent_id: string | null;
7089
7540
  agent_name: string | null;
7090
- agent_runtime: string | null;
7091
7541
  available_tools_count: number | null;
7092
7542
  billing_mode: string | null;
7093
7543
  blocked_at: string | null;
@@ -7171,7 +7621,6 @@ export type Database = {
7171
7621
  Row: {
7172
7622
  agent_id: string | null;
7173
7623
  agent_name: string | null;
7174
- agent_runtime: string | null;
7175
7624
  api_calls_count: number | null;
7176
7625
  attempt_id: string | null;
7177
7626
  completed_at: string | null;
@@ -7669,6 +8118,43 @@ export type Database = {
7669
8118
  };
7670
8119
  Returns: Json;
7671
8120
  };
8121
+ acknowledge_drive_sync_cursor: {
8122
+ Args: {
8123
+ p_drive_id: string;
8124
+ p_last_batch_sequence: number;
8125
+ p_last_error?: string;
8126
+ p_sync_client_id: string;
8127
+ };
8128
+ Returns: {
8129
+ created_at: string;
8130
+ drive_id: string;
8131
+ id: string;
8132
+ last_batch_sequence: number;
8133
+ last_error: string | null;
8134
+ last_success_at: string | null;
8135
+ metadata: Json;
8136
+ status: string;
8137
+ sync_client_id: string;
8138
+ updated_at: string;
8139
+ };
8140
+ SetofOptions: {
8141
+ from: "*";
8142
+ to: "drive_sync_cursors";
8143
+ isOneToOne: true;
8144
+ isSetofReturn: false;
8145
+ };
8146
+ };
8147
+ acknowledge_drive_sync_cursor_with_remote_conflicts: {
8148
+ Args: {
8149
+ p_drive_id: string;
8150
+ p_last_batch_sequence: number;
8151
+ p_last_error?: string;
8152
+ p_remote_conflicts?: Json;
8153
+ p_source_operation_id: string;
8154
+ p_sync_client_id: string;
8155
+ };
8156
+ Returns: Json;
8157
+ };
7672
8158
  activate_agent_with_planner: {
7673
8159
  Args: {
7674
8160
  p_action_summary?: string;
@@ -7716,6 +8202,27 @@ export type Database = {
7716
8202
  };
7717
8203
  Returns: number;
7718
8204
  };
8205
+ apply_drive_conflict_actions: {
8206
+ Args: {
8207
+ p_actions?: Json;
8208
+ p_drive_id: string;
8209
+ p_source_operation_id: string;
8210
+ p_sync_client_id: string;
8211
+ };
8212
+ Returns: Json;
8213
+ };
8214
+ apply_local_drive_change_batch: {
8215
+ Args: {
8216
+ p_actor_agent_id?: string;
8217
+ p_base_cursor_sequence?: number;
8218
+ p_batch_group_metadata?: Json;
8219
+ p_changes?: Json;
8220
+ p_drive_id: string;
8221
+ p_source_operation_id: string;
8222
+ p_sync_client_id: string;
8223
+ };
8224
+ Returns: Json;
8225
+ };
7719
8226
  apply_vm_guest_provisioning_patch: {
7720
8227
  Args: {
7721
8228
  p_patch: Json;
@@ -7767,6 +8274,49 @@ export type Database = {
7767
8274
  };
7768
8275
  Returns: undefined;
7769
8276
  };
8277
+ begin_resource_operation: {
8278
+ Args: {
8279
+ p_actor_agent_id?: string;
8280
+ p_expected_chunk_count?: number;
8281
+ p_metadata?: Json;
8282
+ p_payload_fingerprint?: string;
8283
+ p_source_operation: string;
8284
+ p_source_operation_id: string;
8285
+ p_source_type: string;
8286
+ p_team_resource_id: string;
8287
+ };
8288
+ Returns: {
8289
+ accepted_chunk_count: number;
8290
+ actor_agent_id: string | null;
8291
+ counters: Json;
8292
+ created_at: string;
8293
+ emitted_at: string | null;
8294
+ error: string | null;
8295
+ expected_chunk_count: number | null;
8296
+ failed_at: string | null;
8297
+ finalized_at: string | null;
8298
+ id: string;
8299
+ metadata: Json;
8300
+ path_cover: Json;
8301
+ payload_fingerprint: string;
8302
+ resource_type: string;
8303
+ result: Json;
8304
+ source_operation: string;
8305
+ source_operation_id: string;
8306
+ source_type: string;
8307
+ status: string;
8308
+ summary: string | null;
8309
+ team_id: string;
8310
+ team_resource_id: string;
8311
+ updated_at: string;
8312
+ };
8313
+ SetofOptions: {
8314
+ from: "*";
8315
+ to: "resource_operations";
8316
+ isOneToOne: true;
8317
+ isSetofReturn: false;
8318
+ };
8319
+ };
7770
8320
  build_channel_subscription_snapshot: {
7771
8321
  Args: {
7772
8322
  p_conversation_id: string;
@@ -7981,16 +8531,35 @@ export type Database = {
7981
8531
  wake_generation: number;
7982
8532
  }[];
7983
8533
  };
8534
+ claim_model_cache_entry_creation: {
8535
+ Args: {
8536
+ p_agent_id: string;
8537
+ p_cache_strategy: string;
8538
+ p_claimed_by?: string;
8539
+ p_lease_seconds?: number;
8540
+ p_model_id: string;
8541
+ p_prefix_hash: string;
8542
+ p_provider_model_id: string;
8543
+ p_purpose: string;
8544
+ p_tools_hash?: string;
8545
+ };
8546
+ Returns: {
8547
+ action: string;
8548
+ claim_token: string;
8549
+ expires_at: string;
8550
+ lease_expires_at: string;
8551
+ prefix_chars: number;
8552
+ prefix_hash: string;
8553
+ provider_cache_name: string;
8554
+ tools_hash: string;
8555
+ }[];
8556
+ };
7984
8557
  cleanup_deleted_files: {
7985
8558
  Args: {
7986
8559
  p_days_old?: number;
7987
8560
  };
7988
8561
  Returns: number;
7989
8562
  };
7990
- cleanup_expired_file_locks: {
7991
- Args: never;
7992
- Returns: undefined;
7993
- };
7994
8563
  cleanup_expired_oauth_states: {
7995
8564
  Args: never;
7996
8565
  Returns: number;
@@ -8049,33 +8618,28 @@ export type Database = {
8049
8618
  };
8050
8619
  Returns: number;
8051
8620
  };
8052
- complete_linux_agent_execution: {
8621
+ complete_model_cache_entry_creation: {
8053
8622
  Args: {
8623
+ p_agent_id: string;
8624
+ p_cache_strategy: string;
8054
8625
  p_claim_token: string;
8055
- p_control_signal?: string;
8056
- p_duration_ms?: number;
8057
- p_error?: string;
8058
- p_execution_id: string;
8059
- p_execution_metadata?: Json;
8060
- p_execution_status: string;
8061
- p_exit_code?: number;
8062
- p_stderr?: string;
8063
- p_stderr_bytes?: number;
8064
- p_stderr_overflow_ref?: string;
8065
- p_stderr_preview?: string;
8066
- p_stdout?: string;
8067
- p_stdout_bytes?: number;
8068
- p_stdout_overflow_ref?: string;
8069
- p_stdout_preview?: string;
8070
- p_step_error?: string;
8071
- p_step_result?: Json;
8072
- p_step_status?: string;
8073
- p_step_uncertainty_reason?: string;
8626
+ p_expires_at?: string;
8627
+ p_model_id: string;
8628
+ p_prefix_chars: number;
8629
+ p_prefix_hash: string;
8630
+ p_prefix_tokens_estimate: number;
8631
+ p_provider_cache_name: string;
8632
+ p_provider_model_id: string;
8633
+ p_purpose: string;
8634
+ p_tools_hash: string;
8074
8635
  };
8075
8636
  Returns: {
8076
- agent_id: string;
8077
- run_id: string;
8078
- step_updated: boolean;
8637
+ completed: boolean;
8638
+ expires_at: string;
8639
+ prefix_chars: number;
8640
+ prefix_hash: string;
8641
+ provider_cache_name: string;
8642
+ tools_hash: string;
8079
8643
  }[];
8080
8644
  };
8081
8645
  consume_agent_resources: {
@@ -8139,6 +8703,14 @@ export type Database = {
8139
8703
  isSetofReturn: true;
8140
8704
  };
8141
8705
  };
8706
+ copy_agent_home_drive: {
8707
+ Args: {
8708
+ p_actor_user_id?: string;
8709
+ p_source_agent_id: string;
8710
+ p_target_agent_id: string;
8711
+ };
8712
+ Returns: Json;
8713
+ };
8142
8714
  create_agent_event: {
8143
8715
  Args: {
8144
8716
  p_actor?: string;
@@ -8280,14 +8852,17 @@ export type Database = {
8280
8852
  };
8281
8853
  create_drive_directory: {
8282
8854
  Args: {
8855
+ p_actor_agent_id?: string;
8283
8856
  p_drive_id: string;
8284
8857
  p_metadata?: Json;
8285
8858
  p_path: string;
8859
+ p_source_operation_id?: string;
8860
+ p_source_type?: string;
8286
8861
  };
8287
8862
  Returns: {
8288
- content: string | null;
8289
8863
  content_sha256: string | null;
8290
8864
  created_at: string;
8865
+ current_version_id: string | null;
8291
8866
  drive_id: string;
8292
8867
  entry_type: string;
8293
8868
  id: string;
@@ -8306,6 +8881,16 @@ export type Database = {
8306
8881
  isSetofReturn: false;
8307
8882
  };
8308
8883
  };
8884
+ create_drive_directory_with_resource_operation: {
8885
+ Args: {
8886
+ p_actor_agent_id?: string;
8887
+ p_drive_id: string;
8888
+ p_metadata?: Json;
8889
+ p_path: string;
8890
+ p_source_operation_id?: string;
8891
+ };
8892
+ Returns: Json;
8893
+ };
8309
8894
  create_drive_resource: {
8310
8895
  Args: {
8311
8896
  p_created_by?: string;
@@ -8330,58 +8915,6 @@ export type Database = {
8330
8915
  };
8331
8916
  Returns: Json;
8332
8917
  };
8333
- create_linux_agent_execution_if_runnable: {
8334
- Args: {
8335
- p_agent_id: string;
8336
- p_command: string;
8337
- p_cycle_id: string;
8338
- p_host_attempt_generation: number;
8339
- p_host_id: string;
8340
- p_metadata?: Json;
8341
- p_run_id: string;
8342
- p_run_step_id: string;
8343
- p_worker_job_id: string;
8344
- };
8345
- Returns: {
8346
- agent_id: string;
8347
- claim_token: string | null;
8348
- claimed_by: string | null;
8349
- command: string;
8350
- completed_at: string | null;
8351
- control_signal: string | null;
8352
- created_at: string;
8353
- cycle_id: string | null;
8354
- dispatched_at: string | null;
8355
- duration_ms: number | null;
8356
- error: string | null;
8357
- exit_code: number | null;
8358
- host_attempt_generation: number | null;
8359
- host_id: string | null;
8360
- id: string;
8361
- metadata: Json;
8362
- requested_at: string;
8363
- run_id: string | null;
8364
- run_step_id: string | null;
8365
- started_at: string | null;
8366
- status: string;
8367
- stderr: string | null;
8368
- stderr_bytes: number;
8369
- stderr_overflow_ref: string | null;
8370
- stderr_preview: string | null;
8371
- stdout: string | null;
8372
- stdout_bytes: number;
8373
- stdout_overflow_ref: string | null;
8374
- stdout_preview: string | null;
8375
- updated_at: string;
8376
- worker_job_id: string | null;
8377
- };
8378
- SetofOptions: {
8379
- from: "*";
8380
- to: "linux_agent_executions";
8381
- isOneToOne: true;
8382
- isSetofReturn: false;
8383
- };
8384
- };
8385
8918
  create_message: {
8386
8919
  Args: {
8387
8920
  p_agent_id: string;
@@ -8424,6 +8957,16 @@ export type Database = {
8424
8957
  isSetofReturn: false;
8425
8958
  };
8426
8959
  };
8960
+ create_note_resource: {
8961
+ Args: {
8962
+ p_agent_id: string;
8963
+ p_content?: string;
8964
+ p_name: string;
8965
+ p_scope?: string;
8966
+ p_team_id: string;
8967
+ };
8968
+ Returns: Json;
8969
+ };
8427
8970
  create_or_replace_agent_job: {
8428
8971
  Args: {
8429
8972
  p_agent_id: string;
@@ -8632,13 +9175,16 @@ export type Database = {
8632
9175
  };
8633
9176
  delete_drive_entry: {
8634
9177
  Args: {
9178
+ p_actor_agent_id?: string;
8635
9179
  p_drive_id: string;
8636
9180
  p_path: string;
9181
+ p_source_operation_id?: string;
9182
+ p_source_type?: string;
8637
9183
  };
8638
9184
  Returns: {
8639
- content: string | null;
8640
9185
  content_sha256: string | null;
8641
9186
  created_at: string;
9187
+ current_version_id: string | null;
8642
9188
  drive_id: string;
8643
9189
  entry_type: string;
8644
9190
  id: string;
@@ -8657,6 +9203,22 @@ export type Database = {
8657
9203
  isSetofReturn: false;
8658
9204
  };
8659
9205
  };
9206
+ delete_drive_entry_with_resource_operation: {
9207
+ Args: {
9208
+ p_actor_agent_id?: string;
9209
+ p_drive_id: string;
9210
+ p_path: string;
9211
+ p_source_operation_id?: string;
9212
+ };
9213
+ Returns: Json;
9214
+ };
9215
+ delete_note_resource_with_base_version: {
9216
+ Args: {
9217
+ p_base_version_id: string;
9218
+ p_resource_id: string;
9219
+ };
9220
+ Returns: Json;
9221
+ };
8660
9222
  delete_team_resource_for_stored_resource_identity: {
8661
9223
  Args: {
8662
9224
  p_owner_agent_id: string;
@@ -8716,59 +9278,19 @@ export type Database = {
8716
9278
  };
8717
9279
  Returns: string;
8718
9280
  };
8719
- dispatch_linux_agent_execution: {
9281
+ drive_entry_name: {
8720
9282
  Args: {
8721
- p_agent_id: string;
8722
- p_claim_token?: string;
8723
- p_claimed_by: string;
8724
- p_host_attempt_generation: number;
8725
- p_host_id: string;
8726
- };
8727
- Returns: {
8728
- agent_id: string;
8729
- claim_token: string | null;
8730
- claimed_by: string | null;
8731
- command: string;
8732
- completed_at: string | null;
8733
- control_signal: string | null;
8734
- created_at: string;
8735
- cycle_id: string | null;
8736
- dispatched_at: string | null;
8737
- duration_ms: number | null;
8738
- error: string | null;
8739
- exit_code: number | null;
8740
- host_attempt_generation: number | null;
8741
- host_id: string | null;
8742
- id: string;
8743
- metadata: Json;
8744
- requested_at: string;
8745
- run_id: string | null;
8746
- run_step_id: string | null;
8747
- started_at: string | null;
8748
- status: string;
8749
- stderr: string | null;
8750
- stderr_bytes: number;
8751
- stderr_overflow_ref: string | null;
8752
- stderr_preview: string | null;
8753
- stdout: string | null;
8754
- stdout_bytes: number;
8755
- stdout_overflow_ref: string | null;
8756
- stdout_preview: string | null;
8757
- updated_at: string;
8758
- worker_job_id: string | null;
8759
- };
8760
- SetofOptions: {
8761
- from: "*";
8762
- to: "linux_agent_executions";
8763
- isOneToOne: true;
8764
- isSetofReturn: false;
9283
+ p_path: string;
8765
9284
  };
9285
+ Returns: string;
8766
9286
  };
8767
- drive_entry_name: {
9287
+ drive_has_newer_subtree_change: {
8768
9288
  Args: {
9289
+ p_base_cursor_sequence: number;
9290
+ p_drive_id: string;
8769
9291
  p_path: string;
8770
9292
  };
8771
- Returns: string;
9293
+ Returns: boolean;
8772
9294
  };
8773
9295
  drive_parent_path: {
8774
9296
  Args: {
@@ -8776,12 +9298,32 @@ export type Database = {
8776
9298
  };
8777
9299
  Returns: string;
8778
9300
  };
9301
+ drive_paths_subtree_overlap: {
9302
+ Args: {
9303
+ p_left_path: string;
9304
+ p_right_path: string;
9305
+ };
9306
+ Returns: boolean;
9307
+ };
9308
+ drive_sync_client_can_access_drive: {
9309
+ Args: {
9310
+ p_drive_id: string;
9311
+ p_sync_client_id: string;
9312
+ };
9313
+ Returns: boolean;
9314
+ };
8779
9315
  drive_target_paths: {
8780
9316
  Args: {
8781
9317
  p_path: string;
8782
9318
  };
8783
9319
  Returns: string[];
8784
9320
  };
9321
+ emit_drive_change_batch_resource_event: {
9322
+ Args: {
9323
+ p_batch_id: string;
9324
+ };
9325
+ Returns: undefined;
9326
+ };
8785
9327
  emit_drive_resource_event: {
8786
9328
  Args: {
8787
9329
  p_change_summary: string;
@@ -8801,6 +9343,42 @@ export type Database = {
8801
9343
  };
8802
9344
  Returns: undefined;
8803
9345
  };
9346
+ emit_finalized_resource_operation: {
9347
+ Args: {
9348
+ p_operation_id: string;
9349
+ };
9350
+ Returns: {
9351
+ accepted_chunk_count: number;
9352
+ actor_agent_id: string | null;
9353
+ counters: Json;
9354
+ created_at: string;
9355
+ emitted_at: string | null;
9356
+ error: string | null;
9357
+ expected_chunk_count: number | null;
9358
+ failed_at: string | null;
9359
+ finalized_at: string | null;
9360
+ id: string;
9361
+ metadata: Json;
9362
+ path_cover: Json;
9363
+ payload_fingerprint: string;
9364
+ resource_type: string;
9365
+ result: Json;
9366
+ source_operation: string;
9367
+ source_operation_id: string;
9368
+ source_type: string;
9369
+ status: string;
9370
+ summary: string | null;
9371
+ team_id: string;
9372
+ team_resource_id: string;
9373
+ updated_at: string;
9374
+ };
9375
+ SetofOptions: {
9376
+ from: "*";
9377
+ to: "resource_operations";
9378
+ isOneToOne: true;
9379
+ isSetofReturn: false;
9380
+ };
9381
+ };
8804
9382
  emit_vm_gateway_runtime_change: {
8805
9383
  Args: {
8806
9384
  p_device_name?: string;
@@ -8896,6 +9474,18 @@ export type Database = {
8896
9474
  };
8897
9475
  Returns: undefined;
8898
9476
  };
9477
+ enqueue_rationalize_agent_template_job: {
9478
+ Args: {
9479
+ p_requested_by: string;
9480
+ p_source_agent_id: string;
9481
+ p_template_id: string;
9482
+ };
9483
+ Returns: {
9484
+ job_id: number;
9485
+ message: string;
9486
+ success: boolean;
9487
+ }[];
9488
+ };
8899
9489
  enqueue_subagent_notification_event_job: {
8900
9490
  Args: {
8901
9491
  p_delay_seconds?: number;
@@ -8940,6 +9530,13 @@ export type Database = {
8940
9530
  isSetofReturn: false;
8941
9531
  };
8942
9532
  };
9533
+ ensure_agent_home_drive: {
9534
+ Args: {
9535
+ p_agent_id: string;
9536
+ p_created_by?: string;
9537
+ };
9538
+ Returns: Json;
9539
+ };
8943
9540
  ensure_agent_peer_conversation: {
8944
9541
  Args: {
8945
9542
  p_source_agent_id: string;
@@ -8980,6 +9577,30 @@ export type Database = {
8980
9577
  };
8981
9578
  Returns: undefined;
8982
9579
  };
9580
+ ensure_drive_sync_cursor: {
9581
+ Args: {
9582
+ p_drive_id: string;
9583
+ p_sync_client_id: string;
9584
+ };
9585
+ Returns: {
9586
+ created_at: string;
9587
+ drive_id: string;
9588
+ id: string;
9589
+ last_batch_sequence: number;
9590
+ last_error: string | null;
9591
+ last_success_at: string | null;
9592
+ metadata: Json;
9593
+ status: string;
9594
+ sync_client_id: string;
9595
+ updated_at: string;
9596
+ };
9597
+ SetofOptions: {
9598
+ from: "*";
9599
+ to: "drive_sync_cursors";
9600
+ isOneToOne: true;
9601
+ isSetofReturn: false;
9602
+ };
9603
+ };
8983
9604
  ensure_health_alert_resources: {
8984
9605
  Args: {
8985
9606
  p_team_id: string;
@@ -9054,6 +9675,59 @@ export type Database = {
9054
9675
  };
9055
9676
  Returns: Json;
9056
9677
  };
9678
+ fail_model_cache_entry_creation: {
9679
+ Args: {
9680
+ p_agent_id: string;
9681
+ p_cache_strategy: string;
9682
+ p_claim_token: string;
9683
+ p_error?: string;
9684
+ p_model_id: string;
9685
+ p_prefix_hash: string;
9686
+ p_provider_model_id: string;
9687
+ p_purpose: string;
9688
+ p_tools_hash: string;
9689
+ };
9690
+ Returns: boolean;
9691
+ };
9692
+ fail_resource_operation: {
9693
+ Args: {
9694
+ p_error: string;
9695
+ p_metadata?: Json;
9696
+ p_operation_id: string;
9697
+ p_result?: Json;
9698
+ };
9699
+ Returns: {
9700
+ accepted_chunk_count: number;
9701
+ actor_agent_id: string | null;
9702
+ counters: Json;
9703
+ created_at: string;
9704
+ emitted_at: string | null;
9705
+ error: string | null;
9706
+ expected_chunk_count: number | null;
9707
+ failed_at: string | null;
9708
+ finalized_at: string | null;
9709
+ id: string;
9710
+ metadata: Json;
9711
+ path_cover: Json;
9712
+ payload_fingerprint: string;
9713
+ resource_type: string;
9714
+ result: Json;
9715
+ source_operation: string;
9716
+ source_operation_id: string;
9717
+ source_type: string;
9718
+ status: string;
9719
+ summary: string | null;
9720
+ team_id: string;
9721
+ team_resource_id: string;
9722
+ updated_at: string;
9723
+ };
9724
+ SetofOptions: {
9725
+ from: "*";
9726
+ to: "resource_operations";
9727
+ isOneToOne: true;
9728
+ isSetofReturn: false;
9729
+ };
9730
+ };
9057
9731
  finalize_agent_name_creation: {
9058
9732
  Args: {
9059
9733
  p_action_summary: string;
@@ -9092,6 +9766,46 @@ export type Database = {
9092
9766
  run_status: string;
9093
9767
  }[];
9094
9768
  };
9769
+ finalize_resource_operation: {
9770
+ Args: {
9771
+ p_counters?: Json;
9772
+ p_metadata?: Json;
9773
+ p_operation_id: string;
9774
+ p_result?: Json;
9775
+ p_summary?: string;
9776
+ };
9777
+ Returns: {
9778
+ accepted_chunk_count: number;
9779
+ actor_agent_id: string | null;
9780
+ counters: Json;
9781
+ created_at: string;
9782
+ emitted_at: string | null;
9783
+ error: string | null;
9784
+ expected_chunk_count: number | null;
9785
+ failed_at: string | null;
9786
+ finalized_at: string | null;
9787
+ id: string;
9788
+ metadata: Json;
9789
+ path_cover: Json;
9790
+ payload_fingerprint: string;
9791
+ resource_type: string;
9792
+ result: Json;
9793
+ source_operation: string;
9794
+ source_operation_id: string;
9795
+ source_type: string;
9796
+ status: string;
9797
+ summary: string | null;
9798
+ team_id: string;
9799
+ team_resource_id: string;
9800
+ updated_at: string;
9801
+ };
9802
+ SetofOptions: {
9803
+ from: "*";
9804
+ to: "resource_operations";
9805
+ isOneToOne: true;
9806
+ isSetofReturn: false;
9807
+ };
9808
+ };
9095
9809
  finalize_vm_bootstrap_exchange: {
9096
9810
  Args: {
9097
9811
  p_device_name?: string;
@@ -9536,30 +10250,6 @@ export type Database = {
9536
10250
  visibility: string;
9537
10251
  }[];
9538
10252
  };
9539
- get_note_history: {
9540
- Args: {
9541
- p_agent_id: string;
9542
- p_note_name: string;
9543
- };
9544
- Returns: {
9545
- content: string;
9546
- previous_version_id: string;
9547
- version_created_at: string;
9548
- version_id: string;
9549
- }[];
9550
- };
9551
- get_note_lines: {
9552
- Args: {
9553
- p_agent_id: string;
9554
- p_end_line?: number;
9555
- p_note_name: string;
9556
- p_start_line: number;
9557
- };
9558
- Returns: {
9559
- content: string;
9560
- line_number: number;
9561
- }[];
9562
- };
9563
10253
  get_oldest_logs_chunk: {
9564
10254
  Args: {
9565
10255
  p_after_timestamp: string;
@@ -9586,6 +10276,44 @@ export type Database = {
9586
10276
  total_chars: number;
9587
10277
  }[];
9588
10278
  };
10279
+ get_resource_operation_by_source_id: {
10280
+ Args: {
10281
+ p_source_operation_id: string;
10282
+ p_source_type: string;
10283
+ p_team_resource_id: string;
10284
+ };
10285
+ Returns: {
10286
+ accepted_chunk_count: number;
10287
+ actor_agent_id: string | null;
10288
+ counters: Json;
10289
+ created_at: string;
10290
+ emitted_at: string | null;
10291
+ error: string | null;
10292
+ expected_chunk_count: number | null;
10293
+ failed_at: string | null;
10294
+ finalized_at: string | null;
10295
+ id: string;
10296
+ metadata: Json;
10297
+ path_cover: Json;
10298
+ payload_fingerprint: string;
10299
+ resource_type: string;
10300
+ result: Json;
10301
+ source_operation: string;
10302
+ source_operation_id: string;
10303
+ source_type: string;
10304
+ status: string;
10305
+ summary: string | null;
10306
+ team_id: string;
10307
+ team_resource_id: string;
10308
+ updated_at: string;
10309
+ };
10310
+ SetofOptions: {
10311
+ from: "*";
10312
+ to: "resource_operations";
10313
+ isOneToOne: true;
10314
+ isSetofReturn: false;
10315
+ };
10316
+ };
9589
10317
  get_subagent_timeline_items: {
9590
10318
  Args: {
9591
10319
  p_cursor_run_sequence?: number;
@@ -9630,7 +10358,6 @@ export type Database = {
9630
10358
  };
9631
10359
  Returns: {
9632
10360
  action_summary: string | null;
9633
- agent_runtime: string | null;
9634
10361
  agent_state: string | null;
9635
10362
  auto_model_selection: boolean | null;
9636
10363
  context: string | null;
@@ -10042,37 +10769,37 @@ export type Database = {
10042
10769
  };
10043
10770
  Returns: Json;
10044
10771
  };
10045
- interrupt_linux_agent_executions: {
10772
+ insert_note_resource_version: {
10046
10773
  Args: {
10047
- p_agent_id: string;
10048
- p_control_signal?: string;
10049
- p_execution_error?: string;
10050
- p_execution_metadata?: Json;
10051
- p_pending_step_status?: string;
10052
- p_running_step_status?: string;
10053
- p_step_error?: string;
10054
- p_step_result?: Json;
10055
- p_step_uncertainty_reason?: string;
10774
+ p_content: string;
10775
+ p_name: string;
10776
+ p_previous_version_id?: string;
10777
+ p_resource: Database["public"]["Tables"]["team_resources"]["Row"];
10056
10778
  };
10057
10779
  Returns: {
10058
- applied_step_status: string;
10059
- execution_id: string;
10060
- previous_execution_status: string;
10061
- run_id: string;
10062
- run_step_id: string;
10063
- }[];
10064
- };
10065
- interrupt_tool_invocations: {
10066
- Args: {
10067
- p_agent_id: string;
10068
- p_invocation_metadata?: Json;
10069
- p_system_error?: string;
10780
+ agent_id: string | null;
10781
+ content: string;
10782
+ created_at: string;
10783
+ database_schema: Json | null;
10784
+ deleted_at: string | null;
10785
+ id: string;
10786
+ name: string;
10787
+ previous_version_id: string | null;
10788
+ resource_kind: string;
10789
+ scope: string;
10790
+ size_bytes: number | null;
10791
+ team_id: string;
10792
+ team_resource_id: string | null;
10793
+ updated_at: string;
10794
+ version_created_at: string;
10795
+ version_id: string;
10796
+ };
10797
+ SetofOptions: {
10798
+ from: "*";
10799
+ to: "stored_resources";
10800
+ isOneToOne: true;
10801
+ isSetofReturn: false;
10070
10802
  };
10071
- Returns: {
10072
- applied_status: string;
10073
- previous_status: string;
10074
- tool_invocation_id: string;
10075
- }[];
10076
10803
  };
10077
10804
  invite_team_member: {
10078
10805
  Args: {
@@ -10089,13 +10816,6 @@ export type Database = {
10089
10816
  };
10090
10817
  Returns: boolean;
10091
10818
  };
10092
- is_current_linux_host_runtime: {
10093
- Args: {
10094
- p_attempt_generation: number;
10095
- p_host_id: string;
10096
- };
10097
- Returns: boolean;
10098
- };
10099
10819
  is_dev_access_allowed: {
10100
10820
  Args: never;
10101
10821
  Returns: boolean;
@@ -10181,6 +10901,20 @@ export type Database = {
10181
10901
  user_id: string;
10182
10902
  }[];
10183
10903
  };
10904
+ log_agent_configuration_change: {
10905
+ Args: {
10906
+ p_actor_id?: string;
10907
+ p_actor_type?: string;
10908
+ p_agent_id: string;
10909
+ p_change_type: string;
10910
+ p_details?: Json;
10911
+ p_formatted_content?: string;
10912
+ p_source?: string;
10913
+ p_summary?: string;
10914
+ p_title?: string;
10915
+ };
10916
+ Returns: string;
10917
+ };
10184
10918
  log_agent_cycle_event_once: {
10185
10919
  Args: {
10186
10920
  p_actor?: string;
@@ -10256,6 +10990,16 @@ export type Database = {
10256
10990
  };
10257
10991
  Returns: string;
10258
10992
  };
10993
+ log_resource_subscription_change: {
10994
+ Args: {
10995
+ p_actor_id?: string;
10996
+ p_actor_type?: string;
10997
+ p_agent_id: string;
10998
+ p_change_type: string;
10999
+ p_details?: Json;
11000
+ };
11001
+ Returns: string;
11002
+ };
10259
11003
  mark_chat_as_viewed: {
10260
11004
  Args: {
10261
11005
  p_agent_id: string;
@@ -10279,14 +11023,17 @@ export type Database = {
10279
11023
  };
10280
11024
  move_drive_entry: {
10281
11025
  Args: {
11026
+ p_actor_agent_id?: string;
10282
11027
  p_drive_id: string;
10283
11028
  p_from_path: string;
11029
+ p_source_operation_id?: string;
11030
+ p_source_type?: string;
10284
11031
  p_to_path: string;
10285
11032
  };
10286
11033
  Returns: {
10287
- content: string | null;
10288
11034
  content_sha256: string | null;
10289
11035
  created_at: string;
11036
+ current_version_id: string | null;
10290
11037
  drive_id: string;
10291
11038
  entry_type: string;
10292
11039
  id: string;
@@ -10300,7 +11047,56 @@ export type Database = {
10300
11047
  };
10301
11048
  SetofOptions: {
10302
11049
  from: "*";
10303
- to: "drive_entries";
11050
+ to: "drive_entries";
11051
+ isOneToOne: true;
11052
+ isSetofReturn: false;
11053
+ };
11054
+ };
11055
+ move_drive_entry_with_resource_operation: {
11056
+ Args: {
11057
+ p_actor_agent_id?: string;
11058
+ p_drive_id: string;
11059
+ p_from_path: string;
11060
+ p_source_operation_id?: string;
11061
+ p_to_path: string;
11062
+ };
11063
+ Returns: Json;
11064
+ };
11065
+ noop_resource_operation: {
11066
+ Args: {
11067
+ p_metadata?: Json;
11068
+ p_operation_id: string;
11069
+ p_result?: Json;
11070
+ p_summary?: string;
11071
+ };
11072
+ Returns: {
11073
+ accepted_chunk_count: number;
11074
+ actor_agent_id: string | null;
11075
+ counters: Json;
11076
+ created_at: string;
11077
+ emitted_at: string | null;
11078
+ error: string | null;
11079
+ expected_chunk_count: number | null;
11080
+ failed_at: string | null;
11081
+ finalized_at: string | null;
11082
+ id: string;
11083
+ metadata: Json;
11084
+ path_cover: Json;
11085
+ payload_fingerprint: string;
11086
+ resource_type: string;
11087
+ result: Json;
11088
+ source_operation: string;
11089
+ source_operation_id: string;
11090
+ source_type: string;
11091
+ status: string;
11092
+ summary: string | null;
11093
+ team_id: string;
11094
+ team_resource_id: string;
11095
+ updated_at: string;
11096
+ };
11097
+ SetofOptions: {
11098
+ from: "*";
11099
+ to: "resource_operations";
10304
11100
  isOneToOne: true;
10305
11101
  isSetofReturn: false;
10306
11102
  };
@@ -10323,6 +11119,22 @@ export type Database = {
10323
11119
  };
10324
11120
  Returns: string;
10325
11121
  };
11122
+ note_resource_conflict_result: {
11123
+ Args: {
11124
+ p_base_version_id: string;
11125
+ p_current: Database["public"]["Tables"]["stored_resources"]["Row"];
11126
+ p_operation: string;
11127
+ p_resource: Database["public"]["Tables"]["team_resources"]["Row"];
11128
+ };
11129
+ Returns: Json;
11130
+ };
11131
+ note_resource_success_result: {
11132
+ Args: {
11133
+ p_note: Database["public"]["Tables"]["stored_resources"]["Row"];
11134
+ p_resource: Database["public"]["Tables"]["team_resources"]["Row"];
11135
+ };
11136
+ Returns: Json;
11137
+ };
10326
11138
  notify_agent: {
10327
11139
  Args: {
10328
11140
  p_agent_id: string;
@@ -10423,6 +11235,29 @@ export type Database = {
10423
11235
  };
10424
11236
  Returns: Json;
10425
11237
  };
11238
+ queue_drive_object_cleanup: {
11239
+ Args: {
11240
+ p_drive_id: string;
11241
+ p_reason?: string;
11242
+ };
11243
+ Returns: number;
11244
+ };
11245
+ queue_drive_object_cleanup_key: {
11246
+ Args: {
11247
+ p_drive_id: string;
11248
+ p_reason?: string;
11249
+ p_storage_key: string;
11250
+ };
11251
+ Returns: boolean;
11252
+ };
11253
+ queue_team_agent_setup_if_ready: {
11254
+ Args: {
11255
+ p_source: string;
11256
+ p_subscription_id?: string;
11257
+ p_team_id: string;
11258
+ };
11259
+ Returns: undefined;
11260
+ };
10426
11261
  reconcile_stale_vm_gateway_runtime_events: {
10427
11262
  Args: {
10428
11263
  p_limit?: number;
@@ -10439,6 +11274,42 @@ export type Database = {
10439
11274
  };
10440
11275
  Returns: Json;
10441
11276
  };
11277
+ record_drive_change_batch: {
11278
+ Args: {
11279
+ p_actor_agent_id?: string;
11280
+ p_confidence?: string;
11281
+ p_counters?: Json;
11282
+ p_drive_id: string;
11283
+ p_observation_metadata?: Json;
11284
+ p_path_cover?: Json;
11285
+ p_source_operation: string;
11286
+ p_source_operation_id: string;
11287
+ p_source_type: string;
11288
+ p_summary?: string;
11289
+ };
11290
+ Returns: {
11291
+ actor_agent_id: string | null;
11292
+ completed_at: string;
11293
+ confidence: string;
11294
+ counters: Json;
11295
+ created_at: string;
11296
+ drive_id: string;
11297
+ id: string;
11298
+ observation_metadata: Json;
11299
+ sequence: number;
11300
+ source_operation: string;
11301
+ source_operation_id: string;
11302
+ source_type: string;
11303
+ subscription_notified_at: string | null;
11304
+ summary: string;
11305
+ };
11306
+ SetofOptions: {
11307
+ from: "*";
11308
+ to: "drive_change_batches";
11309
+ isOneToOne: true;
11310
+ isSetofReturn: false;
11311
+ };
11312
+ };
10442
11313
  record_health_alert: {
10443
11314
  Args: {
10444
11315
  p_alert_type: string;
@@ -10497,6 +11368,35 @@ export type Database = {
10497
11368
  };
10498
11369
  Returns: string;
10499
11370
  };
11371
+ record_resource_operation_chunk: {
11372
+ Args: {
11373
+ p_chunk_index: number;
11374
+ p_counters?: Json;
11375
+ p_metadata?: Json;
11376
+ p_operation_id: string;
11377
+ p_path_cover?: Json;
11378
+ p_result?: Json;
11379
+ };
11380
+ Returns: {
11381
+ accepted_at: string;
11382
+ chunk_index: number;
11383
+ counters: Json;
11384
+ created_at: string;
11385
+ id: string;
11386
+ metadata: Json;
11387
+ operation_id: string;
11388
+ path_cover: Json;
11389
+ result: Json;
11390
+ team_resource_id: string;
11391
+ updated_at: string;
11392
+ };
11393
+ SetofOptions: {
11394
+ from: "*";
11395
+ to: "resource_operation_chunks";
11396
+ isOneToOne: true;
11397
+ isSetofReturn: false;
11398
+ };
11399
+ };
10500
11400
  recover_agent_after_cycle_failure: {
10501
11401
  Args: {
10502
11402
  p_agent_id: string;
@@ -10571,6 +11471,12 @@ export type Database = {
10571
11471
  };
10572
11472
  Returns: undefined;
10573
11473
  };
11474
+ refresh_note_team_resource_from_latest: {
11475
+ Args: {
11476
+ p_resource_id: string;
11477
+ };
11478
+ Returns: string;
11479
+ };
10574
11480
  refresh_team_members_subscription_state: {
10575
11481
  Args: {
10576
11482
  p_observed_at?: string;
@@ -10624,6 +11530,36 @@ export type Database = {
10624
11530
  };
10625
11531
  Returns: string;
10626
11532
  };
11533
+ register_drive_sync_client: {
11534
+ Args: {
11535
+ p_agent_id?: string;
11536
+ p_client_key?: string;
11537
+ p_display_name?: string;
11538
+ p_host_id?: string;
11539
+ p_metadata?: Json;
11540
+ p_team_id: string;
11541
+ p_vm_id?: string;
11542
+ };
11543
+ Returns: {
11544
+ agent_id: string | null;
11545
+ client_key: string;
11546
+ created_at: string;
11547
+ display_name: string | null;
11548
+ host_id: string | null;
11549
+ id: string;
11550
+ metadata: Json;
11551
+ status: string;
11552
+ team_id: string;
11553
+ updated_at: string;
11554
+ vm_id: string | null;
11555
+ };
11556
+ SetofOptions: {
11557
+ from: "*";
11558
+ to: "drive_sync_clients";
11559
+ isOneToOne: true;
11560
+ isSetofReturn: false;
11561
+ };
11562
+ };
10627
11563
  register_native_tools: {
10628
11564
  Args: {
10629
11565
  p_tools: Json;
@@ -10684,19 +11620,71 @@ export type Database = {
10684
11620
  isSetofReturn: false;
10685
11621
  };
10686
11622
  };
10687
- request_linux_host_runtime_intent: {
11623
+ rename_note_resource_with_base_version: {
10688
11624
  Args: {
10689
- p_agent_id: string;
10690
- p_allocation_state?: string;
10691
- p_desired_power_state?: string;
10692
- p_priority?: number;
10693
- p_queue_name?: string;
10694
- p_reason?: string;
10695
- p_request_payload?: Json;
10696
- p_requested_by?: string;
11625
+ p_base_version_id: string;
11626
+ p_new_name: string;
11627
+ p_resource_id: string;
10697
11628
  };
10698
11629
  Returns: Json;
10699
11630
  };
11631
+ repair_committed_drive_uploads: {
11632
+ Args: {
11633
+ p_storage_keys?: string[];
11634
+ };
11635
+ Returns: number;
11636
+ };
11637
+ report_drive_sync_status: {
11638
+ Args: {
11639
+ p_drive_id: string;
11640
+ p_last_applied_batch_count?: number;
11641
+ p_last_applied_path_count?: number;
11642
+ p_last_batch_sequence?: number;
11643
+ p_last_deferred_file_count?: number;
11644
+ p_last_error?: string;
11645
+ p_last_reason?: string;
11646
+ p_last_remote_conflict_count?: number;
11647
+ p_last_uploaded_applied_count?: number;
11648
+ p_last_uploaded_batch_count?: number;
11649
+ p_last_uploaded_change_count?: number;
11650
+ p_last_uploaded_conflict_count?: number;
11651
+ p_last_uploaded_rejected_count?: number;
11652
+ p_last_uploaded_unsupported_count?: number;
11653
+ p_metadata?: Json;
11654
+ p_status?: string;
11655
+ p_sync_client_id: string;
11656
+ };
11657
+ Returns: {
11658
+ created_at: string;
11659
+ drive_id: string;
11660
+ id: string;
11661
+ last_applied_batch_count: number;
11662
+ last_applied_path_count: number;
11663
+ last_batch_sequence: number | null;
11664
+ last_deferred_file_count: number;
11665
+ last_error: string | null;
11666
+ last_reason: string | null;
11667
+ last_remote_conflict_count: number;
11668
+ last_success_at: string | null;
11669
+ last_sync_at: string;
11670
+ last_uploaded_applied_count: number;
11671
+ last_uploaded_batch_count: number;
11672
+ last_uploaded_change_count: number;
11673
+ last_uploaded_conflict_count: number;
11674
+ last_uploaded_rejected_count: number;
11675
+ last_uploaded_unsupported_count: number;
11676
+ metadata: Json;
11677
+ status: string;
11678
+ sync_client_id: string;
11679
+ updated_at: string;
11680
+ };
11681
+ SetofOptions: {
11682
+ from: "*";
11683
+ to: "drive_sync_status_reports";
11684
+ isOneToOne: true;
11685
+ isSetofReturn: false;
11686
+ };
11687
+ };
10700
11688
  request_vm_operation: {
10701
11689
  Args: {
10702
11690
  p_idempotency_key?: string;
@@ -10814,12 +11802,13 @@ export type Database = {
10814
11802
  };
10815
11803
  Returns: Json;
10816
11804
  };
10817
- restore_note_version: {
11805
+ restore_note_resource_version: {
10818
11806
  Args: {
10819
- p_agent_id: string;
11807
+ p_base_version_id: string;
11808
+ p_resource_id: string;
10820
11809
  p_version_id: string;
10821
11810
  };
10822
- Returns: string;
11811
+ Returns: Json;
10823
11812
  };
10824
11813
  restore_wiki_page_version: {
10825
11814
  Args: {
@@ -10843,50 +11832,13 @@ export type Database = {
10843
11832
  };
10844
11833
  Returns: Json;
10845
11834
  };
10846
- save_stored_resource_version: {
11835
+ save_note_resource_with_base_version: {
10847
11836
  Args: {
10848
- p_agent_id: string;
11837
+ p_base_version_id: string;
10849
11838
  p_content: string;
10850
- p_database_schema?: Json;
10851
- p_exclude_storage_id?: string;
10852
- p_resource_name: string;
10853
- p_scope?: string;
10854
- p_team_id?: string;
10855
- };
10856
- Returns: string;
10857
- };
10858
- search_agent_stored_resources: {
10859
- Args: {
10860
- p_agent_id: string;
10861
- p_limit?: number;
10862
- p_search_query: string;
10863
- };
10864
- Returns: {
10865
- agent_id: string;
10866
- created_at: string;
10867
- id: string;
10868
- name: string;
10869
- resource_kind: string;
10870
- size_bytes: number;
10871
- updated_at: string;
10872
- }[];
10873
- };
10874
- search_agent_stored_resources_with_match_type: {
10875
- Args: {
10876
- p_agent_id: string;
10877
- p_limit?: number;
10878
- p_search_query: string;
11839
+ p_resource_id: string;
10879
11840
  };
10880
- Returns: {
10881
- created_at: string;
10882
- id: string;
10883
- match_type: string;
10884
- name: string;
10885
- rank: number;
10886
- resource_kind: string;
10887
- size_bytes: number;
10888
- updated_at: string;
10889
- }[];
11841
+ Returns: Json;
10890
11842
  };
10891
11843
  search_log_embeddings: {
10892
11844
  Args: {
@@ -10906,30 +11858,18 @@ export type Database = {
10906
11858
  similarity: number;
10907
11859
  }[];
10908
11860
  };
10909
- search_note_with_context: {
10910
- Args: {
10911
- p_agent_id: string;
10912
- p_context_lines?: number;
10913
- p_note_name: string;
10914
- p_search_term: string;
10915
- };
10916
- Returns: {
10917
- content: string;
10918
- is_match: boolean;
10919
- line_number: number;
10920
- }[];
10921
- };
10922
- search_notes: {
11861
+ search_note_resources: {
10923
11862
  Args: {
10924
11863
  p_agent_id: string;
10925
11864
  p_limit?: number;
10926
- p_search_term: string;
11865
+ p_search_query: string;
10927
11866
  };
10928
11867
  Returns: {
10929
- content_preview: string;
10930
- file_name: string;
10931
- file_path: string;
10932
- match_count: number;
11868
+ match_type: string;
11869
+ name: string;
11870
+ rank: number;
11871
+ size_bytes: number;
11872
+ team_resource_id: string;
10933
11873
  updated_at: string;
10934
11874
  }[];
10935
11875
  };
@@ -11020,6 +11960,12 @@ export type Database = {
11020
11960
  version: string;
11021
11961
  }[];
11022
11962
  };
11963
+ select_current_note_resource_for_update: {
11964
+ Args: {
11965
+ p_resource_id: string;
11966
+ };
11967
+ Returns: Record<string, unknown>;
11968
+ };
11023
11969
  set_agent_creation_step: {
11024
11970
  Args: {
11025
11971
  p_agent_id: string;
@@ -11089,14 +12035,6 @@ export type Database = {
11089
12035
  };
11090
12036
  Returns: Json;
11091
12037
  };
11092
- soft_delete_stored_resource: {
11093
- Args: {
11094
- p_agent_id?: string;
11095
- p_resource_name?: string;
11096
- p_team_id: string;
11097
- };
11098
- Returns: boolean;
11099
- };
11100
12038
  soft_delete_team: {
11101
12039
  Args: {
11102
12040
  p_team_id: string;
@@ -11116,52 +12054,6 @@ export type Database = {
11116
12054
  };
11117
12055
  Returns: boolean;
11118
12056
  };
11119
- start_linux_agent_execution: {
11120
- Args: {
11121
- p_claim_token: string;
11122
- p_claimed_by: string;
11123
- p_execution_id: string;
11124
- };
11125
- Returns: {
11126
- agent_id: string;
11127
- claim_token: string | null;
11128
- claimed_by: string | null;
11129
- command: string;
11130
- completed_at: string | null;
11131
- control_signal: string | null;
11132
- created_at: string;
11133
- cycle_id: string | null;
11134
- dispatched_at: string | null;
11135
- duration_ms: number | null;
11136
- error: string | null;
11137
- exit_code: number | null;
11138
- host_attempt_generation: number | null;
11139
- host_id: string | null;
11140
- id: string;
11141
- metadata: Json;
11142
- requested_at: string;
11143
- run_id: string | null;
11144
- run_step_id: string | null;
11145
- started_at: string | null;
11146
- status: string;
11147
- stderr: string | null;
11148
- stderr_bytes: number;
11149
- stderr_overflow_ref: string | null;
11150
- stderr_preview: string | null;
11151
- stdout: string | null;
11152
- stdout_bytes: number;
11153
- stdout_overflow_ref: string | null;
11154
- stdout_preview: string | null;
11155
- updated_at: string;
11156
- worker_job_id: string | null;
11157
- };
11158
- SetofOptions: {
11159
- from: "*";
11160
- to: "linux_agent_executions";
11161
- isOneToOne: true;
11162
- isSetofReturn: false;
11163
- };
11164
- };
11165
12057
  switch_team: {
11166
12058
  Args: {
11167
12059
  p_team_id: string;
@@ -11457,16 +12349,57 @@ export type Database = {
11457
12349
  };
11458
12350
  write_drive_file: {
11459
12351
  Args: {
12352
+ p_actor_agent_id?: string;
11460
12353
  p_content_base64?: string;
11461
12354
  p_content_text?: string;
11462
12355
  p_drive_id: string;
12356
+ p_expected_version_id?: string;
11463
12357
  p_mime_type?: string;
11464
12358
  p_path: string;
12359
+ p_source_operation_id?: string;
12360
+ p_source_type?: string;
12361
+ };
12362
+ Returns: {
12363
+ content_sha256: string | null;
12364
+ created_at: string;
12365
+ current_version_id: string | null;
12366
+ drive_id: string;
12367
+ entry_type: string;
12368
+ id: string;
12369
+ metadata: Json;
12370
+ mime_type: string | null;
12371
+ name: string;
12372
+ parent_path: string | null;
12373
+ path: string;
12374
+ size_bytes: number;
12375
+ updated_at: string;
12376
+ };
12377
+ SetofOptions: {
12378
+ from: "*";
12379
+ to: "drive_entries";
12380
+ isOneToOne: true;
12381
+ isSetofReturn: false;
12382
+ };
12383
+ };
12384
+ write_drive_file_object: {
12385
+ Args: {
12386
+ p_actor_agent_id?: string;
12387
+ p_content_sha256: string;
12388
+ p_drive_id: string;
12389
+ p_expected_version_id?: string;
12390
+ p_mime_type?: string;
12391
+ p_path: string;
12392
+ p_size_bytes: number;
12393
+ p_source_operation?: string;
12394
+ p_source_operation_id?: string;
12395
+ p_source_type?: string;
12396
+ p_storage_key: string;
12397
+ p_version_id: string;
11465
12398
  };
11466
12399
  Returns: {
11467
- content: string | null;
11468
12400
  content_sha256: string | null;
11469
12401
  created_at: string;
12402
+ current_version_id: string | null;
11470
12403
  drive_id: string;
11471
12404
  entry_type: string;
11472
12405
  id: string;
@@ -11485,6 +12418,23 @@ export type Database = {
11485
12418
  isSetofReturn: false;
11486
12419
  };
11487
12420
  };
12421
+ write_drive_file_object_with_resource_operation: {
12422
+ Args: {
12423
+ p_actor_agent_id?: string;
12424
+ p_content_sha256: string;
12425
+ p_drive_id: string;
12426
+ p_expected_version_id?: string;
12427
+ p_mime_type?: string;
12428
+ p_operation_metadata?: Json;
12429
+ p_path: string;
12430
+ p_size_bytes: number;
12431
+ p_source_operation?: string;
12432
+ p_source_operation_id?: string;
12433
+ p_storage_key: string;
12434
+ p_version_id: string;
12435
+ };
12436
+ Returns: Json;
12437
+ };
11488
12438
  };
11489
12439
  Enums: {
11490
12440
  [_ in never]: never;