@adaptive-ai/sdk 0.1.37 → 0.1.38

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.
@@ -1629,6 +1629,10 @@ export declare const appConfigSchema: z.ZodObject<{
1629
1629
  stopAt: z.ZodOptional<z.ZodString>;
1630
1630
  maxExecutions: z.ZodOptional<z.ZodNumber>;
1631
1631
  timezone: z.ZodOptional<z.ZodString>;
1632
+ modelOverride: z.ZodOptional<z.ZodEnum<[
1633
+ "standard",
1634
+ "ultra"
1635
+ ]>>;
1632
1636
  }, "strip", z.ZodTypeAny, {
1633
1637
  slug: string;
1634
1638
  schedule: string;
@@ -1639,6 +1643,7 @@ export declare const appConfigSchema: z.ZodObject<{
1639
1643
  timezone?: string | undefined;
1640
1644
  stopAt?: string | undefined;
1641
1645
  maxExecutions?: number | undefined;
1646
+ modelOverride?: "standard" | "ultra" | undefined;
1642
1647
  }, {
1643
1648
  slug: string;
1644
1649
  schedule: string;
@@ -1649,6 +1654,7 @@ export declare const appConfigSchema: z.ZodObject<{
1649
1654
  isEnabled?: boolean | undefined;
1650
1655
  stopAt?: string | undefined;
1651
1656
  maxExecutions?: number | undefined;
1657
+ modelOverride?: "standard" | "ultra" | undefined;
1652
1658
  }>, "many">;
1653
1659
  events: z.ZodDefault<z.ZodArray<z.ZodObject<{
1654
1660
  provider: z.ZodNativeEnum<{
@@ -1671,9 +1677,13 @@ export declare const appConfigSchema: z.ZodObject<{
1671
1677
  }>;
1672
1678
  event: z.ZodString;
1673
1679
  handler: z.ZodEffects<z.ZodString, string, string>;
1674
- slug: z.ZodString;
1675
- name: z.ZodString;
1676
- description: z.ZodString;
1680
+ slug: z.ZodDefault<z.ZodString>;
1681
+ name: z.ZodDefault<z.ZodString>;
1682
+ description: z.ZodDefault<z.ZodString>;
1683
+ modelOverride: z.ZodOptional<z.ZodEnum<[
1684
+ "standard",
1685
+ "ultra"
1686
+ ]>>;
1677
1687
  }, "strip", z.ZodTypeAny, {
1678
1688
  description: string;
1679
1689
  event: string;
@@ -1681,13 +1691,15 @@ export declare const appConfigSchema: z.ZodObject<{
1681
1691
  provider: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1";
1682
1692
  slug: string;
1683
1693
  handler: string;
1694
+ modelOverride?: "standard" | "ultra" | undefined;
1684
1695
  }, {
1685
- description: string;
1686
1696
  event: string;
1687
- name: string;
1688
1697
  provider: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1";
1689
- slug: string;
1690
1698
  handler: string;
1699
+ description?: string | undefined;
1700
+ name?: string | undefined;
1701
+ slug?: string | undefined;
1702
+ modelOverride?: "standard" | "ultra" | undefined;
1691
1703
  }>, "many">>;
1692
1704
  webhooks: z.ZodDefault<z.ZodArray<z.ZodObject<{
1693
1705
  handler: z.ZodEffects<z.ZodString, string, string>;
@@ -1709,21 +1721,27 @@ export declare const appConfigSchema: z.ZodObject<{
1709
1721
  readonly SHOPIFY: "SHOPIFY";
1710
1722
  readonly WHOOP: "WHOOP";
1711
1723
  }>>>;
1712
- slug: z.ZodString;
1713
- name: z.ZodString;
1714
- description: z.ZodString;
1724
+ slug: z.ZodDefault<z.ZodString>;
1725
+ name: z.ZodDefault<z.ZodString>;
1726
+ description: z.ZodDefault<z.ZodString>;
1727
+ modelOverride: z.ZodOptional<z.ZodEnum<[
1728
+ "standard",
1729
+ "ultra"
1730
+ ]>>;
1715
1731
  }, "strip", z.ZodTypeAny, {
1716
1732
  description: string;
1717
1733
  name: string;
1718
1734
  slug: string;
1719
1735
  handler: string;
1720
1736
  provider?: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1" | null | undefined;
1737
+ modelOverride?: "standard" | "ultra" | undefined;
1721
1738
  }, {
1722
- description: string;
1723
- name: string;
1724
- slug: string;
1725
1739
  handler: string;
1740
+ description?: string | undefined;
1741
+ name?: string | undefined;
1726
1742
  provider?: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1" | null | undefined;
1743
+ slug?: string | undefined;
1744
+ modelOverride?: "standard" | "ultra" | undefined;
1727
1745
  }>, "many">>;
1728
1746
  }, "strip", z.ZodTypeAny, {
1729
1747
  webhooks: {
@@ -1732,6 +1750,7 @@ export declare const appConfigSchema: z.ZodObject<{
1732
1750
  slug: string;
1733
1751
  handler: string;
1734
1752
  provider?: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1" | null | undefined;
1753
+ modelOverride?: "standard" | "ultra" | undefined;
1735
1754
  }[];
1736
1755
  crons: {
1737
1756
  slug: string;
@@ -1743,6 +1762,7 @@ export declare const appConfigSchema: z.ZodObject<{
1743
1762
  timezone?: string | undefined;
1744
1763
  stopAt?: string | undefined;
1745
1764
  maxExecutions?: number | undefined;
1765
+ modelOverride?: "standard" | "ultra" | undefined;
1746
1766
  }[];
1747
1767
  events: {
1748
1768
  description: string;
@@ -1751,6 +1771,7 @@ export declare const appConfigSchema: z.ZodObject<{
1751
1771
  provider: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1";
1752
1772
  slug: string;
1753
1773
  handler: string;
1774
+ modelOverride?: "standard" | "ultra" | undefined;
1754
1775
  }[];
1755
1776
  }, {
1756
1777
  crons: {
@@ -1763,21 +1784,24 @@ export declare const appConfigSchema: z.ZodObject<{
1763
1784
  isEnabled?: boolean | undefined;
1764
1785
  stopAt?: string | undefined;
1765
1786
  maxExecutions?: number | undefined;
1787
+ modelOverride?: "standard" | "ultra" | undefined;
1766
1788
  }[];
1767
1789
  webhooks?: {
1768
- description: string;
1769
- name: string;
1770
- slug: string;
1771
1790
  handler: string;
1791
+ description?: string | undefined;
1792
+ name?: string | undefined;
1772
1793
  provider?: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1" | null | undefined;
1794
+ slug?: string | undefined;
1795
+ modelOverride?: "standard" | "ultra" | undefined;
1773
1796
  }[] | undefined;
1774
1797
  events?: {
1775
- description: string;
1776
1798
  event: string;
1777
- name: string;
1778
1799
  provider: "GITHUB_USER" | "GITHUB_BOT" | "GOOGLE" | "SLACK" | "SLACK_BOT" | "DISCORD" | "NOTION" | "TWITTER" | "LINKEDIN" | "YAHOO" | "FIGMA" | "SQUARE" | "SHOPIFY" | "WHOOP" | "PLAID" | "AC1";
1779
- slug: string;
1780
1800
  handler: string;
1801
+ description?: string | undefined;
1802
+ name?: string | undefined;
1803
+ slug?: string | undefined;
1804
+ modelOverride?: "standard" | "ultra" | undefined;
1781
1805
  }[] | undefined;
1782
1806
  }>;
1783
1807
  export type AppConfig = z.infer<typeof appConfigSchema>;
@@ -1919,11 +1943,12 @@ declare let client: {
1919
1943
  isDevelopment: boolean | null;
1920
1944
  appId?: string | null | undefined;
1921
1945
  appFolder?: string | null | undefined;
1946
+ modelOverride?: "standard" | "ultra" | null | undefined;
1922
1947
  rpcMethod?: string | null | undefined;
1923
1948
  requestId?: string | null | undefined;
1924
1949
  channelId?: string | null | undefined;
1925
1950
  platformUserId?: string | null | undefined;
1926
- invocationTrigger?: "user" | "scheduled" | null | undefined;
1951
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
1927
1952
  agent?: string | null | undefined;
1928
1953
  sessionId?: string | null | undefined;
1929
1954
  pushToken?: string | null | undefined;
@@ -1961,11 +1986,12 @@ declare let client: {
1961
1986
  appId: string | null | undefined;
1962
1987
  boxId: string;
1963
1988
  appFolder: string | null | undefined;
1989
+ modelOverride: "standard" | "ultra" | null | undefined;
1964
1990
  rpcMethod: string | null | undefined;
1965
1991
  requestId: string | null | undefined;
1966
1992
  channelId: string | null | undefined;
1967
1993
  platformUserId: string | null | undefined;
1968
- invocationTrigger: "user" | "scheduled" | null | undefined;
1994
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
1969
1995
  isDevelopment: boolean | null;
1970
1996
  agent: string | null | undefined;
1971
1997
  sessionId: string | null | undefined;
@@ -2012,11 +2038,12 @@ declare let client: {
2012
2038
  isDevelopment: boolean | null;
2013
2039
  appId?: string | null | undefined;
2014
2040
  appFolder?: string | null | undefined;
2041
+ modelOverride?: "standard" | "ultra" | null | undefined;
2015
2042
  rpcMethod?: string | null | undefined;
2016
2043
  requestId?: string | null | undefined;
2017
2044
  channelId?: string | null | undefined;
2018
2045
  platformUserId?: string | null | undefined;
2019
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2046
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2020
2047
  agent?: string | null | undefined;
2021
2048
  sessionId?: string | null | undefined;
2022
2049
  pushToken?: string | null | undefined;
@@ -2054,11 +2081,12 @@ declare let client: {
2054
2081
  appId: string | null | undefined;
2055
2082
  boxId: string;
2056
2083
  appFolder: string | null | undefined;
2084
+ modelOverride: "standard" | "ultra" | null | undefined;
2057
2085
  rpcMethod: string | null | undefined;
2058
2086
  requestId: string | null | undefined;
2059
2087
  channelId: string | null | undefined;
2060
2088
  platformUserId: string | null | undefined;
2061
- invocationTrigger: "user" | "scheduled" | null | undefined;
2089
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2062
2090
  isDevelopment: boolean | null;
2063
2091
  agent: string | null | undefined;
2064
2092
  sessionId: string | null | undefined;
@@ -2099,11 +2127,12 @@ declare let client: {
2099
2127
  isDevelopment: boolean | null;
2100
2128
  appId?: string | null | undefined;
2101
2129
  appFolder?: string | null | undefined;
2130
+ modelOverride?: "standard" | "ultra" | null | undefined;
2102
2131
  rpcMethod?: string | null | undefined;
2103
2132
  requestId?: string | null | undefined;
2104
2133
  channelId?: string | null | undefined;
2105
2134
  platformUserId?: string | null | undefined;
2106
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2135
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2107
2136
  agent?: string | null | undefined;
2108
2137
  sessionId?: string | null | undefined;
2109
2138
  pushToken?: string | null | undefined;
@@ -2141,11 +2170,12 @@ declare let client: {
2141
2170
  appId: string | null | undefined;
2142
2171
  boxId: string;
2143
2172
  appFolder: string | null | undefined;
2173
+ modelOverride: "standard" | "ultra" | null | undefined;
2144
2174
  rpcMethod: string | null | undefined;
2145
2175
  requestId: string | null | undefined;
2146
2176
  channelId: string | null | undefined;
2147
2177
  platformUserId: string | null | undefined;
2148
- invocationTrigger: "user" | "scheduled" | null | undefined;
2178
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2149
2179
  isDevelopment: boolean | null;
2150
2180
  agent: string | null | undefined;
2151
2181
  sessionId: string | null | undefined;
@@ -2166,6 +2196,7 @@ declare let client: {
2166
2196
  providers: never[];
2167
2197
  userId?: undefined;
2168
2198
  tier?: undefined;
2199
+ planName?: undefined;
2169
2200
  handle?: undefined;
2170
2201
  credits?: undefined;
2171
2202
  } | {
@@ -2173,6 +2204,7 @@ declare let client: {
2173
2204
  error: null;
2174
2205
  providers: never[];
2175
2206
  tier?: undefined;
2207
+ planName?: undefined;
2176
2208
  handle?: undefined;
2177
2209
  credits?: undefined;
2178
2210
  } | {
@@ -2180,6 +2212,7 @@ declare let client: {
2180
2212
  error: null;
2181
2213
  providers: AuthProvider[];
2182
2214
  tier: UserTier | null;
2215
+ planName: string | null;
2183
2216
  handle: string | null;
2184
2217
  credits: {
2185
2218
  available: number;
@@ -2213,11 +2246,12 @@ declare let client: {
2213
2246
  isDevelopment: boolean | null;
2214
2247
  appId?: string | null | undefined;
2215
2248
  appFolder?: string | null | undefined;
2249
+ modelOverride?: "standard" | "ultra" | null | undefined;
2216
2250
  rpcMethod?: string | null | undefined;
2217
2251
  requestId?: string | null | undefined;
2218
2252
  channelId?: string | null | undefined;
2219
2253
  platformUserId?: string | null | undefined;
2220
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2254
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2221
2255
  agent?: string | null | undefined;
2222
2256
  sessionId?: string | null | undefined;
2223
2257
  pushToken?: string | null | undefined;
@@ -2255,11 +2289,12 @@ declare let client: {
2255
2289
  appId: string | null | undefined;
2256
2290
  boxId: string;
2257
2291
  appFolder: string | null | undefined;
2292
+ modelOverride: "standard" | "ultra" | null | undefined;
2258
2293
  rpcMethod: string | null | undefined;
2259
2294
  requestId: string | null | undefined;
2260
2295
  channelId: string | null | undefined;
2261
2296
  platformUserId: string | null | undefined;
2262
- invocationTrigger: "user" | "scheduled" | null | undefined;
2297
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2263
2298
  isDevelopment: boolean | null;
2264
2299
  agent: string | null | undefined;
2265
2300
  sessionId: string | null | undefined;
@@ -2303,11 +2338,12 @@ declare let client: {
2303
2338
  isDevelopment: boolean | null;
2304
2339
  appId?: string | null | undefined;
2305
2340
  appFolder?: string | null | undefined;
2341
+ modelOverride?: "standard" | "ultra" | null | undefined;
2306
2342
  rpcMethod?: string | null | undefined;
2307
2343
  requestId?: string | null | undefined;
2308
2344
  channelId?: string | null | undefined;
2309
2345
  platformUserId?: string | null | undefined;
2310
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2346
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2311
2347
  agent?: string | null | undefined;
2312
2348
  sessionId?: string | null | undefined;
2313
2349
  pushToken?: string | null | undefined;
@@ -2345,11 +2381,12 @@ declare let client: {
2345
2381
  appId: string | null | undefined;
2346
2382
  boxId: string;
2347
2383
  appFolder: string | null | undefined;
2384
+ modelOverride: "standard" | "ultra" | null | undefined;
2348
2385
  rpcMethod: string | null | undefined;
2349
2386
  requestId: string | null | undefined;
2350
2387
  channelId: string | null | undefined;
2351
2388
  platformUserId: string | null | undefined;
2352
- invocationTrigger: "user" | "scheduled" | null | undefined;
2389
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2353
2390
  isDevelopment: boolean | null;
2354
2391
  agent: string | null | undefined;
2355
2392
  sessionId: string | null | undefined;
@@ -2361,14 +2398,14 @@ declare let client: {
2361
2398
  subject: string;
2362
2399
  markdown: string;
2363
2400
  unauthenticatedLinks?: boolean | undefined;
2364
- aclLevel?: "VIEWER" | undefined;
2401
+ aclLevel?: "EDITOR" | "VIEWER" | undefined;
2365
2402
  };
2366
2403
  _input_out: {
2367
2404
  appId: string;
2368
2405
  email: string;
2369
2406
  subject: string;
2370
2407
  markdown: string;
2371
- aclLevel: "VIEWER";
2408
+ aclLevel: "EDITOR" | "VIEWER";
2372
2409
  unauthenticatedLinks?: boolean | undefined;
2373
2410
  };
2374
2411
  _output_in: typeof _trpc_server.unsetMarker;
@@ -2399,11 +2436,12 @@ declare let client: {
2399
2436
  isDevelopment: boolean | null;
2400
2437
  appId?: string | null | undefined;
2401
2438
  appFolder?: string | null | undefined;
2439
+ modelOverride?: "standard" | "ultra" | null | undefined;
2402
2440
  rpcMethod?: string | null | undefined;
2403
2441
  requestId?: string | null | undefined;
2404
2442
  channelId?: string | null | undefined;
2405
2443
  platformUserId?: string | null | undefined;
2406
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2444
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2407
2445
  agent?: string | null | undefined;
2408
2446
  sessionId?: string | null | undefined;
2409
2447
  pushToken?: string | null | undefined;
@@ -2441,11 +2479,12 @@ declare let client: {
2441
2479
  appId: string | null | undefined;
2442
2480
  boxId: string;
2443
2481
  appFolder: string | null | undefined;
2482
+ modelOverride: "standard" | "ultra" | null | undefined;
2444
2483
  rpcMethod: string | null | undefined;
2445
2484
  requestId: string | null | undefined;
2446
2485
  channelId: string | null | undefined;
2447
2486
  platformUserId: string | null | undefined;
2448
- invocationTrigger: "user" | "scheduled" | null | undefined;
2487
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2449
2488
  isDevelopment: boolean | null;
2450
2489
  agent: string | null | undefined;
2451
2490
  sessionId: string | null | undefined;
@@ -2498,11 +2537,12 @@ declare let client: {
2498
2537
  isDevelopment: boolean | null;
2499
2538
  appId?: string | null | undefined;
2500
2539
  appFolder?: string | null | undefined;
2540
+ modelOverride?: "standard" | "ultra" | null | undefined;
2501
2541
  rpcMethod?: string | null | undefined;
2502
2542
  requestId?: string | null | undefined;
2503
2543
  channelId?: string | null | undefined;
2504
2544
  platformUserId?: string | null | undefined;
2505
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2545
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2506
2546
  agent?: string | null | undefined;
2507
2547
  sessionId?: string | null | undefined;
2508
2548
  pushToken?: string | null | undefined;
@@ -2540,11 +2580,12 @@ declare let client: {
2540
2580
  appId: string | null | undefined;
2541
2581
  boxId: string;
2542
2582
  appFolder: string | null | undefined;
2583
+ modelOverride: "standard" | "ultra" | null | undefined;
2543
2584
  rpcMethod: string | null | undefined;
2544
2585
  requestId: string | null | undefined;
2545
2586
  channelId: string | null | undefined;
2546
2587
  platformUserId: string | null | undefined;
2547
- invocationTrigger: "user" | "scheduled" | null | undefined;
2588
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2548
2589
  isDevelopment: boolean | null;
2549
2590
  agent: string | null | undefined;
2550
2591
  sessionId: string | null | undefined;
@@ -2589,11 +2630,12 @@ declare let client: {
2589
2630
  isDevelopment: boolean | null;
2590
2631
  appId?: string | null | undefined;
2591
2632
  appFolder?: string | null | undefined;
2633
+ modelOverride?: "standard" | "ultra" | null | undefined;
2592
2634
  rpcMethod?: string | null | undefined;
2593
2635
  requestId?: string | null | undefined;
2594
2636
  channelId?: string | null | undefined;
2595
2637
  platformUserId?: string | null | undefined;
2596
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2638
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2597
2639
  agent?: string | null | undefined;
2598
2640
  sessionId?: string | null | undefined;
2599
2641
  pushToken?: string | null | undefined;
@@ -2631,11 +2673,12 @@ declare let client: {
2631
2673
  appId: string | null | undefined;
2632
2674
  boxId: string;
2633
2675
  appFolder: string | null | undefined;
2676
+ modelOverride: "standard" | "ultra" | null | undefined;
2634
2677
  rpcMethod: string | null | undefined;
2635
2678
  requestId: string | null | undefined;
2636
2679
  channelId: string | null | undefined;
2637
2680
  platformUserId: string | null | undefined;
2638
- invocationTrigger: "user" | "scheduled" | null | undefined;
2681
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2639
2682
  isDevelopment: boolean | null;
2640
2683
  agent: string | null | undefined;
2641
2684
  sessionId: string | null | undefined;
@@ -2681,11 +2724,12 @@ declare let client: {
2681
2724
  isDevelopment: boolean | null;
2682
2725
  appId?: string | null | undefined;
2683
2726
  appFolder?: string | null | undefined;
2727
+ modelOverride?: "standard" | "ultra" | null | undefined;
2684
2728
  rpcMethod?: string | null | undefined;
2685
2729
  requestId?: string | null | undefined;
2686
2730
  channelId?: string | null | undefined;
2687
2731
  platformUserId?: string | null | undefined;
2688
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2732
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2689
2733
  agent?: string | null | undefined;
2690
2734
  sessionId?: string | null | undefined;
2691
2735
  pushToken?: string | null | undefined;
@@ -2723,11 +2767,12 @@ declare let client: {
2723
2767
  appId: string | null | undefined;
2724
2768
  boxId: string;
2725
2769
  appFolder: string | null | undefined;
2770
+ modelOverride: "standard" | "ultra" | null | undefined;
2726
2771
  rpcMethod: string | null | undefined;
2727
2772
  requestId: string | null | undefined;
2728
2773
  channelId: string | null | undefined;
2729
2774
  platformUserId: string | null | undefined;
2730
- invocationTrigger: "user" | "scheduled" | null | undefined;
2775
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2731
2776
  isDevelopment: boolean | null;
2732
2777
  agent: string | null | undefined;
2733
2778
  sessionId: string | null | undefined;
@@ -2767,11 +2812,12 @@ declare let client: {
2767
2812
  isDevelopment: boolean | null;
2768
2813
  appId?: string | null | undefined;
2769
2814
  appFolder?: string | null | undefined;
2815
+ modelOverride?: "standard" | "ultra" | null | undefined;
2770
2816
  rpcMethod?: string | null | undefined;
2771
2817
  requestId?: string | null | undefined;
2772
2818
  channelId?: string | null | undefined;
2773
2819
  platformUserId?: string | null | undefined;
2774
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2820
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2775
2821
  agent?: string | null | undefined;
2776
2822
  sessionId?: string | null | undefined;
2777
2823
  pushToken?: string | null | undefined;
@@ -2809,11 +2855,12 @@ declare let client: {
2809
2855
  appId: string | null | undefined;
2810
2856
  boxId: string;
2811
2857
  appFolder: string | null | undefined;
2858
+ modelOverride: "standard" | "ultra" | null | undefined;
2812
2859
  rpcMethod: string | null | undefined;
2813
2860
  requestId: string | null | undefined;
2814
2861
  channelId: string | null | undefined;
2815
2862
  platformUserId: string | null | undefined;
2816
- invocationTrigger: "user" | "scheduled" | null | undefined;
2863
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2817
2864
  isDevelopment: boolean | null;
2818
2865
  agent: string | null | undefined;
2819
2866
  sessionId: string | null | undefined;
@@ -2881,11 +2928,12 @@ declare let client: {
2881
2928
  isDevelopment: boolean | null;
2882
2929
  appId?: string | null | undefined;
2883
2930
  appFolder?: string | null | undefined;
2931
+ modelOverride?: "standard" | "ultra" | null | undefined;
2884
2932
  rpcMethod?: string | null | undefined;
2885
2933
  requestId?: string | null | undefined;
2886
2934
  channelId?: string | null | undefined;
2887
2935
  platformUserId?: string | null | undefined;
2888
- invocationTrigger?: "user" | "scheduled" | null | undefined;
2936
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2889
2937
  agent?: string | null | undefined;
2890
2938
  sessionId?: string | null | undefined;
2891
2939
  pushToken?: string | null | undefined;
@@ -2923,11 +2971,12 @@ declare let client: {
2923
2971
  appId: string | null | undefined;
2924
2972
  boxId: string;
2925
2973
  appFolder: string | null | undefined;
2974
+ modelOverride: "standard" | "ultra" | null | undefined;
2926
2975
  rpcMethod: string | null | undefined;
2927
2976
  requestId: string | null | undefined;
2928
2977
  channelId: string | null | undefined;
2929
2978
  platformUserId: string | null | undefined;
2930
- invocationTrigger: "user" | "scheduled" | null | undefined;
2979
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2931
2980
  isDevelopment: boolean | null;
2932
2981
  agent: string | null | undefined;
2933
2982
  sessionId: string | null | undefined;
@@ -2971,11 +3020,12 @@ declare let client: {
2971
3020
  isDevelopment: boolean | null;
2972
3021
  appId?: string | null | undefined;
2973
3022
  appFolder?: string | null | undefined;
3023
+ modelOverride?: "standard" | "ultra" | null | undefined;
2974
3024
  rpcMethod?: string | null | undefined;
2975
3025
  requestId?: string | null | undefined;
2976
3026
  channelId?: string | null | undefined;
2977
3027
  platformUserId?: string | null | undefined;
2978
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3028
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
2979
3029
  agent?: string | null | undefined;
2980
3030
  sessionId?: string | null | undefined;
2981
3031
  pushToken?: string | null | undefined;
@@ -3013,11 +3063,12 @@ declare let client: {
3013
3063
  appId: string | null | undefined;
3014
3064
  boxId: string;
3015
3065
  appFolder: string | null | undefined;
3066
+ modelOverride: "standard" | "ultra" | null | undefined;
3016
3067
  rpcMethod: string | null | undefined;
3017
3068
  requestId: string | null | undefined;
3018
3069
  channelId: string | null | undefined;
3019
3070
  platformUserId: string | null | undefined;
3020
- invocationTrigger: "user" | "scheduled" | null | undefined;
3071
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3021
3072
  isDevelopment: boolean | null;
3022
3073
  agent: string | null | undefined;
3023
3074
  sessionId: string | null | undefined;
@@ -3061,11 +3112,12 @@ declare let client: {
3061
3112
  isDevelopment: boolean | null;
3062
3113
  appId?: string | null | undefined;
3063
3114
  appFolder?: string | null | undefined;
3115
+ modelOverride?: "standard" | "ultra" | null | undefined;
3064
3116
  rpcMethod?: string | null | undefined;
3065
3117
  requestId?: string | null | undefined;
3066
3118
  channelId?: string | null | undefined;
3067
3119
  platformUserId?: string | null | undefined;
3068
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3120
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3069
3121
  agent?: string | null | undefined;
3070
3122
  sessionId?: string | null | undefined;
3071
3123
  pushToken?: string | null | undefined;
@@ -3103,11 +3155,12 @@ declare let client: {
3103
3155
  appId: string | null | undefined;
3104
3156
  boxId: string;
3105
3157
  appFolder: string | null | undefined;
3158
+ modelOverride: "standard" | "ultra" | null | undefined;
3106
3159
  rpcMethod: string | null | undefined;
3107
3160
  requestId: string | null | undefined;
3108
3161
  channelId: string | null | undefined;
3109
3162
  platformUserId: string | null | undefined;
3110
- invocationTrigger: "user" | "scheduled" | null | undefined;
3163
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3111
3164
  isDevelopment: boolean | null;
3112
3165
  agent: string | null | undefined;
3113
3166
  sessionId: string | null | undefined;
@@ -3157,11 +3210,12 @@ declare let client: {
3157
3210
  isDevelopment: boolean | null;
3158
3211
  appId?: string | null | undefined;
3159
3212
  appFolder?: string | null | undefined;
3213
+ modelOverride?: "standard" | "ultra" | null | undefined;
3160
3214
  rpcMethod?: string | null | undefined;
3161
3215
  requestId?: string | null | undefined;
3162
3216
  channelId?: string | null | undefined;
3163
3217
  platformUserId?: string | null | undefined;
3164
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3218
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3165
3219
  agent?: string | null | undefined;
3166
3220
  sessionId?: string | null | undefined;
3167
3221
  pushToken?: string | null | undefined;
@@ -3199,11 +3253,12 @@ declare let client: {
3199
3253
  appId: string | null | undefined;
3200
3254
  boxId: string;
3201
3255
  appFolder: string | null | undefined;
3256
+ modelOverride: "standard" | "ultra" | null | undefined;
3202
3257
  rpcMethod: string | null | undefined;
3203
3258
  requestId: string | null | undefined;
3204
3259
  channelId: string | null | undefined;
3205
3260
  platformUserId: string | null | undefined;
3206
- invocationTrigger: "user" | "scheduled" | null | undefined;
3261
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3207
3262
  isDevelopment: boolean | null;
3208
3263
  agent: string | null | undefined;
3209
3264
  sessionId: string | null | undefined;
@@ -3271,11 +3326,12 @@ declare let client: {
3271
3326
  isDevelopment: boolean | null;
3272
3327
  appId?: string | null | undefined;
3273
3328
  appFolder?: string | null | undefined;
3329
+ modelOverride?: "standard" | "ultra" | null | undefined;
3274
3330
  rpcMethod?: string | null | undefined;
3275
3331
  requestId?: string | null | undefined;
3276
3332
  channelId?: string | null | undefined;
3277
3333
  platformUserId?: string | null | undefined;
3278
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3334
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3279
3335
  agent?: string | null | undefined;
3280
3336
  sessionId?: string | null | undefined;
3281
3337
  pushToken?: string | null | undefined;
@@ -3313,11 +3369,12 @@ declare let client: {
3313
3369
  appId: string | null | undefined;
3314
3370
  boxId: string;
3315
3371
  appFolder: string | null | undefined;
3372
+ modelOverride: "standard" | "ultra" | null | undefined;
3316
3373
  rpcMethod: string | null | undefined;
3317
3374
  requestId: string | null | undefined;
3318
3375
  channelId: string | null | undefined;
3319
3376
  platformUserId: string | null | undefined;
3320
- invocationTrigger: "user" | "scheduled" | null | undefined;
3377
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3321
3378
  isDevelopment: boolean | null;
3322
3379
  agent: string | null | undefined;
3323
3380
  sessionId: string | null | undefined;
@@ -3372,11 +3429,12 @@ declare let client: {
3372
3429
  isDevelopment: boolean | null;
3373
3430
  appId?: string | null | undefined;
3374
3431
  appFolder?: string | null | undefined;
3432
+ modelOverride?: "standard" | "ultra" | null | undefined;
3375
3433
  rpcMethod?: string | null | undefined;
3376
3434
  requestId?: string | null | undefined;
3377
3435
  channelId?: string | null | undefined;
3378
3436
  platformUserId?: string | null | undefined;
3379
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3437
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3380
3438
  agent?: string | null | undefined;
3381
3439
  sessionId?: string | null | undefined;
3382
3440
  pushToken?: string | null | undefined;
@@ -3414,11 +3472,12 @@ declare let client: {
3414
3472
  appId: string | null | undefined;
3415
3473
  boxId: string;
3416
3474
  appFolder: string | null | undefined;
3475
+ modelOverride: "standard" | "ultra" | null | undefined;
3417
3476
  rpcMethod: string | null | undefined;
3418
3477
  requestId: string | null | undefined;
3419
3478
  channelId: string | null | undefined;
3420
3479
  platformUserId: string | null | undefined;
3421
- invocationTrigger: "user" | "scheduled" | null | undefined;
3480
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3422
3481
  isDevelopment: boolean | null;
3423
3482
  agent: string | null | undefined;
3424
3483
  sessionId: string | null | undefined;
@@ -3462,11 +3521,12 @@ declare let client: {
3462
3521
  isDevelopment: boolean | null;
3463
3522
  appId?: string | null | undefined;
3464
3523
  appFolder?: string | null | undefined;
3524
+ modelOverride?: "standard" | "ultra" | null | undefined;
3465
3525
  rpcMethod?: string | null | undefined;
3466
3526
  requestId?: string | null | undefined;
3467
3527
  channelId?: string | null | undefined;
3468
3528
  platformUserId?: string | null | undefined;
3469
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3529
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3470
3530
  agent?: string | null | undefined;
3471
3531
  sessionId?: string | null | undefined;
3472
3532
  pushToken?: string | null | undefined;
@@ -3504,11 +3564,12 @@ declare let client: {
3504
3564
  appId: string | null | undefined;
3505
3565
  boxId: string;
3506
3566
  appFolder: string | null | undefined;
3567
+ modelOverride: "standard" | "ultra" | null | undefined;
3507
3568
  rpcMethod: string | null | undefined;
3508
3569
  requestId: string | null | undefined;
3509
3570
  channelId: string | null | undefined;
3510
3571
  platformUserId: string | null | undefined;
3511
- invocationTrigger: "user" | "scheduled" | null | undefined;
3572
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3512
3573
  isDevelopment: boolean | null;
3513
3574
  agent: string | null | undefined;
3514
3575
  sessionId: string | null | undefined;
@@ -3544,11 +3605,12 @@ declare let client: {
3544
3605
  isDevelopment: boolean | null;
3545
3606
  appId?: string | null | undefined;
3546
3607
  appFolder?: string | null | undefined;
3608
+ modelOverride?: "standard" | "ultra" | null | undefined;
3547
3609
  rpcMethod?: string | null | undefined;
3548
3610
  requestId?: string | null | undefined;
3549
3611
  channelId?: string | null | undefined;
3550
3612
  platformUserId?: string | null | undefined;
3551
- invocationTrigger?: "user" | "scheduled" | null | undefined;
3613
+ invocationTrigger?: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3552
3614
  agent?: string | null | undefined;
3553
3615
  sessionId?: string | null | undefined;
3554
3616
  pushToken?: string | null | undefined;
@@ -3586,11 +3648,12 @@ declare let client: {
3586
3648
  appId: string | null | undefined;
3587
3649
  boxId: string;
3588
3650
  appFolder: string | null | undefined;
3651
+ modelOverride: "standard" | "ultra" | null | undefined;
3589
3652
  rpcMethod: string | null | undefined;
3590
3653
  requestId: string | null | undefined;
3591
3654
  channelId: string | null | undefined;
3592
3655
  platformUserId: string | null | undefined;
3593
- invocationTrigger: "user" | "scheduled" | null | undefined;
3656
+ invocationTrigger: "event" | "webhook" | "user" | "scheduled" | "composio" | null | undefined;
3594
3657
  isDevelopment: boolean | null;
3595
3658
  agent: string | null | undefined;
3596
3659
  sessionId: string | null | undefined;
@@ -1,4 +1,4 @@
1
- import {z}from'zod';import {createTRPCProxyClient,httpLink}from'@trpc/client';import P from'superjson';import {handleRpc}from'typed-rpc/server';import {inspect}from'util';import {AsyncLocalStorage}from'async_hooks';import Ne from'better-sqlite3';import {better,defineQueue,defineWorker,JobStatus}from'plainjob';var le={GITHUB_USER:"GITHUB_USER",GITHUB_BOT:"GITHUB_BOT",GOOGLE:"GOOGLE",SLACK:"SLACK",SLACK_BOT:"SLACK_BOT",DISCORD:"DISCORD",NOTION:"NOTION",TWITTER:"TWITTER",LINKEDIN:"LINKEDIN",YAHOO:"YAHOO",FIGMA:"FIGMA",SQUARE:"SQUARE",SHOPIFY:"SHOPIFY",WHOOP:"WHOOP"},fe={...le,PLAID:"PLAID"},C={...fe,AC1:"AC1"};var me=z.object({slug:z.string(),name:z.string().optional(),schedule:z.string(),description:z.string().optional(),rpcEndpoint:z.string(),isEnabled:z.boolean().default(true),stopAt:z.string().datetime().optional(),maxExecutions:z.number().optional(),timezone:z.string().optional()}),$=z.string().refine(e=>/^[a-zA-Z0-9_]+$/.test(e),"Must be a valid identifier (letters, numbers, and underscores only)."),ge=z.object({handler:$,provider:z.nativeEnum(C).nullish(),slug:z.string(),name:z.string(),description:z.string()}),he=z.object({provider:z.nativeEnum(C),event:z.string().min(1),handler:$,slug:z.string().min(1).max(64),name:z.string().min(1).max(128),description:z.string().min(1).max(256)}),Ee=z.object({crons:z.array(me),events:z.array(he).default([]),webhooks:z.array(ge).default([])});function N(e){let r=Object.create(null);for(let t in e){let o=e[t];r[o]=t;}return r}var x={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};N(x);N(x);typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var S=class e extends Error{static prefix="__MISSING AUTH FOR SCOPE";static jsonRpcCode=-32001;constructor({provider:r,scope:t,accountId:o,popup:n=false}){let s=btoa(JSON.stringify({provider:r,scope:t,accountId:o}));super(`${e.prefix}: ${s}${n?" --popup":" end"}`);}jsonRpcError(){return {code:e.jsonRpcCode,message:this.message}}static check(r){return r?.message?.startsWith(e.prefix)}};var oe=new AsyncLocalStorage;function F(){return oe.getStore()}async function se(e,r){return oe.run(e,r)}function ie({environment:e,dbPath:r="errors.db"}){let t=new Ne(r,{fileMustExist:false});t.pragma("journal_mode = WAL"),t.exec(`
1
+ import*as a from'zod';import {z}from'zod';import {createTRPCProxyClient,httpLink}from'@trpc/client';import _t from'superjson';import {handleRpc}from'typed-rpc/server';import {inspect}from'util';import {AsyncLocalStorage}from'async_hooks';import Ki from'better-sqlite3';import {better,defineQueue,defineWorker,JobStatus}from'plainjob';a.enum(["ReadUncommitted","ReadCommitted","RepeatableRead","Serializable"]);a.enum(["id","name","userId","type","provider","providerAccountId","refreshToken","accessToken","expiresAt","tokenType","scope","scopes","createdAt","updatedAt"]);a.enum(["id","isApiKey","sessionToken","tokenAlias","userId","expires","createdAt","lastSeen"]);a.enum(["identifier","token","expires","createdAt"]);a.enum(["id","guestAppUserId","appId","userId","createdAt"]);a.enum(["id","name","handle","email","emailVerified","image","phoneNumber","mergedIntoId","isStub","externalPaymentId","createdAt","isAdmin","isCreator","isSuspended","classifiedAt","isEmailSubscribed","tier","tierStartedAt","preferences","timezone","mobileAppBackgroundUrl"]);a.enum(["id","userId","token","createdAt","updatedAt","lastSeenAt"]);a.enum(["id","userId","icon","title","body","data","createdAt","readAt"]);a.enum(["id","userId","slug","boxId","isDefault","isSuspended","name","createdAt","lastUsedAt","volumeDeletedAt","lastStorageUsedPercent","volumeSizeGb","lastComputerStorageUsedBytes","lastFileStorageUsedBytes","lastComputerStorageReportedAt","lastFileStorageReportedAt","lastStorageAlertThreshold","lastStorageAlertSentAt","selectedModel"]);a.enum(["id","computerId","kind","apiKey","createdAt","updatedAt"]);a.enum(["id","computerId","agentName","model","createdAt","updatedAt"]);a.enum(["id","computerId","createdById","sessionId","originType","originLocation","originAppId","originSessionId","createdAt","isHidden","lastMessageAt","lastAssistantMessageAt","lastReadAt"]);a.enum(["id","appId","connectionId","createdAt"]);a.enum(["id","createdAt","appId","provider"]);a.enum(["provider","scope","createdAt","appId","userId"]);a.enum(["id","name","description","createdAt","updatedAt","emailDomain","ownerId"]);a.enum(["id","createdAt","enabled","name","description","kind","price","externalPriceId","appId"]);a.enum(["id","createdAt","active","userId","productId","externalId"]);a.enum(["id","appId","userId","workspaceId","level","createdAt"]);a.enum(["id","resourceType","resourceId","relation","subjectType","subjectId","subjectRelation","grantOrigin","grantedByType","grantedById","grantedByRelation","grantReason","createdAt"]);a.enum(["type","id","createdAt","updatedAt","userId","appId","workspaceId","computerId","oAuthConnectionId"]);a.enum(["id","createdAt","options","stopReason","purpose","usage","duration","appId","userId","acuCost","modelName","attributionKind","attributionReason","computerId"]);a.enum(["fileName","createdAt","originalName","size","userId","appId","computerId"]);a.enum(["id","name","subdomain","customDomain","pendingCustomDomain","externalDomainCertificateId","pendingExternalDomainCertificateId","pendingCustomDomainRequestedAt","displayName","description","iconUrl","coverMediaUrl","appListingFeatures","createdAt","updatedAt","latestVersionId","publishedVersionId","madePublicAt","madeUnlistedAt","forkedFromId","isForkable","showWatermark","isPricingLimitExempt","globalRecommendationScore","isLocked","isSuspended","isMessagingDisabled","systemVersion","tier","tierStartedAt","acuTotal","runtimeKind","stackType","computerId","hasProduction","migratedFromId","migratedToId","migratedToBoxmanAt"]);a.enum(["name","priority","createdAt"]);a.enum(["domain","note","createdById","createdAt","updatedAt"]);a.enum(["id","appId","orderPosition","createdAt","updatedAt"]);a.enum(["id","externalId","userId","enabled","createdAt"]);a.enum(["id","values","text","appId","createdAt"]);a.enum(["serverId","createdAt","updatedAt","appId","versionId","cpuMs","requestBytes","responseBytes"]);a.enum(["id","createdAt","updatedAt","rev","frontendSource","frontendCode","frontendUrl","frontendThemeCss","frontendCss","frontendCssUrl","frontendComponentsCss","frontendComponentsCompiledCss","frontendComponentsCssUrl","backendSource","backendCode","backendCodeUrl","backendTypes","dbSchemaCode","dbMigrations","prdSource","prdSummary","prdTransformed","databaseUrl","testDatabaseUrl","prettyDiff","versionChangesSummary","infraConfig","screenshot","isStable","status","parentId","appId","apiTestSource","devChecklistSource","buildDuration"]);a.enum(["id","createdAt","cronName","status","errorMessage","versionId","cronJobId"]);a.enum(["id","createdAt","appId","userId","type"]);a.enum(["id","createdAt","message","summary","hash","errorCategory","kind","level","versionId"]);a.enum(["id","createdAt","appId","level","label","data"]);a.enum(["id","createdAt","source","kind","level","code","message","versionId"]);a.enum(["id","toEmail","subject","markdown","createdAt","appId","userId"]);a.enum(["id","query","params","requestBody","createdAt","versionId"]);a.enum(["id","createdAt","versionId","analyst","analysis","isSuspicious","severity","confidence"]);a.enum(["id","userId","phase","score","signals","actions","createdAt"]);a.enum(["id","createdAt","userId","reason","appId"]);a.enum(["id","userId","orderPosition","createdAt"]);a.enum(["id","homeScreenPageId","appId","orderPosition","createdAt"]);a.enum(["id","createdAt","name","orderPosition"]);a.enum(["id","createdAt","appStoreSectionId","appId","orderPosition"]);a.enum(["id","createdAt","acceptedAt","inviterId","appId","workspaceId","aclLevel","authzGrantResourceType","authzGrantResourceId","authzGrantRelation","authzGrantSubjectRelation","authzGrantOrigin","authzGrantedByType","authzGrantedById","authzGrantedByRelation","userId"]);a.enum(["id","createdAt","tokenHash","redirectUrl","userId","invitationId"]);a.enum(["id","url","userId","createdAt"]);a.enum(["id","createdAt","userId","appId","type","idempotencyKey","amount","deltaDaily","deltaMonthly","deltaPromotional","deltaOver","deltaBilledOver","deltaUnbilledOver","generationId"]);a.enum(["id","userId","daily","monthly","promotional","over","billedOver","unbilledOver","maxOverageSpendCents","paymentFailing","lastMonthlyRefresh","nextMonthlyRefresh","nextMonthlyRefreshIdempotencyKey","lastDailyRefresh","nextDailyRefresh","promotionalExpiresAt","calendarMonthDailyGrantsTotal","dailyGrantsMonthStart","promotionalCycleCapacity","lowCreditWarningDismissedAt"]);a.enum(["id","appId","totalSpent","monthlyLimit","periodStart"]);a.enum(["id","createdAt","updatedAt","appId","lastRunAt","executionCount","slug","name","description","schedule","scheduleDescription","rpcEndpoint","isEnabled","stopAt","maxExecutions","timezone","modelOverride"]);a.enum(["id","createdAt","updatedAt","appId","slug","name","description","handler","provider","modelOverride"]);a.enum(["id","createdAt","webhookId","status","errorMessage"]);a.enum(["id","createdAt","updatedAt","appId","provider","event","handler","slug","name","description","modelOverride"]);a.enum(["id","createdAt","subscriptionId","status","errorMessage"]);a.enum(["createdAt","updatedAt","appId","handler","triggerId","triggerSlug","connectedAccountId","composioUserId","isEnabled","name","description","modelOverride"]);a.enum(["asc","desc"]);a.enum(["DbNull","JsonNull"]);a.enum(["JsonNull"]);a.enum(["default","insensitive"]);a.enum(["first","last"]);a.enum(["DbNull","JsonNull","AnyNull"]);var Ft=a.enum(["FREE","ONE","TWO"]);var Nt=a.enum(["ENABLE_DEV_MODE","FORCE_DARKMODE","FORCE_LIGHTMODE","HIDE_PUBLISH_TOOLTIP","HIDE_FORK_TOOLTIP","HIDE_PLANS_POPUP","HIDE_APP_ERRORS_TOOLTIP","REQUEST_REVIEW","DONT_ASK_FOR_REVIEW","SYS_PLANS_ENABLED","SYS_WORKSPACES_ENABLED","SYS_API_TESTS_ENABLED","SYS_INTEGRATIONS_ENABLED","SYS_COMPUTER_SHARING_ENABLED","SYS_BOXMAN_ENABLED","ONBOARDING_INITIATED","SYS_CREDITS_ENABLED","SYS_ADMIN_SERVICE_TIER_PRIORITY","SYS_ADMIN_SERVICE_TIER_DEFAULT","SYS_ADMIN_SERVICE_TIER_FLEX","SYS_PIPEDREAM_ENABLED","SYS_PAYG_ENABLED","SYS_ENABLE_EDITOR_INVITES"]);var C=a.enum(["standard","ultra"]);var Ut=a.enum(["AGENT_MAIL"]);var Dt=a.enum(["CHAT","APP","SESSION"]);var Bt=a.enum(["HOMESCREEN","APP"]);var jt=a.enum(["SUBSCRIPTION","IN_APP_PURCHASE"]);var ht=a.enum(["VIEWER","EDITOR","OWNER"]);var H=a.enum(["user","app","workspace","computer","oauth_connection"]);var Ht=a.enum(["FREE","ONE","CUSTOM"]);var qt=a.enum(["LEGACY","BOXMAN"]);var Gt=a.enum(["FULL_STACK","UTILITY"]);var Wt=a.enum(["IDLE","GENERATING","DIED"]);var Vt=a.enum(["SUCCESS","ERROR"]);var Kt=a.enum(["PAGE_VIEW","OTHER"]);var Jt=a.enum(["CLIENT","SERVER"]);var be=a.enum(["ERROR","WARN","INFO"]);var Qt=a.enum(["MIGRATION","LINT","TYPECHECK","ESBUILD","CSS","IMPLEMENTATION","MISSING_ENV_VARS"]);var Yt=a.enum(["NONE","LOW","MEDIUM","HIGH"]);var $t=a.enum(["LOW","MEDIUM","HIGH"]);var Xt=a.enum(["ABUSE","FULL"]);var Zt=a.enum(["WAIVED_SPEND","SPEND","GRANT","DAILY_REFRESH","MONTHLY_REFRESH","PROMOTIONAL_EXPIRATION","UPTIME_SPEND"]);var er=a.enum(["SUCCESS","ERROR"]);var tr=a.enum(["SUCCESS","ERROR"]);a.enum(["USER","ASSISTANT","TOOL","SYSTEM"]);a.object({id:a.string(),name:a.string().nullish(),userId:a.string(),type:a.string(),provider:a.string(),providerAccountId:a.string(),refreshToken:a.string().nullish(),accessToken:a.string().nullish(),expiresAt:a.date().nullish(),tokenType:a.string().nullish(),scope:a.string().nullish(),scopes:a.array(a.string()),createdAt:a.date(),updatedAt:a.date().nullish()});a.object({id:a.string(),isApiKey:a.boolean(),sessionToken:a.string(),tokenAlias:a.string().nullish(),userId:a.string(),expires:a.date(),createdAt:a.date(),lastSeen:a.date()});a.object({identifier:a.string(),token:a.string(),expires:a.date(),createdAt:a.date()});a.object({id:a.string(),guestAppUserId:a.string(),appId:a.string(),userId:a.string().nullish(),createdAt:a.date()});a.object({id:a.string(),name:a.string(),handle:a.string(),email:a.string().nullish(),emailVerified:a.date().nullish(),image:a.string().nullish(),phoneNumber:a.string().nullish(),mergedIntoId:a.string().nullish(),isStub:a.boolean(),externalPaymentId:a.string().nullish(),createdAt:a.date(),isAdmin:a.boolean(),isCreator:a.boolean().default(true),isSuspended:a.boolean(),classifiedAt:a.date().nullish(),isEmailSubscribed:a.boolean().default(true),tier:Ft.default("FREE"),tierStartedAt:a.date().nullish(),preferences:a.array(Nt),timezone:a.string().default("America/Los_Angeles"),mobileAppBackgroundUrl:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish()});a.object({id:a.string(),userId:a.string(),token:a.string(),createdAt:a.date(),updatedAt:a.date(),lastSeenAt:a.date()});a.object({id:a.string(),userId:a.string(),icon:a.string().nullish(),title:a.string(),body:a.string(),data:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),createdAt:a.date(),readAt:a.date().nullish()});a.object({id:a.string(),userId:a.string(),slug:a.string(),boxId:a.string(),isDefault:a.boolean(),isSuspended:a.boolean(),name:a.string(),createdAt:a.date(),lastUsedAt:a.date(),volumeDeletedAt:a.date().nullish(),lastStorageUsedPercent:a.number().int().nullish(),volumeSizeGb:a.number().int().nullish(),lastComputerStorageUsedBytes:a.bigint().nullish(),lastFileStorageUsedBytes:a.bigint().nullish(),lastComputerStorageReportedAt:a.date().nullish(),lastFileStorageReportedAt:a.date().nullish(),lastStorageAlertThreshold:a.number().nullish(),lastStorageAlertSentAt:a.date().nullish(),selectedModel:C.nullish()});a.object({id:a.string(),computerId:a.string(),kind:Ut,apiKey:a.string(),createdAt:a.date(),updatedAt:a.date()});a.object({id:a.string(),computerId:a.string(),agentName:a.string(),model:a.string(),createdAt:a.date(),updatedAt:a.date()});a.object({id:a.string(),computerId:a.string(),createdById:a.string().nullish(),sessionId:a.string(),originType:Dt.nullish(),originLocation:Bt.nullish(),originAppId:a.string().nullish(),originSessionId:a.string().nullish(),createdAt:a.date(),isHidden:a.boolean(),lastMessageAt:a.date(),lastAssistantMessageAt:a.date().nullish(),lastReadAt:a.date().nullish()});a.object({id:a.string(),appId:a.string(),connectionId:a.string(),createdAt:a.date()});a.object({id:a.string(),createdAt:a.date(),appId:a.string(),provider:a.string()});a.object({provider:a.string(),scope:a.string(),createdAt:a.date(),appId:a.string(),userId:a.string()});a.object({id:a.string(),name:a.string(),description:a.string(),createdAt:a.date(),updatedAt:a.date(),emailDomain:a.string().nullish(),ownerId:a.string()});a.object({id:a.string(),createdAt:a.date(),enabled:a.boolean().default(true),name:a.string(),description:a.string(),kind:jt.default("IN_APP_PURCHASE"),price:a.number().int(),externalPriceId:a.string().nullish(),appId:a.string()});a.object({id:a.string(),createdAt:a.date(),active:a.boolean().default(true),userId:a.string(),productId:a.string(),externalId:a.string().nullish()});a.object({id:a.string(),appId:a.string(),userId:a.string().nullish(),workspaceId:a.string().nullish(),level:ht.default("VIEWER"),createdAt:a.date()});a.object({id:a.string(),resourceType:H,resourceId:a.string(),relation:a.string(),subjectType:H,subjectId:a.string(),subjectRelation:a.string(),grantOrigin:a.string(),grantedByType:H.nullish(),grantedById:a.string().nullish(),grantedByRelation:a.string().nullish(),grantReason:a.string().nullish(),createdAt:a.date()});a.object({type:H,id:a.string(),createdAt:a.date(),updatedAt:a.date(),userId:a.string().nullish(),appId:a.string().nullish(),workspaceId:a.string().nullish(),computerId:a.string().nullish(),oAuthConnectionId:a.string().nullish()});a.object({id:a.string(),createdAt:a.date(),options:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),stopReason:a.string().nullish(),purpose:a.string().nullish(),usage:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),duration:a.number().int().nullish(),appId:a.string().nullish(),userId:a.string().nullish(),acuCost:a.number().nullish(),modelName:a.string().nullish(),attributionKind:a.string().nullish(),attributionReason:a.string().nullish(),computerId:a.string().nullish()});a.object({fileName:a.string(),createdAt:a.date(),originalName:a.string().nullish(),size:a.number().int(),userId:a.string().nullish(),appId:a.string().nullish(),computerId:a.string().nullish()});a.object({id:a.string(),name:a.string(),subdomain:a.string(),customDomain:a.string().nullish(),pendingCustomDomain:a.string().nullish(),externalDomainCertificateId:a.string().nullish(),pendingExternalDomainCertificateId:a.string().nullish(),pendingCustomDomainRequestedAt:a.date().nullish(),displayName:a.string().nullish(),description:a.string().nullish(),iconUrl:a.string().nullish(),coverMediaUrl:a.string().nullish(),appListingFeatures:a.array(a.string()),createdAt:a.date(),updatedAt:a.date(),latestVersionId:a.string().nullish(),publishedVersionId:a.string().nullish(),madePublicAt:a.date().nullish(),madeUnlistedAt:a.date().nullish(),forkedFromId:a.string().nullish(),isForkable:a.boolean().default(true),showWatermark:a.boolean().default(true),isPricingLimitExempt:a.boolean(),globalRecommendationScore:a.number(),isLocked:a.boolean(),isSuspended:a.boolean(),isMessagingDisabled:a.boolean(),systemVersion:a.number().int().default(2),tier:Ht.default("FREE"),tierStartedAt:a.date().nullish(),acuTotal:a.number().nullish(),runtimeKind:qt.default("LEGACY"),stackType:Gt.default("FULL_STACK"),computerId:a.string().nullish(),hasProduction:a.boolean(),migratedFromId:a.string().nullish(),migratedToId:a.string().nullish(),migratedToBoxmanAt:a.date().nullish()});a.object({name:a.string(),priority:a.number().int(),createdAt:a.date()});a.object({domain:a.string(),note:a.string().nullish(),createdById:a.string().nullish(),createdAt:a.date(),updatedAt:a.date()});a.object({id:a.string(),appId:a.string(),orderPosition:a.number().int(),createdAt:a.date(),updatedAt:a.date()});a.object({id:a.string(),externalId:a.string(),userId:a.string(),enabled:a.boolean(),createdAt:a.date()});a.object({id:a.string(),values:a.array(a.number()),text:a.string().nullish(),appId:a.string().nullish(),createdAt:a.date()});a.object({serverId:a.string(),createdAt:a.date(),updatedAt:a.date(),appId:a.string().nullish(),versionId:a.string().nullish(),cpuMs:a.number().int(),requestBytes:a.number().int(),responseBytes:a.number().int()});a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),rev:a.number().int(),frontendSource:a.string().nullish(),frontendCode:a.string().nullish(),frontendUrl:a.string().nullish(),frontendThemeCss:a.string().nullish(),frontendCss:a.string().nullish(),frontendCssUrl:a.string().nullish(),frontendComponentsCss:a.string().nullish(),frontendComponentsCompiledCss:a.string().nullish(),frontendComponentsCssUrl:a.string().nullish(),backendSource:a.string().nullish(),backendCode:a.string().nullish(),backendCodeUrl:a.string().nullish(),backendTypes:a.string().nullish(),dbSchemaCode:a.string().nullish(),dbMigrations:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),prdSource:a.string().nullish(),prdSummary:a.string().nullish(),prdTransformed:a.string().nullish(),databaseUrl:a.string().nullish(),testDatabaseUrl:a.string().nullish(),prettyDiff:a.string().nullish(),versionChangesSummary:a.string().nullish(),infraConfig:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),screenshot:a.string().nullish(),isStable:a.boolean().default(true),status:Wt.default("IDLE"),parentId:a.string().nullish(),appId:a.string(),apiTestSource:a.string().nullish(),devChecklistSource:a.string().nullish(),buildDuration:a.number().nullish()});a.object({id:a.string(),createdAt:a.date(),cronName:a.string(),status:Vt.default("SUCCESS"),errorMessage:a.string().nullish(),versionId:a.string().nullish(),cronJobId:a.string().nullish()});a.object({id:a.string(),createdAt:a.date(),appId:a.string(),userId:a.string(),type:Kt});a.object({id:a.string(),createdAt:a.date(),message:a.string(),summary:a.string().nullish(),hash:a.string(),errorCategory:a.string().nullish(),kind:Jt,level:be.default("INFO"),versionId:a.string()});a.object({id:a.string(),createdAt:a.date(),appId:a.string().nullish(),level:be.default("INFO"),label:a.string(),data:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10")});a.object({id:a.string(),createdAt:a.date(),source:a.string(),kind:Qt,level:be.default("ERROR"),code:a.string(),message:a.string(),versionId:a.string()});a.object({id:a.string(),toEmail:a.string(),subject:a.string(),markdown:a.string(),createdAt:a.date(),appId:a.string().nullish(),userId:a.string().nullish()});a.object({id:a.string(),query:a.string().nullish(),params:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),requestBody:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10").nullish(),createdAt:a.date(),versionId:a.string()});a.object({id:a.string(),createdAt:a.date(),versionId:a.string(),analyst:a.string(),analysis:a.string(),isSuspicious:a.boolean(),severity:Yt,confidence:$t});a.object({id:a.string(),userId:a.string(),phase:Xt,score:a.number().int(),signals:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10"),actions:a.unknown().refine(e=>{let t=(r,n=0)=>{if(n>10||r===null||typeof r!="object")return n;let o=Object.values(r);return o.length===0?n:Math.max(...o.map(i=>t(i,n+1)))};return t(e)<=10},"JSON nesting depth exceeds maximum of 10"),createdAt:a.date()});a.object({id:a.string(),createdAt:a.date(),userId:a.string(),reason:a.string().nullish(),appId:a.string()});a.object({id:a.string(),userId:a.string(),orderPosition:a.number().int(),createdAt:a.date()});a.object({id:a.string(),homeScreenPageId:a.string(),appId:a.string(),orderPosition:a.number().int(),createdAt:a.date()});a.object({id:a.string(),createdAt:a.date(),name:a.string(),orderPosition:a.number().int()});a.object({id:a.string(),createdAt:a.date(),appStoreSectionId:a.string(),appId:a.string(),orderPosition:a.number().int()});a.object({id:a.string(),createdAt:a.date(),acceptedAt:a.date().nullish(),inviterId:a.string().nullish(),appId:a.string().nullish(),workspaceId:a.string().nullish(),aclLevel:ht.nullish(),authzGrantResourceType:H.nullish(),authzGrantResourceId:a.string().nullish(),authzGrantRelation:a.string().nullish(),authzGrantSubjectRelation:a.string().nullish(),authzGrantOrigin:a.string().nullish(),authzGrantedByType:H.nullish(),authzGrantedById:a.string().nullish(),authzGrantedByRelation:a.string().nullish(),userId:a.string()});a.object({id:a.string(),createdAt:a.date(),tokenHash:a.string(),redirectUrl:a.string().nullish(),userId:a.string(),invitationId:a.string().nullish()});a.object({id:a.string(),url:a.string(),userId:a.string(),createdAt:a.date()});a.object({id:a.string(),createdAt:a.date(),userId:a.string(),appId:a.string().nullish(),type:Zt,idempotencyKey:a.string(),amount:a.number(),deltaDaily:a.number().nullish(),deltaMonthly:a.number().nullish(),deltaPromotional:a.number().nullish(),deltaOver:a.number().nullish(),deltaBilledOver:a.number().nullish(),deltaUnbilledOver:a.number().nullish(),generationId:a.string().nullish()});a.object({id:a.string(),userId:a.string(),daily:a.number(),monthly:a.number(),promotional:a.number(),over:a.number(),billedOver:a.number(),unbilledOver:a.number(),maxOverageSpendCents:a.number().int().nullish(),paymentFailing:a.boolean(),lastMonthlyRefresh:a.date(),nextMonthlyRefresh:a.date(),nextMonthlyRefreshIdempotencyKey:a.string(),lastDailyRefresh:a.date(),nextDailyRefresh:a.date(),promotionalExpiresAt:a.date().nullish(),calendarMonthDailyGrantsTotal:a.number(),dailyGrantsMonthStart:a.date().nullish(),promotionalCycleCapacity:a.number(),lowCreditWarningDismissedAt:a.date().nullish()});a.object({id:a.string(),appId:a.string(),totalSpent:a.number(),monthlyLimit:a.number(),periodStart:a.date()});a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),appId:a.string(),lastRunAt:a.date().nullish(),executionCount:a.number().int(),slug:a.string(),name:a.string().nullish(),description:a.string().nullish(),schedule:a.string(),scheduleDescription:a.string().nullish(),rpcEndpoint:a.string(),isEnabled:a.boolean().default(true),stopAt:a.date().nullish(),maxExecutions:a.number().int().nullish(),timezone:a.string().default("UTC").nullish(),modelOverride:C.nullish()});a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),appId:a.string(),slug:a.string(),name:a.string().nullish(),description:a.string().nullish(),handler:a.string(),provider:a.string().nullish(),modelOverride:C.nullish()});a.object({id:a.string(),createdAt:a.date(),webhookId:a.string(),status:er.default("SUCCESS"),errorMessage:a.string().nullish()});a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),appId:a.string(),provider:a.string(),event:a.string(),handler:a.string(),slug:a.string(),name:a.string(),description:a.string(),modelOverride:C.nullish()});a.object({id:a.string(),createdAt:a.date(),subscriptionId:a.string(),status:tr.default("SUCCESS"),errorMessage:a.string().nullish()});a.object({createdAt:a.date(),updatedAt:a.date(),appId:a.string(),handler:a.string(),triggerId:a.string(),triggerSlug:a.string(),connectedAccountId:a.string(),composioUserId:a.string(),isEnabled:a.boolean().default(true),name:a.string(),description:a.string(),modelOverride:C.nullish()});a.object({id:a.string(),name:a.string().nullable(),userId:a.string(),type:a.string(),provider:a.string(),providerAccountId:a.string(),refreshToken:a.string().nullable(),accessToken:a.string().nullable(),expiresAt:a.date().nullable(),tokenType:a.string().nullable(),scope:a.string().nullable(),scopes:a.array(a.string()),createdAt:a.date(),updatedAt:a.date().nullable(),user:a.unknown(),apps:a.array(a.unknown()),authzNode:a.array(a.unknown())}).strict();a.object({id:a.string(),isApiKey:a.boolean(),sessionToken:a.string(),tokenAlias:a.string().nullable(),user:a.unknown(),userId:a.string(),expires:a.date(),createdAt:a.date(),lastSeen:a.date()}).strict();a.object({identifier:a.string(),token:a.string(),expires:a.date(),createdAt:a.date()}).strict();a.object({id:a.string(),guestAppUserId:a.string(),app:a.unknown(),appId:a.string(),user:a.unknown().nullable(),userId:a.string().nullable(),createdAt:a.date()}).strict();a.object({id:a.string(),name:a.string(),handle:a.string(),email:a.string().nullable(),emailVerified:a.date().nullable(),image:a.string().nullable(),phoneNumber:a.string().nullable(),aclEntries:a.array(a.unknown()),sessions:a.array(a.unknown()),workspaces:a.array(a.unknown()),ownerOfWorkspaces:a.array(a.unknown()),usedApps:a.array(a.unknown()),mergedUsers:a.array(a.unknown()),mergedInto:a.unknown().nullable(),mergedIntoId:a.string().nullable(),isStub:a.boolean(),uploads:a.array(a.unknown()),paymentAccounts:a.array(a.unknown()),purchases:a.array(a.unknown()),externalPaymentId:a.string().nullable(),createdAt:a.date(),isAdmin:a.boolean(),isCreator:a.boolean(),isSuspended:a.boolean(),classifiedAt:a.date().nullable(),userClassifications:a.array(a.unknown()),isEmailSubscribed:a.boolean(),tier:Ft,tierStartedAt:a.date().nullable(),creditLogs:a.array(a.unknown()),creditBalance:a.unknown().nullable(),preferences:Nt.array(),timezone:a.string(),generations:a.array(a.unknown()),emailLogs:a.array(a.unknown()),metrics:a.array(a.unknown()),emailUnsubscriptions:a.array(a.unknown()),invitations:a.array(a.unknown()),sentInvitations:a.array(a.unknown()),magicLinks:a.array(a.unknown()),homeScreenPages:a.array(a.unknown()),oAuthConnections:a.array(a.unknown()),authzNode:a.array(a.unknown()),appConsents:a.array(a.unknown()),computers:a.array(a.unknown()),pushTokens:a.array(a.unknown()),notifications:a.array(a.unknown()),mobileAppBackgroundUrl:a.unknown().nullable(),MobileAppBackground:a.array(a.unknown()),agentSessions:a.array(a.unknown())}).strict();a.object({id:a.string(),userId:a.string(),token:a.string(),createdAt:a.date(),updatedAt:a.date(),lastSeenAt:a.date(),user:a.unknown()}).strict();a.object({id:a.string(),userId:a.string(),user:a.unknown(),icon:a.string().nullable(),title:a.string(),body:a.string(),data:a.unknown().nullable(),createdAt:a.date(),readAt:a.date().nullable()}).strict();a.object({id:a.string(),user:a.unknown(),userId:a.string(),slug:a.string(),boxId:a.string(),isDefault:a.boolean(),isSuspended:a.boolean(),name:a.string(),apps:a.array(a.unknown()),uploads:a.array(a.unknown()),authzNode:a.array(a.unknown()),agentSessions:a.array(a.unknown()),createdAt:a.date(),lastUsedAt:a.date(),volumeDeletedAt:a.date().nullable(),lastStorageUsedPercent:a.number().int().nullable(),volumeSizeGb:a.number().int().nullable(),lastComputerStorageUsedBytes:a.bigint().nullable(),lastFileStorageUsedBytes:a.bigint().nullable(),lastComputerStorageReportedAt:a.date().nullable(),lastFileStorageReportedAt:a.date().nullable(),lastStorageAlertThreshold:a.number().nullable(),lastStorageAlertSentAt:a.date().nullable(),selectedModel:C.nullable(),agentModelOverrides:a.array(a.unknown()),systemConnections:a.array(a.unknown()),generations:a.array(a.unknown())}).strict();a.object({id:a.string(),computerId:a.string(),computer:a.unknown(),kind:Ut,apiKey:a.string(),createdAt:a.date(),updatedAt:a.date()}).strict();a.object({id:a.string(),computer:a.unknown(),computerId:a.string(),agentName:a.string(),model:a.string(),createdAt:a.date(),updatedAt:a.date()}).strict();a.object({id:a.string(),computer:a.unknown(),computerId:a.string(),createdBy:a.unknown().nullable(),createdById:a.string().nullable(),sessionId:a.string(),originType:Dt.nullable(),originLocation:Bt.nullable(),originAppId:a.string().nullable(),originSessionId:a.string().nullable(),createdAt:a.date(),isHidden:a.boolean(),lastMessageAt:a.date(),lastAssistantMessageAt:a.date().nullable(),lastReadAt:a.date().nullable()}).strict();a.object({id:a.string(),appId:a.string(),app:a.unknown(),connectionId:a.string(),connection:a.unknown(),createdAt:a.date()}).strict();a.object({id:a.string(),createdAt:a.date(),appId:a.string(),app:a.unknown(),provider:a.string()}).strict();a.object({provider:a.string(),scope:a.string(),createdAt:a.date(),app:a.unknown(),appId:a.string(),user:a.unknown(),userId:a.string()}).strict();a.object({id:a.string(),name:a.string(),description:a.string(),createdAt:a.date(),updatedAt:a.date(),emailDomain:a.string().nullable(),owner:a.unknown(),ownerId:a.string(),users:a.array(a.unknown()),appAclEntries:a.array(a.unknown()),invitations:a.array(a.unknown()),authzNode:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),enabled:a.boolean(),name:a.string(),description:a.string(),kind:jt,price:a.number().int(),externalPriceId:a.string().nullable(),app:a.unknown(),appId:a.string(),purchases:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),active:a.boolean(),user:a.unknown(),userId:a.string(),product:a.unknown(),productId:a.string(),externalId:a.string().nullable()}).strict();a.object({id:a.string(),app:a.unknown(),appId:a.string(),user:a.unknown().nullable(),userId:a.string().nullable(),workspace:a.unknown().nullable(),workspaceId:a.string().nullable(),level:ht,createdAt:a.date()}).strict();a.object({id:a.string(),resourceType:H,resourceId:a.string(),resource:a.unknown(),relation:a.string(),subjectType:H,subjectId:a.string(),subject:a.unknown(),subjectRelation:a.string(),grantOrigin:a.string(),grantedByType:H.nullable(),grantedById:a.string().nullable(),grantedBy:a.unknown().nullable(),grantedByRelation:a.string().nullable(),grantReason:a.string().nullable(),createdAt:a.date()}).strict();a.object({type:H,id:a.string(),createdAt:a.date(),updatedAt:a.date(),userId:a.string().nullable(),user:a.unknown().nullable(),appId:a.string().nullable(),app:a.unknown().nullable(),workspaceId:a.string().nullable(),workspace:a.unknown().nullable(),computerId:a.string().nullable(),computer:a.unknown().nullable(),oAuthConnectionId:a.string().nullable(),oAuthConnection:a.unknown().nullable(),resourceTuples:a.array(a.unknown()),subjectTuples:a.array(a.unknown()),grantedTuples:a.array(a.unknown()),resourceInvitations:a.array(a.unknown()),invitationsGranted:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),options:a.unknown().nullable(),stopReason:a.string().nullable(),purpose:a.string().nullable(),usage:a.unknown().nullable(),duration:a.number().int().nullable(),app:a.unknown().nullable(),appId:a.string().nullable(),userId:a.string().nullable(),user:a.unknown().nullable(),acuCost:a.number().nullable(),modelName:a.string().nullable(),attributionKind:a.string().nullable(),attributionReason:a.string().nullable(),computer:a.unknown().nullable(),computerId:a.string().nullable(),creditLog:a.unknown().nullable()}).strict();a.object({fileName:a.string(),createdAt:a.date(),originalName:a.string().nullable(),size:a.number().int(),user:a.unknown().nullable(),userId:a.string().nullable(),app:a.unknown().nullable(),appId:a.string().nullable(),computer:a.unknown().nullable(),computerId:a.string().nullable()}).strict();a.object({id:a.string(),name:a.string(),subdomain:a.string(),customDomain:a.string().nullable(),pendingCustomDomain:a.string().nullable(),externalDomainCertificateId:a.string().nullable(),pendingExternalDomainCertificateId:a.string().nullable(),pendingCustomDomainRequestedAt:a.date().nullable(),displayName:a.string().nullable(),description:a.string().nullable(),iconUrl:a.string().nullable(),coverMediaUrl:a.string().nullable(),appListingFeatures:a.array(a.string()),createdAt:a.date(),updatedAt:a.date(),acl:a.array(a.unknown()),versions:a.array(a.unknown()),users:a.array(a.unknown()),latestVersion:a.unknown().nullable(),latestVersionId:a.string().nullable(),publishedVersion:a.unknown().nullable(),publishedVersionId:a.string().nullable(),madePublicAt:a.date().nullable(),madeUnlistedAt:a.date().nullable(),forks:a.array(a.unknown()),forkedFrom:a.unknown().nullable(),forkedFromId:a.string().nullable(),isForkable:a.boolean(),showWatermark:a.boolean(),isPricingLimitExempt:a.boolean(),globalRecommendationScore:a.number(),isLocked:a.boolean(),isSuspended:a.boolean(),isMessagingDisabled:a.boolean(),systemVersion:a.number().int(),generations:a.array(a.unknown()),emailLogs:a.array(a.unknown()),guestApiServerUsages:a.array(a.unknown()),products:a.array(a.unknown()),categories:a.array(a.unknown()),emailUnsubscriptions:a.array(a.unknown()),uploads:a.array(a.unknown()),embedding:a.unknown().nullable(),tier:Ht,tierStartedAt:a.date().nullable(),metrics:a.array(a.unknown()),integrations:a.array(a.unknown()),creditLogs:a.array(a.unknown()),appCreditSpend:a.unknown().nullable(),acuTotal:a.number().nullable(),homeAppPlacements:a.array(a.unknown()),appStoreListings:a.array(a.unknown()),starterApp:a.unknown().nullable(),oAuthConnections:a.array(a.unknown()),authzNode:a.array(a.unknown()),platformLogs:a.array(a.unknown()),invitations:a.array(a.unknown()),appConsents:a.array(a.unknown()),runtimeKind:qt,stackType:Gt,computerId:a.string().nullable(),computer:a.unknown().nullable(),hasProduction:a.boolean(),migratedFromId:a.string().nullable(),migratedToId:a.string().nullable(),migratedToBoxmanAt:a.date().nullable(),cronJobs:a.array(a.unknown()),webhooks:a.array(a.unknown()),boxmanEventSubscriptions:a.array(a.unknown()),composioTriggerSubscriptions:a.array(a.unknown())}).strict();a.object({name:a.string(),priority:a.number().int(),createdAt:a.date(),apps:a.array(a.unknown())}).strict();a.object({domain:a.string(),note:a.string().nullable(),createdById:a.string().nullable(),createdAt:a.date(),updatedAt:a.date()}).strict();a.object({id:a.string(),app:a.unknown(),appId:a.string(),orderPosition:a.number().int(),createdAt:a.date(),updatedAt:a.date()}).strict();a.object({id:a.string(),externalId:a.string(),userId:a.string(),user:a.unknown(),enabled:a.boolean(),createdAt:a.date()}).strict();a.object({id:a.string(),values:a.array(a.number()),text:a.string().nullable(),app:a.unknown().nullable(),appId:a.string().nullable(),createdAt:a.date()}).strict();a.object({serverId:a.string(),createdAt:a.date(),updatedAt:a.date(),app:a.unknown().nullable(),appId:a.string().nullable(),version:a.unknown().nullable(),versionId:a.string().nullable(),cpuMs:a.number().int(),requestBytes:a.number().int(),responseBytes:a.number().int()}).strict();a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),rev:a.number().int(),frontendSource:a.string().nullable(),frontendCode:a.string().nullable(),frontendUrl:a.string().nullable(),frontendThemeCss:a.string().nullable(),frontendCss:a.string().nullable(),frontendCssUrl:a.string().nullable(),frontendComponentsCss:a.string().nullable(),frontendComponentsCompiledCss:a.string().nullable(),frontendComponentsCssUrl:a.string().nullable(),backendSource:a.string().nullable(),backendCode:a.string().nullable(),backendCodeUrl:a.string().nullable(),backendTypes:a.string().nullable(),dbSchemaCode:a.string().nullable(),dbMigrations:a.unknown().nullable(),prdSource:a.string().nullable(),prdSummary:a.string().nullable(),prdTransformed:a.string().nullable(),databaseUrl:a.string().nullable(),testDatabaseUrl:a.string().nullable(),prettyDiff:a.string().nullable(),versionChangesSummary:a.string().nullable(),infraConfig:a.unknown().nullable(),screenshot:a.string().nullable(),isStable:a.boolean(),status:Wt,runtimeLogs:a.array(a.unknown()),buildLogs:a.array(a.unknown()),cronLogs:a.array(a.unknown()),latestVersionApp:a.unknown().nullable(),publishedVersionApp:a.unknown().nullable(),parent:a.unknown().nullable(),parentId:a.string().nullable(),children:a.array(a.unknown()),app:a.unknown(),appId:a.string(),dbCommitLogs:a.array(a.unknown()),guestApiServerUsages:a.array(a.unknown()),apiTestSource:a.string().nullable(),devChecklistSource:a.string().nullable(),buildDuration:a.number().nullable(),securityAnalyses:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),cronName:a.string(),status:Vt,errorMessage:a.string().nullable(),version:a.unknown().nullable(),versionId:a.string().nullable(),cronJob:a.unknown().nullable(),cronJobId:a.string().nullable()}).strict();a.object({id:a.string(),createdAt:a.date(),appId:a.string(),userId:a.string(),type:Kt,app:a.unknown(),user:a.unknown()}).strict();a.object({id:a.string(),createdAt:a.date(),message:a.string(),summary:a.string().nullable(),hash:a.string(),errorCategory:a.string().nullable(),kind:Jt,level:be,versionId:a.string(),version:a.unknown()}).strict();a.object({id:a.string(),createdAt:a.date(),app:a.unknown().nullable(),appId:a.string().nullable(),level:be,label:a.string(),data:a.unknown()}).strict();a.object({id:a.string(),createdAt:a.date(),source:a.string(),kind:Qt,level:be,code:a.string(),message:a.string(),versionId:a.string(),version:a.unknown()}).strict();a.object({id:a.string(),toEmail:a.string(),subject:a.string(),markdown:a.string(),createdAt:a.date(),appId:a.string().nullable(),app:a.unknown().nullable(),userId:a.string().nullable(),user:a.unknown().nullable()}).strict();a.object({id:a.string(),query:a.string().nullable(),params:a.unknown().nullable(),requestBody:a.unknown().nullable(),createdAt:a.date(),versionId:a.string(),version:a.unknown()}).strict();a.object({id:a.string(),createdAt:a.date(),version:a.unknown(),versionId:a.string(),analyst:a.string(),analysis:a.string(),isSuspicious:a.boolean(),severity:Yt,confidence:$t}).strict();a.object({id:a.string(),user:a.unknown(),userId:a.string(),phase:Xt,score:a.number().int(),signals:a.unknown(),actions:a.unknown(),createdAt:a.date()}).strict();a.object({id:a.string(),createdAt:a.date(),userId:a.string(),user:a.unknown(),reason:a.string().nullable(),app:a.unknown(),appId:a.string()}).strict();a.object({id:a.string(),userId:a.string(),user:a.unknown(),orderPosition:a.number().int(),homeAppPlacements:a.array(a.unknown()),createdAt:a.date()}).strict();a.object({id:a.string(),homeScreenPageId:a.string(),homeScreenPage:a.unknown(),appId:a.string(),app:a.unknown(),orderPosition:a.number().int(),createdAt:a.date()}).strict();a.object({id:a.string(),createdAt:a.date(),name:a.string(),orderPosition:a.number().int(),listings:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),appStoreSectionId:a.string(),appId:a.string(),orderPosition:a.number().int(),section:a.unknown(),app:a.unknown()}).strict();a.object({id:a.string(),createdAt:a.date(),acceptedAt:a.date().nullable(),inviter:a.unknown().nullable(),inviterId:a.string().nullable(),app:a.unknown().nullable(),appId:a.string().nullable(),workspace:a.unknown().nullable(),workspaceId:a.string().nullable(),aclLevel:ht.nullable(),authzGrantResourceType:H.nullable(),authzGrantResourceId:a.string().nullable(),authzGrantResource:a.unknown().nullable(),authzGrantRelation:a.string().nullable(),authzGrantSubjectRelation:a.string().nullable(),authzGrantOrigin:a.string().nullable(),authzGrantedByType:H.nullable(),authzGrantedById:a.string().nullable(),authzGrantedBy:a.unknown().nullable(),authzGrantedByRelation:a.string().nullable(),user:a.unknown(),userId:a.string(),magicLinks:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),tokenHash:a.string(),redirectUrl:a.string().nullable(),user:a.unknown(),userId:a.string(),invitation:a.unknown().nullable(),invitationId:a.string().nullable()}).strict();a.object({id:a.string(),url:a.string(),userId:a.string(),user:a.unknown(),createdAt:a.date()}).strict();a.object({id:a.string(),createdAt:a.date(),userId:a.string(),user:a.unknown(),appId:a.string().nullable(),app:a.unknown().nullable(),type:Zt,idempotencyKey:a.string(),amount:a.number(),deltaDaily:a.number().nullable(),deltaMonthly:a.number().nullable(),deltaPromotional:a.number().nullable(),deltaOver:a.number().nullable(),deltaBilledOver:a.number().nullable(),deltaUnbilledOver:a.number().nullable(),generation:a.unknown().nullable(),generationId:a.string().nullable()}).strict();a.object({id:a.string(),userId:a.string(),user:a.unknown(),daily:a.number(),monthly:a.number(),promotional:a.number(),over:a.number(),billedOver:a.number(),unbilledOver:a.number(),maxOverageSpendCents:a.number().int().nullable(),paymentFailing:a.boolean(),lastMonthlyRefresh:a.date(),nextMonthlyRefresh:a.date(),nextMonthlyRefreshIdempotencyKey:a.string(),lastDailyRefresh:a.date(),nextDailyRefresh:a.date(),promotionalExpiresAt:a.date().nullable(),calendarMonthDailyGrantsTotal:a.number(),dailyGrantsMonthStart:a.date().nullable(),promotionalCycleCapacity:a.number(),lowCreditWarningDismissedAt:a.date().nullable()}).strict();a.object({id:a.string(),appId:a.string(),app:a.unknown(),totalSpent:a.number(),monthlyLimit:a.number(),periodStart:a.date()}).strict();a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),app:a.unknown(),appId:a.string(),lastRunAt:a.date().nullable(),executionCount:a.number().int(),slug:a.string(),name:a.string().nullable(),description:a.string().nullable(),schedule:a.string(),scheduleDescription:a.string().nullable(),rpcEndpoint:a.string(),isEnabled:a.boolean(),stopAt:a.date().nullable(),maxExecutions:a.number().int().nullable(),timezone:a.string().nullable(),modelOverride:C.nullable(),cronLogs:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),app:a.unknown(),appId:a.string(),slug:a.string(),name:a.string().nullable(),description:a.string().nullable(),handler:a.string(),provider:a.string().nullable(),modelOverride:C.nullable(),webhookLog:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),webhook:a.unknown(),webhookId:a.string(),status:er,errorMessage:a.string().nullable()}).strict();a.object({id:a.string(),createdAt:a.date(),updatedAt:a.date(),app:a.unknown(),appId:a.string(),provider:a.string(),event:a.string(),handler:a.string(),slug:a.string(),name:a.string(),description:a.string(),modelOverride:C.nullable(),boxmanEventLogs:a.array(a.unknown())}).strict();a.object({id:a.string(),createdAt:a.date(),subscription:a.unknown(),subscriptionId:a.string(),status:tr,errorMessage:a.string().nullable()}).strict();a.object({createdAt:a.date(),updatedAt:a.date(),app:a.unknown(),appId:a.string(),handler:a.string(),triggerId:a.string(),triggerSlug:a.string(),connectedAccountId:a.string(),composioUserId:a.string(),isEnabled:a.boolean(),name:a.string(),description:a.string(),modelOverride:C.nullable()}).strict();var ki={GITHUB_USER:"GITHUB_USER",GITHUB_BOT:"GITHUB_BOT",GOOGLE:"GOOGLE",SLACK:"SLACK",SLACK_BOT:"SLACK_BOT",DISCORD:"DISCORD",NOTION:"NOTION",TWITTER:"TWITTER",LINKEDIN:"LINKEDIN",YAHOO:"YAHOO",FIGMA:"FIGMA",SQUARE:"SQUARE",SHOPIFY:"SHOPIFY",WHOOP:"WHOOP"},wi={...ki,PLAID:"PLAID"},or={...wi,AC1:"AC1"};var Ci=z.object({slug:z.string(),name:z.string().optional(),schedule:z.string(),description:z.string().optional(),rpcEndpoint:z.string(),isEnabled:z.boolean().default(true),stopAt:z.string().datetime().optional(),maxExecutions:z.number().optional(),timezone:z.string().optional(),modelOverride:C.optional()}),eo=z.string().refine(e=>/^[a-zA-Z0-9_]+$/.test(e),"Must be a valid identifier (letters, numbers, and underscores only)."),vi=z.object({handler:eo,provider:z.nativeEnum(or).nullish(),slug:z.string().default("webhook"),name:z.string().default("Webhook"),description:z.string().default("A webhook that can be triggered by external services."),modelOverride:C.optional()}),Pi=z.object({provider:z.nativeEnum(or),event:z.string().min(1),handler:eo,slug:z.string().min(1).max(64).default("event_subscription"),name:z.string().min(1).max(128).default("Event Subscription"),description:z.string().min(1).max(256).default("Subscribes to an event emitted by other apps."),modelOverride:C.optional()}),Mi=z.object({crons:z.array(Ci),events:z.array(Pi).default([]),webhooks:z.array(vi).default([])});function sr(e){let t=Object.create(null);for(let r in e){let n=e[r];t[n]=r;}return t}var Pt={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};sr(Pt);sr(Pt);typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var Lt=class e extends Error{static prefix="__MISSING AUTH FOR SCOPE";static jsonRpcCode=-32001;constructor({provider:t,scope:r,accountId:n,popup:o=false}){let i=btoa(JSON.stringify({provider:t,scope:r,accountId:n}));super(`${e.prefix}: ${i}${o?" --popup":" end"}`);}jsonRpcError(){return {code:e.jsonRpcCode,message:this.message}}static check(t){return t?.message?.startsWith(e.prefix)}};var zo=new AsyncLocalStorage;function zr(){return zo.getStore()}async function fo(e,t){return zo.run(e,t)}function go({environment:e,dbPath:t="errors.db"}){let r=new Ki(t,{fileMustExist:false});r.pragma("journal_mode = WAL"),r.exec(`
2
2
  CREATE TABLE IF NOT EXISTS error_logs (
3
3
  id INTEGER PRIMARY KEY AUTOINCREMENT,
4
4
  environment TEXT NOT NULL,
@@ -9,18 +9,18 @@ import {z}from'zod';import {createTRPCProxyClient,httpLink}from'@trpc/client';im
9
9
  request_id TEXT,
10
10
  created_at INTEGER NOT NULL DEFAULT (unixepoch())
11
11
  )
12
- `),t.exec(`
12
+ `),r.exec(`
13
13
  CREATE INDEX IF NOT EXISTS idx_error_logs_env_created
14
14
  ON error_logs (environment, created_at)
15
- `);let o=t.prepare(`
15
+ `);let n=r.prepare(`
16
16
  INSERT INTO error_logs (environment, source, message, stack, metadata, request_id)
17
17
  VALUES (?, ?, ?, ?, ?, ?)
18
- `),n=false;function s(d){o.run(e,d.source,d.message,d.stack??null,d.metadata?JSON.stringify(d.metadata):null,d.requestId??null);}function i(d=5){return t.prepare(`
18
+ `),o=false;function i(g){n.run(e,g.source,g.message,g.stack??null,g.metadata?JSON.stringify(g.metadata):null,g.requestId??null);}function u(g=5){return r.prepare(`
19
19
  SELECT COUNT(*) as count FROM error_logs
20
20
  WHERE created_at > unixepoch() - ?
21
- `).get(d*60).count>0}function c(d=50){return t.prepare(`
21
+ `).get(g*60).count>0}function f(g=50){return r.prepare(`
22
22
  SELECT * FROM error_logs
23
23
  ORDER BY created_at DESC
24
24
  LIMIT ?
25
- `).all(d)}function u({body:d,requestId:p}){let g=d,m,h;try{let T=JSON.parse(d);g=T.message??d,m=T.stack,h=T.metadata;}catch{}let E=g.startsWith("[console.warn]")||g.startsWith("[console.error]");return E&&s({source:"client",message:g,stack:m,metadata:h,requestId:p}),{message:g,persisted:E}}function a({result:d,requestId:p}){let m=d.json?.error;return m?(s({source:"server",message:m.message??"Unknown RPC error",stack:m.stack,requestId:p,metadata:m.data?{errorData:m.data}:void 0}),true):false}function l({logger:d=console}={}){n||(process.on("uncaughtException",p=>{s({source:"server",message:p.message,stack:p.stack,metadata:{type:"uncaughtException"}}),d.error("Uncaught exception:",p);}),process.on("unhandledRejection",p=>{s({source:"server",message:p instanceof Error?p.message:String(p),stack:p instanceof Error?p.stack:void 0,metadata:{type:"unhandledRejection"}}),d.error("Unhandled rejection:",p);}),n=true);}return {captureClientLog:u,captureRpcError:a,getRecentErrors:c,hasErrors:i,logError:s,registerProcessHandlers:l}}var Me={error:console.error.bind(console),warn:console.warn.bind(console),info:()=>{},debug:()=>{}};function j(e){try{return JSON.parse(e.data)}catch{return null}}function ae({dbPath:e,handlers:r,errorTracker:t,queueName:o="default",logger:n=Me}){let s=new Ne(e,{fileMustExist:false});s.pragma("journal_mode = WAL");let i=better(s),c=defineQueue({connection:i}),u=new Proxy({},{get(m,h){return E=>c.add(o,{action:h,payload:E})}});function a(m){return c.getJobById(m)}function l(){return c.countJobs({status:JobStatus.Processing})}function d(){return c.countJobs({status:JobStatus.Pending})}function p(){return {pending:c.countJobs({status:JobStatus.Pending}),processing:c.countJobs({status:JobStatus.Processing}),done:c.countJobs({status:JobStatus.Done}),failed:c.countJobs({status:JobStatus.Failed})}}function g(){let m=defineWorker(o,async h=>{let E=j(h);if(!E)throw new Error(`Failed to parse queue payload for job ${h.id}`);let T=r[E.action];if(!T)throw new Error(`No handler registered for action: ${E.action}`);console.log(`Processing job ${h.id} with action: ${E.action}`),await T(E.payload,h);},{queue:c,logger:n,onCompleted:h=>{let T=j(h)?.action??"unknown";console.log(`Job ${h.id} completed: ${T}`);},onFailed:(h,E)=>{let T=j(h);t?.logError({source:"worker",message:E instanceof Error?E.message:String(E),stack:E instanceof Error?E.stack:void 0,metadata:{jobId:h.id,action:T?.action}}),console.error(`Job ${h.id} failed: ${T?.action??"unknown"}`,E);}});return m.start(),m}return {getActiveJobCount:l,getJob:a,getJobCounts:p,getPendingJobCount:d,queue:u,startWorker:g}}var J=createTRPCProxyClient({transformer:P,links:[]}),w;function Hr({baseUrl:e,realtimeDomain:r,guestServicesUrl:t,environment:o,queueDbPath:n,errorsDbPath:s,apiKey:i}){return globalThis.env||(globalThis.env={},globalThis.env.BASE_URL=e,globalThis.env.REALTIME_DOMAIN=r,globalThis.env.GUEST_SERVICES_URL=t,J=createTRPCProxyClient({transformer:P,links:[httpLink({url:t,transformer:P,headers:()=>{let c=F();return {...c?.requestId?{"x-request-id":c.requestId}:{},...i?{"x-boxman-api-key":i}:{},"x-boxman-app-base-url":e}}})]}),console.log("Adaptive SDK server environment initialized")),w?(w.environment=o,w.queueDbPath=n,w.errorsDbPath=s):w={environment:o,queueDbPath:n,errorsDbPath:s},w}function I(){if(!w)throw new Error("Adaptive SDK server environment is not initialized. Please call initializeServerEnvironment first.");return w}function pe(){let e=I();!e.errorTracker&&e.errorsDbPath&&(e.errorTracker=ie({environment:e.environment,dbPath:e.errorsDbPath}),e.errorTracker.registerProcessHandlers());let{errorTracker:r}=e;if(!r)throw new Error("Adaptive SDK error tracking is not initialized. Pass `errorsDbPath` to initializeServerEnvironment first.");return r}function Qe({handlers:e,queueName:r,logger:t,autoStartWorker:o=true}){let n=I();if(!n.queue){if(!n.queueDbPath)throw new Error("Adaptive SDK queue is not initialized. Pass `queueDbPath` to initializeServerEnvironment first.");n.queue=ae({dbPath:n.queueDbPath,handlers:e,queueName:r,logger:t,errorTracker:n.errorsDbPath?pe():void 0});}o&&!n.queueWorkerStarted&&(n.queue.startWorker(),n.queueWorkerStarted=true);let{queue:s}=n;if(!s)throw new Error("Adaptive SDK queue is not initialized. Pass `queueDbPath` to initializeServerEnvironment first.");return s}function Lr(){return new Proxy({},{get(e,r){let t=I();if(!t.queue)throw new Error("Adaptive SDK queue is not initialized. Pass `queueDbPath` to initializeServerEnvironment first.");return r==="getJob"?t.queue.getJob:t.queue.queue[r]}})}function Q(e,r){return r.endsWith("*")?e.startsWith(r.slice(0,-1)):e===r}function Je(e){return e?.toLowerCase().startsWith("curl/")??false}function Mr({procedures:e,jobs:r,transcoder:t,rpcPath:o="/api/*",loggerPath:n="/_logger",queueStatusPath:s="/_queue/status"}){let i=I(),c=i.errorsDbPath?pe():void 0,u=r&&i.queueDbPath?Qe({handlers:r}):void 0;return async(a,l)=>{let d=new URL(a.req.url).pathname;if(n&&c&&a.req.method==="POST"&&Q(d,n)){let p=await a.req.text(),g=a.req.header("x-request-id"),{message:m}=c.captureClientLog({body:p,requestId:g??void 0});return console.log("[browser]",m),a.json({status:"ok"})}if(s&&u&&a.req.method==="GET"&&Q(d,s))return a.json({activeJobs:u.getActiveJobCount(),pendingJobs:u.getPendingJobCount()});if(a.req.method==="POST"&&Q(d,o)){let p=await a.req.json(),g=a.req.header("x-request-id"),m=a.req.header("x-channel-id"),h=a.req.header("user-agent");g||console.warn("Request is missing x-request-id header. Adaptive AI SDK relies on this for request context."),Je(h)&&console.error(`[${g??"unknown-request-id"}] Curl request received by Adaptive SDK server. Use the run RPC endpoint MCP instead.`,{method:a.req.method,url:a.req.url,userAgent:h}),console.log(`[${g}] Starting request ${a.req.method} ${a.req.url}`),m&&console.log(`[${g}] Channel ID: ${m}`);let T=await se({requestId:g??"unknown-request-id",channelId:m,hasTasks:false},async()=>await handleRpc(p,e,{transcoder:t}));return console.log(`[${g}] Response:`,inspect(T,{depth:3,colors:true})),c?.captureRpcError({result:T,requestId:g??void 0}),a.json(T)}await l();}}var Be=new Proxy({},{get(e,r){return async t=>{if(globalThis.env===void 0)throw new Error("Adaptive SDK server environment is not initialized. Please call initializeServerEnvironment first.");let n=J[r];if(!n||typeof n.mutate!="function")throw new Error(`Property "${String(r)}" is not a mutation procedure`);return n.mutate(t)}}});async function Ur(e){return await J.executeComposioTool.mutate(e)}function Fr(){return globalThis.env.BASE_URL}var B=null;function jr(){return B}function Qr({channelId:e,onUpdate:r}){let t=new WebSocket(`wss://${globalThis.env.REALTIME_DOMAIN}/${e}`),o=-1;function n(s){r&&(B=Date.now());try{let i=JSON.parse(s.data.toString());if(i?.id&&i.id>o){let c=P.parse(i.payload);r?.(c),o=i.id;}}catch{}}return t.addEventListener("message",n),{destroy(){t.close(),t.removeEventListener("message",n);}}}async function ue({channelId:e,data:r}){B=Date.now(),await fetch(`https://${globalThis.env.REALTIME_DOMAIN}/${e}`,{method:"POST",body:P.stringify(r)}).catch(console.error);}async function Jr(){let e,r=F()?.channelId;if(!r)throw new Error("API's using `startRealtimeResponse` must be called via `useRealtimeMutation`.");return {next(t){e=t,ue({channelId:r,data:t});},end(){return ue({channelId:r,data:e}),e}}}function ce(e){throw new S({provider:"AC1",popup:true})}async function Br(e){let r=await Be.getCurrentUser();if(r?.error==="SEED")throw new Error('Call to "getAuth" in seed function is not allowed. Seed functions should not depend on user data.');if(r.userId)return {userId:r.userId,status:"authenticated",signIn:ce,providers:r.providers};if(e?.required)throw new S({provider:"AC1"});return {userId:null,status:"unauthenticated",signIn:ce,providers:[]}}
26
- export{Ee as appConfigSchema,Ur as executeComposioTool,Br as getAuth,Fr as getBaseUrl,pe as getErrorTracker,jr as getLastStreamTime,Lr as getQueue,Qr as getRealtimeStore,Mr as honoMiddleware,Hr as initializeServerEnvironment,Be as mcp,se as runWithContext,ue as setRealtimeStore,Jr as startRealtimeResponse};
25
+ `).all(g)}function z({body:g,requestId:S}){let F=g,O,N;try{let X=JSON.parse(g);F=X.message??g,O=X.stack,N=X.metadata;}catch{}let U=F.startsWith("[console.warn]")||F.startsWith("[console.error]");return U&&i({source:"client",message:F,stack:O,metadata:N,requestId:S}),{message:F,persisted:U}}function d({result:g,requestId:S}){let O=g.json?.error;return O?(i({source:"server",message:O.message??"Unknown RPC error",stack:O.stack,requestId:S,metadata:O.data?{errorData:O.data}:void 0}),true):false}function h({logger:g=console}={}){o||(process.on("uncaughtException",S=>{i({source:"server",message:S.message,stack:S.stack,metadata:{type:"uncaughtException"}}),g.error("Uncaught exception:",S);}),process.on("unhandledRejection",S=>{i({source:"server",message:S instanceof Error?S.message:String(S),stack:S instanceof Error?S.stack:void 0,metadata:{type:"unhandledRejection"}}),g.error("Unhandled rejection:",S);}),o=true);}return {captureClientLog:z,captureRpcError:d,getRecentErrors:f,hasErrors:u,logError:i,registerProcessHandlers:h}}var Xi={error:console.error.bind(console),warn:console.warn.bind(console),info:()=>{},debug:()=>{}};function fr(e){try{return JSON.parse(e.data)}catch{return null}}function So({dbPath:e,handlers:t,errorTracker:r,queueName:n="default",logger:o=Xi}){let i=new Ki(e,{fileMustExist:false});i.pragma("journal_mode = WAL");let u=better(i),f=defineQueue({connection:u}),z=new Proxy({},{get(O,N){return U=>f.add(n,{action:N,payload:U})}});function d(O){return f.getJobById(O)}function h(){return f.countJobs({status:JobStatus.Processing})}function g(){return f.countJobs({status:JobStatus.Pending})}function S(){return {pending:f.countJobs({status:JobStatus.Pending}),processing:f.countJobs({status:JobStatus.Processing}),done:f.countJobs({status:JobStatus.Done}),failed:f.countJobs({status:JobStatus.Failed})}}function F(){let O=defineWorker(n,async N=>{let U=fr(N);if(!U)throw new Error(`Failed to parse queue payload for job ${N.id}`);let X=t[U.action];if(!X)throw new Error(`No handler registered for action: ${U.action}`);console.log(`Processing job ${N.id} with action: ${U.action}`),await X(U.payload,N);},{queue:f,logger:o,onCompleted:N=>{let X=fr(N)?.action??"unknown";console.log(`Job ${N.id} completed: ${X}`);},onFailed:(N,U)=>{let X=fr(N);r?.logError({source:"worker",message:U instanceof Error?U.message:String(U),stack:U instanceof Error?U.stack:void 0,metadata:{jobId:N.id,action:X?.action}}),console.error(`Job ${N.id} failed: ${X?.action??"unknown"}`,U);}});return O.start(),O}return {getActiveJobCount:h,getJob:d,getJobCounts:S,getPendingJobCount:g,queue:z,startWorker:F}}var Sr=createTRPCProxyClient({transformer:_t,links:[]}),Ct;function Xh({baseUrl:e,realtimeDomain:t,guestServicesUrl:r,environment:n,queueDbPath:o,errorsDbPath:i,apiKey:u}){return globalThis.env||(globalThis.env={},globalThis.env.BASE_URL=e,globalThis.env.REALTIME_DOMAIN=t,globalThis.env.GUEST_SERVICES_URL=r,Sr=createTRPCProxyClient({transformer:_t,links:[httpLink({url:r,transformer:_t,headers:()=>{let f=zr();return {...f?.requestId?{"x-request-id":f.requestId}:{},...u?{"x-boxman-api-key":u}:{},"x-boxman-app-base-url":e}}})]}),console.log("Adaptive SDK server environment initialized")),Ct?(Ct.environment=n,Ct.queueDbPath=o,Ct.errorsDbPath=i):Ct={environment:n,queueDbPath:o,errorsDbPath:i},Ct}function nr(){if(!Ct)throw new Error("Adaptive SDK server environment is not initialized. Please call initializeServerEnvironment first.");return Ct}function bo(){let e=nr();!e.errorTracker&&e.errorsDbPath&&(e.errorTracker=go({environment:e.environment,dbPath:e.errorsDbPath}),e.errorTracker.registerProcessHandlers());let{errorTracker:t}=e;if(!t)throw new Error("Adaptive SDK error tracking is not initialized. Pass `errorsDbPath` to initializeServerEnvironment first.");return t}function rs({handlers:e,queueName:t,logger:r,autoStartWorker:n=true}){let o=nr();if(!o.queue){if(!o.queueDbPath)throw new Error("Adaptive SDK queue is not initialized. Pass `queueDbPath` to initializeServerEnvironment first.");o.queue=So({dbPath:o.queueDbPath,handlers:e,queueName:t,logger:r,errorTracker:o.errorsDbPath?bo():void 0});}n&&!o.queueWorkerStarted&&(o.queue.startWorker(),o.queueWorkerStarted=true);let{queue:i}=o;if(!i)throw new Error("Adaptive SDK queue is not initialized. Pass `queueDbPath` to initializeServerEnvironment first.");return i}function Zh(){return new Proxy({},{get(e,t){let r=nr();if(!r.queue)throw new Error("Adaptive SDK queue is not initialized. Pass `queueDbPath` to initializeServerEnvironment first.");return t==="getJob"?r.queue.getJob:r.queue.queue[t]}})}function gr(e,t){return t.endsWith("*")?e.startsWith(t.slice(0,-1)):e===t}function ns(e){return e?.toLowerCase().startsWith("curl/")??false}function ey({procedures:e,jobs:t,transcoder:r,rpcPath:n="/api/*",loggerPath:o="/_logger",queueStatusPath:i="/_queue/status"}){let u=nr(),f=u.errorsDbPath?bo():void 0,z=t&&u.queueDbPath?rs({handlers:t}):void 0;return async(d,h)=>{let g=new URL(d.req.url).pathname;if(o&&f&&d.req.method==="POST"&&gr(g,o)){let S=await d.req.text(),F=d.req.header("x-request-id"),{message:O}=f.captureClientLog({body:S,requestId:F??void 0});return console.log("[browser]",O),d.json({status:"ok"})}if(i&&z&&d.req.method==="GET"&&gr(g,i))return d.json({activeJobs:z.getActiveJobCount(),pendingJobs:z.getPendingJobCount()});if(d.req.method==="POST"&&gr(g,n)){let S=await d.req.json(),F=d.req.header("x-request-id"),O=d.req.header("x-channel-id"),N=d.req.header("user-agent");F||console.warn("Request is missing x-request-id header. Adaptive AI SDK relies on this for request context."),ns(N)&&console.error(`[${F??"unknown-request-id"}] Curl request received by Adaptive SDK server. Use the run RPC endpoint MCP instead.`,{method:d.req.method,url:d.req.url,userAgent:N}),console.log(`[${F}] Starting request ${d.req.method} ${d.req.url}`),O&&console.log(`[${F}] Channel ID: ${O}`);let X=await fo({requestId:F??"unknown-request-id",channelId:O,hasTasks:false},async()=>await handleRpc(S,e,{transcoder:r}));return console.log(`[${F}] Response:`,inspect(X,{depth:3,colors:true})),f?.captureRpcError({result:X,requestId:F??void 0}),d.json(X)}await h();}}var os=new Proxy({},{get(e,t){return async r=>{if(globalThis.env===void 0)throw new Error("Adaptive SDK server environment is not initialized. Please call initializeServerEnvironment first.");let o=Sr[t];if(!o||typeof o.mutate!="function")throw new Error(`Property "${String(t)}" is not a mutation procedure`);return o.mutate(r)}}});async function ty(e){return await Sr.executeComposioTool.mutate(e)}function ry(){return globalThis.env.BASE_URL}var hr=null;function ny(){return hr}function oy({channelId:e,onUpdate:t}){let r=new WebSocket(`wss://${globalThis.env.REALTIME_DOMAIN}/${e}`),n=-1;function o(i){t&&(hr=Date.now());try{let u=JSON.parse(i.data.toString());if(u?.id&&u.id>n){let f=_t.parse(u.payload);t?.(f),n=u.id;}}catch{}}return r.addEventListener("message",o),{destroy(){r.close(),r.removeEventListener("message",o);}}}async function ho({channelId:e,data:t}){hr=Date.now(),await fetch(`https://${globalThis.env.REALTIME_DOMAIN}/${e}`,{method:"POST",body:_t.stringify(t)}).catch(console.error);}async function ay(){let e,t=zr()?.channelId;if(!t)throw new Error("API's using `startRealtimeResponse` must be called via `useRealtimeMutation`.");return {next(r){e=r,ho({channelId:t,data:r});},end(){return ho({channelId:t,data:e}),e}}}function yo(e){throw new Lt({provider:"AC1",popup:true})}async function iy(e){let t=await os.getCurrentUser();if(t?.error==="SEED")throw new Error('Call to "getAuth" in seed function is not allowed. Seed functions should not depend on user data.');if(t.userId)return {userId:t.userId,status:"authenticated",signIn:yo,providers:t.providers};if(e?.required)throw new Lt({provider:"AC1"});return {userId:null,status:"unauthenticated",signIn:yo,providers:[]}}
26
+ export{Mi as appConfigSchema,ty as executeComposioTool,iy as getAuth,ry as getBaseUrl,bo as getErrorTracker,ny as getLastStreamTime,Zh as getQueue,oy as getRealtimeStore,ey as honoMiddleware,Xh as initializeServerEnvironment,os as mcp,fo as runWithContext,ho as setRealtimeStore,ay as startRealtimeResponse};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptive-ai/sdk",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -75,7 +75,6 @@
75
75
  "eslint": "^8.47.0",
76
76
  "eslint-config-next": "15.5.9",
77
77
  "eslint-config-prettier": "^10.1.8",
78
- "eslint-formatter-codeframe": "^7.32.1",
79
78
  "eslint-plugin-prettier": "^5.5.4",
80
79
  "eslint-plugin-simple-import-sort": "^12.1.0",
81
80
  "npm-run-all2": "^8.0.4",