@ash-cloud/ash-ai 0.1.16 → 0.1.18

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.
@@ -21,6 +21,7 @@ declare const agentBackendEnum: drizzle_orm_pg_core.PgEnum<["claude", "gemini"]>
21
21
  declare const queueItemStatusEnum: drizzle_orm_pg_core.PgEnum<["pending", "processing", "completed", "failed", "cancelled"]>;
22
22
  declare const configDeploymentStatusEnum: drizzle_orm_pg_core.PgEnum<["pending", "success", "failed"]>;
23
23
  declare const configDeploymentTriggerEnum: drizzle_orm_pg_core.PgEnum<["webhook", "manual", "initial", "rollback"]>;
24
+ declare const eventSourceEnum: drizzle_orm_pg_core.PgEnum<["agent", "system", "derived"]>;
24
25
  declare const eventCategoryEnum: drizzle_orm_pg_core.PgEnum<["lifecycle", "content", "tool", "system", "error", "file", "input", "webhook"]>;
25
26
  declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
26
27
  name: "sessions";
@@ -1728,6 +1729,23 @@ declare const sessionEvents: drizzle_orm_pg_core.PgTableWithColumns<{
1728
1729
  identity: undefined;
1729
1730
  generated: undefined;
1730
1731
  }, {}, {}>;
1732
+ eventSource: drizzle_orm_pg_core.PgColumn<{
1733
+ name: "event_source";
1734
+ tableName: "session_events";
1735
+ dataType: "string";
1736
+ columnType: "PgEnumColumn";
1737
+ data: "system" | "agent" | "derived";
1738
+ driverParam: string;
1739
+ notNull: true;
1740
+ hasDefault: true;
1741
+ isPrimaryKey: false;
1742
+ isAutoincrement: false;
1743
+ hasRuntimeDefault: false;
1744
+ enumValues: ["agent", "system", "derived"];
1745
+ baseColumn: never;
1746
+ identity: undefined;
1747
+ generated: undefined;
1748
+ }, {}, {}>;
1731
1749
  sequenceNumber: drizzle_orm_pg_core.PgColumn<{
1732
1750
  name: "sequence_number";
1733
1751
  tableName: "session_events";
@@ -1765,11 +1783,140 @@ declare const sessionEvents: drizzle_orm_pg_core.PgTableWithColumns<{
1765
1783
  };
1766
1784
  dialect: "pg";
1767
1785
  }>;
