notte-sdk 1.9.7 → 1.10.1

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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var SDK_VERSION = true ? "1.9.7" : "dev";
2
+ var SDK_VERSION = true ? "1.10.1" : "dev";
3
3
  var SDK_PACKAGE_NAME = true ? "notte-sdk" : "notte-sdk";
4
4
 
5
5
  // src/version-check.ts
@@ -883,6 +883,11 @@ var createClient = (config = {}) => {
883
883
  const { opts, url } = await beforeRequest(options);
884
884
  return createSseClient({
885
885
  ...opts,
886
+ // Request interceptors can replace fetch when the stream starts.
887
+ fetch: (input, init) => {
888
+ const transport = opts.fetch;
889
+ return transport(input, init);
890
+ },
886
891
  body: opts.body,
887
892
  method,
888
893
  onRequest: async (url2, init) => {
@@ -970,11 +975,6 @@ var sessionProfileSave = (options) => (options.client ?? client).post({
970
975
  ...options.headers
971
976
  }
972
977
  });
973
- var getSessionScript = (options) => (options.client ?? client).get({
974
- security: [{ scheme: "bearer", type: "http" }],
975
- url: "/sessions/{session_id}/workflow/code",
976
- ...options
977
- });
978
978
  var sessionStop = (options) => (options.client ?? client).delete({
979
979
  security: [{ scheme: "bearer", type: "http" }],
980
980
  url: "/sessions/{session_id}/stop",
@@ -1041,11 +1041,25 @@ var sessionNetworkLogs = (options) => (options.client ?? client).get({
1041
1041
  url: "/sessions/{session_id}/network/logs",
1042
1042
  ...options
1043
1043
  });
1044
+ var sessionMouseReplay = (options) => (options.client ?? client).get({
1045
+ security: [{ scheme: "bearer", type: "http" }],
1046
+ url: "/sessions/{session_id}/replay/mouse",
1047
+ ...options
1048
+ });
1044
1049
  var sessionReplay = (options) => (options.client ?? client).get({
1045
1050
  security: [{ scheme: "bearer", type: "http" }],
1046
1051
  url: "/sessions/{session_id}/replay",
1047
1052
  ...options
1048
1053
  });
1054
+ var executeSessionFile = (options) => (options.client ?? client).post({
1055
+ security: [{ scheme: "bearer", type: "http" }],
1056
+ url: "/sessions/{session_id}/page/execute/file",
1057
+ ...options,
1058
+ headers: {
1059
+ "Content-Type": "application/json",
1060
+ ...options.headers
1061
+ }
1062
+ });
1049
1063
  var listSessionFiles = (options) => (options.client ?? client).get({
1050
1064
  security: [{ scheme: "bearer", type: "http" }],
1051
1065
  url: "/sessions/{session_id}/files",
@@ -1071,35 +1085,6 @@ var downloadSessionFile = (options) => (options.client ?? client).get({
1071
1085
  url: "/sessions/{session_id}/files/{file_id}",
1072
1086
  ...options
1073
1087
  });
1074
- var agentStart = (options) => (options.client ?? client).post({
1075
- security: [{ scheme: "bearer", type: "http" }],
1076
- url: "/agents/start",
1077
- ...options,
1078
- headers: {
1079
- "Content-Type": "application/json",
1080
- ...options.headers
1081
- }
1082
- });
1083
- var agentStatus = (options) => (options.client ?? client).get({
1084
- security: [{ scheme: "bearer", type: "http" }],
1085
- url: "/agents/{agent_id}",
1086
- ...options
1087
- });
1088
- var getScript = (options) => (options.client ?? client).get({
1089
- security: [{ scheme: "bearer", type: "http" }],
1090
- url: "/agents/{agent_id}/workflow/code",
1091
- ...options
1092
- });
1093
- var agentStop = (options) => (options.client ?? client).delete({
1094
- security: [{ scheme: "bearer", type: "http" }],
1095
- url: "/agents/{agent_id}/stop",
1096
- ...options
1097
- });
1098
- var listAgents = (options) => (options?.client ?? client).get({
1099
- security: [{ scheme: "bearer", type: "http" }],
1100
- url: "/agents",
1101
- ...options
1102
- });
1103
1088
  var functionRuntimeHealth = (options) => (options?.client ?? client).get({
1104
1089
  security: [{ scheme: "bearer", type: "http" }],
1105
1090
  url: "/functions/health",
@@ -1369,6 +1354,15 @@ var profileCookiesSet = (options) => (options.client ?? client).post({
1369
1354
  ...options.headers
1370
1355
  }
1371
1356
  });
1357
+ var profileStateSet = (options) => (options.client ?? client).post({
1358
+ security: [{ scheme: "bearer", type: "http" }],
1359
+ url: "/profiles/{profile_id}/state",
1360
+ ...options,
1361
+ headers: {
1362
+ "Content-Type": "application/json",
1363
+ ...options.headers
1364
+ }
1365
+ });
1372
1366
  var profileList = (options) => (options?.client ?? client).get({
1373
1367
  security: [{ scheme: "bearer", type: "http" }],
1374
1368
  url: "/profiles",
@@ -1563,6 +1557,215 @@ var searchWeb = (options) => (options.client ?? client).post({
1563
1557
  ...options.headers
1564
1558
  }
1565
1559
  });
1560
+ var summary = (options) => (options?.client ?? client).get({
1561
+ security: [{ scheme: "bearer", type: "http" }],
1562
+ url: "/data/analytics",
1563
+ ...options
1564
+ });
1565
+ var history_ = (options) => (options?.client ?? client).get({
1566
+ security: [{ scheme: "bearer", type: "http" }],
1567
+ url: "/data/analytics/requests",
1568
+ ...options
1569
+ });
1570
+ var detail = (options) => (options.client ?? client).get({
1571
+ security: [{ scheme: "bearer", type: "http" }],
1572
+ url: "/data/analytics/requests/{request_id}",
1573
+ ...options
1574
+ });
1575
+ var invalidate = (options) => (options?.client ?? client).delete({
1576
+ security: [{ scheme: "bearer", type: "http" }],
1577
+ url: "/data/cache",
1578
+ ...options
1579
+ });
1580
+ var getPolicy = (options) => (options?.client ?? client).get({
1581
+ security: [{ scheme: "bearer", type: "http" }],
1582
+ url: "/data/cache",
1583
+ ...options
1584
+ });
1585
+ var brandRetrieve = (options) => (options.client ?? client).post({
1586
+ security: [{ scheme: "bearer", type: "http" }],
1587
+ url: "/data/brand/retrieve",
1588
+ ...options,
1589
+ headers: {
1590
+ "Content-Type": "application/json",
1591
+ ...options.headers
1592
+ }
1593
+ });
1594
+ var extractProductEndpoint = (options) => (options.client ?? client).post({
1595
+ security: [{ scheme: "bearer", type: "http" }],
1596
+ url: "/data/products/extract",
1597
+ ...options,
1598
+ headers: {
1599
+ "Content-Type": "application/json",
1600
+ ...options.headers
1601
+ }
1602
+ });
1603
+ var styleguideEndpoint = (options) => (options?.client ?? client).get({
1604
+ security: [{ scheme: "bearer", type: "http" }],
1605
+ url: "/data/web/styleguide",
1606
+ ...options
1607
+ });
1608
+ var mapsSearch = (options) => (options.client ?? client).post({
1609
+ security: [{ scheme: "bearer", type: "http" }],
1610
+ url: "/data/maps/search",
1611
+ ...options,
1612
+ headers: {
1613
+ "Content-Type": "application/json",
1614
+ ...options.headers
1615
+ }
1616
+ });
1617
+ var listMonitors = (options) => (options?.client ?? client).get({
1618
+ security: [{ scheme: "bearer", type: "http" }],
1619
+ url: "/data/monitors",
1620
+ ...options
1621
+ });
1622
+ var create = (options) => (options.client ?? client).post({
1623
+ security: [{ scheme: "bearer", type: "http" }],
1624
+ url: "/data/monitors",
1625
+ ...options,
1626
+ headers: {
1627
+ "Content-Type": "application/json",
1628
+ ...options.headers
1629
+ }
1630
+ });
1631
+ var limits = (options) => (options?.client ?? client).get({
1632
+ security: [{ scheme: "bearer", type: "http" }],
1633
+ url: "/data/monitors/limits",
1634
+ ...options
1635
+ });
1636
+ var creditUsage = (options) => (options?.client ?? client).get({
1637
+ security: [{ scheme: "bearer", type: "http" }],
1638
+ url: "/data/monitors/credit-usage",
1639
+ ...options
1640
+ });
1641
+ var accountRuns = (options) => (options?.client ?? client).get({
1642
+ security: [{ scheme: "bearer", type: "http" }],
1643
+ url: "/data/monitors/runs",
1644
+ ...options
1645
+ });
1646
+ var accountChanges = (options) => (options?.client ?? client).get({
1647
+ security: [{ scheme: "bearer", type: "http" }],
1648
+ url: "/data/monitors/changes",
1649
+ ...options
1650
+ });
1651
+ var delete_ = (options) => (options.client ?? client).delete({
1652
+ security: [{ scheme: "bearer", type: "http" }],
1653
+ url: "/data/monitors/{monitor_id}",
1654
+ ...options
1655
+ });
1656
+ var retrieve = (options) => (options.client ?? client).get({
1657
+ security: [{ scheme: "bearer", type: "http" }],
1658
+ url: "/data/monitors/{monitor_id}",
1659
+ ...options
1660
+ });
1661
+ var update = (options) => (options.client ?? client).patch({
1662
+ security: [{ scheme: "bearer", type: "http" }],
1663
+ url: "/data/monitors/{monitor_id}",
1664
+ ...options,
1665
+ headers: {
1666
+ "Content-Type": "application/json",
1667
+ ...options.headers
1668
+ }
1669
+ });
1670
+ var runNow = (options) => (options.client ?? client).post({
1671
+ security: [{ scheme: "bearer", type: "http" }],
1672
+ url: "/data/monitors/{monitor_id}/run",
1673
+ ...options
1674
+ });
1675
+ var runs = (options) => (options.client ?? client).get({
1676
+ security: [{ scheme: "bearer", type: "http" }],
1677
+ url: "/data/monitors/{monitor_id}/runs",
1678
+ ...options
1679
+ });
1680
+ var changes = (options) => (options.client ?? client).get({
1681
+ security: [{ scheme: "bearer", type: "http" }],
1682
+ url: "/data/monitors/{monitor_id}/changes",
1683
+ ...options
1684
+ });
1685
+ var retrieveRun = (options) => (options.client ?? client).get({
1686
+ security: [{ scheme: "bearer", type: "http" }],
1687
+ url: "/data/monitors/{monitor_id}/runs/{run_id}",
1688
+ ...options
1689
+ });
1690
+ var retrieveChange = (options) => (options.client ?? client).get({
1691
+ security: [{ scheme: "bearer", type: "http" }],
1692
+ url: "/data/monitors/{monitor_id}/changes/{change_id}",
1693
+ ...options
1694
+ });
1695
+ var rotateSecret = (options) => (options.client ?? client).post({
1696
+ security: [{ scheme: "bearer", type: "http" }],
1697
+ url: "/data/monitors/{monitor_id}/webhook/rotate-secret",
1698
+ ...options
1699
+ });
1700
+ var deliveries = (options) => (options.client ?? client).post({
1701
+ security: [{ scheme: "bearer", type: "http" }],
1702
+ url: "/data/webhooks/deliveries",
1703
+ ...options,
1704
+ headers: {
1705
+ "Content-Type": "application/json",
1706
+ ...options.headers
1707
+ }
1708
+ });
1709
+ var retrieveDelivery = (options) => (options.client ?? client).get({
1710
+ security: [{ scheme: "bearer", type: "http" }],
1711
+ url: "/data/webhooks/deliveries/{delivery_id}",
1712
+ ...options
1713
+ });
1714
+ var attempts = (options) => (options.client ?? client).get({
1715
+ security: [{ scheme: "bearer", type: "http" }],
1716
+ url: "/data/webhooks/deliveries/{delivery_id}/attempts",
1717
+ ...options
1718
+ });
1719
+ var retry = (options) => (options.client ?? client).post({
1720
+ security: [{ scheme: "bearer", type: "http" }],
1721
+ url: "/data/webhooks/deliveries/{delivery_id}/retry",
1722
+ ...options,
1723
+ headers: {
1724
+ "Content-Type": "application/json",
1725
+ ...options.headers
1726
+ }
1727
+ });
1728
+ var peopleEnrich = (options) => (options.client ?? client).post({
1729
+ security: [{ scheme: "bearer", type: "http" }],
1730
+ url: "/data/people/enrich",
1731
+ ...options,
1732
+ headers: {
1733
+ "Content-Type": "application/json",
1734
+ ...options.headers
1735
+ }
1736
+ });
1737
+ var newsSearch = (options) => (options.client ?? client).post({
1738
+ security: [{ scheme: "bearer", type: "http" }],
1739
+ url: "/data/news/search",
1740
+ ...options,
1741
+ headers: {
1742
+ "Content-Type": "application/json",
1743
+ ...options.headers
1744
+ }
1745
+ });
1746
+ var fetchSpecializedData = (options) => (options.client ?? client).post({
1747
+ security: [{ scheme: "bearer", type: "http" }],
1748
+ url: "/data/web/fetch",
1749
+ ...options,
1750
+ headers: {
1751
+ "Content-Type": "application/json",
1752
+ ...options.headers
1753
+ }
1754
+ });
1755
+ var youtubeEndpoint = (options) => (options.client ?? client).post({
1756
+ security: [{ scheme: "bearer", type: "http" }],
1757
+ url: "/data/youtube/extract",
1758
+ ...options,
1759
+ headers: {
1760
+ "Content-Type": "application/json",
1761
+ ...options.headers
1762
+ }
1763
+ });
1764
+ var listDataApis = (options) => (options?.client ?? client).get({
1765
+ security: [{ scheme: "bearer", type: "http" }],
1766
+ url: "/data",
1767
+ ...options
1768
+ });
1566
1769
  var scrapeFromHtml = (options) => (options.client ?? client).post({
1567
1770
  security: [{ scheme: "bearer", type: "http" }],
1568
1771
  url: "/scrape_from_html",
@@ -1572,6 +1775,40 @@ var scrapeFromHtml = (options) => (options.client ?? client).post({
1572
1775
  ...options.headers
1573
1776
  }
1574
1777
  });
1778
+ var agentStart = (options) => (options.client ?? client).post({
1779
+ security: [{ scheme: "bearer", type: "http" }],
1780
+ url: "/agents/start",
1781
+ ...options,
1782
+ headers: {
1783
+ "Content-Type": "application/json",
1784
+ ...options.headers
1785
+ }
1786
+ });
1787
+ var agentStop = (options) => (options.client ?? client).delete({
1788
+ security: [{ scheme: "bearer", type: "http" }],
1789
+ url: "/agents/{agent_id}/stop",
1790
+ ...options
1791
+ });
1792
+ var agentStatus = (options) => (options.client ?? client).get({
1793
+ security: [{ scheme: "bearer", type: "http" }],
1794
+ url: "/agents/{agent_id}",
1795
+ ...options
1796
+ });
1797
+ var getScript = (options) => (options.client ?? client).get({
1798
+ security: [{ scheme: "bearer", type: "http" }],
1799
+ url: "/agents/{agent_id}/workflow/code",
1800
+ ...options
1801
+ });
1802
+ var listAgents = (options) => (options?.client ?? client).get({
1803
+ security: [{ scheme: "bearer", type: "http" }],
1804
+ url: "/agents",
1805
+ ...options
1806
+ });
1807
+ var getSessionScript = (options) => (options.client ?? client).get({
1808
+ security: [{ scheme: "bearer", type: "http" }],
1809
+ url: "/sessions/{session_id}/workflow/code",
1810
+ ...options
1811
+ });
1575
1812
 
1576
1813
  // src/managed-auth.ts
1577
1814
  import { setTimeout as delay } from "timers/promises";
@@ -1656,14 +1893,14 @@ var ActionExecutionError = class _ActionExecutionError extends NotteError {
1656
1893
  agentMessage;
1657
1894
  shouldRetryLater;
1658
1895
  shouldNotifyTeam;
1659
- constructor(detail) {
1660
- super(detail.dev_message || detail.user_message || detail.error_type);
1661
- this.errorType = detail.error_type;
1662
- this.devMessage = detail.dev_message;
1663
- this.userMessage = detail.user_message;
1664
- this.agentMessage = detail.agent_message;
1665
- this.shouldRetryLater = detail.should_retry_later ?? false;
1666
- this.shouldNotifyTeam = detail.should_notify_team ?? false;
1896
+ constructor(detail2) {
1897
+ super(detail2.dev_message || detail2.user_message || detail2.error_type);
1898
+ this.errorType = detail2.error_type;
1899
+ this.devMessage = detail2.dev_message;
1900
+ this.userMessage = detail2.user_message;
1901
+ this.agentMessage = detail2.agent_message;
1902
+ this.shouldRetryLater = detail2.should_retry_later ?? false;
1903
+ this.shouldNotifyTeam = detail2.should_notify_team ?? false;
1667
1904
  }
1668
1905
  static fromMessage(message, errorType = "NotteBaseError") {
1669
1906
  return new _ActionExecutionError({
@@ -1694,7 +1931,7 @@ function normalizeErrorBody(body) {
1694
1931
  return { message: typeof body === "string" ? body : String(body) };
1695
1932
  }
1696
1933
  var DEFAULT_RETRY_MESSAGE = "An error occurred while executing the function. Try again later...";
1697
- function retry(fn, options) {
1934
+ function retry2(fn, options) {
1698
1935
  const {
1699
1936
  maxTries,
1700
1937
  delayMs = 5e3,
@@ -1731,11 +1968,6 @@ function sleep(ms) {
1731
1968
  // src/managed-auth.ts
1732
1969
  var ManagedAuthError = class extends NotteError {
1733
1970
  };
1734
- function validateAuthRetry(value) {
1735
- if (!Number.isInteger(value) || value < 0 || value > 2) {
1736
- throw new InvalidRequestError("auth_retry must be an integer between 0 and 2");
1737
- }
1738
- }
1739
1971
  async function pollAuth(read, options) {
1740
1972
  const timeoutMs = options.timeoutMs ?? 615e3;
1741
1973
  const interval = options.pollIntervalMs ?? 1e3;
@@ -1776,6 +2008,7 @@ var NotteManagedAuth = class {
1776
2008
  constructor(client2) {
1777
2009
  this.client = client2;
1778
2010
  }
2011
+ client;
1779
2012
  /** Run only the verifier; this does not submit login credentials. */
1780
2013
  async checkConnection(connectionId) {
1781
2014
  const response = await this.client.getClient().post({
@@ -1816,12 +2049,10 @@ var NotteManagedAuth = class {
1816
2049
  return this.run(connectionId, "reauthenticate", options);
1817
2050
  }
1818
2051
  async run(connectionId, action, options) {
1819
- const authRetry = options.auth_retry ?? 0;
1820
- validateAuthRetry(authRetry);
1821
2052
  options.signal?.throwIfAborted();
1822
2053
  const response = await this.client.getClient().post({
1823
2054
  url: `/managed-auth/connections/${encodeURIComponent(connectionId)}/${action}`,
1824
- body: { auth_retry: authRetry },
2055
+ body: { auth_retry: options.auth_retry },
1825
2056
  headers: { "Content-Type": "application/json" },
1826
2057
  signal: options.signal,
1827
2058
  throwOnError: true
@@ -1856,7 +2087,7 @@ function createResources(client2, getApiKey) {
1856
2087
  },
1857
2088
  /** downloadSessionFile: /sessions/{session_id}/files/{file_id}. Returns the API response body. */
1858
2089
  downloadSessionFile: async (sessionId, fileId, requestOptions = {}) => {
1859
- const response = await downloadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
2090
+ const response = await downloadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, parseAs: "blob", headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
1860
2091
  return response.data;
1861
2092
  },
1862
2093
  /** pageExecute: /sessions/{session_id}/page/execute. Returns the API response body. */
@@ -1864,6 +2095,11 @@ function createResources(client2, getApiKey) {
1864
2095
  const response = await pageExecute({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
1865
2096
  return response.data;
1866
2097
  },
2098
+ /** executeSessionFile: /sessions/{session_id}/page/execute/file. Returns the API response body. */
2099
+ executeSessionFile: async (sessionId, body, query = void 0, requestOptions = {}) => {
2100
+ const response = await executeSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
2101
+ return response.data;
2102
+ },
1867
2103
  /** sessionCookiesGet: /sessions/{session_id}/cookies. Returns the API response body. */
1868
2104
  getCookies: async (sessionId, query = void 0, requestOptions = {}) => {
1869
2105
  const response = await sessionCookiesGet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
@@ -1884,6 +2120,11 @@ function createResources(client2, getApiKey) {
1884
2120
  const response = await listSessionFiles({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
1885
2121
  return response.data;
1886
2122
  },
2123
+ /** sessionMouseReplay: /sessions/{session_id}/replay/mouse. Returns the API response body. */
2124
+ mouseReplay: async (sessionId, query = void 0, requestOptions = {}) => {
2125
+ const response = await sessionMouseReplay({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
2126
+ return response.data;
2127
+ },
1887
2128
  /** sessionNetworkLogs: /sessions/{session_id}/network/logs. Returns the API response body. */
1888
2129
  networkLogs: async (sessionId, query = void 0, requestOptions = {}) => {
1889
2130
  const response = await sessionNetworkLogs({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
@@ -1909,16 +2150,16 @@ function createResources(client2, getApiKey) {
1909
2150
  const response = await sessionProfilePreview({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
1910
2151
  return response.data;
1911
2152
  },
1912
- /** sessionProfileSave: /sessions/{session_id}/profile/save. Returns the API response body. */
1913
- profileSave: async (sessionId, body, requestOptions = {}) => {
1914
- const response = await sessionProfileSave({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body });
1915
- return response.data;
1916
- },
1917
2153
  /** sessionReplay: /sessions/{session_id}/replay. Returns the API response body. */
1918
2154
  replay: async (sessionId, requestOptions = {}) => {
1919
2155
  const response = await sessionReplay({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId } });
1920
2156
  return response.data;
1921
2157
  },
2158
+ /** sessionProfileSave: /sessions/{session_id}/profile/save. Returns the API response body. */
2159
+ saveProfile: async (sessionId, body, requestOptions = {}) => {
2160
+ const response = await sessionProfileSave({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body });
2161
+ return response.data;
2162
+ },
1922
2163
  /** pageScrape: /sessions/{session_id}/page/scrape. Returns the API response body. */
1923
2164
  scrape: async (sessionId, body, query = void 0, requestOptions = {}) => {
1924
2165
  const response = await pageScrape({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
@@ -1931,6 +2172,9 @@ function createResources(client2, getApiKey) {
1931
2172
  },
1932
2173
  /** sessionStart: /sessions/start. Returns the API response body. */
1933
2174
  start: async (body, requestOptions = {}) => {
2175
+ body = { ...body };
2176
+ if (body.record_session === true) delete body.record_session;
2177
+ if (body.log_session === true) delete body.log_session;
1934
2178
  const response = await sessionStart({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
1935
2179
  return response.data;
1936
2180
  },
@@ -1950,30 +2194,30 @@ function createResources(client2, getApiKey) {
1950
2194
  return response.data;
1951
2195
  }
1952
2196
  },
1953
- agents: {
1954
- /** getScript: /agents/{agent_id}/workflow/code. Returns the API response body. */
1955
- getScript: async (agentId, query, requestOptions = {}) => {
1956
- const response = await getScript({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "agent_id": agentId }, query });
2197
+ files: {
2198
+ /** deleteSessionFile: /sessions/{session_id}/files/{file_id}. Returns the API response body. */
2199
+ delete: async (sessionId, fileId, requestOptions = {}) => {
2200
+ const response = await deleteSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
1957
2201
  return response.data;
1958
2202
  },
1959
- /** listAgents: /agents. Returns the API response body. */
1960
- list: async (query = void 0, requestOptions = {}) => {
1961
- const response = await listAgents({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2203
+ /** downloadSessionFile: /sessions/{session_id}/files/{file_id}. Returns the API response body. */
2204
+ download: async (sessionId, fileId, requestOptions = {}) => {
2205
+ const response = await downloadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, parseAs: "blob", headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
1962
2206
  return response.data;
1963
2207
  },
1964
- /** agentStart: /agents/start. Returns the API response body. */
1965
- start: async (body, requestOptions = {}) => {
1966
- const response = await agentStart({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2208
+ /** executeSessionFile: /sessions/{session_id}/page/execute/file. Returns the API response body. */
2209
+ execute: async (sessionId, body, query = void 0, requestOptions = {}) => {
2210
+ const response = await executeSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
1967
2211
  return response.data;
1968
2212
  },
1969
- /** agentStatus: /agents/{agent_id}. Returns the API response body. */
1970
- status: async (agentId, requestOptions = {}) => {
1971
- const response = await agentStatus({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "agent_id": agentId } });
2213
+ /** listSessionFiles: /sessions/{session_id}/files. Returns the API response body. */
2214
+ list: async (sessionId, query = void 0, requestOptions = {}) => {
2215
+ const response = await listSessionFiles({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
1972
2216
  return response.data;
1973
2217
  },
1974
- /** agentStop: /agents/{agent_id}/stop. Returns the API response body. */
1975
- stop: async (agentId, query, requestOptions = {}) => {
1976
- const response = await agentStop({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "agent_id": agentId }, query });
2218
+ /** uploadSessionFile: /sessions/{session_id}/files. Returns the API response body. */
2219
+ upload: async (sessionId, body, requestOptions = {}) => {
2220
+ const response = await uploadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body });
1977
2221
  return response.data;
1978
2222
  }
1979
2223
  },
@@ -2054,8 +2298,8 @@ function createResources(client2, getApiKey) {
2054
2298
  return response.data;
2055
2299
  },
2056
2300
  /** functionRuntimeHealth: /functions/health. Returns the API response body. */
2057
- runtimeHealth: async (requestOptions = {}) => {
2058
- const response = await functionRuntimeHealth({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers } });
2301
+ runtimeHealth: async (requestOptions = {}, query = void 0) => {
2302
+ const response = await functionRuntimeHealth({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2059
2303
  return response.data;
2060
2304
  },
2061
2305
  /** functionScheduleSet: /functions/{function_id}/schedule. Returns the API response body. */
@@ -2069,6 +2313,43 @@ function createResources(client2, getApiKey) {
2069
2313
  return response.data;
2070
2314
  }
2071
2315
  },
2316
+ personas: {
2317
+ /** personaCreate: /personas/create. Returns the API response body. */
2318
+ create: async (body, requestOptions = {}) => {
2319
+ const response = await personaCreate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2320
+ return response.data;
2321
+ },
2322
+ /** personaDelete: /personas/{persona_id}. Returns the API response body. */
2323
+ delete: async (personaId, requestOptions = {}) => {
2324
+ const response = await personaDelete({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2325
+ return response.data;
2326
+ },
2327
+ /** personaEmailsList: /personas/{persona_id}/emails. Returns the API response body. */
2328
+ emailsList: async (personaId, query = void 0, requestOptions = {}) => {
2329
+ const response = await personaEmailsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2330
+ return response.data;
2331
+ },
2332
+ /** personaGet: /personas/{persona_id}. Returns the API response body. */
2333
+ get: async (personaId, requestOptions = {}) => {
2334
+ const response = await personaGet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2335
+ return response.data;
2336
+ },
2337
+ /** listPersonas: /personas. Returns the API response body. */
2338
+ list: async (query = void 0, requestOptions = {}) => {
2339
+ const response = await listPersonas({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2340
+ return response.data;
2341
+ },
2342
+ /** personaSmsList: /personas/{persona_id}/sms. Returns the API response body. */
2343
+ smsList: async (personaId, query = void 0, requestOptions = {}) => {
2344
+ const response = await personaSmsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2345
+ return response.data;
2346
+ },
2347
+ /** personaUpdate: /personas/{persona_id}. Returns the API response body. */
2348
+ update: async (personaId, body, requestOptions = {}) => {
2349
+ const response = await personaUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, body });
2350
+ return response.data;
2351
+ }
2352
+ },
2072
2353
  vaults: {
2073
2354
  /** vaultCreate: /vaults/create. Returns the API response body. */
2074
2355
  create: async (body, requestOptions = {}) => {
@@ -2112,54 +2393,17 @@ function createResources(client2, getApiKey) {
2112
2393
  },
2113
2394
  /** vaultDelete: /vaults/{vault_id}. Returns the API response body. */
2114
2395
  delete: async (vaultId, requestOptions = {}) => {
2115
- const response = await vaultDelete({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "vault_id": vaultId } });
2116
- return response.data;
2117
- },
2118
- /** listVaults: /vaults. Returns the API response body. */
2119
- list: async (query = void 0, requestOptions = {}) => {
2120
- const response = await listVaults({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2121
- return response.data;
2122
- },
2123
- /** vaultUpdate: /vaults/{vault_id}. Returns the API response body. */
2124
- update: async (vaultId, body, requestOptions = {}) => {
2125
- const response = await vaultUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "vault_id": vaultId }, body });
2126
- return response.data;
2127
- }
2128
- },
2129
- personas: {
2130
- /** personaCreate: /personas/create. Returns the API response body. */
2131
- create: async (body, requestOptions = {}) => {
2132
- const response = await personaCreate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2133
- return response.data;
2134
- },
2135
- /** personaDelete: /personas/{persona_id}. Returns the API response body. */
2136
- delete: async (personaId, requestOptions = {}) => {
2137
- const response = await personaDelete({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2138
- return response.data;
2139
- },
2140
- /** personaEmailsList: /personas/{persona_id}/emails. Returns the API response body. */
2141
- emailsList: async (personaId, query = void 0, requestOptions = {}) => {
2142
- const response = await personaEmailsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2143
- return response.data;
2144
- },
2145
- /** personaGet: /personas/{persona_id}. Returns the API response body. */
2146
- get: async (personaId, requestOptions = {}) => {
2147
- const response = await personaGet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2396
+ const response = await vaultDelete({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "vault_id": vaultId } });
2148
2397
  return response.data;
2149
2398
  },
2150
- /** listPersonas: /personas. Returns the API response body. */
2399
+ /** listVaults: /vaults. Returns the API response body. */
2151
2400
  list: async (query = void 0, requestOptions = {}) => {
2152
- const response = await listPersonas({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2153
- return response.data;
2154
- },
2155
- /** personaSmsList: /personas/{persona_id}/sms. Returns the API response body. */
2156
- smsList: async (personaId, query = void 0, requestOptions = {}) => {
2157
- const response = await personaSmsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2401
+ const response = await listVaults({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2158
2402
  return response.data;
2159
2403
  },
2160
- /** personaUpdate: /personas/{persona_id}. Returns the API response body. */
2161
- update: async (personaId, body, requestOptions = {}) => {
2162
- const response = await personaUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, body });
2404
+ /** vaultUpdate: /vaults/{vault_id}. Returns the API response body. */
2405
+ update: async (vaultId, body, requestOptions = {}) => {
2406
+ const response = await vaultUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "vault_id": vaultId }, body });
2163
2407
  return response.data;
2164
2408
  }
2165
2409
  },
@@ -2198,6 +2442,11 @@ function createResources(client2, getApiKey) {
2198
2442
  list: async (query = void 0, requestOptions = {}) => {
2199
2443
  const response = await profileList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2200
2444
  return response.data;
2445
+ },
2446
+ /** profileStateSet: /profiles/{profile_id}/state. Returns the API response body. */
2447
+ stateSet: async (profileId, body, requestOptions = {}) => {
2448
+ const response = await profileStateSet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "profile_id": profileId }, body });
2449
+ return response.data;
2201
2450
  }
2202
2451
  }
2203
2452
  };
@@ -2562,10 +2811,16 @@ async function createOrAppendCookiesToFile(cookieFile, cookies) {
2562
2811
  throw error;
2563
2812
  }
2564
2813
  }
2565
- existing.push(...cookies);
2566
- await writeFile(cookieFile, JSON.stringify(existing), "utf-8");
2814
+ const merged = /* @__PURE__ */ new Map();
2815
+ for (const cookie of [...existing, ...cookies]) {
2816
+ merged.set(cookieIdentity(cookie), cookie);
2817
+ }
2818
+ await writeFile(cookieFile, JSON.stringify([...merged.values()]), "utf-8");
2567
2819
  });
2568
2820
  }
2821
+ function cookieIdentity(cookie) {
2822
+ return JSON.stringify([cookie.name, cookie.domain ?? null, cookie.path ?? null, cookie.partitionKey ?? null]);
2823
+ }
2569
2824
  var fileLocks = /* @__PURE__ */ new Map();
2570
2825
  async function withFileLock(path, fn) {
2571
2826
  const key = resolve(path);
@@ -2724,8 +2979,8 @@ async function buildScrapeBody(options) {
2724
2979
  if (json_schema) {
2725
2980
  body.response_format = json_schema;
2726
2981
  } else {
2727
- const { z: z2 } = await import("zod");
2728
- body.response_format = normalizeJsonSchema(z2.toJSONSchema(response_format));
2982
+ const { z } = await import("zod");
2983
+ body.response_format = normalizeJsonSchema(z.toJSONSchema(response_format));
2729
2984
  }
2730
2985
  } else if (response_format) {
2731
2986
  body.response_format = response_format;
@@ -2737,9 +2992,6 @@ function processScrapeResponse(scrapeResponse, options) {
2737
2992
  throw new ScrapeFailedError("empty response");
2738
2993
  }
2739
2994
  const raiseOnFailure = options.raiseOnFailure ?? true;
2740
- if (options.only_images) {
2741
- return scrapeResponse.images ?? [];
2742
- }
2743
2995
  if (requiresSchema(options)) {
2744
2996
  const structured = scrapeResponse.structured;
2745
2997
  if (!structured) {
@@ -2762,10 +3014,126 @@ function processScrapeResponse(scrapeResponse, options) {
2762
3014
  return scrapeResponse.markdown;
2763
3015
  }
2764
3016
 
3017
+ // src/retry.ts
3018
+ var DEFAULT_MAX_RETRIES = 3;
3019
+ var RETRY_BASE_DELAY_MS = 1e3;
3020
+ var RETRY_MAX_DELAY_MS = 1e4;
3021
+ var RETRY_AFTER_MAX_MS = 2e4;
3022
+ var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS", "PUT", "DELETE"]);
3023
+ var REFUSED_STATUSES = /* @__PURE__ */ new Set([503, 529]);
3024
+ var GATEWAY_STATUSES = /* @__PURE__ */ new Set([502, 504]);
3025
+ var NOT_SENT_ERROR_CODES = /* @__PURE__ */ new Set([
3026
+ "ECONNREFUSED",
3027
+ "EAI_AGAIN",
3028
+ "ENETUNREACH",
3029
+ "EHOSTUNREACH",
3030
+ "UND_ERR_CONNECT_TIMEOUT"
3031
+ ]);
3032
+ var BROKEN_CONNECTION_ERROR_CODES = /* @__PURE__ */ new Set([
3033
+ "ECONNRESET",
3034
+ "EPIPE",
3035
+ "ETIMEDOUT",
3036
+ "UND_ERR_SOCKET",
3037
+ "UND_ERR_CLOSED"
3038
+ ]);
3039
+ function isIdempotentMethod(method) {
3040
+ return IDEMPOTENT_METHODS.has(method.toUpperCase());
3041
+ }
3042
+ function isRetryableStatus(status, method) {
3043
+ return REFUSED_STATUSES.has(status) || GATEWAY_STATUSES.has(status) && isIdempotentMethod(method);
3044
+ }
3045
+ function isRetryableNetworkError(error, method) {
3046
+ const code = networkErrorCode(error);
3047
+ if (code === void 0) return false;
3048
+ return NOT_SENT_ERROR_CODES.has(code) || BROKEN_CONNECTION_ERROR_CODES.has(code) && isIdempotentMethod(method);
3049
+ }
3050
+ function networkErrorCode(error, depth = 0) {
3051
+ if (typeof error !== "object" || error === null || depth > 4) return void 0;
3052
+ const { code, cause, errors } = error;
3053
+ if (typeof code === "string") return code;
3054
+ if (Array.isArray(errors) && errors.length > 0) return networkErrorCode(errors[0], depth + 1);
3055
+ return networkErrorCode(cause, depth + 1);
3056
+ }
3057
+ function parseRetryAfter(header, now = Date.now()) {
3058
+ if (!header) return void 0;
3059
+ const value = header.trim();
3060
+ if (/^\d+(\.\d+)?$/.test(value)) return Number(value) * 1e3;
3061
+ const date = Date.parse(value);
3062
+ return Number.isNaN(date) ? void 0 : Math.max(0, date - now);
3063
+ }
3064
+ function backoffDelayMs(attempt, random = Math.random) {
3065
+ return random() * Math.min(RETRY_MAX_DELAY_MS, RETRY_BASE_DELAY_MS * 2 ** attempt);
3066
+ }
3067
+ function retryDelayMs(attempt, retryAfter, random) {
3068
+ const requested = parseRetryAfter(retryAfter);
3069
+ if (requested === void 0) return backoffDelayMs(attempt, random);
3070
+ return requested <= RETRY_AFTER_MAX_MS ? requested : void 0;
3071
+ }
3072
+ function createRetryingFetch(options) {
3073
+ const wait2 = options.sleep ?? abortableSleep;
3074
+ return async (input, init) => {
3075
+ const baseFetch = options.fetch ?? globalThis.fetch;
3076
+ const request = input instanceof Request ? input : void 0;
3077
+ const method = (request?.method ?? init?.method ?? "GET").toUpperCase();
3078
+ const signal = init?.signal ?? request?.signal;
3079
+ const maxRetries = Math.max(0, Math.floor(options.maxRetries(signal) || 0));
3080
+ const send = (last) => request && request.body !== null && !last ? baseFetch(request.clone(), init) : baseFetch(input, init);
3081
+ for (let attempt = 0; ; attempt++) {
3082
+ const last = attempt >= maxRetries;
3083
+ let response;
3084
+ try {
3085
+ response = await send(last);
3086
+ } catch (error) {
3087
+ if (last || !isRetryableNetworkError(error, method)) throw error;
3088
+ const delay4 = backoffDelayMs(attempt, options.random);
3089
+ if (!fitsDeadline(delay4)) throw error;
3090
+ warn(`${method} request failed (${networkErrorCode(error)})`, delay4, attempt, maxRetries);
3091
+ await wait2(delay4, signal);
3092
+ continue;
3093
+ }
3094
+ if (last || !isRetryableStatus(response.status, method)) return response;
3095
+ const delay3 = retryDelayMs(attempt, response.headers.get("retry-after"), options.random);
3096
+ if (delay3 === void 0 || !fitsDeadline(delay3)) return response;
3097
+ await response.body?.cancel().catch(() => void 0);
3098
+ warn(`${method} request returned ${response.status}`, delay3, attempt, maxRetries);
3099
+ await wait2(delay3, signal);
3100
+ }
3101
+ function fitsDeadline(delay3) {
3102
+ const deadline = options.deadline?.(signal);
3103
+ return deadline === void 0 || Date.now() + delay3 < deadline;
3104
+ }
3105
+ };
3106
+ }
3107
+ function warn(reason, delay3, attempt, maxRetries) {
3108
+ console.warn(`${reason}, retrying in ${(delay3 / 1e3).toFixed(1)}s (${attempt + 1}/${maxRetries})`);
3109
+ }
3110
+ function abortableSleep(ms, signal) {
3111
+ return new Promise((resolve3, reject) => {
3112
+ if (signal?.aborted) {
3113
+ reject(signal.reason);
3114
+ return;
3115
+ }
3116
+ const onAbort = () => {
3117
+ clearTimeout(timer);
3118
+ reject(signal?.reason);
3119
+ };
3120
+ const timer = setTimeout(() => {
3121
+ signal?.removeEventListener("abort", onAbort);
3122
+ resolve3();
3123
+ }, ms);
3124
+ signal?.addEventListener("abort", onAbort, { once: true });
3125
+ });
3126
+ }
3127
+
2765
3128
  // src/session.ts
2766
3129
  var SESSION_START_TRIES = 3;
2767
3130
  var CLUSTER_OVERLOAD_RETRY_DELAY_MS = 3e4;
2768
3131
  var CAPTCHA_SOLVE_TIMEOUT_MS = 1e5;
3132
+ var OBSERVE_MIGRATION_URL = "https://docs.notte.cc/features/sessions/observe-migration";
3133
+ var OBSERVE_DEPRECATIONS = {
3134
+ instructions: `\`observe({ instructions })\` is deprecated and will be removed on December 1, 2026; <<ALTERNATIVE FOR instructions: session.act() \u2014 pending>>. See ${OBSERVE_MIGRATION_URL}`,
3135
+ deep: `\`perception_type: 'deep'\` is deprecated and will be removed on December 1, 2026; use \`perception_type: 'fast'\` (the default). See ${OBSERVE_MIGRATION_URL}`
3136
+ };
2769
3137
  function observeServerOwnedDialog(_dialog) {
2770
3138
  }
2771
3139
  function installServerOwnedDialogPolicy(browser) {
@@ -2780,6 +3148,7 @@ var Session = class {
2780
3148
  legacyHeadless;
2781
3149
  defaultRaiseOnFailure;
2782
3150
  defaultPerceptionType;
3151
+ warnedObserveDeprecations = /* @__PURE__ */ new Set();
2783
3152
  cookieFile;
2784
3153
  cookiesLoaded = false;
2785
3154
  cookieLoadPromise;
@@ -2815,9 +3184,11 @@ var Session = class {
2815
3184
  /**
2816
3185
  * Start the session: creates a new session on the server.
2817
3186
  *
2818
- * Retries up to `SESSION_START_TRIES` times on 5xx errors, waiting
2819
- * `CLUSTER_OVERLOAD_RETRY_DELAY_MS` on HTTP 529 (cluster overload). 4xx
2820
- * errors are never retried.
3187
+ * 503, 529, and refused connections follow the client's retry policy
3188
+ * (`NotteClientConfig.maxRetries`, honoring `Retry-After`). Other 5xx
3189
+ * errors are retried up to `SESSION_START_TRIES` times. With client
3190
+ * retries disabled, 529 waits `CLUSTER_OVERLOAD_RETRY_DELAY_MS` instead.
3191
+ * 4xx errors are never retried.
2821
3192
  *
2822
3193
  * Managed-auth sessions wait for readiness by default. Pass
2823
3194
  * `{ wait_for_authentication: false }` for an explicit nonblocking start,
@@ -2830,11 +3201,6 @@ var Session = class {
2830
3201
  * await session.start();
2831
3202
  */
2832
3203
  async start(options = {}) {
2833
- if (this.legacyHeadless === false) {
2834
- throw new Error(
2835
- "Remote `headless: false` is no longer supported. `headless: true` sessions still include session replays and access to the live viewer."
2836
- );
2837
- }
2838
3204
  if (this.legacyHeadless === true) {
2839
3205
  console.warn("`headless: true` is deprecated and ignored; remote sessions always use the supported browser launch mode.");
2840
3206
  this.legacyHeadless = void 0;
@@ -2843,42 +3209,62 @@ var Session = class {
2843
3209
  throw new Error("Session is already active");
2844
3210
  }
2845
3211
  options.signal?.throwIfAborted();
2846
- validateAuthRetry(this.options.auth_retry ?? 0);
2847
3212
  const { auth_retry, wait_for_authentication, ...request } = this.options;
2848
3213
  const body = {
2849
3214
  ...request,
2850
- ...request.auth_ids?.length ? { auth_retry: auth_retry ?? 0, wait_for_authentication: false } : {}
3215
+ ...this.legacyHeadless !== void 0 ? { headless: this.legacyHeadless } : {},
3216
+ ...auth_retry !== void 0 ? { auth_retry } : {},
3217
+ ...request.auth_ids?.length ? { wait_for_authentication: false } : {}
2851
3218
  };
3219
+ if (body.record_session === true) delete body.record_session;
3220
+ if (body.log_session === true) delete body.log_session;
2852
3221
  const shouldWait = options.wait_for_authentication ?? wait_for_authentication ?? true;
3222
+ const maxRetries = this.client.getConfig().maxRetries ?? 0;
3223
+ const timeoutMs = this.client.getConfig().timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
3224
+ const deadline = timeoutMs > 0 ? Date.now() + timeoutMs : void 0;
3225
+ const fitsDeadline = (wait2) => deadline === void 0 || Date.now() + wait2 < deadline;
3226
+ let transientRetries = 0;
2853
3227
  let tries = SESSION_START_TRIES;
2854
3228
  const origTries = tries;
2855
3229
  let sessionData;
2856
3230
  while (tries > 0) {
2857
3231
  options.signal?.throwIfAborted();
2858
- tries -= 1;
3232
+ if (!fitsDeadline(0)) throw new NotteTimeoutError(`Session start timed out after ${timeoutMs}ms`);
2859
3233
  try {
2860
- const response = await sessionStart({ client: this.client.getClient(), body, throwOnError: true });
3234
+ const response = await sessionStart({
3235
+ client: this.client.getClient(),
3236
+ body,
3237
+ throwOnError: true,
3238
+ headers: {
3239
+ [MAX_RETRIES_HEADER]: "0",
3240
+ ...deadline === void 0 ? {} : { [TIMEOUT_HEADER]: String(Math.max(1, deadline - Date.now())) }
3241
+ }
3242
+ });
2861
3243
  sessionData = response.data;
2862
3244
  break;
2863
3245
  } catch (error) {
3246
+ const transient = error instanceof NotteAPIError ? isRetryableStatus(error.statusCode, "POST") : isRetryableNetworkError(error, "POST");
3247
+ if (maxRetries > 0 && transient) {
3248
+ const wait2 = transientRetries >= maxRetries ? void 0 : error instanceof NotteAPIError ? retryDelayMs(transientRetries, error.response?.headers.get("retry-after")) : backoffDelayMs(transientRetries);
3249
+ if (wait2 === void 0 || !fitsDeadline(wait2)) throw error;
3250
+ transientRetries += 1;
3251
+ console.warn(
3252
+ `Failed to start session (${error instanceof NotteAPIError ? error.statusCode : "connection error"}), retrying in ${(wait2 / 1e3).toFixed(1)}s (${transientRetries}/${maxRetries})`
3253
+ );
3254
+ await pauseStart(wait2, options.signal);
3255
+ continue;
3256
+ }
3257
+ tries -= 1;
2864
3258
  if (tries === 0 || !(error instanceof NotteAPIError) || error.statusCode < 500) {
2865
3259
  throw error;
2866
3260
  }
2867
3261
  const retryStr = `${origTries - tries}/${origTries - 1}`;
3262
+ if (!fitsDeadline(error.statusCode === 529 ? CLUSTER_OVERLOAD_RETRY_DELAY_MS : 0)) throw error;
2868
3263
  if (error.statusCode === 529) {
2869
3264
  console.warn(
2870
3265
  `Failed to start session due to cluster overload, retrying in ${CLUSTER_OVERLOAD_RETRY_DELAY_MS / 1e3} seconds (${retryStr})...`
2871
3266
  );
2872
- if (options.signal) {
2873
- try {
2874
- await delay2(CLUSTER_OVERLOAD_RETRY_DELAY_MS, void 0, { signal: options.signal });
2875
- } catch (error2) {
2876
- options.signal.throwIfAborted();
2877
- throw error2;
2878
- }
2879
- } else {
2880
- await sleep(CLUSTER_OVERLOAD_RETRY_DELAY_MS);
2881
- }
3267
+ await pauseStart(CLUSTER_OVERLOAD_RETRY_DELAY_MS, options.signal);
2882
3268
  } else {
2883
3269
  console.warn(`Failed to start session: retrying (${retryStr})`);
2884
3270
  }
@@ -2896,6 +3282,7 @@ var Session = class {
2896
3282
  this.fileStorage = this.fileStorage?.forSession(sessionData.session_id);
2897
3283
  try {
2898
3284
  options.signal?.throwIfAborted();
3285
+ if (!fitsDeadline(0)) throw new NotteTimeoutError(`Session start timed out after ${timeoutMs}ms`);
2899
3286
  if (shouldWait) await this.waitForAuth(options);
2900
3287
  if (this.openViewer) {
2901
3288
  this.openViewerInBrowser();
@@ -3132,7 +3519,11 @@ var Session = class {
3132
3519
  if (!(error instanceof NotteAPIError) || error.statusCode !== 404) {
3133
3520
  throw error;
3134
3521
  }
3135
- if (this.isActive && (error.apiMessage ?? "").includes("still active")) {
3522
+ const waitingForClose = error.error.replay_status === "waiting_for_session";
3523
+ if (error.error.replay_status === "disabled" || error.error.retryable === false && !waitingForClose) {
3524
+ throw error;
3525
+ }
3526
+ if (this.isActive && this.sessionId === sessionId && (waitingForClose || (error.apiMessage ?? "").includes("still active"))) {
3136
3527
  throw new Error(`Session ${sessionId} is still active \u2014 close the session first to generate the replay.`, {
3137
3528
  cause: error
3138
3529
  });
@@ -3220,9 +3611,7 @@ var Session = class {
3220
3611
  * start-time profile settings are not changed, so a session started with `persist: true`
3221
3612
  * still saves again when it stops.
3222
3613
  *
3223
- * @example
3224
- * const profile = await session.saveProfile({ name: 'github' });
3225
- * // later: client.Session({ profile: { id: profile.profile_id } })
3614
+ * See [Browser Profiles](/features/sessions/browser-profiles) for the tested Python and TypeScript example.
3226
3615
  */
3227
3616
  async saveProfile(options = {}) {
3228
3617
  const { profile_id, name } = options;
@@ -3455,19 +3844,30 @@ var Session = class {
3455
3844
  * The `perception_type` defaults to the session option (`fast`). A bare
3456
3845
  * string argument is accepted as the perception type.
3457
3846
  *
3847
+ * Deprecated: `perception_type: 'deep'` and `instructions` are removed on
3848
+ * December 1, 2026, and each warns once per session. Use `perception_type:
3849
+ * 'fast'` (the default) instead of `'deep'`. For `instructions`:
3850
+ * `<<ALTERNATIVE FOR instructions: session.act() — pending>>`. See https://docs.notte.cc/features/sessions/observe-migration
3851
+ *
3458
3852
  * @param options - Observation settings, including an optional URL, or a perception-mode string.
3459
3853
  * @returns Structured page analysis, available actions, and page metadata.
3460
3854
  * @throws NotteAPIError if observation fails.
3461
3855
  * @example
3462
3856
  * const obs = await session.observe();
3463
3857
  * console.log(obs.space.description);
3464
- * const deep = await session.observe({ perception_type: 'deep', max_nb_actions: 50 });
3858
+ * const firstActions = await session.observe({ max_nb_actions: 50 });
3465
3859
  */
3466
3860
  async observe(options = {}) {
3467
3861
  const body = typeof options === "string" ? { perception_type: options } : { ...options };
3468
3862
  if (body.perception_type == null) {
3469
3863
  body.perception_type = this.defaultPerceptionType;
3470
3864
  }
3865
+ if (body.instructions != null) {
3866
+ this.warnObserveDeprecation("instructions");
3867
+ }
3868
+ if (body.perception_type !== "fast") {
3869
+ this.warnObserveDeprecation("deep");
3870
+ }
3471
3871
  const response = await pageObserve({
3472
3872
  client: this.client.getClient(),
3473
3873
  path: { session_id: this.requireSessionId() },
@@ -3476,6 +3876,12 @@ var Session = class {
3476
3876
  });
3477
3877
  return response.data;
3478
3878
  }
3879
+ warnObserveDeprecation(option) {
3880
+ if (!this.warnedObserveDeprecations.has(option)) {
3881
+ this.warnedObserveDeprecations.add(option);
3882
+ console.warn(OBSERVE_DEPRECATIONS[option]);
3883
+ }
3884
+ }
3479
3885
  async scrape(options = {}) {
3480
3886
  const sessionId = this.requireSessionId();
3481
3887
  const body = await buildScrapeBody(options);
@@ -3543,424 +3949,18 @@ var Session = class {
3543
3949
  }
3544
3950
  }
3545
3951
  };
3546
-
3547
- // src/agent.ts
3548
- import WebSocket from "ws";
3549
- import { z } from "zod";
3550
- function prepareAgentRequest(data) {
3551
- const apiData = { ...data };
3552
- const rf = data.response_format;
3553
- if (rf && typeof rf.parse === "function" && typeof rf.safeParse === "function") {
3554
- apiData.response_format = normalizeJsonSchema(z.toJSONSchema(rf));
3555
- return { apiData, zodSchema: rf };
3556
- }
3557
- return { apiData, zodSchema: null };
3558
- }
3559
- function parseAgentStatusMessage(parsed, agentId) {
3560
- if (parsed?.status === "agent_stop" && parsed.agent && parsed.agent.agent_id === agentId && parsed.agent.task !== void 0 && parsed.agent.status !== void 0) {
3561
- return parsed.agent;
3562
- }
3563
- if (parsed?.agent_id === agentId && parsed.task !== void 0 && parsed.status !== void 0) {
3564
- return parsed;
3565
- }
3566
- return null;
3567
- }
3568
- function validatePersonaOption(persona, persona_id) {
3569
- if (persona) {
3570
- try {
3571
- const personaId = persona.personaId;
3572
- if (!personaId || personaId.length === 0) {
3573
- throw new Error("Persona ID cannot be empty");
3574
- }
3575
- return personaId;
3576
- } catch (error) {
3577
- throw new Error(`Invalid persona object: ${error instanceof Error ? error.message : String(error)}`);
3578
- }
3579
- } else if (persona_id) {
3580
- if (persona_id.length === 0) {
3581
- throw new Error("Persona ID cannot be empty");
3582
- }
3583
- return persona_id;
3584
- }
3585
- return void 0;
3586
- }
3587
- function validateVaultOption(vault, vault_id) {
3588
- if (vault) {
3589
- try {
3590
- const vaultId = vault.vaultId;
3591
- if (!vaultId || vaultId.length === 0) {
3592
- throw new Error("Vault ID cannot be empty");
3593
- }
3594
- return vaultId;
3595
- } catch (error) {
3596
- throw new Error(`Invalid vault object: ${error instanceof Error ? error.message : String(error)}`);
3597
- }
3598
- } else if (vault_id) {
3599
- if (vault_id.length === 0) {
3600
- throw new Error("Vault ID cannot be empty");
3601
- }
3602
- return vault_id;
3603
- }
3604
- return void 0;
3605
- }
3606
- function validateSessionOption(session) {
3607
- const sessionId = session.getId();
3608
- if (!sessionId || sessionId.length === 0) {
3609
- throw new Error("Session ID cannot be empty");
3952
+ async function pauseStart(ms, signal) {
3953
+ if (!signal) {
3954
+ await sleep(ms);
3955
+ return;
3610
3956
  }
3611
- return sessionId;
3612
- }
3613
- function validateAgentIdOption(agent_id) {
3614
- if (agent_id.length === 0) {
3615
- throw new Error("Agent ID cannot be empty");
3957
+ try {
3958
+ await delay2(ms, void 0, { signal });
3959
+ } catch (error) {
3960
+ signal.throwIfAborted();
3961
+ throw error;
3616
3962
  }
3617
3963
  }
3618
- var defaultStepLogger = (stepData, stepCounter, agentId) => {
3619
- console.log(`\u2728 Step ${stepCounter} (agent: ${agentId})`);
3620
- if (stepData && typeof stepData === "object") {
3621
- if (stepData.state) {
3622
- const state = stepData.state;
3623
- if (state.page_summary) {
3624
- console.log(`\u{1F4DD} Current page: ${state.page_summary}`);
3625
- }
3626
- if (state.previous_goal_eval) {
3627
- const statusEmoji = state.previous_goal_status === "success" ? "\u2705" : state.previous_goal_status === "failure" ? "\u274C" : "\u2753";
3628
- console.log(`\u{1F52C} Previous goal: ${statusEmoji} ${state.previous_goal_eval}`);
3629
- }
3630
- if (state.memory) {
3631
- console.log(`\u{1F9E0} Memory: ${state.memory}`);
3632
- }
3633
- if (state.next_goal) {
3634
- console.log(`\u{1F3AF} Next goal: ${state.next_goal}`);
3635
- }
3636
- if (state.relevant_interactions && state.relevant_interactions.length > 0) {
3637
- console.log(`\u{1F194} Relevant ids:`);
3638
- state.relevant_interactions.forEach((interaction) => {
3639
- console.log(` \u25B6 ${interaction.id}: ${interaction.reason}`);
3640
- });
3641
- }
3642
- }
3643
- if (stepData.action) {
3644
- const action = stepData.action;
3645
- let actionStr = `\u26A1 Taking action:
3646
- \u25B6 ${action.name || action.type || "Unknown action"}`;
3647
- if (action.id) {
3648
- actionStr += ` with id ${action.id}`;
3649
- } else if (action.param && action.param.name && action[action.param.name]) {
3650
- actionStr += ` with ${action.param.name}=${action[action.param.name]}`;
3651
- }
3652
- console.log(actionStr);
3653
- }
3654
- } else {
3655
- console.log(stepData);
3656
- }
3657
- console.log("");
3658
- };
3659
- var Agent = class {
3660
- client;
3661
- request;
3662
- response = null;
3663
- websocket = null;
3664
- existingAgent;
3665
- constructor(client2, options) {
3666
- this.client = client2;
3667
- if ("agent_id" in options && options.agent_id) {
3668
- if (options.session) {
3669
- throw new Error("Either session (for running a new agent) or agent_id (for accessing an existing agent) have to be provided, not both");
3670
- }
3671
- validateAgentIdOption(options.agent_id);
3672
- this.existingAgent = true;
3673
- this.response = { agent_id: options.agent_id };
3674
- } else if ("session" in options && options.session) {
3675
- if (options.agent_id) {
3676
- throw new Error("Either session (for running a new agent) or agent_id (for accessing an existing agent) have to be provided, not both");
3677
- }
3678
- this.existingAgent = false;
3679
- const { session, vault, persona, ...requestData } = options;
3680
- const sessionId = validateSessionOption(session);
3681
- const vaultId = validateVaultOption(vault, options.vault_id);
3682
- const personaId = validatePersonaOption(persona, options.persona_id);
3683
- this.request = {
3684
- session_id: sessionId,
3685
- vault_id: vaultId,
3686
- persona_id: personaId,
3687
- ...requestData
3688
- };
3689
- } else {
3690
- throw new Error("Either session (for running a new agent) or agent_id (for accessing an existing agent) have to be provided");
3691
- }
3692
- }
3693
- async start(data) {
3694
- if (this.existingAgent) {
3695
- throw new Error("You cannot call start() on an agent instantiated from agent id");
3696
- }
3697
- if (!this.request) {
3698
- throw new Error("Agent not properly initialized with session");
3699
- }
3700
- try {
3701
- const { apiData } = prepareAgentRequest(data);
3702
- const requestBody = {
3703
- ...this.request,
3704
- ...apiData
3705
- };
3706
- const response = await agentStart({
3707
- client: this.client.getClient(),
3708
- body: requestBody
3709
- });
3710
- if (response?.error) {
3711
- throw new Error(`Failed to start agent: ${formatError(response.error)}`);
3712
- }
3713
- this.response = response.data;
3714
- return this.response;
3715
- } catch (error) {
3716
- throw new Error(`Failed to start agent: ${error instanceof Error ? error.message : String(error)}`);
3717
- }
3718
- }
3719
- async run(data) {
3720
- if (this.existingAgent) {
3721
- throw new Error("You cannot call run() on an agent instantiated from agent id");
3722
- }
3723
- const { apiData, zodSchema } = prepareAgentRequest(data);
3724
- this.response = await this.start(apiData);
3725
- console.log(`[Agent] ${this.agentId} started`);
3726
- const result = await this.watchLogsAndWait(true, data.updateHandler || null);
3727
- if (zodSchema && result && result.answer !== void 0 && result.answer !== null) {
3728
- let candidate;
3729
- try {
3730
- candidate = typeof result.answer === "string" ? JSON.parse(result.answer) : result.answer;
3731
- } catch {
3732
- throw new Error(`Agent answer is not valid JSON and cannot be validated against the schema`);
3733
- }
3734
- try {
3735
- result.answer = zodSchema.parse(candidate);
3736
- } catch (error) {
3737
- throw new Error(`Agent answer schema validation failed: ${error instanceof Error ? error.message : String(error)}`);
3738
- }
3739
- }
3740
- return result;
3741
- }
3742
- /**
3743
- * Watch logs and wait for completion - mirrors Python watch_logs_and_wait
3744
- */
3745
- async watchLogsAndWait(log = true, updateHandler = null) {
3746
- if (this.existingAgent) {
3747
- throw new Error("You cannot call watchLogsAndWait() on an agent instantiated from agent id");
3748
- }
3749
- if (!this.response) {
3750
- throw new Error("Agent not started");
3751
- }
3752
- const deadline = Date.now() + 3e5;
3753
- try {
3754
- const result = await this.watchLogs(log, updateHandler, deadline);
3755
- if (result && result.status !== "active") {
3756
- return result;
3757
- }
3758
- } catch (error) {
3759
- console.warn(`[Agent] ${this.agentId} log stream unavailable; polling for completion.`);
3760
- }
3761
- while (Date.now() < deadline) {
3762
- const result = await this.status(AbortSignal.timeout(Math.max(1, deadline - Date.now())));
3763
- if (result.status !== "active") {
3764
- updateHandler?.({ type: "completion", data: result, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
3765
- return result;
3766
- }
3767
- await new Promise((resolve3) => setTimeout(resolve3, 1e3));
3768
- }
3769
- throw new Error(`Agent ${this.agentId} did not complete before the polling timeout; retrieve status() later.`);
3770
- }
3771
- /**
3772
- * Watch logs via WebSocket - mirrors Python watch_logs method
3773
- */
3774
- async watchLogs(log = true, updateHandler = null, deadline = Date.now() + 3e5) {
3775
- if (this.existingAgent) {
3776
- throw new Error("You cannot call watchLogs() on an agent instantiated from agent id");
3777
- }
3778
- if (!this.response) {
3779
- throw new Error("Agent not started");
3780
- }
3781
- const config = this.client.getConfig();
3782
- if (config.baseUrl?.startsWith("/")) return null;
3783
- const agentId = this.response.agent_id;
3784
- const sessionId = this.response.session_id;
3785
- const debug = await sessionDebugInfo({
3786
- client: this.client.getClient(),
3787
- path: { session_id: sessionId },
3788
- throwOnError: true,
3789
- signal: AbortSignal.timeout(Math.max(1, deadline - Date.now()))
3790
- });
3791
- const wsUrl = new URL(this.client.withDbPreview(debug.data.ws.logs));
3792
- const token = wsUrl.searchParams.get("token");
3793
- if (!token || token === config.apiKey || wsUrl.protocol !== "wss:") return null;
3794
- wsUrl.pathname = `/agents/${encodeURIComponent(agentId)}/debug/logs`;
3795
- wsUrl.searchParams.set("session_id", sessionId);
3796
- return new Promise((resolve3, reject) => {
3797
- this.websocket = new WebSocket(wsUrl);
3798
- const socket = this.websocket;
3799
- const timeout = setTimeout(() => finish(null), Math.max(0, deadline - Date.now()));
3800
- let settled = false;
3801
- const finish = (result) => {
3802
- if (settled) return;
3803
- settled = true;
3804
- clearTimeout(timeout);
3805
- if (this.websocket === socket) this.websocket = null;
3806
- if (socket.readyState !== WebSocket.CLOSED) socket.terminate();
3807
- resolve3(result);
3808
- };
3809
- let counter = 0;
3810
- this.websocket.on("open", () => {
3811
- });
3812
- this.websocket.on("error", (error) => {
3813
- console.error(`Connection error: ${agentId} ${error.message}`);
3814
- finish(null);
3815
- });
3816
- this.websocket.on("message", (data) => {
3817
- try {
3818
- const message = data.toString();
3819
- let parsed;
3820
- try {
3821
- parsed = JSON.parse(message);
3822
- } catch {
3823
- return;
3824
- }
3825
- const finalStatus = parseAgentStatusMessage(parsed, agentId);
3826
- if (finalStatus) {
3827
- if (updateHandler) {
3828
- updateHandler({
3829
- type: "completion",
3830
- data: finalStatus,
3831
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
3832
- });
3833
- } else if (!finalStatus.success) {
3834
- console.error(finalStatus.answer);
3835
- }
3836
- finish(finalStatus);
3837
- return;
3838
- }
3839
- if (log) {
3840
- counter++;
3841
- if (updateHandler) {
3842
- updateHandler({
3843
- type: "step",
3844
- data: parsed,
3845
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
3846
- });
3847
- } else {
3848
- defaultStepLogger(parsed, counter, agentId);
3849
- }
3850
- }
3851
- } catch (error) {
3852
- console.error(`Error processing WebSocket message: ${error}`);
3853
- }
3854
- });
3855
- this.websocket.on("close", () => {
3856
- finish(null);
3857
- });
3858
- });
3859
- }
3860
- /**
3861
- * Get agent status - mirrors Python status method
3862
- */
3863
- async status(signal) {
3864
- if (!this.response) {
3865
- throw new Error("Agent not started or not accessible");
3866
- }
3867
- const response = await agentStatus({
3868
- client: this.client.getClient(),
3869
- signal,
3870
- path: {
3871
- agent_id: this.response.agent_id
3872
- }
3873
- });
3874
- if (response?.error) {
3875
- throw new Error(`Failed to get agent status: ${formatError(response.error)}`);
3876
- }
3877
- return response.data;
3878
- }
3879
- /**
3880
- * Stop the agent - mirrors Python stop method
3881
- */
3882
- async stop() {
3883
- if (this.existingAgent) {
3884
- throw new Error("You cannot call stop() on an agent instantiated from agent id");
3885
- }
3886
- if (!this.response) {
3887
- throw new Error("Agent not started");
3888
- }
3889
- try {
3890
- console.log(`[Agent] ${this.response.agent_id} is stopping`);
3891
- const response = await agentStop({
3892
- client: this.client.getClient(),
3893
- path: {
3894
- agent_id: this.response.agent_id
3895
- },
3896
- query: { session_id: this.response.session_id }
3897
- });
3898
- if (response?.error) {
3899
- throw new Error(`Failed to stop agent: ${formatError(response.error)}`);
3900
- }
3901
- console.log(`[Agent] ${this.response.agent_id} stopped`);
3902
- return response.data;
3903
- } catch (error) {
3904
- console.warn(`Failed to stop agent: ${error instanceof Error ? error.message : String(error)}`);
3905
- throw error;
3906
- } finally {
3907
- this.disconnectWebSocket();
3908
- }
3909
- }
3910
- /**
3911
- * Disconnect WebSocket
3912
- */
3913
- disconnectWebSocket() {
3914
- if (this.websocket) {
3915
- this.websocket.close();
3916
- this.websocket = null;
3917
- }
3918
- }
3919
- /**
3920
- * Get agent ID - mirrors Python agent_id property
3921
- */
3922
- get agentId() {
3923
- if (!this.response) {
3924
- throw new Error("You need to run the agent first to get the agent id");
3925
- }
3926
- return this.response.agent_id;
3927
- }
3928
- /**
3929
- * Get session ID - mirrors Python session_id property
3930
- */
3931
- get sessionId() {
3932
- if (!this.response) {
3933
- throw new Error("You need to run the agent first to get the session id");
3934
- }
3935
- return this.response.session_id;
3936
- }
3937
- /**
3938
- * Whether `start()`/`run()` was called on this instance (or it was built from an agent id).
3939
- * This is a local check and does not contact the API.
3940
- */
3941
- hasStarted() {
3942
- return this.response !== null;
3943
- }
3944
- /**
3945
- * Whether the agent is still active on the server. Fetches the current status,
3946
- * like calling `agent.status()` in Python; an agent that was never started is not active.
3947
- */
3948
- async isActive() {
3949
- if (!this.response) {
3950
- return false;
3951
- }
3952
- const status = await this.status();
3953
- return status.status === "active";
3954
- }
3955
- /**
3956
- * @deprecated Only reports whether this instance was started; it does not
3957
- * contact the API. Use `hasStarted()` for that check or `isActive()` for the
3958
- * live server status.
3959
- */
3960
- isRunning() {
3961
- return this.hasStarted();
3962
- }
3963
- };
3964
3964
 
3965
3965
  // src/vaults.ts
3966
3966
  import { getDomain } from "tldts";
@@ -4120,9 +4120,9 @@ var NotteVault = class {
4120
4120
  await this.delete();
4121
4121
  }
4122
4122
  /**
4123
- * Add or update the credentials stored for a website. The URL is reduced to
4124
- * its root domain (`https://github.com/login` → `github.com`) before it is
4125
- * sent, like Python's `AddCredentialsRequest`.
4123
+ * Add or update the credentials stored for a website. Values are sent as
4124
+ * supplied; the API validates credentials and reduces the URL to its root
4125
+ * domain (`https://github.com/login` → `github.com`).
4126
4126
  *
4127
4127
  * ```ts
4128
4128
  * await vault.addCredentials('https://github.com/', {
@@ -4133,13 +4133,11 @@ var NotteVault = class {
4133
4133
  * ```
4134
4134
  */
4135
4135
  async addCredentials(url, credentials) {
4136
- const domain = validateUrl(url);
4137
- validateCredentials(credentials);
4138
4136
  const vaultId = await this.ensureInitialized();
4139
4137
  await vaultCredentialsAdd({
4140
4138
  client: this.client.getClient(),
4141
4139
  path: { vault_id: vaultId },
4142
- body: { url: domain, credentials },
4140
+ body: { url, credentials },
4143
4141
  throwOnError: true
4144
4142
  });
4145
4143
  }
@@ -4153,12 +4151,11 @@ var NotteVault = class {
4153
4151
  * ```
4154
4152
  */
4155
4153
  async getCredentials(url) {
4156
- const domain = validateUrl(url);
4157
4154
  const vaultId = await this.ensureInitialized();
4158
4155
  const response = await vaultCredentialsGet({
4159
4156
  client: this.client.getClient(),
4160
4157
  path: { vault_id: vaultId },
4161
- query: { url: domain },
4158
+ query: { url },
4162
4159
  throwOnError: true
4163
4160
  });
4164
4161
  return response.data.credentials;
@@ -4186,12 +4183,11 @@ var NotteVault = class {
4186
4183
  * ```
4187
4184
  */
4188
4185
  async deleteCredentials(url) {
4189
- const domain = validateUrl(url);
4190
4186
  const vaultId = await this.ensureInitialized();
4191
4187
  await vaultCredentialsDelete({
4192
4188
  client: this.client.getClient(),
4193
4189
  path: { vault_id: vaultId },
4194
- query: { url: domain },
4190
+ query: { url },
4195
4191
  throwOnError: true
4196
4192
  });
4197
4193
  }
@@ -4236,7 +4232,7 @@ var NotteVault = class {
4236
4232
  * ```
4237
4233
  */
4238
4234
  async addCredentialsFromEnv(url) {
4239
- const rootDomain = validateUrl(url);
4235
+ const rootDomain = getRootDomain(url);
4240
4236
  const prefix = rootDomain.replace(/\./g, "_").toUpperCase();
4241
4237
  const credentials = {};
4242
4238
  const variableNames = [];
@@ -4312,6 +4308,10 @@ var NotteVault = class {
4312
4308
  };
4313
4309
 
4314
4310
  // src/personas.ts
4311
+ function withPersonaDefaults(persona) {
4312
+ if (!persona || persona.email_provider) return persona;
4313
+ return { ...persona, email_provider: "notte" };
4314
+ }
4315
4315
  var NottePersona = class {
4316
4316
  client;
4317
4317
  _initRequest;
@@ -4371,7 +4371,7 @@ var NottePersona = class {
4371
4371
  if (response?.error) {
4372
4372
  throw new Error(`Failed to get persona: ${formatError(response.error)}`);
4373
4373
  }
4374
- this.response = response.data;
4374
+ this.response = withPersonaDefaults(response.data);
4375
4375
  return this.response;
4376
4376
  }
4377
4377
  async initNewPersona(createData) {
@@ -4382,7 +4382,7 @@ var NottePersona = class {
4382
4382
  if (response?.error) {
4383
4383
  throw new Error(`Failed to create persona: ${formatError(response.error)}`);
4384
4384
  }
4385
- this.response = response.data;
4385
+ this.response = withPersonaDefaults(response.data);
4386
4386
  console.warn(
4387
4387
  `[Persona] ${this.response.persona_id} created since no persona id was provided. Please store this to retrieve it later.`
4388
4388
  );
@@ -4611,11 +4611,10 @@ async function offloadRunPayloads(client2, path, fields) {
4611
4611
  if (payload.length > MAX_PAYLOAD_BYTES) throw new Error(`Function run ${field} exceeds the payload limit`);
4612
4612
  if (payload.length <= INLINE_FIELD_BYTES) continue;
4613
4613
  const checksum = createHash("sha256").update(payload).digest("base64");
4614
- const prepared = await client2.post({
4615
- url: "/functions/{function_id}/runs/{run_id}/payloads/{field}/upload",
4614
+ const prepared = await prepareRunPayloadUpload({
4615
+ client: client2,
4616
4616
  path: { ...path, field },
4617
4617
  body: { size_bytes: payload.length, sha256: checksum },
4618
- headers: { "Content-Type": "application/json" },
4619
4618
  throwOnError: true
4620
4619
  });
4621
4620
  const upload = prepared.data;
@@ -4691,7 +4690,6 @@ var FUNCTION_RUN_ENDPOINTS = {
4691
4690
  start: "/functions/{function_id}/runs/{run_id}"
4692
4691
  };
4693
4692
  var RUN_API_KEY_HEADER = "x-notte-api-key";
4694
- var FUNCTION_RUNTIMES = ["standard", "extended"];
4695
4693
  var FUNCTION_RUN_STATUSES = ["closed", "active", "failed"];
4696
4694
  var NotteFunction = class {
4697
4695
  client;
@@ -4794,7 +4792,7 @@ var NotteFunction = class {
4794
4792
  throwOnError: true,
4795
4793
  path: { function_id: functionId },
4796
4794
  query: {
4797
- restricted: options.restricted ?? true,
4795
+ restricted: options.restricted,
4798
4796
  ...options.version !== void 0 ? { version: options.version } : {}
4799
4797
  },
4800
4798
  body: { file }
@@ -4891,7 +4889,7 @@ var NotteFunction = class {
4891
4889
  client: this.client.getClient(),
4892
4890
  throwOnError: true,
4893
4891
  path: { function_id: functionId },
4894
- query: { restricted: options.restricted ?? true },
4892
+ query: { restricted: options.restricted },
4895
4893
  body: { version: options.version }
4896
4894
  });
4897
4895
  return response.data;
@@ -4987,7 +4985,7 @@ var NotteFunction = class {
4987
4985
  client: this.client.getClient(),
4988
4986
  throwOnError: true,
4989
4987
  path: { function_id: functionId },
4990
- query: { ...options, only_active: options.only_active ?? false }
4988
+ query: options
4991
4989
  });
4992
4990
  return response.data;
4993
4991
  }
@@ -5020,9 +5018,6 @@ var NotteFunction = class {
5020
5018
  if (!(timeoutMs > 0)) {
5021
5019
  throw new InvalidRequestError("timeoutMs must be a positive number");
5022
5020
  }
5023
- if (options.runtime !== void 0 && !FUNCTION_RUNTIMES.includes(options.runtime)) {
5024
- throw new InvalidRequestError(`runtime must be one of ${FUNCTION_RUNTIMES.join(", ")}, got '${String(options.runtime)}'`);
5025
- }
5026
5021
  const functionId = await this.ensureInitialized();
5027
5022
  const functionRunId = options.functionRunId ?? (await this.createRun()).function_run_id;
5028
5023
  const body = {
@@ -5337,6 +5332,8 @@ var SessionFiles = class {
5337
5332
  this.client = client2;
5338
5333
  this.sessionId = sessionId;
5339
5334
  }
5335
+ client;
5336
+ sessionId;
5340
5337
  /**
5341
5338
  * Upload bytes as a session file. `filename` is what the browser sees when
5342
5339
  * the file is later attached to a page.
@@ -5365,7 +5362,7 @@ var SessionFiles = class {
5365
5362
  const response = await listSessionFiles({
5366
5363
  client: this.client,
5367
5364
  path: { session_id: this.sessionId },
5368
- query: { limit: options.limit ?? 100, offset: options.offset ?? 0, source: options.source },
5365
+ query: options,
5369
5366
  throwOnError: true
5370
5367
  });
5371
5368
  return response.data;
@@ -5441,6 +5438,7 @@ var RemoteFileStorage = class _RemoteFileStorage {
5441
5438
  this.client = client2;
5442
5439
  this._sessionId = sessionId ?? null;
5443
5440
  }
5441
+ client;
5444
5442
  _sessionId;
5445
5443
  /** Bind the storage to a session. Called by `Session.start()` when the storage was passed to the session. */
5446
5444
  setSessionId(sessionId) {
@@ -5774,6 +5772,7 @@ var DEFAULT_NOTTE_API_URL = "https://api.notte.cc";
5774
5772
  var DEFAULT_REQUEST_TIMEOUT_MS = 6e4;
5775
5773
  var REQUEST_ORIGIN = "sdk-node";
5776
5774
  var TIMEOUT_HEADER = "x-notte-timeout-ms";
5775
+ var MAX_RETRIES_HEADER = "x-notte-max-retries";
5777
5776
  var DB_PREVIEW_ENV = "NOTTE_DB_PREVIEW_BRANCH";
5778
5777
  var DB_PREVIEW_HEADER = "x-db-preview";
5779
5778
  var EXECUTION_ERROR_CLASS = "NotteApiExecutionError";
@@ -5796,6 +5795,10 @@ var NotteClient3 = class {
5796
5795
  if (!(timeoutMs >= 0)) {
5797
5796
  throw new InvalidRequestError("timeoutMs must be a non-negative number");
5798
5797
  }
5798
+ const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
5799
+ if (!Number.isInteger(maxRetries) || maxRetries < 0) {
5800
+ throw new InvalidRequestError("maxRetries must be a non-negative integer");
5801
+ }
5799
5802
  const isProxyMode = isRelativeProxyUrl(baseUrl);
5800
5803
  if (!isProxyMode) {
5801
5804
  const url = new URL(baseUrl);
@@ -5811,7 +5814,15 @@ var NotteClient3 = class {
5811
5814
  "NOTTE_API_KEY needs to be provided. Pass config.apiKey or set the NOTTE_API_KEY environment variable."
5812
5815
  );
5813
5816
  }
5814
- this.config = { baseUrl, apiKey, timeoutMs, captchaTimeoutSeconds, dbPreview, verbose: config.verbose ?? false };
5817
+ this.config = {
5818
+ baseUrl,
5819
+ apiKey,
5820
+ timeoutMs,
5821
+ captchaTimeoutSeconds,
5822
+ dbPreview,
5823
+ maxRetries,
5824
+ verbose: config.verbose ?? false
5825
+ };
5815
5826
  if (baseUrl !== DEFAULT_NOTTE_API_URL && !isProxyMode) {
5816
5827
  console.warn(`NOTTE_API_URL is set to: ${baseUrl}`);
5817
5828
  }
@@ -5820,7 +5831,7 @@ var NotteClient3 = class {
5820
5831
  redirect: "manual",
5821
5832
  throwOnError: true
5822
5833
  });
5823
- this.client.interceptors.request.use((request) => {
5834
+ this.client.interceptors.request.use((request, opts) => {
5824
5835
  const headers = new Headers(request.headers);
5825
5836
  if (this.config.apiKey) headers.set("Authorization", `Bearer ${this.config.apiKey}`);
5826
5837
  headers.set("x-notte-request-origin", REQUEST_ORIGIN);
@@ -5828,16 +5839,25 @@ var NotteClient3 = class {
5828
5839
  if (this.config.dbPreview) headers.set(DB_PREVIEW_HEADER, this.config.dbPreview);
5829
5840
  const override = headers.get(TIMEOUT_HEADER);
5830
5841
  headers.delete(TIMEOUT_HEADER);
5842
+ const retriesOverride = headers.get(MAX_RETRIES_HEADER);
5843
+ headers.delete(MAX_RETRIES_HEADER);
5831
5844
  const timeoutMs2 = override !== null ? Number(override) : this.config.timeoutMs;
5832
5845
  if (this.config.verbose) {
5833
5846
  console.info(`Making \`${request.method}\` request to \`${request.url}\``);
5834
5847
  }
5835
- if (!(timeoutMs2 > 0)) {
5836
- return new Request(request, { headers });
5837
- }
5838
- const deadline = withTimeout(request.signal, timeoutMs2);
5839
- const timed = new Request(request, { headers, signal: deadline.signal });
5840
- pendingDeadlines.set(timed, deadline.release);
5848
+ const callerSignal = opts.signal ?? request.signal;
5849
+ const deadline = timeoutMs2 > 0 ? withTimeout(callerSignal, timeoutMs2) : void 0;
5850
+ const signal = deadline?.signal ?? callerSignal;
5851
+ const timed = new Request(request, { headers, signal });
5852
+ pendingRequests.set(timed, { signal, release: deadline?.release ?? (() => void 0), expiresAt: deadline?.expiresAt ?? Infinity });
5853
+ const transport = originalTransports.get(opts) ?? opts.fetch ?? globalThis.fetch;
5854
+ originalTransports.set(opts, transport);
5855
+ const retrying = createRetryingFetch({
5856
+ fetch: transport,
5857
+ maxRetries: () => retriesOverride !== null ? Number(retriesOverride) : this.config.maxRetries,
5858
+ deadline: () => deadline?.expiresAt
5859
+ });
5860
+ opts.fetch = (input, init) => retrying(input, { ...init, signal });
5841
5861
  return timed;
5842
5862
  });
5843
5863
  this.client.interceptors.response.use(async (response, request, opts) => {
@@ -5875,7 +5895,7 @@ var NotteClient3 = class {
5875
5895
  method: request.method,
5876
5896
  headers: headerRecord,
5877
5897
  body: opts.serializedBody ?? void 0,
5878
- signal: request.signal,
5898
+ signal: requestSignal(request),
5879
5899
  redirect: "manual"
5880
5900
  });
5881
5901
  currentUrl = location;
@@ -5923,14 +5943,15 @@ var NotteClient3 = class {
5923
5943
  if (error instanceof NotteAPIError) {
5924
5944
  return error;
5925
5945
  }
5926
- if (request?.signal.aborted) {
5927
- error = request.signal.reason ?? error;
5946
+ const signal = request && requestSignal(request);
5947
+ if (signal?.aborted) {
5948
+ error = signal.reason ?? error;
5928
5949
  }
5929
5950
  if (isTimeoutAbort(error)) {
5930
5951
  const target = request ? ` to \`${requestPath(request)}\`` : "";
5931
5952
  return new NotteTimeoutError(`Request${target} ${error.message}`, { cause: error });
5932
5953
  }
5933
- if (request?.signal.aborted) return error;
5954
+ if (signal?.aborted) return error;
5934
5955
  if (response) {
5935
5956
  const path = requestPath(request, response);
5936
5957
  const body = normalizeErrorBody(error);
@@ -5980,6 +6001,10 @@ var NotteClient3 = class {
5980
6001
  Session(options = {}) {
5981
6002
  return new Session(this, options);
5982
6003
  }
6004
+ /** Generated file operations; use Files(sessionId) for local file IO helpers. */
6005
+ get files() {
6006
+ return this.resources.files;
6007
+ }
5983
6008
  /** Access files owned by a specific session, including closed sessions. */
5984
6009
  Files(sessionId) {
5985
6010
  return new SessionFiles(this.getClient(), sessionId);
@@ -5998,12 +6023,6 @@ var NotteClient3 = class {
5998
6023
  FileStorage(sessionId) {
5999
6024
  return new RemoteFileStorage(this, sessionId);
6000
6025
  }
6001
- /**
6002
- * Create a new agent
6003
- */
6004
- Agent(options) {
6005
- return new Agent(this, options);
6006
- }
6007
6026
  /**
6008
6027
  * Create or access a vault
6009
6028
  */
@@ -6036,16 +6055,6 @@ var NotteClient3 = class {
6036
6055
  }
6037
6056
  };
6038
6057
  }
6039
- /** Client-bound agent API operations. `list()` retains its array return value. */
6040
- get agents() {
6041
- return {
6042
- ...this.resources.agents,
6043
- list: async (options = {}) => {
6044
- const response = await listAgents({ client: this.getClient(), query: options });
6045
- return response.data?.items ?? [];
6046
- }
6047
- };
6048
- }
6049
6058
  /** Client-bound vault API operations. `list()` retains its array return value. */
6050
6059
  get vaults() {
6051
6060
  return {
@@ -6094,14 +6103,18 @@ var NotteClient3 = class {
6094
6103
  * Personas client for listing and managing personas
6095
6104
  */
6096
6105
  get personas() {
6106
+ const personas = this.resources.personas;
6097
6107
  return {
6098
- ...this.resources.personas,
6108
+ ...personas,
6109
+ create: async (...args) => withPersonaDefaults(await personas.create(...args)),
6110
+ get: async (...args) => withPersonaDefaults(await personas.get(...args)),
6111
+ update: async (...args) => withPersonaDefaults(await personas.update(...args)),
6099
6112
  list: async (options) => {
6100
6113
  const response = await listPersonas({
6101
6114
  client: this.getClient(),
6102
6115
  query: options || {}
6103
6116
  });
6104
- return response.data?.items || [];
6117
+ return (response.data?.items || []).map(withPersonaDefaults);
6105
6118
  }
6106
6119
  };
6107
6120
  }
@@ -6147,18 +6160,18 @@ function isTimeoutAbort(error) {
6147
6160
  function timeoutReason(timeoutMs) {
6148
6161
  return new DOMException(`timed out after ${timeoutMs}ms`, "TimeoutError");
6149
6162
  }
6150
- var pendingDeadlines = /* @__PURE__ */ new WeakMap();
6163
+ var pendingRequests = /* @__PURE__ */ new WeakMap();
6164
+ var originalTransports = /* @__PURE__ */ new WeakMap();
6165
+ function requestSignal(request) {
6166
+ return pendingRequests.get(request)?.signal ?? request.signal;
6167
+ }
6151
6168
  function releaseDeadline(request) {
6152
- if (!request) return;
6153
- const release = pendingDeadlines.get(request);
6154
- if (release) {
6155
- pendingDeadlines.delete(request);
6156
- release();
6157
- }
6169
+ if (request) pendingRequests.get(request)?.release();
6158
6170
  }
6159
6171
  function withTimeout(signal, timeoutMs) {
6160
6172
  const controller = new AbortController();
6161
6173
  const timer = setTimeout(() => controller.abort(timeoutReason(timeoutMs)), timeoutMs);
6174
+ const expiresAt = Date.now() + timeoutMs;
6162
6175
  timer.unref?.();
6163
6176
  let detach = () => void 0;
6164
6177
  let composite;
@@ -6185,7 +6198,7 @@ function withTimeout(signal, timeoutMs) {
6185
6198
  detach();
6186
6199
  };
6187
6200
  composite.addEventListener("abort", release, { once: true });
6188
- return { signal: composite, release };
6201
+ return { signal: composite, release, expiresAt };
6189
6202
  }
6190
6203
 
6191
6204
  // src/actions.ts
@@ -6278,11 +6291,11 @@ var createClient2 = (config) => {
6278
6291
  };
6279
6292
  export {
6280
6293
  ActionExecutionError,
6281
- Agent,
6282
6294
  AuthenticationError,
6283
6295
  CAPTCHA_SOLVE_TIMEOUT_MS,
6284
6296
  CLUSTER_OVERLOAD_RETRY_DELAY_MS,
6285
6297
  CREDENTIAL_FIELDS,
6298
+ DEFAULT_MAX_RETRIES,
6286
6299
  DEFAULT_NOTTE_API_URL,
6287
6300
  DEFAULT_REQUEST_TIMEOUT_MS,
6288
6301
  Encryption,
@@ -6317,12 +6330,17 @@ export {
6317
6330
  Session,
6318
6331
  SessionFiles,
6319
6332
  TIMEOUT_HEADER,
6333
+ accountChanges,
6334
+ accountRuns,
6320
6335
  actions,
6321
6336
  agentStart,
6322
6337
  agentStatus,
6323
6338
  agentStop,
6324
6339
  anythingStart,
6340
+ attempts,
6341
+ brandRetrieve,
6325
6342
  buildFetchScript,
6343
+ changes,
6326
6344
  checkForLatestVersion,
6327
6345
  client,
6328
6346
  connectLinkContext,
@@ -6332,15 +6350,23 @@ export {
6332
6350
  connectLinkStatus,
6333
6351
  connectLinkSubmit,
6334
6352
  connectPaymentWallet,
6353
+ create,
6335
6354
  createClient2 as createClient,
6336
6355
  createOrAppendCookiesToFile,
6337
6356
  createPayment,
6357
+ creditUsage,
6338
6358
  NotteClient3 as default,
6339
6359
  deleteSecret,
6340
6360
  deleteSessionFile,
6361
+ delete_,
6362
+ deliveries,
6363
+ detail,
6341
6364
  disconnectPaymentWallet,
6342
6365
  downloadRunPayload,
6343
6366
  downloadSessionFile,
6367
+ executeSessionFile,
6368
+ extractProductEndpoint,
6369
+ fetchSpecializedData,
6344
6370
  functionCreate,
6345
6371
  functionDelete,
6346
6372
  functionDownloadUrl,
@@ -6356,6 +6382,7 @@ export {
6356
6382
  functionScheduleSet,
6357
6383
  functionUpdate,
6358
6384
  getPayment,
6385
+ getPolicy,
6359
6386
  getRootDomain,
6360
6387
  getScript,
6361
6388
  getSecret,
@@ -6363,13 +6390,18 @@ export {
6363
6390
  getUsage,
6364
6391
  getUsageLogs,
6365
6392
  healthCheck,
6393
+ history_,
6366
6394
  installServerOwnedDialogPolicy,
6395
+ invalidate,
6367
6396
  isCaptchaSolveAction,
6368
6397
  isValidMfaSecret,
6398
+ limits,
6369
6399
  listAgents,
6370
6400
  listAuditEvents,
6401
+ listDataApis,
6371
6402
  listFunctionRunsByFunctionId,
6372
6403
  listFunctions,
6404
+ listMonitors,
6373
6405
  listPersonas,
6374
6406
  listSecrets,
6375
6407
  listSessionFiles,
@@ -6382,19 +6414,20 @@ export {
6382
6414
  mailboxSync,
6383
6415
  mailboxUpdate,
6384
6416
  managedAuthConnectLinkCreate,
6417
+ mapsSearch,
6418
+ newsSearch,
6385
6419
  observeServerOwnedDialog,
6386
6420
  pageExecute,
6387
6421
  pageObserve,
6388
6422
  pageScrape,
6389
6423
  pageScreenshot,
6390
- parseAgentStatusMessage,
6424
+ peopleEnrich,
6391
6425
  personaCreate,
6392
6426
  personaDelete,
6393
6427
  personaEmailsList,
6394
6428
  personaGet,
6395
6429
  personaSmsList,
6396
6430
  personaUpdate,
6397
- prepareAgentRequest,
6398
6431
  prepareRunPayloadUpload,
6399
6432
  processScrapeResponse,
6400
6433
  profileCookiesGet,
@@ -6404,18 +6437,29 @@ export {
6404
6437
  profileDuplicate,
6405
6438
  profileGet,
6406
6439
  profileList,
6440
+ profileStateSet,
6407
6441
  readCookiesFile,
6408
6442
  readyCheck,
6409
6443
  responseFromEvaluated,
6410
- retry,
6444
+ retrieve,
6445
+ retrieveChange,
6446
+ retrieveDelivery,
6447
+ retrieveRun,
6448
+ retry2 as retry,
6449
+ retry as retryWebhookDelivery,
6450
+ rotateSecret,
6451
+ runNow,
6452
+ runs,
6411
6453
  sanitizeFilename,
6412
6454
  scrapeFromHtml,
6455
+ fetchSpecializedData as scrapeSpecializedData,
6413
6456
  scrapeWebpage,
6414
6457
  searchWeb,
6415
6458
  sessionAuthReadiness,
6416
6459
  sessionCookiesGet,
6417
6460
  sessionCookiesSet,
6418
6461
  sessionDebugInfo,
6462
+ sessionMouseReplay,
6419
6463
  sessionNetworkLogs,
6420
6464
  sessionOffset,
6421
6465
  sessionProfilePreview,
@@ -6426,6 +6470,9 @@ export {
6426
6470
  sessionStop,
6427
6471
  startVersionCheck,
6428
6472
  storeSecret,
6473
+ styleguideEndpoint,
6474
+ summary,
6475
+ update,
6429
6476
  uploadSessionFile,
6430
6477
  validateCredentials,
6431
6478
  validateMfaSecret,
@@ -6439,6 +6486,7 @@ export {
6439
6486
  vaultCreditCardGet,
6440
6487
  vaultCreditCardSet,
6441
6488
  vaultDelete,
6442
- vaultUpdate
6489
+ vaultUpdate,
6490
+ youtubeEndpoint
6443
6491
  };
6444
6492
  //# sourceMappingURL=index.mjs.map