notte-sdk 1.9.6 → 1.10.0

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.6" : "dev";
2
+ var SDK_VERSION = true ? "1.10.0" : "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) => {
@@ -961,10 +966,14 @@ var sessionProfilePreview = (options) => (options.client ?? client).get({
961
966
  url: "/sessions/{session_id}/profile-preview",
962
967
  ...options
963
968
  });
964
- var getSessionScript = (options) => (options.client ?? client).get({
969
+ var sessionProfileSave = (options) => (options.client ?? client).post({
965
970
  security: [{ scheme: "bearer", type: "http" }],
966
- url: "/sessions/{session_id}/workflow/code",
967
- ...options
971
+ url: "/sessions/{session_id}/profile/save",
972
+ ...options,
973
+ headers: {
974
+ "Content-Type": "application/json",
975
+ ...options.headers
976
+ }
968
977
  });
969
978
  var sessionStop = (options) => (options.client ?? client).delete({
970
979
  security: [{ scheme: "bearer", type: "http" }],
@@ -1032,11 +1041,25 @@ var sessionNetworkLogs = (options) => (options.client ?? client).get({
1032
1041
  url: "/sessions/{session_id}/network/logs",
1033
1042
  ...options
1034
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
+ });
1035
1049
  var sessionReplay = (options) => (options.client ?? client).get({
1036
1050
  security: [{ scheme: "bearer", type: "http" }],
1037
1051
  url: "/sessions/{session_id}/replay",
1038
1052
  ...options
1039
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
+ });
1040
1063
  var listSessionFiles = (options) => (options.client ?? client).get({
1041
1064
  security: [{ scheme: "bearer", type: "http" }],
1042
1065
  url: "/sessions/{session_id}/files",
@@ -1062,35 +1085,6 @@ var downloadSessionFile = (options) => (options.client ?? client).get({
1062
1085
  url: "/sessions/{session_id}/files/{file_id}",
1063
1086
  ...options
1064
1087
  });
1065
- var agentStart = (options) => (options.client ?? client).post({
1066
- security: [{ scheme: "bearer", type: "http" }],
1067
- url: "/agents/start",
1068
- ...options,
1069
- headers: {
1070
- "Content-Type": "application/json",
1071
- ...options.headers
1072
- }
1073
- });
1074
- var agentStatus = (options) => (options.client ?? client).get({
1075
- security: [{ scheme: "bearer", type: "http" }],
1076
- url: "/agents/{agent_id}",
1077
- ...options
1078
- });
1079
- var getScript = (options) => (options.client ?? client).get({
1080
- security: [{ scheme: "bearer", type: "http" }],
1081
- url: "/agents/{agent_id}/workflow/code",
1082
- ...options
1083
- });
1084
- var agentStop = (options) => (options.client ?? client).delete({
1085
- security: [{ scheme: "bearer", type: "http" }],
1086
- url: "/agents/{agent_id}/stop",
1087
- ...options
1088
- });
1089
- var listAgents = (options) => (options?.client ?? client).get({
1090
- security: [{ scheme: "bearer", type: "http" }],
1091
- url: "/agents",
1092
- ...options
1093
- });
1094
1088
  var functionRuntimeHealth = (options) => (options?.client ?? client).get({
1095
1089
  security: [{ scheme: "bearer", type: "http" }],
1096
1090
  url: "/functions/health",
@@ -1360,6 +1354,15 @@ var profileCookiesSet = (options) => (options.client ?? client).post({
1360
1354
  ...options.headers
1361
1355
  }
1362
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
+ });
1363
1366
  var profileList = (options) => (options?.client ?? client).get({
1364
1367
  security: [{ scheme: "bearer", type: "http" }],
1365
1368
  url: "/profiles",
@@ -1486,24 +1489,6 @@ var connectLinkSubmit = (options) => (options.client ?? client).post({
1486
1489
  }
1487
1490
  });
1488
1491
  var connectLinkStatus = (options) => (options.client ?? client).get({ url: "/managed-auth/connect-links/status", ...options });
1489
- var improvePrompt = (options) => (options.client ?? client).post({
1490
- security: [{ scheme: "bearer", type: "http" }],
1491
- url: "/prompts/improve",
1492
- ...options,
1493
- headers: {
1494
- "Content-Type": "application/json",
1495
- ...options.headers
1496
- }
1497
- });
1498
- var nudgePrompt = (options) => (options.client ?? client).post({
1499
- security: [{ scheme: "bearer", type: "http" }],
1500
- url: "/prompts/nudge",
1501
- ...options,
1502
- headers: {
1503
- "Content-Type": "application/json",
1504
- ...options.headers
1505
- }
1506
- });
1507
1492
  var getUsage = (options) => (options?.client ?? client).get({
1508
1493
  security: [{ scheme: "bearer", type: "http" }],
1509
1494
  url: "/usage",
@@ -1547,6 +1532,11 @@ var deleteSecret = (options) => (options.client ?? client).delete({
1547
1532
  url: "/secrets/{secret_id}",
1548
1533
  ...options
1549
1534
  });
1535
+ var listAuditEvents = (options) => (options?.client ?? client).get({
1536
+ security: [{ scheme: "bearer", type: "http" }],
1537
+ url: "/audit-events",
1538
+ ...options
1539
+ });
1550
1540
  var healthCheck = (options) => (options?.client ?? client).get({ url: "/health", ...options });
1551
1541
  var readyCheck = (options) => (options?.client ?? client).get({ url: "/ready", ...options });
1552
1542
  var scrapeWebpage = (options) => (options.client ?? client).post({
@@ -1567,6 +1557,215 @@ var searchWeb = (options) => (options.client ?? client).post({
1567
1557
  ...options.headers
1568
1558
  }
1569
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
+ });
1570
1769
  var scrapeFromHtml = (options) => (options.client ?? client).post({
1571
1770
  security: [{ scheme: "bearer", type: "http" }],
1572
1771
  url: "/scrape_from_html",
@@ -1576,6 +1775,40 @@ var scrapeFromHtml = (options) => (options.client ?? client).post({
1576
1775
  ...options.headers
1577
1776
  }
1578
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
+ });
1579
1812
 
1580
1813
  // src/managed-auth.ts
1581
1814
  import { setTimeout as delay } from "timers/promises";
@@ -1660,14 +1893,14 @@ var ActionExecutionError = class _ActionExecutionError extends NotteError {
1660
1893
  agentMessage;
1661
1894
  shouldRetryLater;
1662
1895
  shouldNotifyTeam;
1663
- constructor(detail) {
1664
- super(detail.dev_message || detail.user_message || detail.error_type);
1665
- this.errorType = detail.error_type;
1666
- this.devMessage = detail.dev_message;
1667
- this.userMessage = detail.user_message;
1668
- this.agentMessage = detail.agent_message;
1669
- this.shouldRetryLater = detail.should_retry_later ?? false;
1670
- 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;
1671
1904
  }
1672
1905
  static fromMessage(message, errorType = "NotteBaseError") {
1673
1906
  return new _ActionExecutionError({
@@ -1698,7 +1931,7 @@ function normalizeErrorBody(body) {
1698
1931
  return { message: typeof body === "string" ? body : String(body) };
1699
1932
  }
1700
1933
  var DEFAULT_RETRY_MESSAGE = "An error occurred while executing the function. Try again later...";
1701
- function retry(fn, options) {
1934
+ function retry2(fn, options) {
1702
1935
  const {
1703
1936
  maxTries,
1704
1937
  delayMs = 5e3,
@@ -1735,11 +1968,6 @@ function sleep(ms) {
1735
1968
  // src/managed-auth.ts
1736
1969
  var ManagedAuthError = class extends NotteError {
1737
1970
  };
1738
- function validateAuthRetry(value) {
1739
- if (!Number.isInteger(value) || value < 0 || value > 2) {
1740
- throw new InvalidRequestError("auth_retry must be an integer between 0 and 2");
1741
- }
1742
- }
1743
1971
  async function pollAuth(read, options) {
1744
1972
  const timeoutMs = options.timeoutMs ?? 615e3;
1745
1973
  const interval = options.pollIntervalMs ?? 1e3;
@@ -1820,12 +2048,10 @@ var NotteManagedAuth = class {
1820
2048
  return this.run(connectionId, "reauthenticate", options);
1821
2049
  }
1822
2050
  async run(connectionId, action, options) {
1823
- const authRetry = options.auth_retry ?? 0;
1824
- validateAuthRetry(authRetry);
1825
2051
  options.signal?.throwIfAborted();
1826
2052
  const response = await this.client.getClient().post({
1827
2053
  url: `/managed-auth/connections/${encodeURIComponent(connectionId)}/${action}`,
1828
- body: { auth_retry: authRetry },
2054
+ body: { auth_retry: options.auth_retry },
1829
2055
  headers: { "Content-Type": "application/json" },
1830
2056
  signal: options.signal,
1831
2057
  throwOnError: true
@@ -1860,7 +2086,7 @@ function createResources(client2, getApiKey) {
1860
2086
  },
1861
2087
  /** downloadSessionFile: /sessions/{session_id}/files/{file_id}. Returns the API response body. */
1862
2088
  downloadSessionFile: async (sessionId, fileId, requestOptions = {}) => {
1863
- const response = await downloadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
2089
+ const response = await downloadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, parseAs: "blob", headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
1864
2090
  return response.data;
1865
2091
  },
1866
2092
  /** pageExecute: /sessions/{session_id}/page/execute. Returns the API response body. */
@@ -1868,6 +2094,11 @@ function createResources(client2, getApiKey) {
1868
2094
  const response = await pageExecute({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
1869
2095
  return response.data;
1870
2096
  },
2097
+ /** executeSessionFile: /sessions/{session_id}/page/execute/file. Returns the API response body. */
2098
+ executeSessionFile: async (sessionId, body, query = void 0, requestOptions = {}) => {
2099
+ const response = await executeSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
2100
+ return response.data;
2101
+ },
1871
2102
  /** sessionCookiesGet: /sessions/{session_id}/cookies. Returns the API response body. */
1872
2103
  getCookies: async (sessionId, query = void 0, requestOptions = {}) => {
1873
2104
  const response = await sessionCookiesGet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
@@ -1888,6 +2119,11 @@ function createResources(client2, getApiKey) {
1888
2119
  const response = await listSessionFiles({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
1889
2120
  return response.data;
1890
2121
  },
2122
+ /** sessionMouseReplay: /sessions/{session_id}/replay/mouse. Returns the API response body. */
2123
+ mouseReplay: async (sessionId, query = void 0, requestOptions = {}) => {
2124
+ const response = await sessionMouseReplay({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
2125
+ return response.data;
2126
+ },
1891
2127
  /** sessionNetworkLogs: /sessions/{session_id}/network/logs. Returns the API response body. */
1892
2128
  networkLogs: async (sessionId, query = void 0, requestOptions = {}) => {
1893
2129
  const response = await sessionNetworkLogs({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
@@ -1918,6 +2154,11 @@ function createResources(client2, getApiKey) {
1918
2154
  const response = await sessionReplay({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId } });
1919
2155
  return response.data;
1920
2156
  },
2157
+ /** sessionProfileSave: /sessions/{session_id}/profile/save. Returns the API response body. */
2158
+ saveProfile: async (sessionId, body, requestOptions = {}) => {
2159
+ const response = await sessionProfileSave({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body });
2160
+ return response.data;
2161
+ },
1921
2162
  /** pageScrape: /sessions/{session_id}/page/scrape. Returns the API response body. */
1922
2163
  scrape: async (sessionId, body, query = void 0, requestOptions = {}) => {
1923
2164
  const response = await pageScrape({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
@@ -1949,30 +2190,30 @@ function createResources(client2, getApiKey) {
1949
2190
  return response.data;
1950
2191
  }
1951
2192
  },
1952
- agents: {
1953
- /** getScript: /agents/{agent_id}/workflow/code. Returns the API response body. */
1954
- getScript: async (agentId, query, requestOptions = {}) => {
1955
- const response = await getScript({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "agent_id": agentId }, query });
2193
+ files: {
2194
+ /** deleteSessionFile: /sessions/{session_id}/files/{file_id}. Returns the API response body. */
2195
+ delete: async (sessionId, fileId, requestOptions = {}) => {
2196
+ const response = await deleteSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
1956
2197
  return response.data;
1957
2198
  },
1958
- /** listAgents: /agents. Returns the API response body. */
1959
- list: async (query = void 0, requestOptions = {}) => {
1960
- const response = await listAgents({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2199
+ /** downloadSessionFile: /sessions/{session_id}/files/{file_id}. Returns the API response body. */
2200
+ download: async (sessionId, fileId, requestOptions = {}) => {
2201
+ const response = await downloadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, parseAs: "blob", headers: { ...requestOptions.headers }, path: { "session_id": sessionId, "file_id": fileId } });
1961
2202
  return response.data;
1962
2203
  },
1963
- /** agentStart: /agents/start. Returns the API response body. */
1964
- start: async (body, requestOptions = {}) => {
1965
- const response = await agentStart({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2204
+ /** executeSessionFile: /sessions/{session_id}/page/execute/file. Returns the API response body. */
2205
+ execute: async (sessionId, body, query = void 0, requestOptions = {}) => {
2206
+ const response = await executeSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
1966
2207
  return response.data;
1967
2208
  },
1968
- /** agentStatus: /agents/{agent_id}. Returns the API response body. */
1969
- status: async (agentId, requestOptions = {}) => {
1970
- const response = await agentStatus({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "agent_id": agentId } });
2209
+ /** listSessionFiles: /sessions/{session_id}/files. Returns the API response body. */
2210
+ list: async (sessionId, query = void 0, requestOptions = {}) => {
2211
+ const response = await listSessionFiles({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, query });
1971
2212
  return response.data;
1972
2213
  },
1973
- /** agentStop: /agents/{agent_id}/stop. Returns the API response body. */
1974
- stop: async (agentId, query, requestOptions = {}) => {
1975
- const response = await agentStop({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "agent_id": agentId }, query });
2214
+ /** uploadSessionFile: /sessions/{session_id}/files. Returns the API response body. */
2215
+ upload: async (sessionId, body, requestOptions = {}) => {
2216
+ const response = await uploadSessionFile({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body });
1976
2217
  return response.data;
1977
2218
  }
1978
2219
  },
@@ -2053,8 +2294,8 @@ function createResources(client2, getApiKey) {
2053
2294
  return response.data;
2054
2295
  },
2055
2296
  /** functionRuntimeHealth: /functions/health. Returns the API response body. */
2056
- runtimeHealth: async (requestOptions = {}) => {
2057
- const response = await functionRuntimeHealth({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers } });
2297
+ runtimeHealth: async (requestOptions = {}, query = void 0) => {
2298
+ const response = await functionRuntimeHealth({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2058
2299
  return response.data;
2059
2300
  },
2060
2301
  /** functionScheduleSet: /functions/{function_id}/schedule. Returns the API response body. */
@@ -2068,6 +2309,43 @@ function createResources(client2, getApiKey) {
2068
2309
  return response.data;
2069
2310
  }
2070
2311
  },
2312
+ personas: {
2313
+ /** personaCreate: /personas/create. Returns the API response body. */
2314
+ create: async (body, requestOptions = {}) => {
2315
+ const response = await personaCreate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2316
+ return response.data;
2317
+ },
2318
+ /** personaDelete: /personas/{persona_id}. Returns the API response body. */
2319
+ delete: async (personaId, requestOptions = {}) => {
2320
+ const response = await personaDelete({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2321
+ return response.data;
2322
+ },
2323
+ /** personaEmailsList: /personas/{persona_id}/emails. Returns the API response body. */
2324
+ emailsList: async (personaId, query = void 0, requestOptions = {}) => {
2325
+ const response = await personaEmailsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2326
+ return response.data;
2327
+ },
2328
+ /** personaGet: /personas/{persona_id}. Returns the API response body. */
2329
+ get: async (personaId, requestOptions = {}) => {
2330
+ const response = await personaGet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2331
+ return response.data;
2332
+ },
2333
+ /** listPersonas: /personas. Returns the API response body. */
2334
+ list: async (query = void 0, requestOptions = {}) => {
2335
+ const response = await listPersonas({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2336
+ return response.data;
2337
+ },
2338
+ /** personaSmsList: /personas/{persona_id}/sms. Returns the API response body. */
2339
+ smsList: async (personaId, query = void 0, requestOptions = {}) => {
2340
+ const response = await personaSmsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2341
+ return response.data;
2342
+ },
2343
+ /** personaUpdate: /personas/{persona_id}. Returns the API response body. */
2344
+ update: async (personaId, body, requestOptions = {}) => {
2345
+ const response = await personaUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, body });
2346
+ return response.data;
2347
+ }
2348
+ },
2071
2349
  vaults: {
2072
2350
  /** vaultCreate: /vaults/create. Returns the API response body. */
2073
2351
  create: async (body, requestOptions = {}) => {
@@ -2118,47 +2396,10 @@ function createResources(client2, getApiKey) {
2118
2396
  list: async (query = void 0, requestOptions = {}) => {
2119
2397
  const response = await listVaults({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2120
2398
  return response.data;
2121
- },
2122
- /** vaultUpdate: /vaults/{vault_id}. Returns the API response body. */
2123
- update: async (vaultId, body, requestOptions = {}) => {
2124
- const response = await vaultUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "vault_id": vaultId }, body });
2125
- return response.data;
2126
- }
2127
- },
2128
- personas: {
2129
- /** personaCreate: /personas/create. Returns the API response body. */
2130
- create: async (body, requestOptions = {}) => {
2131
- const response = await personaCreate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2132
- return response.data;
2133
- },
2134
- /** personaDelete: /personas/{persona_id}. Returns the API response body. */
2135
- delete: async (personaId, requestOptions = {}) => {
2136
- const response = await personaDelete({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2137
- return response.data;
2138
- },
2139
- /** personaEmailsList: /personas/{persona_id}/emails. Returns the API response body. */
2140
- emailsList: async (personaId, query = void 0, requestOptions = {}) => {
2141
- const response = await personaEmailsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2142
- return response.data;
2143
- },
2144
- /** personaGet: /personas/{persona_id}. Returns the API response body. */
2145
- get: async (personaId, requestOptions = {}) => {
2146
- const response = await personaGet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId } });
2147
- return response.data;
2148
- },
2149
- /** listPersonas: /personas. Returns the API response body. */
2150
- list: async (query = void 0, requestOptions = {}) => {
2151
- const response = await listPersonas({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2152
- return response.data;
2153
- },
2154
- /** personaSmsList: /personas/{persona_id}/sms. Returns the API response body. */
2155
- smsList: async (personaId, query = void 0, requestOptions = {}) => {
2156
- const response = await personaSmsList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, query });
2157
- return response.data;
2158
- },
2159
- /** personaUpdate: /personas/{persona_id}. Returns the API response body. */
2160
- update: async (personaId, body, requestOptions = {}) => {
2161
- const response = await personaUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "persona_id": personaId }, body });
2399
+ },
2400
+ /** vaultUpdate: /vaults/{vault_id}. Returns the API response body. */
2401
+ update: async (vaultId, body, requestOptions = {}) => {
2402
+ const response = await vaultUpdate({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "vault_id": vaultId }, body });
2162
2403
  return response.data;
2163
2404
  }
2164
2405
  },
@@ -2197,6 +2438,11 @@ function createResources(client2, getApiKey) {
2197
2438
  list: async (query = void 0, requestOptions = {}) => {
2198
2439
  const response = await profileList({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, query });
2199
2440
  return response.data;
2441
+ },
2442
+ /** profileStateSet: /profiles/{profile_id}/state. Returns the API response body. */
2443
+ stateSet: async (profileId, body, requestOptions = {}) => {
2444
+ const response = await profileStateSet({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "profile_id": profileId }, body });
2445
+ return response.data;
2200
2446
  }
2201
2447
  }
2202
2448
  };
@@ -2561,10 +2807,16 @@ async function createOrAppendCookiesToFile(cookieFile, cookies) {
2561
2807
  throw error;
2562
2808
  }
2563
2809
  }
2564
- existing.push(...cookies);
2565
- await writeFile(cookieFile, JSON.stringify(existing), "utf-8");
2810
+ const merged = /* @__PURE__ */ new Map();
2811
+ for (const cookie of [...existing, ...cookies]) {
2812
+ merged.set(cookieIdentity(cookie), cookie);
2813
+ }
2814
+ await writeFile(cookieFile, JSON.stringify([...merged.values()]), "utf-8");
2566
2815
  });
2567
2816
  }
2817
+ function cookieIdentity(cookie) {
2818
+ return JSON.stringify([cookie.name, cookie.domain ?? null, cookie.path ?? null, cookie.partitionKey ?? null]);
2819
+ }
2568
2820
  var fileLocks = /* @__PURE__ */ new Map();
2569
2821
  async function withFileLock(path, fn) {
2570
2822
  const key = resolve(path);
@@ -2723,8 +2975,8 @@ async function buildScrapeBody(options) {
2723
2975
  if (json_schema) {
2724
2976
  body.response_format = json_schema;
2725
2977
  } else {
2726
- const { z: z2 } = await import("zod");
2727
- body.response_format = normalizeJsonSchema(z2.toJSONSchema(response_format));
2978
+ const { z } = await import("zod");
2979
+ body.response_format = normalizeJsonSchema(z.toJSONSchema(response_format));
2728
2980
  }
2729
2981
  } else if (response_format) {
2730
2982
  body.response_format = response_format;
@@ -2736,9 +2988,6 @@ function processScrapeResponse(scrapeResponse, options) {
2736
2988
  throw new ScrapeFailedError("empty response");
2737
2989
  }
2738
2990
  const raiseOnFailure = options.raiseOnFailure ?? true;
2739
- if (options.only_images) {
2740
- return scrapeResponse.images ?? [];
2741
- }
2742
2991
  if (requiresSchema(options)) {
2743
2992
  const structured = scrapeResponse.structured;
2744
2993
  if (!structured) {
@@ -2761,10 +3010,126 @@ function processScrapeResponse(scrapeResponse, options) {
2761
3010
  return scrapeResponse.markdown;
2762
3011
  }
2763
3012
 
3013
+ // src/retry.ts
3014
+ var DEFAULT_MAX_RETRIES = 3;
3015
+ var RETRY_BASE_DELAY_MS = 1e3;
3016
+ var RETRY_MAX_DELAY_MS = 1e4;
3017
+ var RETRY_AFTER_MAX_MS = 2e4;
3018
+ var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS", "PUT", "DELETE"]);
3019
+ var REFUSED_STATUSES = /* @__PURE__ */ new Set([503, 529]);
3020
+ var GATEWAY_STATUSES = /* @__PURE__ */ new Set([502, 504]);
3021
+ var NOT_SENT_ERROR_CODES = /* @__PURE__ */ new Set([
3022
+ "ECONNREFUSED",
3023
+ "EAI_AGAIN",
3024
+ "ENETUNREACH",
3025
+ "EHOSTUNREACH",
3026
+ "UND_ERR_CONNECT_TIMEOUT"
3027
+ ]);
3028
+ var BROKEN_CONNECTION_ERROR_CODES = /* @__PURE__ */ new Set([
3029
+ "ECONNRESET",
3030
+ "EPIPE",
3031
+ "ETIMEDOUT",
3032
+ "UND_ERR_SOCKET",
3033
+ "UND_ERR_CLOSED"
3034
+ ]);
3035
+ function isIdempotentMethod(method) {
3036
+ return IDEMPOTENT_METHODS.has(method.toUpperCase());
3037
+ }
3038
+ function isRetryableStatus(status, method) {
3039
+ return REFUSED_STATUSES.has(status) || GATEWAY_STATUSES.has(status) && isIdempotentMethod(method);
3040
+ }
3041
+ function isRetryableNetworkError(error, method) {
3042
+ const code = networkErrorCode(error);
3043
+ if (code === void 0) return false;
3044
+ return NOT_SENT_ERROR_CODES.has(code) || BROKEN_CONNECTION_ERROR_CODES.has(code) && isIdempotentMethod(method);
3045
+ }
3046
+ function networkErrorCode(error, depth = 0) {
3047
+ if (typeof error !== "object" || error === null || depth > 4) return void 0;
3048
+ const { code, cause, errors } = error;
3049
+ if (typeof code === "string") return code;
3050
+ if (Array.isArray(errors) && errors.length > 0) return networkErrorCode(errors[0], depth + 1);
3051
+ return networkErrorCode(cause, depth + 1);
3052
+ }
3053
+ function parseRetryAfter(header, now = Date.now()) {
3054
+ if (!header) return void 0;
3055
+ const value = header.trim();
3056
+ if (/^\d+(\.\d+)?$/.test(value)) return Number(value) * 1e3;
3057
+ const date = Date.parse(value);
3058
+ return Number.isNaN(date) ? void 0 : Math.max(0, date - now);
3059
+ }
3060
+ function backoffDelayMs(attempt, random = Math.random) {
3061
+ return random() * Math.min(RETRY_MAX_DELAY_MS, RETRY_BASE_DELAY_MS * 2 ** attempt);
3062
+ }
3063
+ function retryDelayMs(attempt, retryAfter, random) {
3064
+ const requested = parseRetryAfter(retryAfter);
3065
+ if (requested === void 0) return backoffDelayMs(attempt, random);
3066
+ return requested <= RETRY_AFTER_MAX_MS ? requested : void 0;
3067
+ }
3068
+ function createRetryingFetch(options) {
3069
+ const wait2 = options.sleep ?? abortableSleep;
3070
+ return async (input, init) => {
3071
+ const baseFetch = options.fetch ?? globalThis.fetch;
3072
+ const request = input instanceof Request ? input : void 0;
3073
+ const method = (request?.method ?? init?.method ?? "GET").toUpperCase();
3074
+ const signal = init?.signal ?? request?.signal;
3075
+ const maxRetries = Math.max(0, Math.floor(options.maxRetries(signal) || 0));
3076
+ const send = (last) => request && request.body !== null && !last ? baseFetch(request.clone(), init) : baseFetch(input, init);
3077
+ for (let attempt = 0; ; attempt++) {
3078
+ const last = attempt >= maxRetries;
3079
+ let response;
3080
+ try {
3081
+ response = await send(last);
3082
+ } catch (error) {
3083
+ if (last || !isRetryableNetworkError(error, method)) throw error;
3084
+ const delay4 = backoffDelayMs(attempt, options.random);
3085
+ if (!fitsDeadline(delay4)) throw error;
3086
+ warn(`${method} request failed (${networkErrorCode(error)})`, delay4, attempt, maxRetries);
3087
+ await wait2(delay4, signal);
3088
+ continue;
3089
+ }
3090
+ if (last || !isRetryableStatus(response.status, method)) return response;
3091
+ const delay3 = retryDelayMs(attempt, response.headers.get("retry-after"), options.random);
3092
+ if (delay3 === void 0 || !fitsDeadline(delay3)) return response;
3093
+ await response.body?.cancel().catch(() => void 0);
3094
+ warn(`${method} request returned ${response.status}`, delay3, attempt, maxRetries);
3095
+ await wait2(delay3, signal);
3096
+ }
3097
+ function fitsDeadline(delay3) {
3098
+ const deadline = options.deadline?.(signal);
3099
+ return deadline === void 0 || Date.now() + delay3 < deadline;
3100
+ }
3101
+ };
3102
+ }
3103
+ function warn(reason, delay3, attempt, maxRetries) {
3104
+ console.warn(`${reason}, retrying in ${(delay3 / 1e3).toFixed(1)}s (${attempt + 1}/${maxRetries})`);
3105
+ }
3106
+ function abortableSleep(ms, signal) {
3107
+ return new Promise((resolve3, reject) => {
3108
+ if (signal?.aborted) {
3109
+ reject(signal.reason);
3110
+ return;
3111
+ }
3112
+ const onAbort = () => {
3113
+ clearTimeout(timer);
3114
+ reject(signal?.reason);
3115
+ };
3116
+ const timer = setTimeout(() => {
3117
+ signal?.removeEventListener("abort", onAbort);
3118
+ resolve3();
3119
+ }, ms);
3120
+ signal?.addEventListener("abort", onAbort, { once: true });
3121
+ });
3122
+ }
3123
+
2764
3124
  // src/session.ts
2765
3125
  var SESSION_START_TRIES = 3;
2766
3126
  var CLUSTER_OVERLOAD_RETRY_DELAY_MS = 3e4;
2767
3127
  var CAPTCHA_SOLVE_TIMEOUT_MS = 1e5;
3128
+ var OBSERVE_MIGRATION_URL = "https://docs.notte.cc/features/sessions/observe-migration";
3129
+ var OBSERVE_DEPRECATIONS = {
3130
+ instructions: `\`observe({ instructions })\` is deprecated and will be removed on December 1, 2026; <<ALTERNATIVE FOR instructions: session.act() \u2014 pending>>. See ${OBSERVE_MIGRATION_URL}`,
3131
+ deep: `\`perception_type: 'deep'\` is deprecated and will be removed on December 1, 2026; use \`perception_type: 'fast'\` (the default). See ${OBSERVE_MIGRATION_URL}`
3132
+ };
2768
3133
  function observeServerOwnedDialog(_dialog) {
2769
3134
  }
2770
3135
  function installServerOwnedDialogPolicy(browser) {
@@ -2779,6 +3144,7 @@ var Session = class {
2779
3144
  legacyHeadless;
2780
3145
  defaultRaiseOnFailure;
2781
3146
  defaultPerceptionType;
3147
+ warnedObserveDeprecations = /* @__PURE__ */ new Set();
2782
3148
  cookieFile;
2783
3149
  cookiesLoaded = false;
2784
3150
  cookieLoadPromise;
@@ -2814,9 +3180,11 @@ var Session = class {
2814
3180
  /**
2815
3181
  * Start the session: creates a new session on the server.
2816
3182
  *
2817
- * Retries up to `SESSION_START_TRIES` times on 5xx errors, waiting
2818
- * `CLUSTER_OVERLOAD_RETRY_DELAY_MS` on HTTP 529 (cluster overload). 4xx
2819
- * errors are never retried.
3183
+ * 503, 529, and refused connections follow the client's retry policy
3184
+ * (`NotteClientConfig.maxRetries`, honoring `Retry-After`). Other 5xx
3185
+ * errors are retried up to `SESSION_START_TRIES` times. With client
3186
+ * retries disabled, 529 waits `CLUSTER_OVERLOAD_RETRY_DELAY_MS` instead.
3187
+ * 4xx errors are never retried.
2820
3188
  *
2821
3189
  * Managed-auth sessions wait for readiness by default. Pass
2822
3190
  * `{ wait_for_authentication: false }` for an explicit nonblocking start,
@@ -2829,11 +3197,6 @@ var Session = class {
2829
3197
  * await session.start();
2830
3198
  */
2831
3199
  async start(options = {}) {
2832
- if (this.legacyHeadless === false) {
2833
- throw new Error(
2834
- "Remote `headless: false` is no longer supported. `headless: true` sessions still include session replays and access to the live viewer."
2835
- );
2836
- }
2837
3200
  if (this.legacyHeadless === true) {
2838
3201
  console.warn("`headless: true` is deprecated and ignored; remote sessions always use the supported browser launch mode.");
2839
3202
  this.legacyHeadless = void 0;
@@ -2842,42 +3205,60 @@ var Session = class {
2842
3205
  throw new Error("Session is already active");
2843
3206
  }
2844
3207
  options.signal?.throwIfAborted();
2845
- validateAuthRetry(this.options.auth_retry ?? 0);
2846
3208
  const { auth_retry, wait_for_authentication, ...request } = this.options;
2847
3209
  const body = {
2848
3210
  ...request,
2849
- ...request.auth_ids?.length ? { auth_retry: auth_retry ?? 0, wait_for_authentication: false } : {}
3211
+ ...this.legacyHeadless !== void 0 ? { headless: this.legacyHeadless } : {},
3212
+ ...auth_retry !== void 0 ? { auth_retry } : {},
3213
+ ...request.auth_ids?.length ? { wait_for_authentication: false } : {}
2850
3214
  };
2851
3215
  const shouldWait = options.wait_for_authentication ?? wait_for_authentication ?? true;
3216
+ const maxRetries = this.client.getConfig().maxRetries ?? 0;
3217
+ const timeoutMs = this.client.getConfig().timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
3218
+ const deadline = timeoutMs > 0 ? Date.now() + timeoutMs : void 0;
3219
+ const fitsDeadline = (wait2) => deadline === void 0 || Date.now() + wait2 < deadline;
3220
+ let transientRetries = 0;
2852
3221
  let tries = SESSION_START_TRIES;
2853
3222
  const origTries = tries;
2854
3223
  let sessionData;
2855
3224
  while (tries > 0) {
2856
3225
  options.signal?.throwIfAborted();
2857
- tries -= 1;
3226
+ if (!fitsDeadline(0)) throw new NotteTimeoutError(`Session start timed out after ${timeoutMs}ms`);
2858
3227
  try {
2859
- const response = await sessionStart({ client: this.client.getClient(), body, throwOnError: true });
3228
+ const response = await sessionStart({
3229
+ client: this.client.getClient(),
3230
+ body,
3231
+ throwOnError: true,
3232
+ headers: {
3233
+ [MAX_RETRIES_HEADER]: "0",
3234
+ ...deadline === void 0 ? {} : { [TIMEOUT_HEADER]: String(Math.max(1, deadline - Date.now())) }
3235
+ }
3236
+ });
2860
3237
  sessionData = response.data;
2861
3238
  break;
2862
3239
  } catch (error) {
3240
+ const transient = error instanceof NotteAPIError ? isRetryableStatus(error.statusCode, "POST") : isRetryableNetworkError(error, "POST");
3241
+ if (maxRetries > 0 && transient) {
3242
+ const wait2 = transientRetries >= maxRetries ? void 0 : error instanceof NotteAPIError ? retryDelayMs(transientRetries, error.response?.headers.get("retry-after")) : backoffDelayMs(transientRetries);
3243
+ if (wait2 === void 0 || !fitsDeadline(wait2)) throw error;
3244
+ transientRetries += 1;
3245
+ console.warn(
3246
+ `Failed to start session (${error instanceof NotteAPIError ? error.statusCode : "connection error"}), retrying in ${(wait2 / 1e3).toFixed(1)}s (${transientRetries}/${maxRetries})`
3247
+ );
3248
+ await pauseStart(wait2, options.signal);
3249
+ continue;
3250
+ }
3251
+ tries -= 1;
2863
3252
  if (tries === 0 || !(error instanceof NotteAPIError) || error.statusCode < 500) {
2864
3253
  throw error;
2865
3254
  }
2866
3255
  const retryStr = `${origTries - tries}/${origTries - 1}`;
3256
+ if (!fitsDeadline(error.statusCode === 529 ? CLUSTER_OVERLOAD_RETRY_DELAY_MS : 0)) throw error;
2867
3257
  if (error.statusCode === 529) {
2868
3258
  console.warn(
2869
3259
  `Failed to start session due to cluster overload, retrying in ${CLUSTER_OVERLOAD_RETRY_DELAY_MS / 1e3} seconds (${retryStr})...`
2870
3260
  );
2871
- if (options.signal) {
2872
- try {
2873
- await delay2(CLUSTER_OVERLOAD_RETRY_DELAY_MS, void 0, { signal: options.signal });
2874
- } catch (error2) {
2875
- options.signal.throwIfAborted();
2876
- throw error2;
2877
- }
2878
- } else {
2879
- await sleep(CLUSTER_OVERLOAD_RETRY_DELAY_MS);
2880
- }
3261
+ await pauseStart(CLUSTER_OVERLOAD_RETRY_DELAY_MS, options.signal);
2881
3262
  } else {
2882
3263
  console.warn(`Failed to start session: retrying (${retryStr})`);
2883
3264
  }
@@ -2895,6 +3276,7 @@ var Session = class {
2895
3276
  this.fileStorage = this.fileStorage?.forSession(sessionData.session_id);
2896
3277
  try {
2897
3278
  options.signal?.throwIfAborted();
3279
+ if (!fitsDeadline(0)) throw new NotteTimeoutError(`Session start timed out after ${timeoutMs}ms`);
2898
3280
  if (shouldWait) await this.waitForAuth(options);
2899
3281
  if (this.openViewer) {
2900
3282
  this.openViewerInBrowser();
@@ -3208,6 +3590,42 @@ var Session = class {
3208
3590
  return response.data.cookies;
3209
3591
  }
3210
3592
  // #######################################################################
3593
+ // ############################# Profiles ################################
3594
+ // #######################################################################
3595
+ /**
3596
+ * Save the session's current browser state (cookies, localStorage, sessionStorage) into a
3597
+ * profile, without stopping the session.
3598
+ *
3599
+ * Pass `profile_id` to overwrite an existing profile or `name` to create a new one. With
3600
+ * neither, the state is saved into the profile the session was started with. The session's
3601
+ * start-time profile settings are not changed, so a session started with `persist: true`
3602
+ * still saves again when it stops.
3603
+ *
3604
+ * See [Browser Profiles](/features/sessions/browser-profiles) for the tested Python and TypeScript example.
3605
+ */
3606
+ async saveProfile(options = {}) {
3607
+ const { profile_id, name } = options;
3608
+ if (profile_id !== void 0 && name !== void 0) {
3609
+ throw new Error("profile_id and name are mutually exclusive");
3610
+ }
3611
+ if (profile_id !== void 0 && profile_id.trim() === "") {
3612
+ throw new Error("profile_id must not be empty");
3613
+ }
3614
+ if (name !== void 0 && name.trim() === "") {
3615
+ throw new Error("name must not be empty");
3616
+ }
3617
+ const body = {};
3618
+ if (profile_id !== void 0) body.profile_id = profile_id;
3619
+ if (name !== void 0) body.name = name;
3620
+ const response = await sessionProfileSave({
3621
+ client: this.client.getClient(),
3622
+ path: { session_id: this.requireSessionId() },
3623
+ body,
3624
+ throwOnError: true
3625
+ });
3626
+ return response.data;
3627
+ }
3628
+ // #######################################################################
3211
3629
  // ############################# Debug / CDP #############################
3212
3630
  // #######################################################################
3213
3631
  /** Detailed debug information for the session (debug URL, websocket URLs, tabs). */
@@ -3284,7 +3702,9 @@ var Session = class {
3284
3702
  try {
3285
3703
  if (!this.playwrightBrowser) {
3286
3704
  const cdpUrl = await this.cdpUrl();
3287
- this.playwrightBrowser = await playwright.chromium.connectOverCDP(cdpUrl);
3705
+ this.playwrightBrowser = this.options.cdp_url ? await playwright.chromium.connectOverCDP(cdpUrl) : await playwright.chromium.connectOverCDP(cdpUrl, {
3706
+ headers: { "x-notte-request-origin": REQUEST_ORIGIN, "x-notte-sdk-version": SDK_VERSION }
3707
+ });
3288
3708
  installServerOwnedDialogPolicy(this.playwrightBrowser);
3289
3709
  }
3290
3710
  const page = this.playwrightBrowser.contexts()[0]?.pages()[0];
@@ -3414,19 +3834,30 @@ var Session = class {
3414
3834
  * The `perception_type` defaults to the session option (`fast`). A bare
3415
3835
  * string argument is accepted as the perception type.
3416
3836
  *
3837
+ * Deprecated: `perception_type: 'deep'` and `instructions` are removed on
3838
+ * December 1, 2026, and each warns once per session. Use `perception_type:
3839
+ * 'fast'` (the default) instead of `'deep'`. For `instructions`:
3840
+ * `<<ALTERNATIVE FOR instructions: session.act() — pending>>`. See https://docs.notte.cc/features/sessions/observe-migration
3841
+ *
3417
3842
  * @param options - Observation settings, including an optional URL, or a perception-mode string.
3418
3843
  * @returns Structured page analysis, available actions, and page metadata.
3419
3844
  * @throws NotteAPIError if observation fails.
3420
3845
  * @example
3421
3846
  * const obs = await session.observe();
3422
3847
  * console.log(obs.space.description);
3423
- * const deep = await session.observe({ perception_type: 'deep', max_nb_actions: 50 });
3848
+ * const firstActions = await session.observe({ max_nb_actions: 50 });
3424
3849
  */
3425
3850
  async observe(options = {}) {
3426
3851
  const body = typeof options === "string" ? { perception_type: options } : { ...options };
3427
3852
  if (body.perception_type == null) {
3428
3853
  body.perception_type = this.defaultPerceptionType;
3429
3854
  }
3855
+ if (body.instructions != null) {
3856
+ this.warnObserveDeprecation("instructions");
3857
+ }
3858
+ if (body.perception_type !== "fast") {
3859
+ this.warnObserveDeprecation("deep");
3860
+ }
3430
3861
  const response = await pageObserve({
3431
3862
  client: this.client.getClient(),
3432
3863
  path: { session_id: this.requireSessionId() },
@@ -3435,6 +3866,12 @@ var Session = class {
3435
3866
  });
3436
3867
  return response.data;
3437
3868
  }
3869
+ warnObserveDeprecation(option) {
3870
+ if (!this.warnedObserveDeprecations.has(option)) {
3871
+ this.warnedObserveDeprecations.add(option);
3872
+ console.warn(OBSERVE_DEPRECATIONS[option]);
3873
+ }
3874
+ }
3438
3875
  async scrape(options = {}) {
3439
3876
  const sessionId = this.requireSessionId();
3440
3877
  const body = await buildScrapeBody(options);
@@ -3502,424 +3939,18 @@ var Session = class {
3502
3939
  }
3503
3940
  }
3504
3941
  };
3505
-
3506
- // src/agent.ts
3507
- import WebSocket from "ws";
3508
- import { z } from "zod";
3509
- function prepareAgentRequest(data) {
3510
- const apiData = { ...data };
3511
- const rf = data.response_format;
3512
- if (rf && typeof rf.parse === "function" && typeof rf.safeParse === "function") {
3513
- apiData.response_format = normalizeJsonSchema(z.toJSONSchema(rf));
3514
- return { apiData, zodSchema: rf };
3515
- }
3516
- return { apiData, zodSchema: null };
3517
- }
3518
- function parseAgentStatusMessage(parsed, agentId) {
3519
- if (parsed?.status === "agent_stop" && parsed.agent && parsed.agent.agent_id === agentId && parsed.agent.task !== void 0 && parsed.agent.status !== void 0) {
3520
- return parsed.agent;
3521
- }
3522
- if (parsed?.agent_id === agentId && parsed.task !== void 0 && parsed.status !== void 0) {
3523
- return parsed;
3524
- }
3525
- return null;
3526
- }
3527
- function validatePersonaOption(persona, persona_id) {
3528
- if (persona) {
3529
- try {
3530
- const personaId = persona.personaId;
3531
- if (!personaId || personaId.length === 0) {
3532
- throw new Error("Persona ID cannot be empty");
3533
- }
3534
- return personaId;
3535
- } catch (error) {
3536
- throw new Error(`Invalid persona object: ${error instanceof Error ? error.message : String(error)}`);
3537
- }
3538
- } else if (persona_id) {
3539
- if (persona_id.length === 0) {
3540
- throw new Error("Persona ID cannot be empty");
3541
- }
3542
- return persona_id;
3543
- }
3544
- return void 0;
3545
- }
3546
- function validateVaultOption(vault, vault_id) {
3547
- if (vault) {
3548
- try {
3549
- const vaultId = vault.vaultId;
3550
- if (!vaultId || vaultId.length === 0) {
3551
- throw new Error("Vault ID cannot be empty");
3552
- }
3553
- return vaultId;
3554
- } catch (error) {
3555
- throw new Error(`Invalid vault object: ${error instanceof Error ? error.message : String(error)}`);
3556
- }
3557
- } else if (vault_id) {
3558
- if (vault_id.length === 0) {
3559
- throw new Error("Vault ID cannot be empty");
3560
- }
3561
- return vault_id;
3562
- }
3563
- return void 0;
3564
- }
3565
- function validateSessionOption(session) {
3566
- const sessionId = session.getId();
3567
- if (!sessionId || sessionId.length === 0) {
3568
- throw new Error("Session ID cannot be empty");
3942
+ async function pauseStart(ms, signal) {
3943
+ if (!signal) {
3944
+ await sleep(ms);
3945
+ return;
3569
3946
  }
3570
- return sessionId;
3571
- }
3572
- function validateAgentIdOption(agent_id) {
3573
- if (agent_id.length === 0) {
3574
- throw new Error("Agent ID cannot be empty");
3947
+ try {
3948
+ await delay2(ms, void 0, { signal });
3949
+ } catch (error) {
3950
+ signal.throwIfAborted();
3951
+ throw error;
3575
3952
  }
3576
3953
  }
3577
- var defaultStepLogger = (stepData, stepCounter, agentId) => {
3578
- console.log(`\u2728 Step ${stepCounter} (agent: ${agentId})`);
3579
- if (stepData && typeof stepData === "object") {
3580
- if (stepData.state) {
3581
- const state = stepData.state;
3582
- if (state.page_summary) {
3583
- console.log(`\u{1F4DD} Current page: ${state.page_summary}`);
3584
- }
3585
- if (state.previous_goal_eval) {
3586
- const statusEmoji = state.previous_goal_status === "success" ? "\u2705" : state.previous_goal_status === "failure" ? "\u274C" : "\u2753";
3587
- console.log(`\u{1F52C} Previous goal: ${statusEmoji} ${state.previous_goal_eval}`);
3588
- }
3589
- if (state.memory) {
3590
- console.log(`\u{1F9E0} Memory: ${state.memory}`);
3591
- }
3592
- if (state.next_goal) {
3593
- console.log(`\u{1F3AF} Next goal: ${state.next_goal}`);
3594
- }
3595
- if (state.relevant_interactions && state.relevant_interactions.length > 0) {
3596
- console.log(`\u{1F194} Relevant ids:`);
3597
- state.relevant_interactions.forEach((interaction) => {
3598
- console.log(` \u25B6 ${interaction.id}: ${interaction.reason}`);
3599
- });
3600
- }
3601
- }
3602
- if (stepData.action) {
3603
- const action = stepData.action;
3604
- let actionStr = `\u26A1 Taking action:
3605
- \u25B6 ${action.name || action.type || "Unknown action"}`;
3606
- if (action.id) {
3607
- actionStr += ` with id ${action.id}`;
3608
- } else if (action.param && action.param.name && action[action.param.name]) {
3609
- actionStr += ` with ${action.param.name}=${action[action.param.name]}`;
3610
- }
3611
- console.log(actionStr);
3612
- }
3613
- } else {
3614
- console.log(stepData);
3615
- }
3616
- console.log("");
3617
- };
3618
- var Agent = class {
3619
- client;
3620
- request;
3621
- response = null;
3622
- websocket = null;
3623
- existingAgent;
3624
- constructor(client2, options) {
3625
- this.client = client2;
3626
- if ("agent_id" in options && options.agent_id) {
3627
- if (options.session) {
3628
- throw new Error("Either session (for running a new agent) or agent_id (for accessing an existing agent) have to be provided, not both");
3629
- }
3630
- validateAgentIdOption(options.agent_id);
3631
- this.existingAgent = true;
3632
- this.response = { agent_id: options.agent_id };
3633
- } else if ("session" in options && options.session) {
3634
- if (options.agent_id) {
3635
- throw new Error("Either session (for running a new agent) or agent_id (for accessing an existing agent) have to be provided, not both");
3636
- }
3637
- this.existingAgent = false;
3638
- const { session, vault, persona, ...requestData } = options;
3639
- const sessionId = validateSessionOption(session);
3640
- const vaultId = validateVaultOption(vault, options.vault_id);
3641
- const personaId = validatePersonaOption(persona, options.persona_id);
3642
- this.request = {
3643
- session_id: sessionId,
3644
- vault_id: vaultId,
3645
- persona_id: personaId,
3646
- ...requestData
3647
- };
3648
- } else {
3649
- throw new Error("Either session (for running a new agent) or agent_id (for accessing an existing agent) have to be provided");
3650
- }
3651
- }
3652
- async start(data) {
3653
- if (this.existingAgent) {
3654
- throw new Error("You cannot call start() on an agent instantiated from agent id");
3655
- }
3656
- if (!this.request) {
3657
- throw new Error("Agent not properly initialized with session");
3658
- }
3659
- try {
3660
- const { apiData } = prepareAgentRequest(data);
3661
- const requestBody = {
3662
- ...this.request,
3663
- ...apiData
3664
- };
3665
- const response = await agentStart({
3666
- client: this.client.getClient(),
3667
- body: requestBody
3668
- });
3669
- if (response?.error) {
3670
- throw new Error(`Failed to start agent: ${formatError(response.error)}`);
3671
- }
3672
- this.response = response.data;
3673
- return this.response;
3674
- } catch (error) {
3675
- throw new Error(`Failed to start agent: ${error instanceof Error ? error.message : String(error)}`);
3676
- }
3677
- }
3678
- async run(data) {
3679
- if (this.existingAgent) {
3680
- throw new Error("You cannot call run() on an agent instantiated from agent id");
3681
- }
3682
- const { apiData, zodSchema } = prepareAgentRequest(data);
3683
- this.response = await this.start(apiData);
3684
- console.log(`[Agent] ${this.agentId} started`);
3685
- const result = await this.watchLogsAndWait(true, data.updateHandler || null);
3686
- if (zodSchema && result && result.answer !== void 0 && result.answer !== null) {
3687
- let candidate;
3688
- try {
3689
- candidate = typeof result.answer === "string" ? JSON.parse(result.answer) : result.answer;
3690
- } catch {
3691
- throw new Error(`Agent answer is not valid JSON and cannot be validated against the schema`);
3692
- }
3693
- try {
3694
- result.answer = zodSchema.parse(candidate);
3695
- } catch (error) {
3696
- throw new Error(`Agent answer schema validation failed: ${error instanceof Error ? error.message : String(error)}`);
3697
- }
3698
- }
3699
- return result;
3700
- }
3701
- /**
3702
- * Watch logs and wait for completion - mirrors Python watch_logs_and_wait
3703
- */
3704
- async watchLogsAndWait(log = true, updateHandler = null) {
3705
- if (this.existingAgent) {
3706
- throw new Error("You cannot call watchLogsAndWait() on an agent instantiated from agent id");
3707
- }
3708
- if (!this.response) {
3709
- throw new Error("Agent not started");
3710
- }
3711
- const deadline = Date.now() + 3e5;
3712
- try {
3713
- const result = await this.watchLogs(log, updateHandler, deadline);
3714
- if (result && result.status !== "active") {
3715
- return result;
3716
- }
3717
- } catch (error) {
3718
- console.warn(`[Agent] ${this.agentId} log stream unavailable; polling for completion.`);
3719
- }
3720
- while (Date.now() < deadline) {
3721
- const result = await this.status(AbortSignal.timeout(Math.max(1, deadline - Date.now())));
3722
- if (result.status !== "active") {
3723
- updateHandler?.({ type: "completion", data: result, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
3724
- return result;
3725
- }
3726
- await new Promise((resolve3) => setTimeout(resolve3, 1e3));
3727
- }
3728
- throw new Error(`Agent ${this.agentId} did not complete before the polling timeout; retrieve status() later.`);
3729
- }
3730
- /**
3731
- * Watch logs via WebSocket - mirrors Python watch_logs method
3732
- */
3733
- async watchLogs(log = true, updateHandler = null, deadline = Date.now() + 3e5) {
3734
- if (this.existingAgent) {
3735
- throw new Error("You cannot call watchLogs() on an agent instantiated from agent id");
3736
- }
3737
- if (!this.response) {
3738
- throw new Error("Agent not started");
3739
- }
3740
- const config = this.client.getConfig();
3741
- if (config.baseUrl?.startsWith("/")) return null;
3742
- const agentId = this.response.agent_id;
3743
- const sessionId = this.response.session_id;
3744
- const debug = await sessionDebugInfo({
3745
- client: this.client.getClient(),
3746
- path: { session_id: sessionId },
3747
- throwOnError: true,
3748
- signal: AbortSignal.timeout(Math.max(1, deadline - Date.now()))
3749
- });
3750
- const wsUrl = new URL(this.client.withDbPreview(debug.data.ws.logs));
3751
- const token = wsUrl.searchParams.get("token");
3752
- if (!token || token === config.apiKey || wsUrl.protocol !== "wss:") return null;
3753
- wsUrl.pathname = `/agents/${encodeURIComponent(agentId)}/debug/logs`;
3754
- wsUrl.searchParams.set("session_id", sessionId);
3755
- return new Promise((resolve3, reject) => {
3756
- this.websocket = new WebSocket(wsUrl);
3757
- const socket = this.websocket;
3758
- const timeout = setTimeout(() => finish(null), Math.max(0, deadline - Date.now()));
3759
- let settled = false;
3760
- const finish = (result) => {
3761
- if (settled) return;
3762
- settled = true;
3763
- clearTimeout(timeout);
3764
- if (this.websocket === socket) this.websocket = null;
3765
- if (socket.readyState !== WebSocket.CLOSED) socket.terminate();
3766
- resolve3(result);
3767
- };
3768
- let counter = 0;
3769
- this.websocket.on("open", () => {
3770
- });
3771
- this.websocket.on("error", (error) => {
3772
- console.error(`Connection error: ${agentId} ${error.message}`);
3773
- finish(null);
3774
- });
3775
- this.websocket.on("message", (data) => {
3776
- try {
3777
- const message = data.toString();
3778
- let parsed;
3779
- try {
3780
- parsed = JSON.parse(message);
3781
- } catch {
3782
- return;
3783
- }
3784
- const finalStatus = parseAgentStatusMessage(parsed, agentId);
3785
- if (finalStatus) {
3786
- if (updateHandler) {
3787
- updateHandler({
3788
- type: "completion",
3789
- data: finalStatus,
3790
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
3791
- });
3792
- } else if (!finalStatus.success) {
3793
- console.error(finalStatus.answer);
3794
- }
3795
- finish(finalStatus);
3796
- return;
3797
- }
3798
- if (log) {
3799
- counter++;
3800
- if (updateHandler) {
3801
- updateHandler({
3802
- type: "step",
3803
- data: parsed,
3804
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
3805
- });
3806
- } else {
3807
- defaultStepLogger(parsed, counter, agentId);
3808
- }
3809
- }
3810
- } catch (error) {
3811
- console.error(`Error processing WebSocket message: ${error}`);
3812
- }
3813
- });
3814
- this.websocket.on("close", () => {
3815
- finish(null);
3816
- });
3817
- });
3818
- }
3819
- /**
3820
- * Get agent status - mirrors Python status method
3821
- */
3822
- async status(signal) {
3823
- if (!this.response) {
3824
- throw new Error("Agent not started or not accessible");
3825
- }
3826
- const response = await agentStatus({
3827
- client: this.client.getClient(),
3828
- signal,
3829
- path: {
3830
- agent_id: this.response.agent_id
3831
- }
3832
- });
3833
- if (response?.error) {
3834
- throw new Error(`Failed to get agent status: ${formatError(response.error)}`);
3835
- }
3836
- return response.data;
3837
- }
3838
- /**
3839
- * Stop the agent - mirrors Python stop method
3840
- */
3841
- async stop() {
3842
- if (this.existingAgent) {
3843
- throw new Error("You cannot call stop() on an agent instantiated from agent id");
3844
- }
3845
- if (!this.response) {
3846
- throw new Error("Agent not started");
3847
- }
3848
- try {
3849
- console.log(`[Agent] ${this.response.agent_id} is stopping`);
3850
- const response = await agentStop({
3851
- client: this.client.getClient(),
3852
- path: {
3853
- agent_id: this.response.agent_id
3854
- },
3855
- query: { session_id: this.response.session_id }
3856
- });
3857
- if (response?.error) {
3858
- throw new Error(`Failed to stop agent: ${formatError(response.error)}`);
3859
- }
3860
- console.log(`[Agent] ${this.response.agent_id} stopped`);
3861
- return response.data;
3862
- } catch (error) {
3863
- console.warn(`Failed to stop agent: ${error instanceof Error ? error.message : String(error)}`);
3864
- throw error;
3865
- } finally {
3866
- this.disconnectWebSocket();
3867
- }
3868
- }
3869
- /**
3870
- * Disconnect WebSocket
3871
- */
3872
- disconnectWebSocket() {
3873
- if (this.websocket) {
3874
- this.websocket.close();
3875
- this.websocket = null;
3876
- }
3877
- }
3878
- /**
3879
- * Get agent ID - mirrors Python agent_id property
3880
- */
3881
- get agentId() {
3882
- if (!this.response) {
3883
- throw new Error("You need to run the agent first to get the agent id");
3884
- }
3885
- return this.response.agent_id;
3886
- }
3887
- /**
3888
- * Get session ID - mirrors Python session_id property
3889
- */
3890
- get sessionId() {
3891
- if (!this.response) {
3892
- throw new Error("You need to run the agent first to get the session id");
3893
- }
3894
- return this.response.session_id;
3895
- }
3896
- /**
3897
- * Whether `start()`/`run()` was called on this instance (or it was built from an agent id).
3898
- * This is a local check and does not contact the API.
3899
- */
3900
- hasStarted() {
3901
- return this.response !== null;
3902
- }
3903
- /**
3904
- * Whether the agent is still active on the server. Fetches the current status,
3905
- * like calling `agent.status()` in Python; an agent that was never started is not active.
3906
- */
3907
- async isActive() {
3908
- if (!this.response) {
3909
- return false;
3910
- }
3911
- const status = await this.status();
3912
- return status.status === "active";
3913
- }
3914
- /**
3915
- * @deprecated Only reports whether this instance was started; it does not
3916
- * contact the API. Use `hasStarted()` for that check or `isActive()` for the
3917
- * live server status.
3918
- */
3919
- isRunning() {
3920
- return this.hasStarted();
3921
- }
3922
- };
3923
3954
 
3924
3955
  // src/vaults.ts
3925
3956
  import { getDomain } from "tldts";
@@ -4079,9 +4110,9 @@ var NotteVault = class {
4079
4110
  await this.delete();
4080
4111
  }
4081
4112
  /**
4082
- * Add or update the credentials stored for a website. The URL is reduced to
4083
- * its root domain (`https://github.com/login` → `github.com`) before it is
4084
- * sent, like Python's `AddCredentialsRequest`.
4113
+ * Add or update the credentials stored for a website. Values are sent as
4114
+ * supplied; the API validates credentials and reduces the URL to its root
4115
+ * domain (`https://github.com/login` → `github.com`).
4085
4116
  *
4086
4117
  * ```ts
4087
4118
  * await vault.addCredentials('https://github.com/', {
@@ -4092,13 +4123,11 @@ var NotteVault = class {
4092
4123
  * ```
4093
4124
  */
4094
4125
  async addCredentials(url, credentials) {
4095
- const domain = validateUrl(url);
4096
- validateCredentials(credentials);
4097
4126
  const vaultId = await this.ensureInitialized();
4098
4127
  await vaultCredentialsAdd({
4099
4128
  client: this.client.getClient(),
4100
4129
  path: { vault_id: vaultId },
4101
- body: { url: domain, credentials },
4130
+ body: { url, credentials },
4102
4131
  throwOnError: true
4103
4132
  });
4104
4133
  }
@@ -4112,12 +4141,11 @@ var NotteVault = class {
4112
4141
  * ```
4113
4142
  */
4114
4143
  async getCredentials(url) {
4115
- const domain = validateUrl(url);
4116
4144
  const vaultId = await this.ensureInitialized();
4117
4145
  const response = await vaultCredentialsGet({
4118
4146
  client: this.client.getClient(),
4119
4147
  path: { vault_id: vaultId },
4120
- query: { url: domain },
4148
+ query: { url },
4121
4149
  throwOnError: true
4122
4150
  });
4123
4151
  return response.data.credentials;
@@ -4145,12 +4173,11 @@ var NotteVault = class {
4145
4173
  * ```
4146
4174
  */
4147
4175
  async deleteCredentials(url) {
4148
- const domain = validateUrl(url);
4149
4176
  const vaultId = await this.ensureInitialized();
4150
4177
  await vaultCredentialsDelete({
4151
4178
  client: this.client.getClient(),
4152
4179
  path: { vault_id: vaultId },
4153
- query: { url: domain },
4180
+ query: { url },
4154
4181
  throwOnError: true
4155
4182
  });
4156
4183
  }
@@ -4195,7 +4222,7 @@ var NotteVault = class {
4195
4222
  * ```
4196
4223
  */
4197
4224
  async addCredentialsFromEnv(url) {
4198
- const rootDomain = validateUrl(url);
4225
+ const rootDomain = getRootDomain(url);
4199
4226
  const prefix = rootDomain.replace(/\./g, "_").toUpperCase();
4200
4227
  const credentials = {};
4201
4228
  const variableNames = [];
@@ -4271,6 +4298,10 @@ var NotteVault = class {
4271
4298
  };
4272
4299
 
4273
4300
  // src/personas.ts
4301
+ function withPersonaDefaults(persona) {
4302
+ if (!persona || persona.email_provider) return persona;
4303
+ return { ...persona, email_provider: "notte" };
4304
+ }
4274
4305
  var NottePersona = class {
4275
4306
  client;
4276
4307
  _initRequest;
@@ -4330,7 +4361,7 @@ var NottePersona = class {
4330
4361
  if (response?.error) {
4331
4362
  throw new Error(`Failed to get persona: ${formatError(response.error)}`);
4332
4363
  }
4333
- this.response = response.data;
4364
+ this.response = withPersonaDefaults(response.data);
4334
4365
  return this.response;
4335
4366
  }
4336
4367
  async initNewPersona(createData) {
@@ -4341,7 +4372,7 @@ var NottePersona = class {
4341
4372
  if (response?.error) {
4342
4373
  throw new Error(`Failed to create persona: ${formatError(response.error)}`);
4343
4374
  }
4344
- this.response = response.data;
4375
+ this.response = withPersonaDefaults(response.data);
4345
4376
  console.warn(
4346
4377
  `[Persona] ${this.response.persona_id} created since no persona id was provided. Please store this to retrieve it later.`
4347
4378
  );
@@ -4570,11 +4601,10 @@ async function offloadRunPayloads(client2, path, fields) {
4570
4601
  if (payload.length > MAX_PAYLOAD_BYTES) throw new Error(`Function run ${field} exceeds the payload limit`);
4571
4602
  if (payload.length <= INLINE_FIELD_BYTES) continue;
4572
4603
  const checksum = createHash("sha256").update(payload).digest("base64");
4573
- const prepared = await client2.post({
4574
- url: "/functions/{function_id}/runs/{run_id}/payloads/{field}/upload",
4604
+ const prepared = await prepareRunPayloadUpload({
4605
+ client: client2,
4575
4606
  path: { ...path, field },
4576
4607
  body: { size_bytes: payload.length, sha256: checksum },
4577
- headers: { "Content-Type": "application/json" },
4578
4608
  throwOnError: true
4579
4609
  });
4580
4610
  const upload = prepared.data;
@@ -4650,7 +4680,6 @@ var FUNCTION_RUN_ENDPOINTS = {
4650
4680
  start: "/functions/{function_id}/runs/{run_id}"
4651
4681
  };
4652
4682
  var RUN_API_KEY_HEADER = "x-notte-api-key";
4653
- var FUNCTION_RUNTIMES = ["standard", "extended"];
4654
4683
  var FUNCTION_RUN_STATUSES = ["closed", "active", "failed"];
4655
4684
  var NotteFunction = class {
4656
4685
  client;
@@ -4753,7 +4782,7 @@ var NotteFunction = class {
4753
4782
  throwOnError: true,
4754
4783
  path: { function_id: functionId },
4755
4784
  query: {
4756
- restricted: options.restricted ?? true,
4785
+ restricted: options.restricted,
4757
4786
  ...options.version !== void 0 ? { version: options.version } : {}
4758
4787
  },
4759
4788
  body: { file }
@@ -4850,7 +4879,7 @@ var NotteFunction = class {
4850
4879
  client: this.client.getClient(),
4851
4880
  throwOnError: true,
4852
4881
  path: { function_id: functionId },
4853
- query: { restricted: options.restricted ?? true },
4882
+ query: { restricted: options.restricted },
4854
4883
  body: { version: options.version }
4855
4884
  });
4856
4885
  return response.data;
@@ -4946,7 +4975,7 @@ var NotteFunction = class {
4946
4975
  client: this.client.getClient(),
4947
4976
  throwOnError: true,
4948
4977
  path: { function_id: functionId },
4949
- query: { ...options, only_active: options.only_active ?? false }
4978
+ query: options
4950
4979
  });
4951
4980
  return response.data;
4952
4981
  }
@@ -4979,9 +5008,6 @@ var NotteFunction = class {
4979
5008
  if (!(timeoutMs > 0)) {
4980
5009
  throw new InvalidRequestError("timeoutMs must be a positive number");
4981
5010
  }
4982
- if (options.runtime !== void 0 && !FUNCTION_RUNTIMES.includes(options.runtime)) {
4983
- throw new InvalidRequestError(`runtime must be one of ${FUNCTION_RUNTIMES.join(", ")}, got '${String(options.runtime)}'`);
4984
- }
4985
5011
  const functionId = await this.ensureInitialized();
4986
5012
  const functionRunId = options.functionRunId ?? (await this.createRun()).function_run_id;
4987
5013
  const body = {
@@ -5324,7 +5350,7 @@ var SessionFiles = class {
5324
5350
  const response = await listSessionFiles({
5325
5351
  client: this.client,
5326
5352
  path: { session_id: this.sessionId },
5327
- query: { limit: options.limit ?? 100, offset: options.offset ?? 0, source: options.source },
5353
+ query: options,
5328
5354
  throwOnError: true
5329
5355
  });
5330
5356
  return response.data;
@@ -5733,6 +5759,7 @@ var DEFAULT_NOTTE_API_URL = "https://api.notte.cc";
5733
5759
  var DEFAULT_REQUEST_TIMEOUT_MS = 6e4;
5734
5760
  var REQUEST_ORIGIN = "sdk-node";
5735
5761
  var TIMEOUT_HEADER = "x-notte-timeout-ms";
5762
+ var MAX_RETRIES_HEADER = "x-notte-max-retries";
5736
5763
  var DB_PREVIEW_ENV = "NOTTE_DB_PREVIEW_BRANCH";
5737
5764
  var DB_PREVIEW_HEADER = "x-db-preview";
5738
5765
  var EXECUTION_ERROR_CLASS = "NotteApiExecutionError";
@@ -5755,6 +5782,10 @@ var NotteClient3 = class {
5755
5782
  if (!(timeoutMs >= 0)) {
5756
5783
  throw new InvalidRequestError("timeoutMs must be a non-negative number");
5757
5784
  }
5785
+ const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
5786
+ if (!Number.isInteger(maxRetries) || maxRetries < 0) {
5787
+ throw new InvalidRequestError("maxRetries must be a non-negative integer");
5788
+ }
5758
5789
  const isProxyMode = isRelativeProxyUrl(baseUrl);
5759
5790
  if (!isProxyMode) {
5760
5791
  const url = new URL(baseUrl);
@@ -5770,7 +5801,15 @@ var NotteClient3 = class {
5770
5801
  "NOTTE_API_KEY needs to be provided. Pass config.apiKey or set the NOTTE_API_KEY environment variable."
5771
5802
  );
5772
5803
  }
5773
- this.config = { baseUrl, apiKey, timeoutMs, captchaTimeoutSeconds, dbPreview, verbose: config.verbose ?? false };
5804
+ this.config = {
5805
+ baseUrl,
5806
+ apiKey,
5807
+ timeoutMs,
5808
+ captchaTimeoutSeconds,
5809
+ dbPreview,
5810
+ maxRetries,
5811
+ verbose: config.verbose ?? false
5812
+ };
5774
5813
  if (baseUrl !== DEFAULT_NOTTE_API_URL && !isProxyMode) {
5775
5814
  console.warn(`NOTTE_API_URL is set to: ${baseUrl}`);
5776
5815
  }
@@ -5779,7 +5818,7 @@ var NotteClient3 = class {
5779
5818
  redirect: "manual",
5780
5819
  throwOnError: true
5781
5820
  });
5782
- this.client.interceptors.request.use((request) => {
5821
+ this.client.interceptors.request.use((request, opts) => {
5783
5822
  const headers = new Headers(request.headers);
5784
5823
  if (this.config.apiKey) headers.set("Authorization", `Bearer ${this.config.apiKey}`);
5785
5824
  headers.set("x-notte-request-origin", REQUEST_ORIGIN);
@@ -5787,16 +5826,25 @@ var NotteClient3 = class {
5787
5826
  if (this.config.dbPreview) headers.set(DB_PREVIEW_HEADER, this.config.dbPreview);
5788
5827
  const override = headers.get(TIMEOUT_HEADER);
5789
5828
  headers.delete(TIMEOUT_HEADER);
5829
+ const retriesOverride = headers.get(MAX_RETRIES_HEADER);
5830
+ headers.delete(MAX_RETRIES_HEADER);
5790
5831
  const timeoutMs2 = override !== null ? Number(override) : this.config.timeoutMs;
5791
5832
  if (this.config.verbose) {
5792
5833
  console.info(`Making \`${request.method}\` request to \`${request.url}\``);
5793
5834
  }
5794
- if (!(timeoutMs2 > 0)) {
5795
- return new Request(request, { headers });
5796
- }
5797
- const deadline = withTimeout(request.signal, timeoutMs2);
5798
- const timed = new Request(request, { headers, signal: deadline.signal });
5799
- pendingDeadlines.set(timed, deadline.release);
5835
+ const callerSignal = opts.signal ?? request.signal;
5836
+ const deadline = timeoutMs2 > 0 ? withTimeout(callerSignal, timeoutMs2) : void 0;
5837
+ const signal = deadline?.signal ?? callerSignal;
5838
+ const timed = new Request(request, { headers, signal });
5839
+ pendingRequests.set(timed, { signal, release: deadline?.release ?? (() => void 0), expiresAt: deadline?.expiresAt ?? Infinity });
5840
+ const transport = originalTransports.get(opts) ?? opts.fetch ?? globalThis.fetch;
5841
+ originalTransports.set(opts, transport);
5842
+ const retrying = createRetryingFetch({
5843
+ fetch: transport,
5844
+ maxRetries: () => retriesOverride !== null ? Number(retriesOverride) : this.config.maxRetries,
5845
+ deadline: () => deadline?.expiresAt
5846
+ });
5847
+ opts.fetch = (input, init) => retrying(input, { ...init, signal });
5800
5848
  return timed;
5801
5849
  });
5802
5850
  this.client.interceptors.response.use(async (response, request, opts) => {
@@ -5834,7 +5882,7 @@ var NotteClient3 = class {
5834
5882
  method: request.method,
5835
5883
  headers: headerRecord,
5836
5884
  body: opts.serializedBody ?? void 0,
5837
- signal: request.signal,
5885
+ signal: requestSignal(request),
5838
5886
  redirect: "manual"
5839
5887
  });
5840
5888
  currentUrl = location;
@@ -5882,14 +5930,15 @@ var NotteClient3 = class {
5882
5930
  if (error instanceof NotteAPIError) {
5883
5931
  return error;
5884
5932
  }
5885
- if (request?.signal.aborted) {
5886
- error = request.signal.reason ?? error;
5933
+ const signal = request && requestSignal(request);
5934
+ if (signal?.aborted) {
5935
+ error = signal.reason ?? error;
5887
5936
  }
5888
5937
  if (isTimeoutAbort(error)) {
5889
5938
  const target = request ? ` to \`${requestPath(request)}\`` : "";
5890
5939
  return new NotteTimeoutError(`Request${target} ${error.message}`, { cause: error });
5891
5940
  }
5892
- if (request?.signal.aborted) return error;
5941
+ if (signal?.aborted) return error;
5893
5942
  if (response) {
5894
5943
  const path = requestPath(request, response);
5895
5944
  const body = normalizeErrorBody(error);
@@ -5939,6 +5988,10 @@ var NotteClient3 = class {
5939
5988
  Session(options = {}) {
5940
5989
  return new Session(this, options);
5941
5990
  }
5991
+ /** Generated file operations; use Files(sessionId) for local file IO helpers. */
5992
+ get files() {
5993
+ return this.resources.files;
5994
+ }
5942
5995
  /** Access files owned by a specific session, including closed sessions. */
5943
5996
  Files(sessionId) {
5944
5997
  return new SessionFiles(this.getClient(), sessionId);
@@ -5957,12 +6010,6 @@ var NotteClient3 = class {
5957
6010
  FileStorage(sessionId) {
5958
6011
  return new RemoteFileStorage(this, sessionId);
5959
6012
  }
5960
- /**
5961
- * Create a new agent
5962
- */
5963
- Agent(options) {
5964
- return new Agent(this, options);
5965
- }
5966
6013
  /**
5967
6014
  * Create or access a vault
5968
6015
  */
@@ -5995,16 +6042,6 @@ var NotteClient3 = class {
5995
6042
  }
5996
6043
  };
5997
6044
  }
5998
- /** Client-bound agent API operations. `list()` retains its array return value. */
5999
- get agents() {
6000
- return {
6001
- ...this.resources.agents,
6002
- list: async (options = {}) => {
6003
- const response = await listAgents({ client: this.getClient(), query: options });
6004
- return response.data?.items ?? [];
6005
- }
6006
- };
6007
- }
6008
6045
  /** Client-bound vault API operations. `list()` retains its array return value. */
6009
6046
  get vaults() {
6010
6047
  return {
@@ -6053,14 +6090,18 @@ var NotteClient3 = class {
6053
6090
  * Personas client for listing and managing personas
6054
6091
  */
6055
6092
  get personas() {
6093
+ const personas = this.resources.personas;
6056
6094
  return {
6057
- ...this.resources.personas,
6095
+ ...personas,
6096
+ create: async (...args) => withPersonaDefaults(await personas.create(...args)),
6097
+ get: async (...args) => withPersonaDefaults(await personas.get(...args)),
6098
+ update: async (...args) => withPersonaDefaults(await personas.update(...args)),
6058
6099
  list: async (options) => {
6059
6100
  const response = await listPersonas({
6060
6101
  client: this.getClient(),
6061
6102
  query: options || {}
6062
6103
  });
6063
- return response.data?.items || [];
6104
+ return (response.data?.items || []).map(withPersonaDefaults);
6064
6105
  }
6065
6106
  };
6066
6107
  }
@@ -6106,18 +6147,18 @@ function isTimeoutAbort(error) {
6106
6147
  function timeoutReason(timeoutMs) {
6107
6148
  return new DOMException(`timed out after ${timeoutMs}ms`, "TimeoutError");
6108
6149
  }
6109
- var pendingDeadlines = /* @__PURE__ */ new WeakMap();
6150
+ var pendingRequests = /* @__PURE__ */ new WeakMap();
6151
+ var originalTransports = /* @__PURE__ */ new WeakMap();
6152
+ function requestSignal(request) {
6153
+ return pendingRequests.get(request)?.signal ?? request.signal;
6154
+ }
6110
6155
  function releaseDeadline(request) {
6111
- if (!request) return;
6112
- const release = pendingDeadlines.get(request);
6113
- if (release) {
6114
- pendingDeadlines.delete(request);
6115
- release();
6116
- }
6156
+ if (request) pendingRequests.get(request)?.release();
6117
6157
  }
6118
6158
  function withTimeout(signal, timeoutMs) {
6119
6159
  const controller = new AbortController();
6120
6160
  const timer = setTimeout(() => controller.abort(timeoutReason(timeoutMs)), timeoutMs);
6161
+ const expiresAt = Date.now() + timeoutMs;
6121
6162
  timer.unref?.();
6122
6163
  let detach = () => void 0;
6123
6164
  let composite;
@@ -6144,7 +6185,7 @@ function withTimeout(signal, timeoutMs) {
6144
6185
  detach();
6145
6186
  };
6146
6187
  composite.addEventListener("abort", release, { once: true });
6147
- return { signal: composite, release };
6188
+ return { signal: composite, release, expiresAt };
6148
6189
  }
6149
6190
 
6150
6191
  // src/actions.ts
@@ -6237,11 +6278,11 @@ var createClient2 = (config) => {
6237
6278
  };
6238
6279
  export {
6239
6280
  ActionExecutionError,
6240
- Agent,
6241
6281
  AuthenticationError,
6242
6282
  CAPTCHA_SOLVE_TIMEOUT_MS,
6243
6283
  CLUSTER_OVERLOAD_RETRY_DELAY_MS,
6244
6284
  CREDENTIAL_FIELDS,
6285
+ DEFAULT_MAX_RETRIES,
6245
6286
  DEFAULT_NOTTE_API_URL,
6246
6287
  DEFAULT_REQUEST_TIMEOUT_MS,
6247
6288
  Encryption,
@@ -6276,12 +6317,17 @@ export {
6276
6317
  Session,
6277
6318
  SessionFiles,
6278
6319
  TIMEOUT_HEADER,
6320
+ accountChanges,
6321
+ accountRuns,
6279
6322
  actions,
6280
6323
  agentStart,
6281
6324
  agentStatus,
6282
6325
  agentStop,
6283
6326
  anythingStart,
6327
+ attempts,
6328
+ brandRetrieve,
6284
6329
  buildFetchScript,
6330
+ changes,
6285
6331
  checkForLatestVersion,
6286
6332
  client,
6287
6333
  connectLinkContext,
@@ -6291,15 +6337,23 @@ export {
6291
6337
  connectLinkStatus,
6292
6338
  connectLinkSubmit,
6293
6339
  connectPaymentWallet,
6340
+ create,
6294
6341
  createClient2 as createClient,
6295
6342
  createOrAppendCookiesToFile,
6296
6343
  createPayment,
6344
+ creditUsage,
6297
6345
  NotteClient3 as default,
6298
6346
  deleteSecret,
6299
6347
  deleteSessionFile,
6348
+ delete_,
6349
+ deliveries,
6350
+ detail,
6300
6351
  disconnectPaymentWallet,
6301
6352
  downloadRunPayload,
6302
6353
  downloadSessionFile,
6354
+ executeSessionFile,
6355
+ extractProductEndpoint,
6356
+ fetchSpecializedData,
6303
6357
  functionCreate,
6304
6358
  functionDelete,
6305
6359
  functionDownloadUrl,
@@ -6315,6 +6369,7 @@ export {
6315
6369
  functionScheduleSet,
6316
6370
  functionUpdate,
6317
6371
  getPayment,
6372
+ getPolicy,
6318
6373
  getRootDomain,
6319
6374
  getScript,
6320
6375
  getSecret,
@@ -6322,13 +6377,18 @@ export {
6322
6377
  getUsage,
6323
6378
  getUsageLogs,
6324
6379
  healthCheck,
6325
- improvePrompt,
6380
+ history_,
6326
6381
  installServerOwnedDialogPolicy,
6382
+ invalidate,
6327
6383
  isCaptchaSolveAction,
6328
6384
  isValidMfaSecret,
6385
+ limits,
6329
6386
  listAgents,
6387
+ listAuditEvents,
6388
+ listDataApis,
6330
6389
  listFunctionRunsByFunctionId,
6331
6390
  listFunctions,
6391
+ listMonitors,
6332
6392
  listPersonas,
6333
6393
  listSecrets,
6334
6394
  listSessionFiles,
@@ -6341,20 +6401,20 @@ export {
6341
6401
  mailboxSync,
6342
6402
  mailboxUpdate,
6343
6403
  managedAuthConnectLinkCreate,
6344
- nudgePrompt,
6404
+ mapsSearch,
6405
+ newsSearch,
6345
6406
  observeServerOwnedDialog,
6346
6407
  pageExecute,
6347
6408
  pageObserve,
6348
6409
  pageScrape,
6349
6410
  pageScreenshot,
6350
- parseAgentStatusMessage,
6411
+ peopleEnrich,
6351
6412
  personaCreate,
6352
6413
  personaDelete,
6353
6414
  personaEmailsList,
6354
6415
  personaGet,
6355
6416
  personaSmsList,
6356
6417
  personaUpdate,
6357
- prepareAgentRequest,
6358
6418
  prepareRunPayloadUpload,
6359
6419
  processScrapeResponse,
6360
6420
  profileCookiesGet,
@@ -6364,27 +6424,42 @@ export {
6364
6424
  profileDuplicate,
6365
6425
  profileGet,
6366
6426
  profileList,
6427
+ profileStateSet,
6367
6428
  readCookiesFile,
6368
6429
  readyCheck,
6369
6430
  responseFromEvaluated,
6370
- retry,
6431
+ retrieve,
6432
+ retrieveChange,
6433
+ retrieveDelivery,
6434
+ retrieveRun,
6435
+ retry2 as retry,
6436
+ retry as retryWebhookDelivery,
6437
+ rotateSecret,
6438
+ runNow,
6439
+ runs,
6371
6440
  sanitizeFilename,
6372
6441
  scrapeFromHtml,
6442
+ fetchSpecializedData as scrapeSpecializedData,
6373
6443
  scrapeWebpage,
6374
6444
  searchWeb,
6375
6445
  sessionAuthReadiness,
6376
6446
  sessionCookiesGet,
6377
6447
  sessionCookiesSet,
6378
6448
  sessionDebugInfo,
6449
+ sessionMouseReplay,
6379
6450
  sessionNetworkLogs,
6380
6451
  sessionOffset,
6381
6452
  sessionProfilePreview,
6453
+ sessionProfileSave,
6382
6454
  sessionReplay,
6383
6455
  sessionStart,
6384
6456
  sessionStatus,
6385
6457
  sessionStop,
6386
6458
  startVersionCheck,
6387
6459
  storeSecret,
6460
+ styleguideEndpoint,
6461
+ summary,
6462
+ update,
6388
6463
  uploadSessionFile,
6389
6464
  validateCredentials,
6390
6465
  validateMfaSecret,
@@ -6398,6 +6473,7 @@ export {
6398
6473
  vaultCreditCardGet,
6399
6474
  vaultCreditCardSet,
6400
6475
  vaultDelete,
6401
- vaultUpdate
6476
+ vaultUpdate,
6477
+ youtubeEndpoint
6402
6478
  };
6403
6479
  //# sourceMappingURL=index.mjs.map