1786
+ declare const streamEvents: drizzle_orm_pg_core.PgTableWithColumns<{
1787
+ name: "stream_events";
1788
+ schema: undefined;
1789
+ columns: {
1790
+ id: drizzle_orm_pg_core.PgColumn<{
1791
+ name: "id";
1792
+ tableName: "stream_events";
1793
+ dataType: "string";
1794
+ columnType: "PgUUID";
1795
+ data: string;
1796
+ driverParam: string;
1797
+ notNull: true;
1798
+ hasDefault: true;
1799
+ isPrimaryKey: true;
1800
+ isAutoincrement: false;
1801
+ hasRuntimeDefault: false;
1802
+ enumValues: undefined;
1803
+ baseColumn: never;
1804
+ identity: undefined;
1805
+ generated: undefined;
1806
+ }, {}, {}>;
1807
+ sessionId: drizzle_orm_pg_core.PgColumn<{
1808
+ name: "session_id";
1809
+ tableName: "stream_events";
1810
+ dataType: "string";
1811
+ columnType: "PgUUID";
1812
+ data: string;
1813
+ driverParam: string;
1814
+ notNull: true;
1815
+ hasDefault: false;
1816
+ isPrimaryKey: false;
1817
+ isAutoincrement: false;
1818
+ hasRuntimeDefault: false;
1819
+ enumValues: undefined;
1820
+ baseColumn: never;
1821
+ identity: undefined;
1822
+ generated: undefined;
1823
+ }, {}, {}>;
1824
+ sequence: drizzle_orm_pg_core.PgColumn<{
1825
+ name: "sequence";
1826
+ tableName: "stream_events";
1827
+ dataType: "number";
1828
+ columnType: "PgInteger";
1829
+ data: number;
1830
+ driverParam: string | number;
1831
+ notNull: true;
1832
+ hasDefault: false;
1833
+ isPrimaryKey: false;
1834
+ isAutoincrement: false;
1835
+ hasRuntimeDefault: false;
1836
+ enumValues: undefined;
1837
+ baseColumn: never;
1838
+ identity: undefined;
1839
+ generated: undefined;
1840
+ }, {}, {}>;
1841
+ eventType: drizzle_orm_pg_core.PgColumn<{
1842
+ name: "event_type";
1843
+ tableName: "stream_events";
1844
+ dataType: "string";
1845
+ columnType: "PgText";
1846
+ data: string;
1847
+ driverParam: string;
1848
+ notNull: true;
1849
+ hasDefault: false;
1850
+ isPrimaryKey: false;
1851
+ isAutoincrement: false;
1852
+ hasRuntimeDefault: false;
1853
+ enumValues: [string, ...string[]];
1854
+ baseColumn: never;
1855
+ identity: undefined;
1856
+ generated: undefined;
1857
+ }, {}, {}>;
1858
+ payload: drizzle_orm_pg_core.PgColumn<{
1859
+ name: "payload";
1860
+ tableName: "stream_events";
1861
+ dataType: "json";
1862
+ columnType: "PgJsonb";
1863
+ data: Record<string, unknown>;
1864
+ driverParam: unknown;
1865
+ notNull: true;
1866
+ hasDefault: false;
1867
+ isPrimaryKey: false;
1868
+ isAutoincrement: false;
1869
+ hasRuntimeDefault: false;
1870
+ enumValues: undefined;
1871
+ baseColumn: never;
1872
+ identity: undefined;
1873
+ generated: undefined;
1874
+ }, {}, {
1875
+ $type: Record<string, unknown>;
1876
+ }>;
1877
+ batchCount: drizzle_orm_pg_core.PgColumn<{
1878
+ name: "batch_count";
1879
+ tableName: "stream_events";
1880
+ dataType: "number";
1881
+ columnType: "PgInteger";
1882
+ data: number;
1883
+ driverParam: string | number;
1884
+ notNull: true;
1885
+ hasDefault: true;
1886
+ isPrimaryKey: false;
1887
+ isAutoincrement: false;
1888
+ hasRuntimeDefault: false;
1889
+ enumValues: undefined;
1890
+ baseColumn: never;
1891
+ identity: undefined;
1892
+ generated: undefined;
1893
+ }, {}, {}>;
1894
+ createdAt: drizzle_orm_pg_core.PgColumn<{
1895
+ name: "created_at";
1896
+ tableName: "stream_events";
1897
+ dataType: "date";
1898
+ columnType: "PgTimestamp";
1899
+ data: Date;
1900
+ driverParam: string;
1901
+ notNull: true;
1902
+ hasDefault: true;
1903
+ isPrimaryKey: false;
1904
+ isAutoincrement: false;
1905
+ hasRuntimeDefault: false;
1906
+ enumValues: undefined;
1907
+ baseColumn: never;
1908
+ identity: undefined;
1909
+ generated: undefined;
1910
+ }, {}, {}>;
1911
+ };
1912
+ dialect: "pg";
1913
+ }>;
1768
1914
  declare const sessionsRelations: drizzle_orm.Relations<"sessions", {
1769
1915
  parentSession: drizzle_orm.One<"sessions", false>;
1770
1916
  childSessions: drizzle_orm.Many<"sessions">;
1771
1917
  messages: drizzle_orm.Many<"messages">;
1772
1918
  events: drizzle_orm.Many<"session_events">;
1919
+ streamEvents: drizzle_orm.Many<"stream_events">;
1773
1920
  }>;
1774
1921
  declare const sessionEventsRelations: drizzle_orm.Relations<"session_events", {
1775
1922
  session: drizzle_orm.One<"sessions", true>;
@@ -1784,6 +1931,9 @@ declare const attachmentsRelations: drizzle_orm.Relations<"attachments", {
1784
1931
  declare const configDeploymentsRelations: drizzle_orm.Relations<"config_deployments", {
1785
1932
  agent: drizzle_orm.One<"agents", true>;
1786
1933
  }>;
1934
+ declare const streamEventsRelations: drizzle_orm.Relations<"stream_events", {
1935
+ session: drizzle_orm.One<"sessions", true>;
1936
+ }>;
1787
1937
  declare const agentsRelations: drizzle_orm.Relations<"agents", {
1788
1938
  configDeployments: drizzle_orm.Many<"config_deployments">;
1789
1939
  }>;
@@ -1801,6 +1951,8 @@ type ConfigDeploymentRow = typeof configDeployments.$inferSelect;
1801
1951
  type NewConfigDeploymentRow = typeof configDeployments.$inferInsert;
1802
1952
  type SessionEventRow = typeof sessionEvents.$inferSelect;
1803
1953
  type NewSessionEventRow = typeof sessionEvents.$inferInsert;
1954
+ type StreamEventRow = typeof streamEvents.$inferSelect;
1955
+ type NewStreamEventRow = typeof streamEvents.$inferInsert;
1804
1956
 
1805
1957
  type schema_AgentRow = AgentRow;
1806
1958
  type schema_AttachmentRow = AttachmentRow;
@@ -1813,9 +1965,11 @@ type schema_NewMessageRow = NewMessageRow;
1813
1965
  type schema_NewQueueItemRow = NewQueueItemRow;
1814
1966
  type schema_NewSessionEventRow = NewSessionEventRow;
1815
1967
  type schema_NewSessionRow = NewSessionRow;
1968
+ type schema_NewStreamEventRow = NewStreamEventRow;
1816
1969
  type schema_QueueItemRow = QueueItemRow;
1817
1970
  type schema_SessionEventRow = SessionEventRow;
1818
1971
  type schema_SessionRow = SessionRow;
1972
+ type schema_StreamEventRow = StreamEventRow;
1819
1973
  declare const schema_agentBackendEnum: typeof agentBackendEnum;
1820
1974
  declare const schema_agentStatusEnum: typeof agentStatusEnum;
1821
1975
  declare const schema_agents: typeof agents;
@@ -1827,6 +1981,7 @@ declare const schema_configDeploymentTriggerEnum: typeof configDeploymentTrigger
1827
1981
  declare const schema_configDeployments: typeof configDeployments;
1828
1982
  declare const schema_configDeploymentsRelations: typeof configDeploymentsRelations;
1829
1983
  declare const schema_eventCategoryEnum: typeof eventCategoryEnum;
1984
+ declare const schema_eventSourceEnum: typeof eventSourceEnum;
1830
1985
  declare const schema_messageRoleEnum: typeof messageRoleEnum;
1831
1986
  declare const schema_messages: typeof messages;
1832
1987
  declare const schema_messagesRelations: typeof messagesRelations;
@@ -1837,8 +1992,10 @@ declare const schema_sessionEventsRelations: typeof sessionEventsRelations;
1837
1992
  declare const schema_sessionStatusEnum: typeof sessionStatusEnum;
1838
1993
  declare const schema_sessions: typeof sessions;
1839
1994
  declare const schema_sessionsRelations: typeof sessionsRelations;
1995
+ declare const schema_streamEvents: typeof streamEvents;
1996
+ declare const schema_streamEventsRelations: typeof streamEventsRelations;
1840
1997
  declare namespace schema {
1841
- export { type schema_AgentRow as AgentRow, type schema_AttachmentRow as AttachmentRow, type schema_ConfigDeploymentRow as ConfigDeploymentRow, type schema_MessageRow as MessageRow, type schema_NewAgentRow as NewAgentRow, type schema_NewAttachmentRow as NewAttachmentRow, type schema_NewConfigDeploymentRow as NewConfigDeploymentRow, type schema_NewMessageRow as NewMessageRow, type schema_NewQueueItemRow as NewQueueItemRow, type schema_NewSessionEventRow as NewSessionEventRow, type schema_NewSessionRow as NewSessionRow, type schema_QueueItemRow as QueueItemRow, type schema_SessionEventRow as SessionEventRow, type schema_SessionRow as SessionRow, schema_agentBackendEnum as agentBackendEnum, schema_agentStatusEnum as agentStatusEnum, schema_agents as agents, schema_agentsRelations as agentsRelations, schema_attachments as attachments, schema_attachmentsRelations as attachmentsRelations, schema_configDeploymentStatusEnum as configDeploymentStatusEnum, schema_configDeploymentTriggerEnum as configDeploymentTriggerEnum, schema_configDeployments as configDeployments, schema_configDeploymentsRelations as configDeploymentsRelations, schema_eventCategoryEnum as eventCategoryEnum, schema_messageRoleEnum as messageRoleEnum, schema_messages as messages, schema_messagesRelations as messagesRelations, schema_queueItemStatusEnum as queueItemStatusEnum, schema_queueItems as queueItems, schema_sessionEvents as sessionEvents, schema_sessionEventsRelations as sessionEventsRelations, schema_sessionStatusEnum as sessionStatusEnum, schema_sessions as sessions, schema_sessionsRelations as sessionsRelations };
1998
+ export { type schema_AgentRow as AgentRow, type schema_AttachmentRow as AttachmentRow, type schema_ConfigDeploymentRow as ConfigDeploymentRow, type schema_MessageRow as MessageRow, type schema_NewAgentRow as NewAgentRow, type schema_NewAttachmentRow as NewAttachmentRow, type schema_NewConfigDeploymentRow as NewConfigDeploymentRow, type schema_NewMessageRow as NewMessageRow, type schema_NewQueueItemRow as NewQueueItemRow, type schema_NewSessionEventRow as NewSessionEventRow, type schema_NewSessionRow as NewSessionRow, type schema_NewStreamEventRow as NewStreamEventRow, type schema_QueueItemRow as QueueItemRow, type schema_SessionEventRow as SessionEventRow, type schema_SessionRow as SessionRow, type schema_StreamEventRow as StreamEventRow, schema_agentBackendEnum as agentBackendEnum, schema_agentStatusEnum as agentStatusEnum, schema_agents as agents, schema_agentsRelations as agentsRelations, schema_attachments as attachments, schema_attachmentsRelations as attachmentsRelations, schema_configDeploymentStatusEnum as configDeploymentStatusEnum, schema_configDeploymentTriggerEnum as configDeploymentTriggerEnum, schema_configDeployments as configDeployments, schema_configDeploymentsRelations as configDeploymentsRelations, schema_eventCategoryEnum as eventCategoryEnum, schema_eventSourceEnum as eventSourceEnum, schema_messageRoleEnum as messageRoleEnum, schema_messages as messages, schema_messagesRelations as messagesRelations, schema_queueItemStatusEnum as queueItemStatusEnum, schema_queueItems as queueItems, schema_sessionEvents as sessionEvents, schema_sessionEventsRelations as sessionEventsRelations, schema_sessionStatusEnum as sessionStatusEnum, schema_sessions as sessions, schema_sessionsRelations as sessionsRelations, schema_streamEvents as streamEvents, schema_streamEventsRelations as streamEventsRelations };
1842
1999
  }
1843
2000
 
1844
- export { type AttachmentRow as A, agentsRelations as B, type AgentRow as C, type NewAgentRow as D, type ConfigDeploymentRow as E, type NewConfigDeploymentRow as F, type MessageRow as M, type NewSessionRow as N, type QueueItemRow as Q, type SessionRow as S, type NewMessageRow as a, type NewAttachmentRow as b, type NewQueueItemRow as c, type SessionEventRow as d, type NewSessionEventRow as e, sessionStatusEnum as f, agentStatusEnum as g, agentBackendEnum as h, configDeploymentStatusEnum as i, configDeploymentTriggerEnum as j, eventCategoryEnum as k, sessions as l, messageRoleEnum as m, messages as n, attachments as o, agents as p, queueItemStatusEnum as q, queueItems as r, schema as s, configDeployments as t, sessionEvents as u, sessionsRelations as v, sessionEventsRelations as w, messagesRelations as x, attachmentsRelations as y, configDeploymentsRelations as z };
2001
+ export { type AttachmentRow as A, sessionEventsRelations as B, messagesRelations as C, attachmentsRelations as D, configDeploymentsRelations as E, streamEventsRelations as F, agentsRelations as G, type AgentRow as H, type NewAgentRow as I, type ConfigDeploymentRow as J, type NewConfigDeploymentRow as K, type MessageRow as M, type NewSessionRow as N, type QueueItemRow as Q, type SessionRow as S, type NewMessageRow as a, type NewAttachmentRow as b, type NewQueueItemRow as c, type SessionEventRow as d, type NewSessionEventRow as e, type StreamEventRow as f, type NewStreamEventRow as g, sessionStatusEnum as h, agentStatusEnum as i, agentBackendEnum as j, configDeploymentStatusEnum as k, configDeploymentTriggerEnum as l, messageRoleEnum as m, eventSourceEnum as n, eventCategoryEnum as o, sessions as p, queueItemStatusEnum as q, messages as r, schema as s, attachments as t, agents as u, queueItems as v, configDeployments as w, sessionEvents as x, streamEvents as y, sessionsRelations as z };
@@ -21,6 +21,7 @@ declare const agentBackendEnum: drizzle_orm_pg_core.PgEnum<["claude", "gemini"]>
21
21
  declare const queueItemStatusEnum: drizzle_orm_pg_core.PgEnum<["pending", "processing", "completed", "failed", "cancelled"]>;
22
22
  declare const configDeploymentStatusEnum: drizzle_orm_pg_core.PgEnum<["pending", "success", "failed"]>;
23
23
  declare const configDeploymentTriggerEnum: drizzle_orm_pg_core.PgEnum<["webhook", "manual", "initial", "rollback"]>;
24
+ declare const eventSourceEnum: drizzle_orm_pg_core.PgEnum<["agent", "system", "derived"]>;
24
25
  declare const eventCategoryEnum: drizzle_orm_pg_core.PgEnum<["lifecycle", "content", "tool", "system", "error", "file", "input", "webhook"]>;
25
26
  declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
26
27
  name: "sessions";
@@ -1728,6 +1729,23 @@ declare const sessionEvents: drizzle_orm_pg_core.PgTableWithColumns<{
1728
1729
  identity: undefined;
1729
1730
  generated: undefined;
1730
1731
  }, {}, {}>;
1732
+ eventSource: drizzle_orm_pg_core.PgColumn<{
1733
+ name: "event_source";
1734
+ tableName: "session_events";
1735
+ dataType: "string";
1736
+ columnType: "PgEnumColumn";
1737
+ data: "system" | "agent" | "derived";
1738
+ driverParam: string;
1739
+ notNull: true;
1740
+ hasDefault: true;
1741
+ isPrimaryKey: false;
1742
+ isAutoincrement: false;
1743
+ hasRuntimeDefault: false;
1744
+ enumValues: ["agent", "system", "derived"];
1745
+ baseColumn: never;
1746
+ identity: undefined;
1747
+ generated: undefined;
1748
+ }, {}, {}>;
1731
1749
  sequenceNumber: drizzle_orm_pg_core.PgColumn<{
1732
1750
  name: "sequence_number";
1733
1751
  tableName: "session_events";
@@ -1765,11 +1783,140 @@ declare const sessionEvents: drizzle_orm_pg_core.PgTableWithColumns<{
1765
1783
  };
1766
1784
  dialect: "pg";
1767
1785
  }>;
1786
+ declare const streamEvents: drizzle_orm_pg_core.PgTableWithColumns<{
1787
+ name: "stream_events";
1788
+ schema: undefined;
1789
+ columns: {
1790
+ id: drizzle_orm_pg_core.PgColumn<{
1791
+ name: "id";
1792
+ tableName: "stream_events";
1793
+ dataType: "string";
1794
+ columnType: "PgUUID";
1795
+ data: string;
1796
+ driverParam: string;
1797
+ notNull: true;
1798
+ hasDefault: true;
1799
+ isPrimaryKey: true;
1800
+ isAutoincrement: false;
1801
+ hasRuntimeDefault: false;
1802
+ enumValues: undefined;
1803
+ baseColumn: never;
1804
+ identity: undefined;
1805
+ generated: undefined;
1806
+ }, {}, {}>;
1807
+ sessionId: drizzle_orm_pg_core.PgColumn<{
1808
+ name: "session_id";
1809
+ tableName: "stream_events";
1810
+ dataType: "string";
1811
+ columnType: "PgUUID";
1812
+ data: string;
1813
+ driverParam: string;
1814
+ notNull: true;
1815
+ hasDefault: false;
1816
+ isPrimaryKey: false;
1817
+ isAutoincrement: false;
1818
+ hasRuntimeDefault: false;
1819
+ enumValues: undefined;
1820
+ baseColumn: never;
1821
+ identity: undefined;
1822
+ generated: undefined;
1823
+ }, {}, {}>;
1824
+ sequence: drizzle_orm_pg_core.PgColumn<{
1825
+ name: "sequence";
1826
+ tableName: "stream_events";
1827
+ dataType: "number";
1828
+ columnType: "PgInteger";
1829
+ data: number;
1830
+ driverParam: string | number;
1831
+ notNull: true;
1832
+ hasDefault: false;
1833
+ isPrimaryKey: false;
1834
+ isAutoincrement: false;
1835
+ hasRuntimeDefault: false;
1836
+ enumValues: undefined;
1837
+ baseColumn: never;
1838
+ identity: undefined;
1839
+ generated: undefined;
1840
+ }, {}, {}>;
1841
+ eventType: drizzle_orm_pg_core.PgColumn<{
1842
+ name: "event_type";
1843
+ tableName: "stream_events";
1844
+ dataType: "string";
1845
+ columnType: "PgText";
1846
+ data: string;
1847
+ driverParam: string;
1848
+ notNull: true;
1849
+ hasDefault: false;
1850
+ isPrimaryKey: false;
1851
+ isAutoincrement: false;
1852
+ hasRuntimeDefault: false;
1853
+ enumValues: [string, ...string[]];
1854
+ baseColumn: never;
1855
+ identity: undefined;
1856
+ generated: undefined;
1857
+ }, {}, {}>;
1858
+ payload: drizzle_orm_pg_core.PgColumn<{
1859
+ name: "payload";
1860
+ tableName: "stream_events";
1861
+ dataType: "json";
1862
+ columnType: "PgJsonb";
1863
+ data: Record<string, unknown>;
1864
+ driverParam: unknown;
1865
+ notNull: true;
1866
+ hasDefault: false;
1867
+ isPrimaryKey: false;
1868
+ isAutoincrement: false;
1869
+ hasRuntimeDefault: false;
1870
+ enumValues: undefined;
1871
+ baseColumn: never;
1872
+ identity: undefined;
1873
+ generated: undefined;
1874
+ }, {}, {
1875
+ $type: Record<string, unknown>;
1876
+ }>;
1877
+ batchCount: drizzle_orm_pg_core.PgColumn<{
1878
+ name: "batch_count";
1879
+ tableName: "stream_events";
1880
+ dataType: "number";
1881
+ columnType: "PgInteger";
1882
+ data: number;
1883
+ driverParam: string | number;
1884
+ notNull: true;
1885
+ hasDefault: true;
1886
+ isPrimaryKey: false;
1887
+ isAutoincrement: false;
1888
+ hasRuntimeDefault: false;
1889
+ enumValues: undefined;
1890
+ baseColumn: never;
1891
+ identity: undefined;
1892
+ generated: undefined;
1893
+ }, {}, {}>;
1894
+ createdAt: drizzle_orm_pg_core.PgColumn<{
1895
+ name: "created_at";
1896
+ tableName: "stream_events";
1897
+ dataType: "date";
1898
+ columnType: "PgTimestamp";
1899
+ data: Date;
1900
+ driverParam: string;
1901
+ notNull: true;
1902
+ hasDefault: true;
1903
+ isPrimaryKey: false;
1904
+ isAutoincrement: false;
1905
+ hasRuntimeDefault: false;
1906
+ enumValues: undefined;
1907
+ baseColumn: never;
1908
+ identity: undefined;
1909
+ generated: undefined;
1910
+ }, {}, {}>;
1911
+ };
1912
+ dialect: "pg";
1913
+ }>;
1768
1914
  declare const sessionsRelations: drizzle_orm.Relations<"sessions", {
1769
1915
  parentSession: drizzle_orm.One<"sessions", false>;
1770
1916
  childSessions: drizzle_orm.Many<"sessions">;
1771
1917
  messages: drizzle_orm.Many<"messages">;
1772
1918
  events: drizzle_orm.Many<"session_events">;
1919
+ streamEvents: drizzle_orm.Many<"stream_events">;
1773
1920
  }>;
1774
1921
  declare const sessionEventsRelations: drizzle_orm.Relations<"session_events", {
1775
1922
  session: drizzle_orm.One<"sessions", true>;
@@ -1784,6 +1931,9 @@ declare const attachmentsRelations: drizzle_orm.Relations<"attachments", {
1784
1931
  declare const configDeploymentsRelations: drizzle_orm.Relations<"config_deployments", {
1785
1932
  agent: drizzle_orm.One<"agents", true>;
1786
1933
  }>;
1934
+ declare const streamEventsRelations: drizzle_orm.Relations<"stream_events", {
1935
+ session: drizzle_orm.One<"sessions", true>;
1936
+ }>;
1787
1937
  declare const agentsRelations: drizzle_orm.Relations<"agents", {
1788
1938
  configDeployments: drizzle_orm.Many<"config_deployments">;
1789
1939
  }>;
@@ -1801,6 +1951,8 @@ type ConfigDeploymentRow = typeof configDeployments.$inferSelect;
1801
1951
  type NewConfigDeploymentRow = typeof configDeployments.$inferInsert;
1802
1952
  type SessionEventRow = typeof sessionEvents.$inferSelect;
1803
1953
  type NewSessionEventRow = typeof sessionEvents.$inferInsert;
1954
+ type StreamEventRow = typeof streamEvents.$inferSelect;
1955
+ type NewStreamEventRow = typeof streamEvents.$inferInsert;
1804
1956
 
1805
1957
  type schema_AgentRow = AgentRow;
1806
1958
  type schema_AttachmentRow = AttachmentRow;
@@ -1813,9 +1965,11 @@ type schema_NewMessageRow = NewMessageRow;
1813
1965
  type schema_NewQueueItemRow = NewQueueItemRow;
1814
1966
  type schema_NewSessionEventRow = NewSessionEventRow;
1815
1967
  type schema_NewSessionRow = NewSessionRow;
1968
+ type schema_NewStreamEventRow = NewStreamEventRow;
1816
1969
  type schema_QueueItemRow = QueueItemRow;
1817
1970
  type schema_SessionEventRow = SessionEventRow;
1818
1971
  type schema_SessionRow = SessionRow;
1972
+ type schema_StreamEventRow = StreamEventRow;
1819
1973
  declare const schema_agentBackendEnum: typeof agentBackendEnum;
1820
1974
  declare const schema_agentStatusEnum: typeof agentStatusEnum;
1821
1975
  declare const schema_agents: typeof agents;
@@ -1827,6 +1981,7 @@ declare const schema_configDeploymentTriggerEnum: typeof configDeploymentTrigger
1827
1981
  declare const schema_configDeployments: typeof configDeployments;
1828
1982
  declare const schema_configDeploymentsRelations: typeof configDeploymentsRelations;
1829
1983
  declare const schema_eventCategoryEnum: typeof eventCategoryEnum;
1984
+ declare const schema_eventSourceEnum: typeof eventSourceEnum;
1830
1985
  declare const schema_messageRoleEnum: typeof messageRoleEnum;
1831
1986
  declare const schema_messages: typeof messages;
1832
1987
  declare const schema_messagesRelations: typeof messagesRelations;
@@ -1837,8 +1992,10 @@ declare const schema_sessionEventsRelations: typeof sessionEventsRelations;
1837
1992
  declare const schema_sessionStatusEnum: typeof sessionStatusEnum;
1838
1993
  declare const schema_sessions: typeof sessions;
1839
1994
  declare const schema_sessionsRelations: typeof sessionsRelations;
1995
+ declare const schema_streamEvents: typeof streamEvents;
1996
+ declare const schema_streamEventsRelations: typeof streamEventsRelations;
1840
1997
  declare namespace schema {
1841
- export { type schema_AgentRow as AgentRow, type schema_AttachmentRow as AttachmentRow, type schema_ConfigDeploymentRow as ConfigDeploymentRow, type schema_MessageRow as MessageRow, type schema_NewAgentRow as NewAgentRow, type schema_NewAttachmentRow as NewAttachmentRow, type schema_NewConfigDeploymentRow as NewConfigDeploymentRow, type schema_NewMessageRow as NewMessageRow, type schema_NewQueueItemRow as NewQueueItemRow, type schema_NewSessionEventRow as NewSessionEventRow, type schema_NewSessionRow as NewSessionRow, type schema_QueueItemRow as QueueItemRow, type schema_SessionEventRow as SessionEventRow, type schema_SessionRow as SessionRow, schema_agentBackendEnum as agentBackendEnum, schema_agentStatusEnum as agentStatusEnum, schema_agents as agents, schema_agentsRelations as agentsRelations, schema_attachments as attachments, schema_attachmentsRelations as attachmentsRelations, schema_configDeploymentStatusEnum as configDeploymentStatusEnum, schema_configDeploymentTriggerEnum as configDeploymentTriggerEnum, schema_configDeployments as configDeployments, schema_configDeploymentsRelations as configDeploymentsRelations, schema_eventCategoryEnum as eventCategoryEnum, schema_messageRoleEnum as messageRoleEnum, schema_messages as messages, schema_messagesRelations as messagesRelations, schema_queueItemStatusEnum as queueItemStatusEnum, schema_queueItems as queueItems, schema_sessionEvents as sessionEvents, schema_sessionEventsRelations as sessionEventsRelations, schema_sessionStatusEnum as sessionStatusEnum, schema_sessions as sessions, schema_sessionsRelations as sessionsRelations };
1998
+ export { type schema_AgentRow as AgentRow, type schema_AttachmentRow as AttachmentRow, type schema_ConfigDeploymentRow as ConfigDeploymentRow, type schema_MessageRow as MessageRow, type schema_NewAgentRow as NewAgentRow, type schema_NewAttachmentRow as NewAttachmentRow, type schema_NewConfigDeploymentRow as NewConfigDeploymentRow, type schema_NewMessageRow as NewMessageRow, type schema_NewQueueItemRow as NewQueueItemRow, type schema_NewSessionEventRow as NewSessionEventRow, type schema_NewSessionRow as NewSessionRow, type schema_NewStreamEventRow as NewStreamEventRow, type schema_QueueItemRow as QueueItemRow, type schema_SessionEventRow as SessionEventRow, type schema_SessionRow as SessionRow, type schema_StreamEventRow as StreamEventRow, schema_agentBackendEnum as agentBackendEnum, schema_agentStatusEnum as agentStatusEnum, schema_agents as agents, schema_agentsRelations as agentsRelations, schema_attachments as attachments, schema_attachmentsRelations as attachmentsRelations, schema_configDeploymentStatusEnum as configDeploymentStatusEnum, schema_configDeploymentTriggerEnum as configDeploymentTriggerEnum, schema_configDeployments as configDeployments, schema_configDeploymentsRelations as configDeploymentsRelations, schema_eventCategoryEnum as eventCategoryEnum, schema_eventSourceEnum as eventSourceEnum, schema_messageRoleEnum as messageRoleEnum, schema_messages as messages, schema_messagesRelations as messagesRelations, schema_queueItemStatusEnum as queueItemStatusEnum, schema_queueItems as queueItems, schema_sessionEvents as sessionEvents, schema_sessionEventsRelations as sessionEventsRelations, schema_sessionStatusEnum as sessionStatusEnum, schema_sessions as sessions, schema_sessionsRelations as sessionsRelations, schema_streamEvents as streamEvents, schema_streamEventsRelations as streamEventsRelations };
1842
1999
  }
1843
2000
 
1844
- export { type AttachmentRow as A, agentsRelations as B, type AgentRow as C, type NewAgentRow as D, type ConfigDeploymentRow as E, type NewConfigDeploymentRow as F, type MessageRow as M, type NewSessionRow as N, type QueueItemRow as Q, type SessionRow as S, type NewMessageRow as a, type NewAttachmentRow as b, type NewQueueItemRow as c, type SessionEventRow as d, type NewSessionEventRow as e, sessionStatusEnum as f, agentStatusEnum as g, agentBackendEnum as h, configDeploymentStatusEnum as i, configDeploymentTriggerEnum as j, eventCategoryEnum as k, sessions as l, messageRoleEnum as m, messages as n, attachments as o, agents as p, queueItemStatusEnum as q, queueItems as r, schema as s, configDeployments as t, sessionEvents as u, sessionsRelations as v, sessionEventsRelations as w, messagesRelations as x, attachmentsRelations as y, configDeploymentsRelations as z };
2001
+ export { type AttachmentRow as A, sessionEventsRelations as B, messagesRelations as C, attachmentsRelations as D, configDeploymentsRelations as E, streamEventsRelations as F, agentsRelations as G, type AgentRow as H, type NewAgentRow as I, type ConfigDeploymentRow as J, type NewConfigDeploymentRow as K, type MessageRow as M, type NewSessionRow as N, type QueueItemRow as Q, type SessionRow as S, type NewMessageRow as a, type NewAttachmentRow as b, type NewQueueItemRow as c, type SessionEventRow as d, type NewSessionEventRow as e, type StreamEventRow as f, type NewStreamEventRow as g, sessionStatusEnum as h, agentStatusEnum as i, agentBackendEnum as j, configDeploymentStatusEnum as k, configDeploymentTriggerEnum as l, messageRoleEnum as m, eventSourceEnum as n, eventCategoryEnum as o, sessions as p, queueItemStatusEnum as q, messages as r, schema as s, attachments as t, agents as u, queueItems as v, configDeployments as w, sessionEvents as x, streamEvents as y, sessionsRelations as z };
package/dist/schema.cjs CHANGED
@@ -43,6 +43,14 @@ var configDeploymentTriggerEnum = pgCore.pgEnum("config_deployment_trigger", [
43
43
  "initial",
44
44
  "rollback"
45
45
  ]);
46
+ var eventSourceEnum = pgCore.pgEnum("event_source", [
47
+ "agent",
48
+ // Directly from the agent SDK
49
+ "system",
50
+ // Generated by execution layer (lifecycle, user input)
51
+ "derived"
52
+ // Transformed/aggregated from agent events
53
+ ]);
46
54
  var eventCategoryEnum = pgCore.pgEnum("event_category", [
47
55
  "lifecycle",
48
56
  // session_start, session_end, turn_complete
@@ -233,6 +241,8 @@ var sessionEvents = pgCore.pgTable(
233
241
  // Aggregation fields (for text_stream events)
234
242
  isAggregated: pgCore.boolean("is_aggregated").default(false),
235
243
  aggregatedCount: pgCore.integer("aggregated_count"),
244
+ // Event source tagging
245
+ eventSource: eventSourceEnum("event_source").notNull().default("agent"),
236
246
  // Ordering
237
247
  sequenceNumber: pgCore.integer("sequence_number").notNull(),
238
248
  createdAt: pgCore.timestamp("created_at", { withTimezone: true }).defaultNow().notNull()
@@ -242,6 +252,21 @@ var sessionEvents = pgCore.pgTable(
242
252
  pgCore.index("idx_session_events_category").on(table.sessionId, table.category)
243
253
  ]
244
254
  );
255
+ var streamEvents = pgCore.pgTable(
256
+ "stream_events",
257
+ {
258
+ id: pgCore.uuid("id").defaultRandom().primaryKey(),
259
+ sessionId: pgCore.uuid("session_id").notNull().references(() => sessions.id, { onDelete: "cascade" }),
260
+ sequence: pgCore.integer("sequence").notNull(),
261
+ eventType: pgCore.text("event_type").notNull(),
262
+ payload: pgCore.jsonb("payload").notNull().$type(),
263
+ batchCount: pgCore.integer("batch_count").default(1).notNull(),
264
+ createdAt: pgCore.timestamp("created_at", { withTimezone: true }).defaultNow().notNull()
265
+ },
266
+ (table) => [
267
+ pgCore.index("idx_stream_events_session_seq").on(table.sessionId, table.sequence)
268
+ ]
269
+ );
245
270
  var sessionsRelations = drizzleOrm.relations(sessions, ({ one, many }) => ({
246
271
  parentSession: one(sessions, {
247
272
  fields: [sessions.parentSessionId],
@@ -252,7 +277,8 @@ var sessionsRelations = drizzleOrm.relations(sessions, ({ one, many }) => ({
252
277
  relationName: "parentSession"
253
278
  }),
254
279
  messages: many(messages),
255
- events: many(sessionEvents)
280
+ events: many(sessionEvents),
281
+ streamEvents: many(streamEvents)
256
282
  }));
257
283
  var sessionEventsRelations = drizzleOrm.relations(sessionEvents, ({ one }) => ({
258
284
  session: one(sessions, {
@@ -279,6 +305,12 @@ var configDeploymentsRelations = drizzleOrm.relations(configDeployments, ({ one
279
305
  references: [agents.id]
280
306
  })
281
307
  }));
308
+ var streamEventsRelations = drizzleOrm.relations(streamEvents, ({ one }) => ({
309
+ session: one(sessions, {
310
+ fields: [streamEvents.sessionId],
311
+ references: [sessions.id]
312
+ })
313
+ }));
282
314
  var agentsRelations = drizzleOrm.relations(agents, ({ many }) => ({
283
315
  configDeployments: many(configDeployments)
284
316
  }));
@@ -294,6 +326,7 @@ exports.configDeploymentTriggerEnum = configDeploymentTriggerEnum;
294
326
  exports.configDeployments = configDeployments;
295
327
  exports.configDeploymentsRelations = configDeploymentsRelations;
296
328
  exports.eventCategoryEnum = eventCategoryEnum;
329
+ exports.eventSourceEnum = eventSourceEnum;
297
330
  exports.messageRoleEnum = messageRoleEnum;
298
331
  exports.messages = messages;
299
332
  exports.messagesRelations = messagesRelations;
@@ -304,5 +337,7 @@ exports.sessionEventsRelations = sessionEventsRelations;
304
337
  exports.sessionStatusEnum = sessionStatusEnum;
305
338
  exports.sessions = sessions;
306
339
  exports.sessionsRelations = sessionsRelations;
340
+ exports.streamEvents = streamEvents;
341
+ exports.streamEventsRelations = streamEventsRelations;
307
342
  //# sourceMappingURL=schema.cjs.map
308
343
  //# sourceMappingURL=schema.cjs.map