notte-sdk 0.0.22 → 1.9.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.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { Page, Browser, Dialog } from 'playwright-core';
1
2
  import { z } from 'zod';
2
- export { N as NotteProxyAuthError, a as NotteProxyConfig } from './types-DmqqdEMP.js';
3
+ export { N as NotteProxyAuthError, a as NotteProxyConfig } from './types-C5V9BOux.js';
3
4
 
4
5
  type AuthToken = string | undefined;
5
6
  interface Auth {
@@ -327,6 +328,22 @@ interface TDataShape {
327
328
  type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
328
329
  type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
329
330
 
331
+ type Env = Record<string, string | undefined>;
332
+ type VersionCheckOptions = {
333
+ currentVersion?: string;
334
+ packageName?: string;
335
+ fetchFn?: typeof fetch;
336
+ warnFn?: (message: string) => void;
337
+ env?: Env;
338
+ };
339
+ /**
340
+ * Check the npm registry once per process and warn when a newer release exists.
341
+ * Called by `NotteClient` on construction, like `check_and_warn_version_mismatch`
342
+ * in the Python client. Never throws and never blocks the caller.
343
+ */
344
+ declare function startVersionCheck(): void;
345
+ declare function checkForLatestVersion(options?: VersionCheckOptions): Promise<void>;
346
+
330
347
  type ClientOptions = {
331
348
  baseUrl: 'https://us-staging.notte.cc' | (string & {});
332
349
  };
@@ -2060,7 +2077,7 @@ type FallbackFillActionOutput = {
2060
2077
  /**
2061
2078
  * FileSource
2062
2079
  */
2063
- type FileSource$1 = 'user_upload' | 'session_download';
2080
+ type FileSource = 'user_upload' | 'session_download';
2064
2081
  /**
2065
2082
  * FillAction
2066
2083
  */
@@ -4027,6 +4044,10 @@ type PersonaResponse = {
4027
4044
  * Name
4028
4045
  */
4029
4046
  name?: string | null;
4047
+ /**
4048
+ * Created At
4049
+ */
4050
+ created_at: string;
4030
4051
  };
4031
4052
  /**
4032
4053
  * PersonaUpdateRequest
@@ -4167,71 +4188,58 @@ type ProfileResponse = {
4167
4188
  persisted_domains?: Array<string>;
4168
4189
  };
4169
4190
  /**
4170
- * ProxyCredentialRequest
4191
+ * ProxyGeolocationCountry
4192
+ */
4193
+ type ProxyGeolocationCountry = 'ad' | 'ae' | 'af' | 'ag' | 'ai' | 'al' | 'am' | 'ao' | 'ar' | 'at' | 'au' | 'aw' | 'az' | 'ba' | 'bb' | 'bd' | 'be' | 'bf' | 'bg' | 'bh' | 'bi' | 'bj' | 'bm' | 'bn' | 'bo' | 'bq' | 'br' | 'bs' | 'bt' | 'bw' | 'by' | 'bz' | 'ca' | 'cd' | 'cg' | 'ch' | 'ci' | 'cl' | 'cm' | 'cn' | 'co' | 'cr' | 'cu' | 'cv' | 'cw' | 'cy' | 'cz' | 'de' | 'dj' | 'dk' | 'dm' | 'do' | 'dz' | 'ec' | 'ee' | 'eg' | 'es' | 'et' | 'fi' | 'fj' | 'fr' | 'ga' | 'gb' | 'gd' | 'ge' | 'gf' | 'gg' | 'gh' | 'gi' | 'gm' | 'gn' | 'gp' | 'gq' | 'gr' | 'gt' | 'gu' | 'gw' | 'gy' | 'hk' | 'hn' | 'hr' | 'ht' | 'hu' | 'id' | 'ie' | 'il' | 'im' | 'in' | 'iq' | 'ir' | 'is' | 'it' | 'je' | 'jm' | 'jo' | 'jp' | 'ke' | 'kg' | 'kh' | 'kn' | 'kr' | 'kw' | 'ky' | 'kz' | 'la' | 'lb' | 'lc' | 'lk' | 'lr' | 'ls' | 'lt' | 'lu' | 'lv' | 'ly' | 'ma' | 'md' | 'me' | 'mf' | 'mg' | 'mk' | 'ml' | 'mm' | 'mn' | 'mo' | 'mq' | 'mr' | 'mt' | 'mu' | 'mv' | 'mw' | 'mx' | 'my' | 'mz' | 'na' | 'nc' | 'ne' | 'ng' | 'ni' | 'nl' | 'no' | 'np' | 'nz' | 'om' | 'pa' | 'pe' | 'pf' | 'pg' | 'ph' | 'pk' | 'pl' | 'pr' | 'ps' | 'pt' | 'py' | 'qa' | 're' | 'ro' | 'rs' | 'ru' | 'rw' | 'sa' | 'sc' | 'sd' | 'se' | 'sg' | 'si' | 'sk' | 'sl' | 'sm' | 'sn' | 'so' | 'sr' | 'ss' | 'st' | 'sv' | 'sx' | 'sy' | 'sz' | 'tc' | 'tg' | 'th' | 'tj' | 'tm' | 'tn' | 'tr' | 'tt' | 'tw' | 'tz' | 'ua' | 'ug' | 'us' | 'uy' | 'uz' | 'vc' | 've' | 'vg' | 'vi' | 'vn' | 'ye' | 'za' | 'zm' | 'zw';
4194
+ /**
4195
+ * ReloadAction
4171
4196
  */
4172
- type ProxyCredentialRequest = {
4197
+ type ReloadAction = {
4173
4198
  /**
4174
- * Country
4175
- *
4176
- * ISO 3166-1 alpha-2 country code, e.g. `us`.
4199
+ * Type
4177
4200
  */
4178
- country?: string | null;
4201
+ type?: 'reload';
4179
4202
  /**
4180
- * City
4181
- *
4182
- * Evomi city id or display name, e.g. `new.york`. Wins over country.
4203
+ * Category
4183
4204
  */
4184
- city?: string | null;
4205
+ category?: string;
4206
+ /**
4207
+ * Description
4208
+ */
4209
+ description?: string;
4185
4210
  };
4186
4211
  /**
4187
- * ProxyCredentialResponse
4212
+ * ReplayMissingResponse
4188
4213
  */
4189
- type ProxyCredentialResponse = {
4214
+ type ReplayMissingResponse = {
4190
4215
  /**
4191
- * Username
4216
+ * Detail
4192
4217
  */
4193
- username: string;
4218
+ detail: string;
4194
4219
  /**
4195
- * Password
4220
+ * Session Id
4196
4221
  */
4197
- password: string;
4222
+ session_id: string | null;
4198
4223
  /**
4199
- * Expires At
4224
+ * Status
4200
4225
  */
4201
- expires_at: string;
4226
+ status: number;
4202
4227
  /**
4203
- * Proxy Url Tls
4204
- *
4205
- * `https://user:pass@host:443`, for clients that do TLS to the proxy.
4228
+ * Error
4206
4229
  */
4207
- proxy_url_tls: string;
4230
+ error: string;
4208
4231
  /**
4209
- * Proxy Url Plain
4210
- *
4211
- * `http://user:pass@host:3128`, for clients that cannot.
4212
- */
4213
- proxy_url_plain: string;
4214
- };
4215
- /**
4216
- * ProxyGeolocationCountry
4217
- */
4218
- type ProxyGeolocationCountry = 'ad' | 'ae' | 'af' | 'ag' | 'ai' | 'al' | 'am' | 'ao' | 'ar' | 'at' | 'au' | 'aw' | 'az' | 'ba' | 'bb' | 'bd' | 'be' | 'bf' | 'bg' | 'bh' | 'bi' | 'bj' | 'bm' | 'bn' | 'bo' | 'bq' | 'br' | 'bs' | 'bt' | 'bw' | 'by' | 'bz' | 'ca' | 'cd' | 'cg' | 'ch' | 'ci' | 'cl' | 'cm' | 'cn' | 'co' | 'cr' | 'cu' | 'cv' | 'cw' | 'cy' | 'cz' | 'de' | 'dj' | 'dk' | 'dm' | 'do' | 'dz' | 'ec' | 'ee' | 'eg' | 'es' | 'et' | 'fi' | 'fj' | 'fr' | 'ga' | 'gb' | 'gd' | 'ge' | 'gf' | 'gg' | 'gh' | 'gi' | 'gm' | 'gn' | 'gp' | 'gq' | 'gr' | 'gt' | 'gu' | 'gw' | 'gy' | 'hk' | 'hn' | 'hr' | 'ht' | 'hu' | 'id' | 'ie' | 'il' | 'im' | 'in' | 'iq' | 'ir' | 'is' | 'it' | 'je' | 'jm' | 'jo' | 'jp' | 'ke' | 'kg' | 'kh' | 'kn' | 'kr' | 'kw' | 'ky' | 'kz' | 'la' | 'lb' | 'lc' | 'lk' | 'lr' | 'ls' | 'lt' | 'lu' | 'lv' | 'ly' | 'ma' | 'md' | 'me' | 'mf' | 'mg' | 'mk' | 'ml' | 'mm' | 'mn' | 'mo' | 'mq' | 'mr' | 'mt' | 'mu' | 'mv' | 'mw' | 'mx' | 'my' | 'mz' | 'na' | 'nc' | 'ne' | 'ng' | 'ni' | 'nl' | 'no' | 'np' | 'nz' | 'om' | 'pa' | 'pe' | 'pf' | 'pg' | 'ph' | 'pk' | 'pl' | 'pr' | 'ps' | 'pt' | 'py' | 'qa' | 're' | 'ro' | 'rs' | 'ru' | 'rw' | 'sa' | 'sc' | 'sd' | 'se' | 'sg' | 'si' | 'sk' | 'sl' | 'sm' | 'sn' | 'so' | 'sr' | 'ss' | 'st' | 'sv' | 'sx' | 'sy' | 'sz' | 'tc' | 'tg' | 'th' | 'tj' | 'tm' | 'tn' | 'tr' | 'tt' | 'tw' | 'tz' | 'ua' | 'ug' | 'us' | 'uy' | 'uz' | 'vc' | 've' | 'vg' | 'vi' | 'vn' | 'ye' | 'za' | 'zm' | 'zw';
4219
- /**
4220
- * ReloadAction
4221
- */
4222
- type ReloadAction = {
4223
- /**
4224
- * Type
4232
+ * Message
4225
4233
  */
4226
- type?: 'reload';
4234
+ message: string;
4227
4235
  /**
4228
- * Category
4236
+ * Replay Status
4229
4237
  */
4230
- category?: string;
4238
+ replay_status: 'waiting_for_session' | 'processing' | 'unavailable' | 'failed' | 'unknown';
4231
4239
  /**
4232
- * Description
4240
+ * Retryable
4233
4241
  */
4234
- description?: string;
4242
+ retryable: boolean;
4235
4243
  };
4236
4244
  /**
4237
4245
  * ReplayResponse
@@ -4874,7 +4882,7 @@ type SessionDebugResponse = {
4874
4882
  /**
4875
4883
  * SessionFile
4876
4884
  */
4877
- type SessionFile$1 = {
4885
+ type SessionFile = {
4878
4886
  /**
4879
4887
  * Id
4880
4888
  */
@@ -4907,16 +4915,16 @@ type SessionFile$1 = {
4907
4915
  * Expires At
4908
4916
  */
4909
4917
  expires_at: string;
4910
- source: FileSource$1;
4918
+ source: FileSource;
4911
4919
  };
4912
4920
  /**
4913
4921
  * SessionFilesPage
4914
4922
  */
4915
- type SessionFilesPage$1 = {
4923
+ type SessionFilesPage = {
4916
4924
  /**
4917
4925
  * Files
4918
4926
  */
4919
- files: Array<SessionFile$1>;
4927
+ files: Array<SessionFile>;
4920
4928
  /**
4921
4929
  * Total
4922
4930
  */
@@ -7660,6 +7668,14 @@ type SessionReplayData = {
7660
7668
  url: '/sessions/{session_id}/replay';
7661
7669
  };
7662
7670
  type SessionReplayErrors = {
7671
+ /**
7672
+ * Replay missing; see replay_status and retryable.
7673
+ */
7674
+ 404: ReplayMissingResponse;
7675
+ /**
7676
+ * Capture completed without any frames.
7677
+ */
7678
+ 410: ReplayMissingResponse;
7663
7679
  /**
7664
7680
  * Validation Error
7665
7681
  */
@@ -7695,7 +7711,7 @@ type ListSessionFilesData = {
7695
7711
  /**
7696
7712
  * Source
7697
7713
  */
7698
- source?: FileSource$1 | null;
7714
+ source?: FileSource | null;
7699
7715
  /**
7700
7716
  * Limit
7701
7717
  */
@@ -7718,7 +7734,7 @@ type ListSessionFilesResponses = {
7718
7734
  /**
7719
7735
  * Successful Response
7720
7736
  */
7721
- 200: SessionFilesPage$1;
7737
+ 200: SessionFilesPage;
7722
7738
  };
7723
7739
  type ListSessionFilesResponse = ListSessionFilesResponses[keyof ListSessionFilesResponses];
7724
7740
  type UploadSessionFileData = {
@@ -7753,7 +7769,7 @@ type UploadSessionFileResponses = {
7753
7769
  /**
7754
7770
  * Successful Response
7755
7771
  */
7756
- 201: SessionFile$1;
7772
+ 201: SessionFile;
7757
7773
  };
7758
7774
  type UploadSessionFileResponse = UploadSessionFileResponses[keyof UploadSessionFileResponses];
7759
7775
  type DeleteSessionFileData = {
@@ -10425,36 +10441,6 @@ type DeleteSecretResponses = {
10425
10441
  204: void;
10426
10442
  };
10427
10443
  type DeleteSecretResponse = DeleteSecretResponses[keyof DeleteSecretResponses];
10428
- type MintProxyCredentialsData = {
10429
- body: ProxyCredentialRequest;
10430
- headers?: {
10431
- /**
10432
- * X-Notte-Request-Origin
10433
- */
10434
- 'x-notte-request-origin'?: string | null;
10435
- /**
10436
- * X-Notte-Sdk-Version
10437
- */
10438
- 'x-notte-sdk-version'?: string | null;
10439
- };
10440
- path?: never;
10441
- query?: never;
10442
- url: '/proxies/gateway/credentials';
10443
- };
10444
- type MintProxyCredentialsErrors = {
10445
- /**
10446
- * Validation Error
10447
- */
10448
- 422: HttpValidationError;
10449
- };
10450
- type MintProxyCredentialsError = MintProxyCredentialsErrors[keyof MintProxyCredentialsErrors];
10451
- type MintProxyCredentialsResponses = {
10452
- /**
10453
- * Successful Response
10454
- */
10455
- 200: ProxyCredentialResponse;
10456
- };
10457
- type MintProxyCredentialsResponse = MintProxyCredentialsResponses[keyof MintProxyCredentialsResponses];
10458
10444
  type HealthCheckData = {
10459
10445
  body?: never;
10460
10446
  path?: never;
@@ -10932,12 +10918,6 @@ declare const getSecret: <ThrowOnError extends boolean = false>(options: Options
10932
10918
  * Delete Secret
10933
10919
  */
10934
10920
  declare const deleteSecret: <ThrowOnError extends boolean = false>(options: Options<DeleteSecretData, ThrowOnError>) => RequestResult<DeleteSecretResponses, DeleteSecretErrors, ThrowOnError>;
10935
- /**
10936
- * Mint a short-lived proxy credential
10937
- *
10938
- * Returns a derived username/password for `proxy.notte.cc`, signed for this workspace and valid for your plan's maximum session duration (see `expires_at`). Traffic through it is billed to this API key's workspace at the proxy rate. Clients that support TLS to a proxy can also use the API key itself as the proxy password on port 443.
10939
- */
10940
- declare const mintProxyCredentials: <ThrowOnError extends boolean = false>(options: Options<MintProxyCredentialsData, ThrowOnError>) => RequestResult<MintProxyCredentialsResponses, MintProxyCredentialsErrors, ThrowOnError>;
10941
10921
  /**
10942
10922
  * Health Check
10943
10923
  */
@@ -10961,7 +10941,556 @@ declare const scrapeFromHtml: <ThrowOnError extends boolean = false>(options: Op
10961
10941
 
10962
10942
  declare const client: Client;
10963
10943
 
10964
- interface SessionOptions extends Omit<ApiSessionStartRequest, 'use_file_storage'> {
10944
+ /** Discriminated union of every action `session.execute()` accepts. */
10945
+ type ExecuteAction = PageExecuteData['body'];
10946
+ /** The `type` discriminator of an `ExecuteAction`. */
10947
+ type ActionType = ExecuteAction['type'];
10948
+ /** The union member whose `type` is `T`. */
10949
+ type ActionOfType<T extends ActionType> = Extract<ExecuteAction, {
10950
+ type: T;
10951
+ }>;
10952
+ /** The fields of an action minus its `type` discriminator. */
10953
+ type ActionInput<T extends ActionType> = Omit<ActionOfType<T>, 'type'>;
10954
+ /** Namespace object mirroring `from notte_sdk import actions`. */
10955
+ declare const actions: {
10956
+ readonly goto: (input: ActionInput<"goto">) => {
10957
+ type: "goto";
10958
+ } & GotoAction;
10959
+ readonly gotoNewTab: (input: ActionInput<"goto_new_tab">) => {
10960
+ type: "goto_new_tab";
10961
+ } & GotoNewTabAction;
10962
+ readonly closeTab: (input?: ActionInput<"close_tab"> | undefined) => {
10963
+ type: "close_tab";
10964
+ } & CloseTabAction;
10965
+ readonly switchTab: (input: ActionInput<"switch_tab">) => {
10966
+ type: "switch_tab";
10967
+ } & SwitchTabAction;
10968
+ readonly goBack: (input?: ActionInput<"go_back"> | undefined) => {
10969
+ type: "go_back";
10970
+ } & GoBackAction;
10971
+ readonly goForward: (input?: ActionInput<"go_forward"> | undefined) => {
10972
+ type: "go_forward";
10973
+ } & GoForwardAction;
10974
+ readonly reload: (input?: ActionInput<"reload"> | undefined) => {
10975
+ type: "reload";
10976
+ } & ReloadAction;
10977
+ readonly wait: (input: ActionInput<"wait">) => {
10978
+ type: "wait";
10979
+ } & WaitAction;
10980
+ readonly pressKey: (input: ActionInput<"press_key">) => {
10981
+ type: "press_key";
10982
+ } & PressKeyAction;
10983
+ readonly scrollUp: (input?: ActionInput<"scroll_up"> | undefined) => {
10984
+ type: "scroll_up";
10985
+ } & ScrollUpAction;
10986
+ readonly scrollDown: (input?: ActionInput<"scroll_down"> | undefined) => {
10987
+ type: "scroll_down";
10988
+ } & ScrollDownAction;
10989
+ readonly captchaSolve: (input?: ActionInput<"captcha_solve"> | undefined) => {
10990
+ type: "captcha_solve";
10991
+ } & CaptchaSolveAction;
10992
+ readonly help: (input: ActionInput<"help">) => {
10993
+ type: "help";
10994
+ } & HelpAction;
10995
+ readonly completion: (input: ActionInput<"completion">) => {
10996
+ type: "completion";
10997
+ } & CompletionAction;
10998
+ readonly scrape: (input?: ActionInput<"scrape"> | undefined) => {
10999
+ type: "scrape";
11000
+ } & ScrapeAction;
11001
+ readonly emailRead: (input?: ActionInput<"email_read"> | undefined) => {
11002
+ type: "email_read";
11003
+ } & EmailReadAction;
11004
+ readonly emailVerificationRead: (input: ActionInput<"email_verification_read">) => {
11005
+ type: "email_verification_read";
11006
+ } & EmailVerificationReadAction;
11007
+ readonly smsRead: (input?: ActionInput<"sms_read"> | undefined) => {
11008
+ type: "sms_read";
11009
+ } & SmsReadAction;
11010
+ readonly evaluateJs: (input: ActionInput<"evaluate_js">) => {
11011
+ type: "evaluate_js";
11012
+ } & EvaluateJsAction;
11013
+ readonly formFill: (input: ActionInput<"form_fill">) => {
11014
+ type: "form_fill";
11015
+ } & FormFillActionWritable;
11016
+ readonly click: (input?: ActionInput<"click"> | undefined) => {
11017
+ type: "click";
11018
+ } & ClickActionInput;
11019
+ readonly fill: (input: ActionInput<"fill">) => {
11020
+ type: "fill";
11021
+ } & FillActionInputWritable;
11022
+ readonly multiFactorFill: (input: ActionInput<"multi_factor_fill">) => {
11023
+ type: "multi_factor_fill";
11024
+ } & MultiFactorFillActionInputWritable;
11025
+ readonly fallbackFill: (input: ActionInput<"fallback_fill">) => {
11026
+ type: "fallback_fill";
11027
+ } & FallbackFillActionInputWritable;
11028
+ readonly check: (input: ActionInput<"check">) => {
11029
+ type: "check";
11030
+ } & CheckActionInput;
11031
+ readonly selectDropdownOption: (input: ActionInput<"select_dropdown_option">) => {
11032
+ type: "select_dropdown_option";
11033
+ } & SelectDropdownOptionActionInputWritable;
11034
+ readonly uploadFile: (input: ActionInput<"upload_file">) => {
11035
+ type: "upload_file";
11036
+ } & UploadFileActionInput;
11037
+ readonly downloadFile: (input?: ActionInput<"download_file"> | undefined) => {
11038
+ type: "download_file";
11039
+ } & DownloadFileActionInput;
11040
+ };
11041
+ /** True when the action is a captcha solve, which gets a longer request timeout and 408 retries. */
11042
+ declare function isCaptchaSolveAction(action: ExecuteAction): action is ActionOfType<'captcha_solve'>;
11043
+
11044
+ /**
11045
+ * Typed error hierarchy mirroring `notte_sdk.errors` and the `notte_core` errors
11046
+ * the Python SDK raises. Every error thrown by the SDK extends `NotteError`, so
11047
+ * callers can `catch (e) { if (e instanceof NotteError) ... }` and branch on the
11048
+ * concrete class or on `NotteAPIError.statusCode`.
11049
+ */
11050
+
11051
+ declare class NotteError extends Error {
11052
+ constructor(message: string, options?: {
11053
+ cause?: unknown;
11054
+ });
11055
+ }
11056
+ /**
11057
+ * Body of a failed HTTP response, best effort. JSON bodies are exposed as-is;
11058
+ * non-JSON bodies (HTML error pages, empty 502s) are wrapped as `{ message }`.
11059
+ */
11060
+ type NotteAPIErrorBody = Record<string, unknown>;
11061
+ /** The API answered with a non-2xx status. */
11062
+ declare class NotteAPIError extends NotteError {
11063
+ readonly path: string;
11064
+ readonly statusCode: number;
11065
+ readonly error: NotteAPIErrorBody;
11066
+ readonly response: Response | undefined;
11067
+ constructor(path: string, statusCode: number, error: NotteAPIErrorBody, response?: Response);
11068
+ /** The API's own error message, when it sent one. */
11069
+ get apiMessage(): string | undefined;
11070
+ static fromBody(path: string, statusCode: number, body: unknown, response?: Response): NotteAPIError;
11071
+ }
11072
+ /** The API flagged the failure as an execution error (`x-error-class: NotteApiExecutionError`). */
11073
+ declare class NotteAPIExecutionError extends NotteAPIError {
11074
+ constructor(path: string, statusCode: number, error: NotteAPIErrorBody, response?: Response);
11075
+ }
11076
+ /** Missing or rejected credentials. Not retryable. */
11077
+ declare class AuthenticationError extends NotteError {
11078
+ constructor(message: string);
11079
+ }
11080
+ /** The request is malformed. Not retryable. */
11081
+ declare class InvalidRequestError extends NotteError {
11082
+ constructor(message: string);
11083
+ }
11084
+ /** A request or a wait exceeded its deadline. */
11085
+ declare class NotteTimeoutError extends NotteError {
11086
+ }
11087
+ /** A cloud function run finished with `status: "failed"`. */
11088
+ declare class FailedToRunCloudFunctionError extends NotteError {
11089
+ readonly functionId: string;
11090
+ readonly functionRunId: string;
11091
+ readonly response: unknown;
11092
+ constructor(functionId: string, functionRunId: string, response: unknown);
11093
+ }
11094
+ /** Structured scrape extraction failed (`StructuredData.success === false`). */
11095
+ declare class ScrapeFailedError extends NotteError {
11096
+ readonly structuredError: string | undefined;
11097
+ constructor(error: string | undefined);
11098
+ }
11099
+ /**
11100
+ * An action executed through `session.execute()` failed. Rehydrated from the
11101
+ * structured `exception_detail` payload the API returns, so `errorType` names
11102
+ * the concrete server-side error class and the three messages carry the same
11103
+ * text Python exposes on `NotteBaseError`.
11104
+ */
11105
+ declare class ActionExecutionError extends NotteError {
11106
+ readonly errorType: string;
11107
+ readonly devMessage: string;
11108
+ readonly userMessage: string;
11109
+ readonly agentMessage: string;
11110
+ readonly shouldRetryLater: boolean;
11111
+ readonly shouldNotifyTeam: boolean;
11112
+ constructor(detail: SerializedError);
11113
+ static fromMessage(message: string, errorType?: string): ActionExecutionError;
11114
+ }
11115
+ /** `evaluate_js` reported success but the API build predates the data payload. */
11116
+ declare class EvaluateJsNoDataError extends NotteError {
11117
+ constructor();
11118
+ }
11119
+ /** The envelope returned by `session.fetch()` could not be decoded. */
11120
+ declare class FetchResponseDecodeError extends NotteError {
11121
+ constructor(reason: string);
11122
+ }
11123
+ interface RetryOptions {
11124
+ /** Maximum number of attempts, including the first one. */
11125
+ maxTries: number;
11126
+ /** Delay between attempts in milliseconds. Defaults to 5000 like the Python decorator. */
11127
+ delayMs?: number;
11128
+ /** Message of the `Error` raised once every attempt failed. */
11129
+ errorMessage?: string;
11130
+ /** Only retry when this returns true for the thrown error. Defaults to retrying on any error. */
11131
+ shouldRetry?: (error: unknown, attempt: number) => boolean;
11132
+ /** Called before sleeping between attempts. Defaults to `console.warn`. */
11133
+ onRetry?: (error: unknown, attempt: number, maxTries: number) => void;
11134
+ }
11135
+ /**
11136
+ * Wrap an async function so it is retried when it throws, mirroring
11137
+ * `notte_sdk.errors.retry`. The final failure is raised as an `Error` whose
11138
+ * `cause` is the last underlying error.
11139
+ *
11140
+ * ```ts
11141
+ * const start = retry(() => session.start(), { maxTries: 3, delayMs: 1000 });
11142
+ * await start();
11143
+ * ```
11144
+ */
11145
+ declare function retry<TArgs extends unknown[], TResult>(fn: (...args: TArgs) => Promise<TResult>, options: RetryOptions): (...args: TArgs) => Promise<TResult>;
11146
+
11147
+ /**
11148
+ * Issue an HTTP request from the page a session is on, the port of
11149
+ * `notte_core.data.fetch`.
11150
+ *
11151
+ * `session.fetch()` runs the browser's own `fetch()` inside the current page, so
11152
+ * the request carries the page's cookies, the session's proxy and the browser's
11153
+ * network fingerprint. This module builds the script and reads the result back
11154
+ * into a `PageFetchResponse`.
11155
+ */
11156
+
11157
+ /** A form body (`Record`) or a raw string body. */
11158
+ type FetchData = string | Record<string, unknown>;
11159
+ interface PageFetchOptions {
11160
+ /** HTTP method. Defaults to `GET`. */
11161
+ method?: string;
11162
+ /** Request headers. */
11163
+ headers?: Record<string, string>;
11164
+ /** Query parameters appended to the URL (before any fragment). Arrays repeat the key. */
11165
+ params?: Record<string, unknown>;
11166
+ /** JSON body, sent with `Content-Type: application/json` unless a content type is given. */
11167
+ json?: unknown;
11168
+ /** Form body (`Record`, sent url-encoded) or a raw string body sent verbatim. */
11169
+ data?: FetchData;
11170
+ /** Abort the request after this many milliseconds. Must be positive. */
11171
+ timeoutMs?: number;
11172
+ /**
11173
+ * Allow `http:` URLs and follow redirects. Off by default because the request
11174
+ * carries the page's cookies: an `https:` request redirected to `http:` would
11175
+ * send them in cleartext before the response can be inspected, so by default
11176
+ * redirects are not followed and a redirected response throws.
11177
+ */
11178
+ allowInsecure?: boolean;
11179
+ /**
11180
+ * Browser `fetch` redirect mode. Defaults to `manual` (a redirect throws)
11181
+ * unless `allowInsecure` is set, in which case redirects are followed like
11182
+ * the Python SDK does.
11183
+ */
11184
+ redirect?: 'follow' | 'manual' | 'error';
11185
+ }
11186
+ /**
11187
+ * Return the JavaScript that performs the request and serialises the response.
11188
+ *
11189
+ * The script is an async IIFE, which `evaluateJs` awaits. It returns a JSON
11190
+ * string so the value survives the evaluate round-trip unchanged.
11191
+ *
11192
+ * ```ts
11193
+ * const script = buildFetchScript('/api/items', { params: { page: 2 } });
11194
+ * const response = responseFromEvaluated(await session.evaluateJs(script));
11195
+ * ```
11196
+ */
11197
+ declare function buildFetchScript(url: string, options?: PageFetchOptions): string;
11198
+ /** `response.raiseForStatus()` rejected a 4xx/5xx response, like `requests.HTTPError`. */
11199
+ declare class PageFetchHTTPError extends NotteError {
11200
+ readonly response: PageFetchResponse;
11201
+ constructor(response: PageFetchResponse);
11202
+ }
11203
+ /**
11204
+ * The response of `session.fetch()`, shaped like the Web `Response` with the
11205
+ * final `url` after redirects exposed as a plain property. A non-2xx status is
11206
+ * a response, not an error; `raiseForStatus()` throws `PageFetchHTTPError`.
11207
+ * `bytes()` holds the exact bytes the server sent, so binary bodies survive;
11208
+ * `text()` decodes them with the declared charset, or utf-8 when none is given.
11209
+ */
11210
+ declare class PageFetchResponse {
11211
+ readonly status: number;
11212
+ readonly statusText: string;
11213
+ readonly headers: Headers;
11214
+ /** The final URL after redirects. */
11215
+ readonly url: string;
11216
+ /** The declared charset, `utf-8` when the body is valid utf-8, else `undefined`. */
11217
+ readonly encoding: string | undefined;
11218
+ private readonly content;
11219
+ constructor(init: {
11220
+ status: number;
11221
+ headers: Record<string, string>;
11222
+ url: string;
11223
+ content: Uint8Array;
11224
+ });
11225
+ get ok(): boolean;
11226
+ /** The raw body bytes. */
11227
+ bytes(): Uint8Array;
11228
+ arrayBuffer(): Promise<ArrayBuffer>;
11229
+ text(): Promise<string>;
11230
+ json(): Promise<unknown>;
11231
+ /** Throw `PageFetchHTTPError` on a 4xx/5xx status, like `requests.Response.raise_for_status()`. */
11232
+ raiseForStatus(): this;
11233
+ }
11234
+ /**
11235
+ * Turn the envelope `buildFetchScript` returns into a `PageFetchResponse`.
11236
+ * Throws `FetchResponseDecodeError` when the envelope cannot be read.
11237
+ */
11238
+ declare function responseFromEvaluated(raw: string): PageFetchResponse;
11239
+
11240
+ /**
11241
+ * Shared scrape request/response handling for `client.scrape()` and
11242
+ * `session.scrape()`, mirroring `PageClient.scrape` in the Python SDK.
11243
+ */
11244
+
11245
+ /** Minimal structural view of a Zod schema so `zod` stays an optional import path. */
11246
+ interface ZodLikeSchema<T> {
11247
+ parse(data: unknown): T;
11248
+ }
11249
+ /** Structured extraction result when `raiseOnFailure` is false, like `StructuredData` in Python. */
11250
+ interface StructuredData<T> {
11251
+ success: boolean;
11252
+ error?: string | null;
11253
+ data?: T | null;
11254
+ }
11255
+ interface ScrapeOptions<T = unknown> {
11256
+ /** A Zod schema or a JSON Schema object describing the data to extract. */
11257
+ response_format?: ZodLikeSchema<T> | Record<string, unknown> | null;
11258
+ /** JSON Schema to send instead of converting `response_format`. Only used with a Zod schema. */
11259
+ json_schema?: Record<string, unknown>;
11260
+ /**
11261
+ * When true (default) a failed structured extraction throws `ScrapeFailedError`
11262
+ * and the extracted data is returned directly. When false the `StructuredData`
11263
+ * wrapper is returned so callers can inspect `.success`.
11264
+ */
11265
+ raiseOnFailure?: boolean;
11266
+ }
11267
+ type SessionScrapeOptions<T = unknown> = Omit<ScrapeRequest, 'response_format'> & ScrapeOptions<T>;
11268
+ type ScrapeResult<T> = string | ImageData[] | T | StructuredData<T>;
11269
+ /**
11270
+ * Post-process a scrape response according to the request options:
11271
+ * - `only_images` returns the image list,
11272
+ * - `response_format` / `instructions` return the extracted data (validated by
11273
+ * the Zod schema when one was given) or throw `ScrapeFailedError`,
11274
+ * - otherwise the markdown string is returned.
11275
+ */
11276
+ declare function processScrapeResponse<T = unknown>(scrapeResponse: DataSpace | undefined, options: SessionScrapeOptions<T> & {
11277
+ instructions?: string | null;
11278
+ only_images?: boolean;
11279
+ }): ScrapeResult<T>;
11280
+
11281
+ /** A file ID was not found in the session, the counterpart of Python's `FileNotFoundError`. */
11282
+ declare class FileNotFoundError extends NotteError {
11283
+ }
11284
+ /** The download destination already exists, the counterpart of Python's `FileExistsError`. */
11285
+ declare class FileExistsError extends NotteError {
11286
+ }
11287
+ interface FileListOptions {
11288
+ /** Only return files from this source: `user_upload` or `session_download`. */
11289
+ source?: FileSource;
11290
+ /** Page size. Defaults to 100. */
11291
+ limit?: number;
11292
+ /** Page offset. Defaults to 0. */
11293
+ offset?: number;
11294
+ }
11295
+ interface FileDownloadOptions {
11296
+ /** Overwrite an existing local file instead of rejecting with `FileExistsError`. */
11297
+ force?: boolean;
11298
+ }
11299
+ /** Bytes accepted by `upload()`: a local path, a `Blob`/`File`, or an in-memory buffer. */
11300
+ type UploadableFile = string | Blob | Uint8Array;
11301
+ /**
11302
+ * Reduce a server-provided filename to a safe basename, like Python's
11303
+ * `Path(PureWindowsPath(filename).name).name`: both separators are honoured,
11304
+ * drive letters are dropped and only the last component is kept.
11305
+ */
11306
+ declare function sanitizeFilename(filename: string): string;
11307
+ /**
11308
+ * Session-scoped file operations built on the generated `sessions/{id}/files`
11309
+ * client. Every API failure rejects with a `NotteAPIError`.
11310
+ *
11311
+ * ```ts
11312
+ * const files = client.Files(sessionId);
11313
+ * const uploaded = await files.upload(new Blob(['hello']), 'hello.txt');
11314
+ * const page = await files.list({ source: 'user_upload' });
11315
+ * ```
11316
+ */
11317
+ declare class SessionFiles {
11318
+ private readonly client;
11319
+ readonly sessionId: string;
11320
+ constructor(client: Client, sessionId: string);
11321
+ /**
11322
+ * Upload bytes as a session file. `filename` is what the browser sees when
11323
+ * the file is later attached to a page.
11324
+ *
11325
+ * @param file - Bytes to upload as a Blob, File, or buffer.
11326
+ * @param filename - Stored filename, defaulting to `file`.
11327
+ * @returns Metadata for the uploaded file, including its ID, name, and size.
11328
+ * @throws NotteAPIError if the storage API request fails.
11329
+ */
11330
+ upload(file: Blob | Uint8Array, filename?: string): Promise<SessionFile>;
11331
+ /** List the session's non-expired files, newest first.
11332
+ *
11333
+ * @param options - Optional source filter and pagination. Defaults to all sources, limit 100, and offset 0.
11334
+ * @returns One page of non-expired files and the total count; pagination is not automatic.
11335
+ * @throws NotteAPIError if the storage API request fails.
11336
+ */
11337
+ list(options?: FileListOptions): Promise<SessionFilesPage>;
11338
+ /**
11339
+ * Find a file's metadata by ID by scanning the session listing. Rejects with
11340
+ * `FileNotFoundError` when the ID is unknown or expired.
11341
+ *
11342
+ * @param fileId - ID of a file belonging to this session.
11343
+ * @returns The matching file's metadata.
11344
+ * @throws NotteAPIError if the storage API request fails.
11345
+ * @throws FileNotFoundError if the file ID is unknown or expired.
11346
+ */
11347
+ metadata(fileId: string): Promise<SessionFile>;
11348
+ /** Download a file's bytes as a `Blob`.
11349
+ *
11350
+ * @param fileId - ID of a file belonging to this session.
11351
+ * @returns The downloaded bytes as a Blob; no local file is written.
11352
+ * @throws NotteAPIError if the storage API request fails.
11353
+ */
11354
+ download(fileId: string): Promise<Blob>;
11355
+ /** Stream a file's bytes. Used by `RemoteFileStorage.download()` to write to disk without buffering. */
11356
+ stream(fileId: string): Promise<ReadableStream<Uint8Array>>;
11357
+ /** Delete a session file.
11358
+ *
11359
+ * @param fileId - ID of the session file to delete.
11360
+ * @returns Resolves when deletion succeeds.
11361
+ * @throws NotteAPIError if the storage API request fails.
11362
+ */
11363
+ delete(fileId: string): Promise<void>;
11364
+ }
11365
+ /**
11366
+ * File storage bound to a session, the counterpart of Python's
11367
+ * `RemoteFileStorage`. Create it unbound and pass it to `client.Session({ storage })`
11368
+ * so the session binds it on start, or bind it yourself with a session ID.
11369
+ *
11370
+ * ```ts
11371
+ * const storage = client.FileStorage(sessionId);
11372
+ * const uploaded = await storage.upload('./resume.pdf');
11373
+ * const localPath = await storage.download(uploaded.id, './downloads');
11374
+ * const blob = await storage.downloadBlob(uploaded.id);
11375
+ * ```
11376
+ *
11377
+ * `download()` saves to disk; `downloadBlob()` returns bytes in memory, and
11378
+ * `stream()` returns a readable stream. For lower-level session file access,
11379
+ * see [NotteClient.Files](/typescript-sdk-reference/client/files).
11380
+ *
11381
+ */
11382
+ declare class RemoteFileStorage {
11383
+ readonly client: NotteClient;
11384
+ private _sessionId;
11385
+ constructor(client: NotteClient, sessionId?: string);
11386
+ /** Bind the storage to a session. Called by `Session.start()` when the storage was passed to the session. */
11387
+ setSessionId(sessionId: string): void;
11388
+ /**
11389
+ * Bind this storage once, cloning it when another session already owns it.
11390
+ *
11391
+ * ```ts
11392
+ * const first = storage.forSession('session-a'); // first === storage
11393
+ * const second = storage.forSession('session-b'); // a clone sharing the client
11394
+ * ```
11395
+ */
11396
+ forSession(sessionId: string): RemoteFileStorage;
11397
+ /** ID of the bound session. Throws `InvalidRequestError` while the storage is unbound. */
11398
+ get sessionId(): string;
11399
+ /** Whether the storage has been bound to a session yet. */
11400
+ get isBound(): boolean;
11401
+ private files;
11402
+ /**
11403
+ * Upload a file to the session. A string is read as a local path and its
11404
+ * basename becomes the uploaded filename unless `uploadFileName` is set.
11405
+ *
11406
+ * @param file - Local file path, Blob, File, or buffer to upload.
11407
+ * @param uploadFileName - Optional stored filename. Local paths default to their basename; File objects keep their name.
11408
+ * @returns Metadata for the uploaded file, including its ID, name, and size.
11409
+ * @throws NotteAPIError if the storage API request fails.
11410
+ * @throws InvalidRequestError if storage has not been bound to a session.
11411
+ * @throws InvalidRequestError if a supplied local path is not a file.
11412
+ * @example
11413
+ * await storage.upload('./data/resume.pdf');
11414
+ * await storage.upload(Buffer.from('hello'), 'hello.txt');
11415
+ */
11416
+ upload(file: UploadableFile, uploadFileName?: string): Promise<SessionFile>;
11417
+ /**
11418
+ * List the session's files.
11419
+ *
11420
+ * @param options - Optional source filter and pagination. Defaults to all sources, limit 100, and offset 0.
11421
+ * @returns One page of non-expired files and the total count; pagination is not automatic.
11422
+ * @throws NotteAPIError if the storage API request fails.
11423
+ * @throws InvalidRequestError if storage has not been bound to a session.
11424
+ * @example
11425
+ * const downloads = await storage.list({ source: 'session_download', limit: 1000 });
11426
+ */
11427
+ list(options?: FileListOptions): Promise<SessionFilesPage>;
11428
+ /** Metadata of a file by ID. Rejects with `FileNotFoundError` when unknown.
11429
+ *
11430
+ * @param fileId - ID of a file belonging to this session.
11431
+ * @returns The matching file's metadata.
11432
+ * @throws NotteAPIError if the storage API request fails.
11433
+ * @throws FileNotFoundError if the file ID is unknown or expired.
11434
+ * @throws InvalidRequestError if storage has not been bound to a session.
11435
+ */
11436
+ metadata(fileId: string): Promise<SessionFile>;
11437
+ /**
11438
+ * Download a file to `<localDir>/<filename>` and return the local path. The
11439
+ * file is written atomically (temporary file + rename). Rejects with
11440
+ * `FileExistsError` when the destination exists unless `force` is set.
11441
+ *
11442
+ * @param fileId - ID of the file to download.
11443
+ * @param localDir - Destination directory, created if needed. Defaults to the current directory.
11444
+ * @param options - Set `force` to overwrite an existing destination; defaults to false.
11445
+ * @returns The local file path after the download has been written successfully.
11446
+ * @throws NotteAPIError if the storage API request fails.
11447
+ * @throws InvalidRequestError if storage has not been bound to a session.
11448
+ * @throws FileExistsError if the destination exists and `force` is false. Filesystem errors also propagate.
11449
+ * @example
11450
+ * const path = await storage.download(fileId, './downloads', { force: true });
11451
+ */
11452
+ download(fileId: string, localDir?: string, options?: FileDownloadOptions): Promise<string>;
11453
+ /** Download a file's bytes as a `Blob` without touching the local filesystem. */
11454
+ downloadBlob(fileId: string): Promise<Blob>;
11455
+ /** Stream a file's bytes without buffering the whole file in memory. */
11456
+ stream(fileId: string): Promise<ReadableStream<Uint8Array>>;
11457
+ /** Delete a session file.
11458
+ *
11459
+ * @param fileId - ID of the session file to delete.
11460
+ * @returns Resolves when deletion succeeds.
11461
+ * @throws NotteAPIError if the storage API request fails.
11462
+ * @throws InvalidRequestError if storage has not been bound to a session.
11463
+ */
11464
+ delete(fileId: string): Promise<void>;
11465
+ }
11466
+
11467
+ /** Number of attempts `start()` makes on 5xx errors, like `RemoteSession.start(tries=3)`. */
11468
+ declare const SESSION_START_TRIES = 3;
11469
+ /** Delay before retrying `start()` after an HTTP 529 (cluster overload). */
11470
+ declare const CLUSTER_OVERLOAD_RETRY_DELAY_MS = 30000;
11471
+ /** Request timeout for `captcha_solve` actions, like `PageClient.execute` in Python. */
11472
+ declare const CAPTCHA_SOLVE_TIMEOUT_MS = 100000;
11473
+ type PerceptionType = NonNullable<ObserveRequest['perception_type']>;
11474
+ type SessionCloseReason = 'manual' | 'error';
11475
+ interface ExecuteOptions {
11476
+ /** Throw when the action fails. Defaults to the session's `raiseOnFailure` (true). */
11477
+ raiseOnFailure?: boolean;
11478
+ }
11479
+ interface ReplayOptions {
11480
+ /** Poll until the replay is ready instead of failing on 404. Defaults to true. */
11481
+ wait?: boolean;
11482
+ /** Maximum time to wait for the replay, in milliseconds. Defaults to 240 000. */
11483
+ timeoutMs?: number;
11484
+ /** Delay between polling attempts, in milliseconds. Defaults to 5 000. */
11485
+ pollIntervalMs?: number;
11486
+ }
11487
+ interface SessionScriptOptions {
11488
+ /** Return a standalone workflow script rather than only the relevant steps. Defaults to true. */
11489
+ as_workflow?: boolean;
11490
+ /** Infer a `response_format` schema for scrape calls that have instructions but no schema. */
11491
+ infer_response_format?: boolean;
11492
+ }
11493
+ interface SessionOptions extends ApiSessionStartRequest {
10965
11494
  /**
10966
11495
  * @deprecated Remote sessions always use the supported browser launch mode.
10967
11496
  * Retained as a boolean so existing typed configuration still compiles.
@@ -10973,85 +11502,323 @@ interface SessionOptions extends Omit<ApiSessionStartRequest, 'use_file_storage'
10973
11502
  * This is a local SDK option and is not sent to the API.
10974
11503
  */
10975
11504
  open_viewer?: boolean;
11505
+ /**
11506
+ * Default for `execute()`: throw `ActionExecutionError` when an action fails.
11507
+ * The counterpart of `raise_on_failure` on `RemoteSession`. Defaults to true.
11508
+ */
11509
+ raiseOnFailure?: boolean;
11510
+ /** Default perception type for `observe()`. Defaults to `fast`. */
11511
+ perception_type?: PerceptionType;
11512
+ /**
11513
+ * JSON cookie file: loaded into the session on `start()` when it exists and
11514
+ * appended with the session cookies on `stop()`.
11515
+ */
11516
+ cookie_file?: string;
11517
+ /** File storage to attach to the session so agents can consume uploaded files. */
11518
+ storage?: RemoteFileStorage;
10976
11519
  }
11520
+ /**
11521
+ * Keep the external CDP client from competing with Notte for native dialogs.
11522
+ *
11523
+ * Playwright automatically handles a JavaScript dialog when no listener is
11524
+ * registered. Native dialogs are target-global, so that default races the
11525
+ * Notte browser controller attached to the same target. The backend owns
11526
+ * dialog handling; this listener makes the SDK Playwright connection an
11527
+ * observer without issuing a second `Page.handleJavaScriptDialog` command.
11528
+ */
11529
+ declare function observeServerOwnedDialog(_dialog: Dialog): void;
11530
+ declare function installServerOwnedDialogPolicy(browser: Pick<Browser, 'contexts'>): void;
11531
+ /**
11532
+ * Browser session created with `client.Session(options)`.
11533
+ * Call `start()` before using it and `stop()` when finished, or use `use()`
11534
+ * to start and stop automatically around an asynchronous callback.
11535
+ */
10977
11536
  declare class Session {
10978
11537
  private client;
10979
11538
  private options;
10980
11539
  private openViewer;
10981
11540
  private legacyHeadless;
11541
+ private defaultRaiseOnFailure;
11542
+ private defaultPerceptionType;
11543
+ private cookieFile;
11544
+ private fileStorage;
10982
11545
  private sessionId;
10983
11546
  private isActive;
10984
11547
  private response;
11548
+ private playwrightBrowser;
11549
+ private playwrightPage;
10985
11550
  constructor(client: NotteClient, options?: SessionOptions);
10986
11551
  /**
10987
- * Start the session - creates a new session on the server
11552
+ * Start the session: creates a new session on the server.
11553
+ *
11554
+ * Retries up to `SESSION_START_TRIES` times on 5xx errors, waiting
11555
+ * `CLUSTER_OVERLOAD_RETRY_DELAY_MS` on HTTP 529 (cluster overload). 4xx
11556
+ * errors are never retried.
11557
+ *
11558
+ * Prefer `session.use(async session => { ... })`, which also stops the session.
11559
+ * @example
11560
+ * const session = client.Session();
11561
+ * await session.start();
10988
11562
  */
10989
11563
  start(): Promise<void>;
10990
11564
  /**
10991
- * Stop the session - terminates the session on the server
11565
+ * Stop the session and clean up resources (including any Playwright
11566
+ * connection opened with `page()`). When a `cookie_file` was given, the
11567
+ * session cookies are appended to it first. A session the API reports as
11568
+ * already stopped is tolerated with a warning.
11569
+ *
11570
+ * @example
11571
+ * await session.stop();
10992
11572
  */
10993
- stop(closeReason?: 'manual' | 'error'): Promise<void>;
11573
+ stop(closeReason?: SessionCloseReason): Promise<void>;
11574
+ private closePlaywright;
10994
11575
  /**
10995
- * Get session status
11576
+ * Get the current status of the session. Like Python, this keeps working
11577
+ * after `stop()` (for example to read the recorded `steps`).
11578
+ *
11579
+ * @returns Current session metadata, including lifecycle status and recorded steps. Works after `stop()`.
11580
+ * @throws Error if this session has never been started.
11581
+ * @throws NotteAPIError if the status request fails.
11582
+ * @example
11583
+ * const status = await session.status();
11584
+ * console.log(status.status); // 'active'
10996
11585
  */
10997
11586
  status(): Promise<SessionResponse>;
10998
- /**
10999
- * Get session ID
11000
- */
11587
+ /** Session ID while the session is active, `null` otherwise. */
11001
11588
  getId(): string | null;
11002
- /**
11003
- * Check if session is active
11004
- */
11589
+ /** Whether the session has been started and not stopped yet. */
11005
11590
  isSessionActive(): boolean;
11006
- /**
11007
- * Get the last response from session operations
11008
- */
11591
+ /** The last `SessionResponse` received from the API (start, stop or status). */
11009
11592
  getResponse(): SessionResponse | null;
11593
+ /** The file storage attached to the session, when one was given. */
11594
+ get storage(): RemoteFileStorage | undefined;
11595
+ private requireSessionId;
11596
+ /** Session ID of the active session, or of the last one when it was stopped. */
11597
+ private lastSessionId;
11010
11598
  /**
11011
11599
  * Open the live viewer for this session in the local default browser.
11600
+ * @throws If the session has not started or no viewer URL is available.
11012
11601
  */
11013
11602
  viewer(): void;
11014
11603
  private openViewerInBrowser;
11015
11604
  /**
11016
- * Set cookies for the session
11605
+ * Get presigned URLs for the session replay. Recordings are finalized after
11606
+ * the session is closed, so by default this polls on 404 until the replay is
11607
+ * ready. It keeps working after `stop()`.
11608
+ *
11609
+ * Throws an `Error` when the API reports the session is still active and a
11610
+ * `NotteTimeoutError` when the replay is not ready within `timeoutMs`.
11611
+ * @example
11612
+ * await session.stop();
11613
+ * const replay = await session.replay();
11614
+ * console.log(replay.mp4_url);
11615
+ */
11616
+ replay(options?: ReplayOptions): Promise<ReplayResponse>;
11617
+ /**
11618
+ * Download the MP4 replay to a local file, like `ReplayResponse.download()`
11619
+ * in Python. Resolves with the absolute path of the written file and throws
11620
+ * when the replay has no `mp4_url`.
11621
+ *
11622
+ * @example
11623
+ * await session.stop();
11624
+ * const file = await session.downloadReplay('session.mp4');
11625
+ */
11626
+ downloadReplay(path?: string, options?: ReplayOptions): Promise<string>;
11627
+ /**
11628
+ * Upload cookies to the session.
11629
+ *
11630
+ * @example
11631
+ * await session.setCookies([{ name: 'token', value: 'abc', domain: 'example.com', path: '/', httpOnly: false }]);
11017
11632
  */
11018
11633
  setCookies(cookies: Cookie[]): Promise<ExecutionResponse>;
11019
11634
  /**
11020
- * Set cookies from a file
11635
+ * Upload cookies from a JSON file (a list of cookies, like `getCookies()` returns).
11636
+ *
11637
+ * @example
11638
+ * await session.setCookiesFromFile('cookies.json');
11021
11639
  */
11022
11640
  setCookiesFromFile(cookieFile: string): Promise<ExecutionResponse>;
11023
11641
  /**
11024
- * Get cookies from the session
11642
+ * Get the cookies of the session.
11643
+ *
11644
+ * @example
11645
+ * const cookies = await session.getCookies();
11646
+ * await fs.writeFile('cookies.json', JSON.stringify(cookies));
11025
11647
  */
11026
11648
  getCookies(): Promise<Cookie[]>;
11649
+ /** Detailed debug information for the session (debug URL, websocket URLs, tabs). */
11650
+ debugInfo(): Promise<SessionDebugResponse>;
11027
11651
  /**
11028
- * Execute an action on the page
11652
+ * Debug information for one tab of the session. The API client has no
11653
+ * dedicated tab endpoint, so this reads the tab from `debugInfo().tabs`.
11029
11654
  */
11030
- execute(action: any, raiseOnFailure?: boolean): Promise<ApiExecutionResponse>;
11655
+ debugTabInfo(tabIdx?: number): Promise<TabSessionDebugResponse>;
11031
11656
  /**
11032
- * Observe the current page state
11657
+ * Get the Chrome DevTools Protocol WebSocket URL for the session.
11658
+ *
11659
+ * A `cdp_url` given at construction (another browser provider) is returned
11660
+ * untouched. Notte-served URLs, from the start response or the debug info,
11661
+ * carry the database preview branch when one is configured.
11662
+ *
11663
+ * @returns The CDP WebSocket URL for connecting a browser automation client.
11664
+ * @throws Error if no session ID or CDP URL is available.
11665
+ * @example
11666
+ * const browser = await chromium.connectOverCDP(await session.cdpUrl());
11033
11667
  */
11034
- observe(perceptionType?: 'fast' | 'deep'): Promise<Observation>;
11668
+ cdpUrl(): Promise<string>;
11035
11669
  /**
11036
- * Get session replay data
11670
+ * Get a Playwright page connected to the session via CDP. The connection is
11671
+ * established lazily on first access, cached, and closed by `stop()`.
11672
+ * Native dialogs are left to the Notte backend.
11673
+ *
11674
+ * Requires the optional `playwright-core` peer dependency
11675
+ * (`npm install playwright-core`).
11676
+ *
11677
+ * @example
11678
+ * const page = await session.page();
11679
+ * await page.goto('https://www.google.com');
11680
+ * await page.screenshot({ path: 'screenshot.png' });
11037
11681
  */
11038
- replay(): Promise<any>;
11682
+ page(): Promise<Page>;
11039
11683
  /**
11040
- * Scrape the current page
11041
- */
11042
- scrape(options?: ScrapeRequest): Promise<string | any>;
11043
- scrape<T>(options: ScrapeRequest & {
11044
- response_format: z.ZodSchema<T>;
11045
- json_schema?: any;
11684
+ * Get the workflow code generated from the session steps
11685
+ * (`GET /sessions/{id}/workflow/code`).
11686
+ *
11687
+ * @example
11688
+ * const { python_script } = await session.getScript();
11689
+ */
11690
+ getScript(options?: SessionScriptOptions): Promise<AgentFunctionCodeResponse>;
11691
+ /**
11692
+ * Execute an action on the current page.
11693
+ *
11694
+ * When the action fails and `raiseOnFailure` is true (the default, see the
11695
+ * session option), the structured `exception_detail` returned by the API is
11696
+ * rehydrated into an `ActionExecutionError` whose `errorType` names the
11697
+ * server-side error class. `captcha_solve` actions get a 100 s request
11698
+ * timeout and are retried up to 3 times on HTTP 408.
11699
+ *
11700
+ * @param action - Action type, target, and action-specific arguments.
11701
+ * @param options - Override failure handling for this call; otherwise use the session setting.
11702
+ * @returns The execution response, including `success` and failure details when throwing is disabled.
11703
+ * @throws ActionExecutionError if the action fails and failure throwing is enabled.
11704
+ * @throws NotteAPIError if the API request fails.
11705
+ * @example
11706
+ * import { actions } from 'notte-sdk';
11707
+ *
11708
+ * await session.execute({ type: 'goto', url: 'https://www.notte.cc' });
11709
+ * await session.execute(actions.fill({ selector: "input[name='email']", value: 'user@example.com' }));
11710
+ * const result = await session.execute({ type: 'click', id: 'B1' }, { raiseOnFailure: false });
11711
+ * if (!result.success) console.log(result.message);
11712
+ */
11713
+ execute(action: ExecuteAction, options?: boolean | ExecuteOptions): Promise<ApiExecutionResponse>;
11714
+ /**
11715
+ * Evaluate JavaScript on the current page and return its result as a string.
11716
+ *
11717
+ * The result is stringified the way `evaluate_js` records it: objects and
11718
+ * arrays as JSON, a JS `null` as the string `"null"`. On failure the typed
11719
+ * `ActionExecutionError` is thrown with the actual JavaScript error; pass
11720
+ * `raiseOnFailure: false` to get the execution result envelope instead.
11721
+ *
11722
+ * @example
11723
+ * const title = await session.evaluateJs('document.title');
11724
+ * const payload = JSON.parse(await session.evaluateJs('(async () => JSON.stringify(await (await fetch("/api")).json()))()'));
11725
+ */
11726
+ evaluateJs(code: string, options?: {
11727
+ raiseOnFailure?: true;
11728
+ }): Promise<string>;
11729
+ evaluateJs(code: string, options: {
11730
+ raiseOnFailure: false;
11731
+ }): Promise<ApiExecutionResponse>;
11732
+ /**
11733
+ * Issue an HTTP request from the page the session is on and return the response.
11734
+ *
11735
+ * The request runs inside the browser through `fetch()`, so it carries the
11736
+ * page's cookies, the session's proxy and the browser's own network
11737
+ * fingerprint. A relative `url` resolves against the current page, which
11738
+ * also makes it same-origin; a cross-origin URL is subject to CORS exactly
11739
+ * as in a browser tab, so `goto` the target origin first. Redirects are
11740
+ * followed and the final URL is on `response.url`. A non-2xx status is
11741
+ * returned, not thrown; `response.raiseForStatus()` throws `PageFetchHTTPError`.
11742
+ *
11743
+ * `json` is serialised as the body with an `application/json` content type,
11744
+ * `data` as a form body when it is an object or verbatim when it is a string.
11745
+ *
11746
+ * @param url - Absolute URL or a path relative to the current page.
11747
+ * @param options - HTTP method, headers, and request body settings.
11748
+ * @returns A response with status, headers, and body readers. Non-2xx responses are not automatically thrown.
11749
+ * @throws ActionExecutionError if browser-side execution fails.
11750
+ * @example
11751
+ * await session.execute({ type: 'goto', url: 'https://en.wikipedia.org/wiki/Main_Page' });
11752
+ * const summary = await (await session.fetch('/api/rest_v1/page/summary/Main_Page')).json();
11753
+ */
11754
+ fetch(url: string, options?: PageFetchOptions): Promise<PageFetchResponse>;
11755
+ /**
11756
+ * Observe the current page: the list of actions that can be taken, a
11757
+ * screenshot and page metadata.
11758
+ *
11759
+ * The `perception_type` defaults to the session option (`fast`). A bare
11760
+ * string argument is accepted as the perception type.
11761
+ *
11762
+ * @param options - Observation settings, including an optional URL, or a perception-mode string.
11763
+ * @returns Structured page analysis, available actions, and page metadata.
11764
+ * @throws NotteAPIError if observation fails.
11765
+ * @example
11766
+ * const obs = await session.observe();
11767
+ * console.log(obs.space.description);
11768
+ * const deep = await session.observe({ perception_type: 'deep', max_nb_actions: 50 });
11769
+ */
11770
+ observe(options?: ObserveRequest | PerceptionType): Promise<Observation>;
11771
+ /**
11772
+ * Scrape the current page.
11773
+ *
11774
+ * With `response_format` or `instructions`, the extracted data is returned
11775
+ * directly and a failed extraction throws `ScrapeFailedError`. Pass
11776
+ * `raiseOnFailure: false` to receive the `StructuredData` wrapper instead.
11777
+ * @example
11778
+ * const markdown = await session.scrape({ only_main_content: true });
11779
+ * const images = await session.scrape({ only_images: true });
11780
+ * const product = await session.scrape({ response_format: Product, instructions: 'Extract the product' });
11781
+ * const result = await session.scrape({ response_format: Product, raiseOnFailure: false });
11782
+ * if (result.success) console.log(result.data);
11783
+ */
11784
+ scrape(options: SessionScrapeOptions<unknown> & {
11785
+ only_images: true;
11786
+ }): Promise<ImageData[]>;
11787
+ scrape(options?: SessionScrapeOptions<unknown> & {
11788
+ response_format?: undefined;
11789
+ instructions?: undefined | null;
11790
+ only_images?: false;
11791
+ }): Promise<string>;
11792
+ scrape<T>(options: SessionScrapeOptions<T> & {
11793
+ response_format: ZodLikeSchema<T>;
11794
+ raiseOnFailure?: true;
11046
11795
  }): Promise<T>;
11047
- /**
11048
- * Context manager pattern - automatically start and stop session
11049
- * Usage: await session.use(async (session) => { ... })
11796
+ scrape<T>(options: SessionScrapeOptions<T> & {
11797
+ response_format: ZodLikeSchema<T>;
11798
+ raiseOnFailure: false;
11799
+ }): Promise<StructuredData<T>>;
11800
+ scrape(options: SessionScrapeOptions<unknown>): Promise<ScrapeResult<unknown>>;
11801
+ /**
11802
+ * Context manager pattern: start the session, run the callback and stop the
11803
+ * session, with close reason `error` when the callback throws.
11804
+ *
11805
+ * @param callback - Async work to perform with the started session.
11806
+ * @returns The callback's return value after session cleanup has been attempted.
11807
+ * @throws Error if startup fails, the callback throws, or cleanup fails after a successful callback.
11808
+ * @example
11809
+ * await client.Session().use(async session => {
11810
+ * await session.execute({ type: 'goto', url: 'https://www.notte.cc' });
11811
+ * });
11050
11812
  */
11051
11813
  use<T>(callback: (session: Session) => Promise<T>): Promise<T>;
11052
11814
  /**
11053
- * Async iterator pattern for session lifecycle management
11054
- * Usage: for await (const session of sessionInstance) { ... }
11815
+ * Async iterator pattern for session lifecycle management.
11816
+ *
11817
+ * ```ts
11818
+ * for await (const session of client.Session()) {
11819
+ * await session.execute({ type: 'goto', url: 'https://www.notte.cc' });
11820
+ * }
11821
+ * ```
11055
11822
  */
11056
11823
  [Symbol.asyncIterator](): AsyncGenerator<this, void, unknown>;
11057
11824
  }
@@ -11059,12 +11826,67 @@ declare class Session {
11059
11826
  interface VaultConstructorWithId {
11060
11827
  vault_id: string;
11061
11828
  }
11062
- interface VaultConstructorCreate extends Omit<VaultCreateRequest, never> {
11829
+ interface VaultConstructorCreate extends VaultCreateRequest {
11063
11830
  vault_id?: never;
11064
11831
  }
11065
11832
  type VaultConstructor = VaultConstructorWithId | VaultConstructorCreate;
11833
+ /** Credential fields read by `addCredentialsFromEnv`, in the order Python's `CredentialField.registry` declares them. */
11834
+ declare const CREDENTIAL_FIELDS: readonly ["email", "username", "mfa_secret", "password"];
11835
+ type CredentialField = (typeof CREDENTIAL_FIELDS)[number];
11836
+ /**
11837
+ * Get the root domain of a URL, the counterpart of `notte_core.utils.url.get_root_domain`.
11838
+ * Returns an empty string when no domain can be extracted.
11839
+ *
11840
+ * ```ts
11841
+ * getRootDomain('https://www.example.com/path'); // 'example.com'
11842
+ * getRootDomain('https://test.peeple.com/ok'); // 'peeple.com'
11843
+ * getRootDomain('https://shop.example.co.uk'); // 'example.co.uk'
11844
+ * ```
11845
+ */
11846
+ declare function getRootDomain(url: string): string;
11847
+ /**
11848
+ * Normalise a credential URL to its root domain, the counterpart of
11849
+ * `notte_sdk.types.validate_url`. Throws `InvalidRequestError` when the URL
11850
+ * has no domain name.
11851
+ *
11852
+ * ```ts
11853
+ * validateUrl('https://github.com/login'); // 'github.com'
11854
+ * validateUrl('https://'); // throws InvalidRequestError
11855
+ * ```
11856
+ */
11857
+ declare function validateUrl(url: string): string;
11066
11858
  /**
11067
- * Vault that fetches credentials stored using the SDK - mirrors Python NotteVault class
11859
+ * Check that a string is a base32 TOTP secret, with the padding rules Python's
11860
+ * `pyotp.TOTP(secret).now()` applies (`base64.b32decode` after right-padding
11861
+ * the secret to a multiple of eight characters).
11862
+ */
11863
+ declare function isValidMfaSecret(secret: string): boolean;
11864
+ /**
11865
+ * Validate an MFA secret like `AddCredentialsRequest.check_email_and_username`
11866
+ * in Python. Rejects one-time codes (`999777`) and anything that is not base32.
11867
+ */
11868
+ declare function validateMfaSecret(secret: string): void;
11869
+ /**
11870
+ * Apply the client-side rules of Python's `AddCredentialsRequest`: exactly one
11871
+ * of `username` / `email`, and a base32 `mfa_secret` when one is provided.
11872
+ * Returns the credentials unchanged.
11873
+ */
11874
+ declare function validateCredentials(credentials: CredentialsDictInput): CredentialsDictInput;
11875
+ /**
11876
+ * Vault that fetches credentials stored using the SDK, the counterpart of
11877
+ * `notte_sdk.endpoints.vaults.NotteVault`.
11878
+ *
11879
+ * The remote vault is created lazily on the first API operation so local-only
11880
+ * helpers such as `generatePassword()` stay side-effect free. Every API
11881
+ * failure rejects with a `NotteAPIError`; caller mistakes (invalid URL,
11882
+ * one-time code stored as an MFA secret, ...) reject with `InvalidRequestError`.
11883
+ * // pragma: allowlist secret
11884
+ * ```ts
11885
+ * const vault = client.Vault({ name: 'My vault' });
11886
+ * await vault.addCredentials('https://github.com/', { email: 'me@example.org', password: 'secret' }); // pragma: allowlist secret
11887
+ * const credentials = await vault.getCredentials('https://github.com/login');
11888
+ * await vault.stop(); // deletes the vault and every credential it holds
11889
+ * ```
11068
11890
  */
11069
11891
  declare class NotteVault {
11070
11892
  private client;
@@ -11076,64 +11898,98 @@ declare class NotteVault {
11076
11898
  private initNewVault;
11077
11899
  private verifyVaultExists;
11078
11900
  private ensureInitialized;
11901
+ /** ID of the remote vault. Throws until the first API operation has created or verified it. */
11079
11902
  get vaultId(): string;
11080
11903
  /**
11081
- * Start the vault - no-op for compatibility with Python interface
11904
+ * Start the vault. No-op kept for parity with Python's `SyncResource` interface.
11082
11905
  */
11083
11906
  start(): void;
11084
11907
  /**
11085
- * Stop the vault - deletes it and all credentials
11908
+ * Stop the vault: deletes it together with every credential it holds.
11909
+ *
11910
+ * ```ts
11911
+ * await vault.stop();
11912
+ * ```
11086
11913
  */
11087
11914
  stop(): Promise<void>;
11088
11915
  /**
11089
- * Add or update credentials for a URL
11916
+ * Add or update the credentials stored for a website. The URL is reduced to
11917
+ * its root domain (`https://github.com/login` → `github.com`) before it is
11918
+ * sent, like Python's `AddCredentialsRequest`.
11919
+ *
11920
+ * ```ts
11921
+ * await vault.addCredentials('https://github.com/', {
11922
+ * email: 'me@example.org',
11923
+ * password: 'secret', // pragma: allowlist secret
11924
+ * mfa_secret: 'JBSWY3DPEHPK3PXP', // pragma: allowlist secret
11925
+ * });
11926
+ * ```
11090
11927
  */
11091
11928
  addCredentials(url: string, credentials: CredentialsDictInput): Promise<void>;
11092
11929
  /**
11093
- * Get credentials for a URL
11094
- */
11095
- getCredentials(url: string): Promise<CredentialsDictInput | null>;
11096
- /**
11097
- * Delete credentials for a URL
11930
+ * Get the credentials stored for a website. Rejects with a `NotteAPIError`
11931
+ * when the vault holds no credentials for that domain, like Python's
11932
+ * `get_credentials`.
11933
+ *
11934
+ * ```ts
11935
+ * const { email, password } = await vault.getCredentials('https://github.com/login');
11936
+ * ```
11098
11937
  */
11099
- deleteCredentials(url: string): Promise<void>;
11938
+ getCredentials(url: string): Promise<CredentialsDictOutput>;
11100
11939
  /**
11101
- * Set credit card information
11940
+ * Check whether the vault holds credentials for a website, the counterpart
11941
+ * of `BaseVault.has_credential`. Never rejects for a missing credential.
11942
+ *
11943
+ * ```ts
11944
+ * if (!(await vault.hasCredential('https://github.com/'))) {
11945
+ * await vault.addCredentialsFromEnv('https://github.com/');
11946
+ * }
11947
+ * ```
11102
11948
  */
11103
- setCreditCard(creditCard: CreditCardDictInput): Promise<void>;
11949
+ hasCredential(url: string): Promise<boolean>;
11104
11950
  /**
11105
- * Get credit card information
11951
+ * Delete the credentials stored for a website.
11952
+ *
11953
+ * ```ts
11954
+ * await vault.deleteCredentials('https://github.com/');
11955
+ * ```
11106
11956
  */
11107
- getCreditCard(): Promise<CreditCardDictInput>;
11957
+ deleteCredentials(url: string): Promise<void>;
11108
11958
  /**
11109
- * List all credentials in the vault
11959
+ * List the websites the vault holds credentials for. Passwords are never returned.
11960
+ *
11961
+ * ```ts
11962
+ * const credentials = await vault.listCredentials();
11963
+ * console.log(credentials.map(c => c.url));
11964
+ * ```
11110
11965
  */
11111
11966
  listCredentials(): Promise<Credential[]>;
11112
11967
  /**
11113
- * Delete credit card information
11114
- */
11115
- deleteCreditCard(): Promise<void>;
11116
- /**
11117
- * Delete the entire vault
11968
+ * Delete the vault and every credential it holds.
11118
11969
  */
11119
11970
  delete(): Promise<void>;
11120
11971
  /**
11121
- * Add credentials from environment variables
11122
- * Mirrors Python's add_credentials_from_env method
11972
+ * Add credentials read from environment variables, the counterpart of
11973
+ * `BaseVault.add_credentials_from_env`. For `https://github.com/` the
11974
+ * variables are `GITHUB_COM_EMAIL`, `GITHUB_COM_USERNAME`,
11975
+ * `GITHUB_COM_MFA_SECRET` and `GITHUB_COM_PASSWORD`.
11976
+ *
11977
+ * ```ts
11978
+ * process.env.GITHUB_COM_EMAIL = 'me@example.org';
11979
+ * process.env.GITHUB_COM_PASSWORD = 'secret'; // pragma: allowlist secret
11980
+ * await vault.addCredentialsFromEnv('https://github.com/');
11981
+ * ```
11123
11982
  */
11124
11983
  addCredentialsFromEnv(url: string): Promise<void>;
11125
11984
  /**
11126
- * Extract domain from URL for environment variable naming
11127
- */
11128
- private extractDomainFromUrl;
11129
- /**
11130
- * Validate MFA secret format
11131
- * Mirrors Python's MFA secret validation
11132
- */
11133
- private validateMfaSecret;
11134
- /**
11135
- * Generate a secure random password
11136
- * Mirrors Python's generate_password method
11985
+ * Generate a secure random password, the counterpart of Python's
11986
+ * `generate_password`. The result always contains a lowercase letter, an
11987
+ * uppercase letter and a digit, plus a special character unless
11988
+ * `includeSpecialChars` is false.
11989
+ *
11990
+ * ```ts
11991
+ * const password = vault.generatePassword(24);
11992
+ * ```
11137
11993
  */
11138
11994
  generatePassword(length?: number, includeSpecialChars?: boolean): string;
11139
11995
  }
@@ -11167,6 +12023,7 @@ declare class NottePersona {
11167
12023
  private response;
11168
12024
  private initPromise;
11169
12025
  private _vault;
12026
+ private readonly ownsPersona;
11170
12027
  constructor(client: NotteClient, options?: PersonaConstructor);
11171
12028
  /**
11172
12029
  * Get persona info
@@ -11232,11 +12089,24 @@ declare class NottePersona {
11232
12089
  */
11233
12090
  get(): Promise<PersonaResponseWithInternalEmail>;
11234
12091
  /**
11235
- * Context manager for automatic cleanup
12092
+ * Run a callback and automatically delete a persona created by this instance.
12093
+ * Personas loaded by an existing ID are retained after the callback finishes.
11236
12094
  */
11237
12095
  use<T>(callback: (persona: NottePersona) => Promise<T>): Promise<T>;
11238
12096
  }
11239
12097
 
12098
+ /**
12099
+ * If `response_format` is a Zod schema, convert it to JSON Schema for the API
12100
+ * and return the schema for later runtime validation of the agent's answer.
12101
+ * Mirrors the Zod handling on `session.scrape()`.
12102
+ */
12103
+ declare function prepareAgentRequest<T = unknown>(data: AgentRunRequest & {
12104
+ response_format?: z.ZodSchema<T> | unknown | null;
12105
+ }): {
12106
+ apiData: AgentRunRequest;
12107
+ zodSchema: z.ZodSchema<T> | null;
12108
+ };
12109
+ declare function parseAgentStatusMessage(parsed: any, agentId: string): LegacyAgentStatusResponse | null;
11240
12110
  interface AgentConstructorWithSession extends Omit<ApiAgentStartRequest, 'session_id' | 'vault_id' | 'persona_id' | 'task' | 'response_format' | 'url'> {
11241
12111
  session: Session;
11242
12112
  vault?: NotteVault;
@@ -11307,7 +12177,7 @@ declare class Agent {
11307
12177
  /**
11308
12178
  * Get agent status - mirrors Python status method
11309
12179
  */
11310
- status(): Promise<LegacyAgentStatusResponse>;
12180
+ status(signal?: AbortSignal): Promise<LegacyAgentStatusResponse>;
11311
12181
  /**
11312
12182
  * Stop the agent - mirrors Python stop method
11313
12183
  */
@@ -11325,134 +12195,586 @@ declare class Agent {
11325
12195
  */
11326
12196
  get sessionId(): string;
11327
12197
  /**
11328
- * Check if agent is running - convenience method
12198
+ * Whether `start()`/`run()` was called on this instance (or it was built from an agent id).
12199
+ * This is a local check and does not contact the API.
12200
+ */
12201
+ hasStarted(): boolean;
12202
+ /**
12203
+ * Whether the agent is still active on the server. Fetches the current status,
12204
+ * like calling `agent.status()` in Python; an agent that was never started is not active.
12205
+ */
12206
+ isActive(): Promise<boolean>;
12207
+ /**
12208
+ * @deprecated Only reports whether this instance was started; it does not
12209
+ * contact the API. Use `hasStarted()` for that check or `isActive()` for the
12210
+ * live server status.
11329
12211
  */
11330
12212
  isRunning(): boolean;
11331
12213
  }
11332
12214
 
11333
- /** Select extended for longer cloud execution. Defaults to standard (Lambda). */
11334
- type FunctionRunOptions = Pick<RunFunctionRequest, 'runtime'>;
11335
- interface FunctionRunStartResult {
12215
+ /** Default deadline of `run()`, the counterpart of `WorkflowsClient.WORKFLOW_RUN_TIMEOUT` (5 minutes). */
12216
+ declare const FUNCTION_RUN_TIMEOUT_MS: number;
12217
+ /**
12218
+ * Run endpoints that the OpenAPI spec does not describe. They are the Python
12219
+ * SDK's `WorkflowsClient.CREATE_WORKFLOW_RUN` and `START_WORKFLOW_RUN` paths
12220
+ * and are only ever called through `NotteFunction.postRunEndpoint()`.
12221
+ */
12222
+ declare const FUNCTION_RUN_ENDPOINTS: {
12223
+ /** `POST` creates a run record without executing it (`CreateFunctionRunRequest`). */
12224
+ readonly create: "/functions/{function_id}/runs/create";
12225
+ /** `POST` executes a previously created run (`StartFunctionRunRequest`). */
12226
+ readonly start: "/functions/{function_id}/runs/{run_id}";
12227
+ };
12228
+ /**
12229
+ * The run endpoints hand the caller's key to the execution runtime through
12230
+ * this header (the `Authorization` header is not forwarded), so `run()` sends
12231
+ * it whenever the client holds a key, like `WorkflowsClient.run` in Python.
12232
+ * Proxy-mode clients have no key; their proxy must add the header itself.
12233
+ */
12234
+ declare const RUN_API_KEY_HEADER = "x-notte-api-key";
12235
+ type FunctionRuntime = NonNullable<RunFunctionRequest['runtime']>;
12236
+ type FunctionRunStatus = GetFunctionRunResponse['status'];
12237
+ /** Reference an existing function by ID. */
12238
+ interface FunctionConstructorWithId {
12239
+ function_id: string;
12240
+ /** Key used to decrypt the download URL of Notte managed functions. */
12241
+ decryption_key?: string;
12242
+ path?: never;
12243
+ }
12244
+ /**
12245
+ * Create a function from a local `.py` file, like `client.Function(path=...)`
12246
+ * in Python. The upload happens on the first operation that needs the ID.
12247
+ */
12248
+ interface FunctionConstructorCreate {
12249
+ /** Path to the python file containing the `run` function. Must end with `.py`. */
12250
+ path: string;
12251
+ name?: string | null;
12252
+ description?: string | null;
12253
+ /** Whether the function is public and shared with other users. Defaults to false. */
12254
+ shared?: boolean;
12255
+ decryption_key?: string;
12256
+ function_id?: never;
12257
+ }
12258
+ type FunctionConstructor = FunctionConstructorWithId | FunctionConstructorCreate;
12259
+ /** Result of executing a run, the counterpart of `FunctionRunResponse` in Python. */
12260
+ interface FunctionRunResult {
12261
+ function_id: string;
11336
12262
  function_run_id: string;
11337
- [key: string]: unknown;
12263
+ session_id: string | null;
12264
+ /** The value returned by the script's `run` function, decoded from JSON. */
12265
+ result: unknown;
12266
+ status: FunctionRunStatus;
11338
12267
  }
11339
- interface FunctionConstructor {
12268
+ /** Alias of `FunctionRunResult` using the Python model name. */
12269
+ type FunctionRunResponse = FunctionRunResult;
12270
+ /** @deprecated `run()` now returns `FunctionRunResult` whether or not it streams. */
12271
+ type FunctionRunStartResult = FunctionRunResult;
12272
+ /** Run record returned by `createRun()`, the counterpart of `CreateFunctionRunResponse` in Python. */
12273
+ interface FunctionRunCreateResult {
11340
12274
  function_id: string;
11341
- decryption_key?: string;
12275
+ function_run_id: string;
12276
+ created_at: string;
12277
+ status: 'created';
12278
+ }
12279
+ interface FunctionRunCreateOptions {
12280
+ /** Mark the record as a local run. Defaults to false; the Node SDK only executes on the cloud. */
12281
+ local?: boolean;
11342
12282
  }
11343
- interface FunctionUrlOptions {
11344
- /** Version to download. Defaults to the latest version. */
12283
+ interface FunctionRunOptions {
12284
+ /** Stream logs and wait for completion. Defaults to true. */
12285
+ stream?: boolean;
12286
+ /** Receive streamed logs instead of printing them to console.log. */
12287
+ onLog?: (message: string) => void;
12288
+ /** Throw `FailedToRunCloudFunctionError` when execution fails. Defaults to true, matching Python. */
12289
+ raiseOnFailure?: boolean;
12290
+ /** Execute a record returned by createRun(). Omit to create a new run. */
12291
+ functionRunId?: string;
12292
+ /** Override the saved function runtime; omit to inherit its default. */
12293
+ runtime?: FunctionRuntime;
12294
+ /**
12295
+ * Deadline of the whole execution in milliseconds. The wait is aborted with
12296
+ * `NotteTimeoutError` once it elapses. Defaults to `FUNCTION_RUN_TIMEOUT_MS` (5 minutes).
12297
+ */
12298
+ timeoutMs?: number;
12299
+ }
12300
+ interface FunctionGetOptions {
12301
+ /** Version to fetch. Defaults to the latest version. */
11345
12302
  version?: string;
12303
+ }
12304
+ interface FunctionUrlOptions extends FunctionGetOptions {
11346
12305
  /** Overrides the decryption key passed to the constructor. */
11347
12306
  decryption_key?: string;
11348
12307
  }
11349
12308
  interface FunctionDownloadOptions extends FunctionUrlOptions {
11350
- /** Where to write the code. Must end with `.py`. Returned only when omitted. */
12309
+ /** Optional local destination ending in `.py`. Source text is returned whether or not a path is supplied. */
11351
12310
  path?: string;
11352
12311
  }
12312
+ interface FunctionUpdateOptions {
12313
+ /** Path to the new python code. Must end with `.py`. */
12314
+ path?: string;
12315
+ /** Only update this version. Defaults to creating a new version. */
12316
+ version?: string;
12317
+ /** Whether to restrict the function code. Defaults to true, like Python. */
12318
+ restricted?: boolean;
12319
+ }
12320
+ /** Metadata fields accepted by `PATCH /functions/{function_id}`. */
12321
+ type FunctionMetadataUpdateOptions = FunctionMetadataUpdateRequest;
12322
+ interface FunctionScheduleOptions {
12323
+ /** Cron expression of the schedule. */
12324
+ cron: FunctionScheduleCreateRequest['cron'];
12325
+ /** Variables passed to every scheduled run. */
12326
+ variables?: FunctionScheduleCreateRequest['variables'];
12327
+ }
12328
+ interface FunctionRollbackOptions extends FunctionRollbackRequest {
12329
+ /** Whether to restrict the function code. Defaults to true, like `update()`. */
12330
+ restricted?: boolean;
12331
+ }
11353
12332
  /**
11354
12333
  * Query options for listing a function's runs: `page`, `page_size`,
11355
- * `only_active`, `only_current_token`, `include_system`.
12334
+ * `only_active`, `only_current_token`, `include_system`, `source`.
11356
12335
  */
11357
12336
  type FunctionRunListOptions = NonNullable<ListFunctionRunsByFunctionIdData['query']>;
11358
12337
  /**
11359
- * Function class for managing function runs
12338
+ * Cloud function saved in the Notte console, the counterpart of
12339
+ * `notte.Function` in Python.
12340
+ *
12341
+ * ```ts
12342
+ * const fn = client.NotteFunction({ function_id: '<your-function-id>' });
12343
+ * const result = await fn.run({ url: 'https://example.com' });
12344
+ *
12345
+ * const created = client.NotteFunction({ path: './scraper.py', name: 'Scraper' });
12346
+ * await created.run(); // uploads scraper.py first
12347
+ * ```
11360
12348
  */
11361
12349
  declare class NotteFunction {
11362
- private client;
11363
- readonly functionId: string;
12350
+ private readonly client;
12351
+ private _functionId;
12352
+ private initPromise;
12353
+ private createData;
11364
12354
  readonly decryptionKey?: string;
11365
12355
  constructor(client: NotteClient, options: FunctionConstructor);
12356
+ /** The function ID. Throws before a `path`-constructed function has been uploaded. */
12357
+ get functionId(): string;
12358
+ /** Alias of the `functionId` accessor. */
12359
+ getFunctionId(): string;
12360
+ private ensureInitialized;
12361
+ private createFunction;
12362
+ /**
12363
+ * Get the function metadata together with its download URL, the
12364
+ * counterpart of `client.functions.get()` in Python.
12365
+ *
12366
+ * @param options - Optional version selector; omitted means the latest version.
12367
+ * @returns Function metadata, version history, and the download link returned by the API.
12368
+ * @throws NotteAPIError if the function cannot be retrieved.
12369
+ * @example
12370
+ * const { latest_version, versions } = await fn.get();
12371
+ */
12372
+ get(options?: FunctionGetOptions): Promise<FunctionWithLinkResponse>;
12373
+ /**
12374
+ * Upload a new version of the code, mirroring `function.update(path=...)`.
12375
+ *
12376
+ * @param options - Local Python file path, optional version, and code-access settings.
12377
+ * @returns Updated function metadata, including its latest version.
12378
+ * @throws InvalidRequestError if the path is missing or does not end in `.py`.
12379
+ * @throws NotteAPIError if the upload is rejected.
12380
+ * @example
12381
+ * const updated = await fn.update({ path: './scraper.py' });
12382
+ * console.log(updated.latest_version);
12383
+ */
12384
+ update(options: FunctionUpdateOptions): Promise<FunctionResponse>;
11366
12385
  /**
11367
- * Get metadata for a specific function run
12386
+ * Update the function metadata (name, description, default runtime, ...).
12387
+ *
12388
+ * @param options - Metadata fields to update, such as name, description, or default runtime.
12389
+ * @returns Updated function metadata.
12390
+ * @throws NotteAPIError if the metadata update is rejected.
12391
+ * @example
12392
+ * await fn.updateMetadata({ name: 'Price monitor', default_runtime: 'extended' });
12393
+ */
12394
+ updateMetadata(options: FunctionMetadataUpdateOptions): Promise<FunctionResponse>;
12395
+ /**
12396
+ * Delete the function from the Notte console.
12397
+ *
12398
+ * @returns The API's function-deletion confirmation.
12399
+ * @throws NotteAPIError if the function cannot be deleted.
12400
+ * @example
12401
+ * await fn.delete();
12402
+ */
12403
+ delete(): Promise<DeleteFunctionResponse>;
12404
+ /**
12405
+ * Schedule the function to run on a cron expression.
12406
+ *
12407
+ * @param options - Cron expression and optional variables passed to each scheduled execution.
12408
+ * @returns The saved schedule configuration.
12409
+ * @throws NotteAPIError if the schedule cannot be saved.
12410
+ * @example
12411
+ * await fn.setSchedule({ cron: '0 9 * * *', variables: { url: 'https://example.com' } });
12412
+ */
12413
+ setSchedule(options: FunctionScheduleOptions): Promise<ScheduleResponse>;
12414
+ /**
12415
+ * Remove the function schedule.
12416
+ *
12417
+ * @returns The API's schedule-deletion confirmation.
12418
+ * @throws NotteAPIError if schedule deletion fails.
12419
+ * @example
12420
+ * await fn.deleteSchedule();
12421
+ */
12422
+ deleteSchedule(): Promise<ScheduleDeleteResponse>;
12423
+ /**
12424
+ * Roll the function back to a previous version.
12425
+ *
12426
+ * @param options - Target version and optional code-access restriction, which defaults to true.
12427
+ * @returns Updated function metadata after rollback.
12428
+ * @throws NotteAPIError if the requested version cannot be restored.
12429
+ * @example
12430
+ * const { versions } = await fn.get();
12431
+ * await fn.rollback({ version: versions[0] });
12432
+ */
12433
+ rollback(options: FunctionRollbackOptions): Promise<FunctionResponse>;
12434
+ /**
12435
+ * Get metadata for a specific function run.
12436
+ *
12437
+ * @param functionRunId - ID of a run belonging to this function.
12438
+ * @returns The run's current status, logs, and result metadata. This does not wait for completion.
12439
+ * @throws NotteAPIError if the run cannot be retrieved.
12440
+ * @example
12441
+ * const run = await fn.getRun(result.function_run_id);
12442
+ * console.log(run.status, run.logs);
12443
+ */
12444
+ getRun(functionRunId: string): Promise<GetFunctionRunResponse>;
12445
+ /**
12446
+ * Compatibility alias for getRun().
12447
+ * @deprecated Use getRun() instead. Retained for backwards compatibility.
11368
12448
  */
11369
12449
  retrieve(functionRunId: string): Promise<GetFunctionRunResponse>;
12450
+ /**
12451
+ * Create a cloud run record without starting execution, like
12452
+ * `function.create_run()` in Python. Use this only when you need the ID
12453
+ * before execution, then pass it to `run(variables, { functionRunId })`.
12454
+ * `run()` otherwise creates a new run on its own.
12455
+ *
12456
+ * @param options - Run-record settings; `local` defaults to false. Node execution remains cloud-only.
12457
+ * @returns A created run record and its ID. No function code has executed yet.
12458
+ * @throws NotteAPIError if run creation is rejected.
12459
+ * @example
12460
+ * const created = await fn.createRun();
12461
+ * const result = await fn.run({ url: 'https://example.com' }, { functionRunId: created.function_run_id });
12462
+ */
12463
+ createRun(options?: FunctionRunCreateOptions): Promise<FunctionRunCreateResult>;
11370
12464
  /**
11371
12465
  * List the runs of this function.
11372
12466
  *
11373
- * `only_active` is sent as `false` unless the caller says otherwise, and that
11374
- * is deliberate rather than redundant. `GET /functions/{function_id}/runs`
11375
- * now defaults it to `false` server-side as well, but it used to default to
11376
- * `true`: the request model was a bare subclass of the session one, where
11377
- * "only active" reads sensibly as "list my running sessions" and, for "list
11378
- * this function's runs", was a trap. Hitting the endpoint with no query
11379
- * parameters returned only the runs executing right now - an empty list for
11380
- * any function that had finished. That cost us a bug in the anything-api
11381
- * console, where a function with 15 recorded runs displayed "Nothing has run
11382
- * this endpoint yet".
11383
- *
11384
- * Sending it explicitly pins this method to the documented behaviour against
11385
- * whichever API version it is talking to, including deployments that predate
11386
- * the server-side change. Callers who want only in-flight runs pass
11387
- * `only_active: true`.
12467
+ * Includes completed runs by default. Set `only_active: true` to retrieve
12468
+ * only in-flight runs. Use the response pagination metadata to request
12469
+ * additional pages.
12470
+ *
12471
+ * @param options - Pagination and filtering options. `only_active` defaults to false, including completed runs.
12472
+ * @returns One page of run records and pagination metadata; additional pages require another call.
12473
+ * @throws NotteAPIError if the run history cannot be retrieved.
12474
+ * @example
12475
+ * const { items } = await fn.runs({ page_size: 20 });
11388
12476
  */
11389
12477
  runs(options?: FunctionRunListOptions): Promise<PaginatedResponseFunctionRunListItemResponse>;
11390
12478
  /**
11391
- * Start a function run
12479
+ * Run the function on the cloud and wait for its result, streaming logs by
12480
+ * default like `function.run(**variables)` in Python.
12481
+ *
12482
+ * Pass `{ stream: false }` to receive the backend's JSON response without
12483
+ * live logs; execution still blocks until completion. Pass `functionRunId`
12484
+ * to execute a record returned by `createRun()`; otherwise a new run record
12485
+ * is created first, exactly like Python. A failed execution throws
12486
+ * `FailedToRunCloudFunctionError` unless `raiseOnFailure` is false, and the
12487
+ * wait is aborted with `NotteTimeoutError` after `timeoutMs`.
12488
+ *
12489
+ * @param variables - JSON-serializable keyword arguments passed to the Python function's `run` entry point.
12490
+ * @param options - Log streaming, failure handling, runtime, run ID, and timeout settings.
12491
+ * @returns The completed execution response. The function's return value is in `result`. Disabling streaming still waits for completion.
12492
+ * @throws FailedToRunCloudFunctionError if execution fails and `raiseOnFailure` is true.
12493
+ * @throws NotteTimeoutError if the execution request exceeds `timeoutMs`.
12494
+ * @throws InvalidRequestError if the run options are invalid.
12495
+ * @example
12496
+ * const result = await fn.run({ url: 'https://example.com' });
12497
+ * console.log(result.result);
12498
+ *
12499
+ * await fn.run({ url: 'https://example.com' }, { runtime: 'extended', onLog: line => logger.info(line) });
11392
12500
  */
11393
- run(variables?: Record<string, unknown>, options?: FunctionRunOptions): Promise<FunctionRunStartResult>;
12501
+ run(variables?: Record<string, unknown>, options?: FunctionRunOptions): Promise<FunctionRunResult>;
11394
12502
  /**
11395
12503
  * Get the download URL of the function code, decrypting it when the API
11396
12504
  * returns an encrypted one (Notte managed functions).
12505
+ *
12506
+ * @param options - Optional version and decryption-key override.
12507
+ * @returns An HTTP(S) URL for downloading the function source.
12508
+ * @throws InvalidRequestError if an encrypted URL has no usable decryption key.
12509
+ * @throws NotteError if decryption does not produce an HTTP(S) URL.
12510
+ * @example
12511
+ * const url = await fn.getUrl({ version: 'v1' });
11397
12512
  */
11398
12513
  getUrl(options?: FunctionUrlOptions): Promise<string>;
11399
12514
  /**
11400
12515
  * Download the function code as a python file. Returns the code, and writes
11401
12516
  * it to `path` when one is provided.
12517
+ *
12518
+ * @param options - Optional version, decryption key, and local `.py` destination path.
12519
+ * @returns The Python source text, including when a local destination is supplied.
12520
+ * @throws InvalidRequestError if the destination does not end in `.py` or the decryption key is invalid.
12521
+ * @throws NotteError if the source download fails. Local filesystem failures also propagate.
12522
+ * @example
12523
+ * const code = await fn.download({ path: './scraper.py' });
11402
12524
  */
11403
12525
  download(options?: FunctionDownloadOptions): Promise<string>;
11404
12526
  /**
11405
- * Get the function ID
12527
+ * Call one of the run endpoints that the OpenAPI spec does not describe
12528
+ * (`FUNCTION_RUN_ENDPOINTS`). The generated client has no operation for
12529
+ * them, so this is the single place where they are hand-rolled; the request
12530
+ * and response shapes are transcribed from `notte_sdk.types`
12531
+ * (`CreateFunctionRunRequest` / `CreateFunctionRunResponse` and
12532
+ * `StartFunctionRunRequest` / `FunctionRunResponse`). Replace the callers
12533
+ * with generated operations once the spec exposes these paths.
11406
12534
  */
11407
- getFunctionId(): string;
12535
+ private postRunEndpoint;
11408
12536
  }
11409
12537
 
11410
- type FileSource = 'user_upload' | 'session_download';
11411
- type SessionFile = {
11412
- id: string;
11413
- session_id: string;
11414
- filename: string;
11415
- mime_type: string;
11416
- size: number;
11417
- checksum: string;
11418
- created_at: string;
11419
- expires_at: string;
11420
- source: FileSource;
11421
- };
11422
- type SessionFilesPage = {
11423
- files: SessionFile[];
11424
- total: number;
11425
- limit: number;
11426
- offset: number;
11427
- };
11428
- declare class SessionFiles {
12538
+ /**
12539
+ * Options of `client.search()`: the `POST /search` body minus the query
12540
+ * itself (`q`). Extra fields such as `maxResults` or `includeDomains` are
12541
+ * forwarded to the search provider untouched.
12542
+ */
12543
+ type SearchOptions = Omit<SearchRequest, 'q'>;
12544
+ /** One ranked hit of a `searchResults` search. */
12545
+ interface SearchResultItem {
12546
+ url: string;
12547
+ name: string;
12548
+ content: string;
12549
+ [key: string]: unknown;
12550
+ }
12551
+ /** Response of a search with `outputType: 'searchResults'` (the default). */
12552
+ interface SearchResultsResponse {
12553
+ results: SearchResultItem[];
12554
+ [key: string]: unknown;
12555
+ }
12556
+ /** One supporting source of a `sourcedAnswer` search. */
12557
+ interface SearchSource {
12558
+ url: string;
12559
+ name?: string;
12560
+ snippet?: string;
12561
+ [key: string]: unknown;
12562
+ }
12563
+ /** Response of a search with `outputType: 'sourcedAnswer'`. */
12564
+ interface SearchSourcedAnswerResponse {
12565
+ answer: string;
12566
+ sources: SearchSource[];
12567
+ [key: string]: unknown;
12568
+ }
12569
+ /** Response of a search with `outputType: 'structured'`: the caller-provided schema decides the shape. */
12570
+ type SearchStructuredResponse = Record<string, unknown>;
12571
+ /**
12572
+ * Union of every shape `POST /search` can answer with. The OpenAPI spec leaves
12573
+ * the response untyped; these interfaces follow the documented shapes at
12574
+ * https://docs.notte.cc/concepts/search#response-shapes.
12575
+ */
12576
+ type SearchResponse = SearchResultsResponse | SearchSourcedAnswerResponse | SearchStructuredResponse;
12577
+
12578
+ /** Body of `POST /anything/start`: the natural-language description of the task. */
12579
+ type AnythingStartOptions = AnythingStartRequest;
12580
+ /**
12581
+ * Response of `POST /anything/start`. The OpenAPI spec declares the 200
12582
+ * response as an untyped JSON object (`{}`), so the SDK exposes it as an
12583
+ * opaque record. In practice the Anything API answers with a reference to the
12584
+ * function it built for the task (for example a `function_id`), which can then
12585
+ * be run through `client.NotteFunction({ function_id })`. Check the keys at
12586
+ * runtime rather than relying on a fixed shape.
12587
+ */
12588
+ type AnythingStartResponse = Record<string, unknown>;
12589
+ /**
12590
+ * Anything API, the counterpart of `POST /anything/start`: turn a plain-English
12591
+ * description of a web task into a deployed, reusable function.
12592
+ *
12593
+ * ```ts
12594
+ * const started = await client.anything.start({ task: 'fetch the top 3 hacker news posts' });
12595
+ * console.log(started);
12596
+ * ```
12597
+ */
12598
+ declare class NotteAnything {
11429
12599
  private readonly client;
11430
- private readonly sessionId;
11431
- constructor(client: Client, sessionId: string);
11432
- private path;
11433
- upload(file: Blob, filename?: string): Promise<SessionFile>;
11434
- list(options?: {
11435
- source?: FileSource;
11436
- limit?: number;
11437
- offset?: number;
11438
- }): Promise<SessionFilesPage>;
11439
- download(fileId: string): Promise<Blob>;
11440
- delete(fileId: string): Promise<void>;
12600
+ constructor(client: NotteClient);
12601
+ /**
12602
+ * Start building a function for `task`. Building is slow (minutes) and
12603
+ * billable; prefer the marketplace (`client.functions.list()`) when a
12604
+ * ready-made function already fits.
12605
+ *
12606
+ * ```ts
12607
+ * const result = await client.anything.start({ task: 'get the weather in Paris' });
12608
+ * if (typeof result.function_id === 'string') {
12609
+ * const fn = client.NotteFunction({ function_id: result.function_id });
12610
+ * }
12611
+ * ```
12612
+ *
12613
+ * Rejects with a `NotteAPIError` when the API answers with a non-2xx status.
12614
+ */
12615
+ start(body: AnythingStartOptions): Promise<AnythingStartResponse>;
12616
+ }
12617
+
12618
+ /** Options of `client.secrets.list()`: optionally filter by namespace. */
12619
+ type SecretListOptions = NonNullable<ListSecretsData['query']>;
12620
+ /** Body of `client.secrets.store()`. */
12621
+ type SecretStoreOptions = SecretStoreRequest;
12622
+
12623
+ /**
12624
+ * Workspace secrets store, the counterpart of the `/secrets` endpoints.
12625
+ * Secrets are scoped by namespace: `llm_provider` keys are used by agents and
12626
+ * scraping, `function_env` values are injected into function runs.
12627
+ *
12628
+ * ```ts
12629
+ * await client.secrets.store({ namespace: 'function_env', name: 'MY_TOKEN', value: 'xyz' });
12630
+ * const secrets = await client.secrets.list({ namespace: 'function_env' });
12631
+ * ```
12632
+ */
12633
+ declare class NotteSecrets {
12634
+ private readonly client;
12635
+ constructor(client: NotteClient);
12636
+ /**
12637
+ * List secret metadata (never the values), optionally filtered by namespace.
12638
+ *
12639
+ * ```ts
12640
+ * const secrets = await client.secrets.list({ namespace: 'llm_provider' });
12641
+ * secrets.forEach(s => console.log(s.name, s.key_hint));
12642
+ * ```
12643
+ */
12644
+ list(options?: SecretListOptions): Promise<SecretMetadata[]>;
12645
+ /**
12646
+ * Store (or overwrite) a secret and return its metadata.
12647
+ *
12648
+ * ```ts
12649
+ * const meta = await client.secrets.store({ namespace: 'function_env', name: 'API_TOKEN', value: 'xyz' });
12650
+ * console.log(meta.id, meta.key_hint);
12651
+ * ```
12652
+ */
12653
+ store(body: SecretStoreOptions): Promise<SecretMetadata>;
12654
+ /**
12655
+ * Read the value of a secret by name within a namespace.
12656
+ *
12657
+ * ```ts
12658
+ * const { value } = await client.secrets.get('API_TOKEN', 'function_env');
12659
+ * ```
12660
+ */
12661
+ get(name: string, namespace: SecretNamespace): Promise<SecretValueResponse>;
12662
+ /**
12663
+ * Delete a secret by id (the `id` field of `SecretMetadata`).
12664
+ *
12665
+ * ```ts
12666
+ * const meta = await client.secrets.store({ namespace: 'function_env', name: 'TMP', value: 'x' });
12667
+ * await client.secrets.delete(meta.id);
12668
+ * ```
12669
+ */
12670
+ delete(secretId: string): Promise<void>;
12671
+ }
12672
+
12673
+ /** Options of `client.usage.get()`: the monthly period, e.g. `"May 2025"`. Defaults to the current month. */
12674
+ type UsageOptions = NonNullable<GetUsageData['query']>;
12675
+ /** Options of `client.usage.logs()`: endpoint filter and pagination. */
12676
+ type UsageLogsOptions = NonNullable<GetUsageLogsData['query']>;
12677
+ /** Endpoint names accepted by `UsageLogsOptions.endpoint`. */
12678
+ type UsageLogEndpoint = NonNullable<UsageLogsOptions['endpoint']>;
12679
+
12680
+ /**
12681
+ * Usage and billing, the counterpart of `GET /usage` and `GET /usage/logs`.
12682
+ *
12683
+ * ```ts
12684
+ * const usage = await client.usage.get();
12685
+ * console.log(usage.total_cost, usage.balance_amount);
12686
+ * ```
12687
+ */
12688
+ declare class NotteUsage {
12689
+ private readonly client;
12690
+ constructor(client: NotteClient);
12691
+ /**
12692
+ * Usage summary for a monthly period (current month by default).
12693
+ *
12694
+ * ```ts
12695
+ * const usage = await client.usage.get({ period: 'May 2025' });
12696
+ * console.log(`${usage.session_count} sessions, $${usage.total_cost}`);
12697
+ * ```
12698
+ */
12699
+ get(options?: UsageOptions): Promise<UsageResponse>;
12700
+ /**
12701
+ * Paginated per-request usage logs, optionally filtered by endpoint.
12702
+ *
12703
+ * ```ts
12704
+ * const page = await client.usage.logs({ endpoint: 'sessions.start', page: 1, page_size: 50 });
12705
+ * page.items.forEach(log => console.log(log.created_at, log.endpoint, log.duration_ms));
12706
+ * ```
12707
+ */
12708
+ logs(options?: UsageLogsOptions): Promise<PaginatedResponseUsageLog>;
11441
12709
  }
11442
12710
 
12711
+ declare const DEFAULT_NOTTE_API_URL = "https://api.notte.cc";
12712
+ declare const DEFAULT_REQUEST_TIMEOUT_MS = 60000;
12713
+ /**
12714
+ * Per-call header read by the client's request interceptor to override the
12715
+ * default request timeout. `0` disables the timeout (streaming responses).
12716
+ * The header is stripped before the request leaves the process.
12717
+ */
12718
+ declare const TIMEOUT_HEADER = "x-notte-timeout-ms";
11443
12719
  interface NotteClientConfig {
12720
+ /** API base URL. Defaults to `NOTTE_API_URL` or `https://api.notte.cc`. */
11444
12721
  baseUrl?: string;
12722
+ /** API key. Defaults to `NOTTE_API_KEY`. Optional only for relative proxy base URLs. */
11445
12723
  apiKey?: string;
12724
+ /** Default per-request timeout in milliseconds. Defaults to 60 000, like the Python SDK. */
12725
+ timeoutMs?: number;
12726
+ /** Database preview branch. Defaults to `NOTTE_DB_PREVIEW_BRANCH`. Internal. */
12727
+ dbPreview?: string;
12728
+ /** Log every request like `NotteClient(verbose=True)` in Python. */
12729
+ verbose?: boolean;
11446
12730
  }
12731
+ type SessionListOptions = NonNullable<ListSessionsData['query']>;
12732
+ type AgentListOptions = NonNullable<ListAgentsData['query']>;
12733
+ type VaultListOptions = NonNullable<ListVaultsData['query']>;
12734
+ type FunctionListOptions = NonNullable<ListFunctionsData['query']>;
12735
+ /** Options of `client.scrape()`: the global scrape request minus `url`, plus the SDK-only scrape options. */
12736
+ type GlobalScrapeOptions<T = unknown> = Omit<GlobalScrapeRequest, 'url' | 'response_format'> & ScrapeOptions<T>;
12737
+ /** Entry point for sessions, agents, functions, vaults, personas, and session files. */
11447
12738
  declare class NotteClient {
11448
- private config;
12739
+ private readonly config;
12740
+ private readonly client;
11449
12741
  constructor(config?: NotteClientConfig);
12742
+ /**
12743
+ * Map the raw value the generated client rejects with into a `NotteError`.
12744
+ * HTTP failures become `NotteAPIError` (or `NotteAPIExecutionError` when the
12745
+ * API flags them), timeouts become `NotteTimeoutError`, anything else is
12746
+ * returned untouched.
12747
+ */
12748
+ private toTypedError;
12749
+ /**
12750
+ * Add the database preview branch to a websocket URL served by the Notte API.
12751
+ * The websocket handshake reads the branch from the query string, so without
12752
+ * it a preview-branch session is looked up in the default database.
12753
+ */
12754
+ withDbPreview(url: string): string;
12755
+ /**
12756
+ * Health check the Notte API. Resolves when the API answers 200 and rejects
12757
+ * with a `NotteAPIError` (or a network error) otherwise.
12758
+ */
12759
+ healthCheck(): Promise<void>;
11450
12760
  /**
11451
12761
  * Create a new session
11452
12762
  */
11453
12763
  Session(options?: SessionOptions): Session;
11454
12764
  /** Access files owned by a specific session, including closed sessions. */
11455
12765
  Files(sessionId: string): SessionFiles;
12766
+ /**
12767
+ * File storage to attach to a session, the counterpart of `client.FileStorage()`.
12768
+ *
12769
+ * ```ts
12770
+ * const storage = client.FileStorage();
12771
+ * await client.Session({ storage }).use(async session => {
12772
+ * await storage.upload('./invoice.pdf');
12773
+ * const files = await storage.list({ source: 'session_download' });
12774
+ * });
12775
+ * ```
12776
+ */
12777
+ FileStorage(sessionId?: string): RemoteFileStorage;
11456
12778
  /**
11457
12779
  * Create a new agent
11458
12780
  */
@@ -11469,6 +12791,53 @@ declare class NotteClient {
11469
12791
  * Create or access a function
11470
12792
  */
11471
12793
  NotteFunction(options: FunctionConstructor): NotteFunction;
12794
+ /** Alias of `NotteFunction`, matching `client.Function` in Python. */
12795
+ Function(options: FunctionConstructor): NotteFunction;
12796
+ /** Sessions listing, the counterpart of `client.sessions.list()`. */
12797
+ get sessions(): {
12798
+ list: (options?: SessionListOptions) => Promise<SessionResponse[]>;
12799
+ };
12800
+ /** Agents listing, the counterpart of `client.agents.list()`. */
12801
+ get agents(): {
12802
+ list: (options?: AgentListOptions) => Promise<AgentResponse[]>;
12803
+ };
12804
+ /** Vaults listing, the counterpart of `client.vaults.list()`. */
12805
+ get vaults(): {
12806
+ list: (options?: VaultListOptions) => Promise<Vault[]>;
12807
+ };
12808
+ /** Functions listing, the counterpart of `client.functions.list()`. */
12809
+ get functions(): {
12810
+ list: (options?: FunctionListOptions) => Promise<FunctionListItemResponse[]>;
12811
+ };
12812
+ /**
12813
+ * Search the public web (`POST /search`). Returns ranked results by default,
12814
+ * an answer with sources with `outputType: 'sourcedAnswer'`, or structured
12815
+ * output with `outputType: 'structured'`.
12816
+ *
12817
+ * ```ts
12818
+ * import { NotteClient } from 'notte-sdk';
12819
+ *
12820
+ * const client = new NotteClient();
12821
+ * const { results } = await client.search('notte browser agents');
12822
+ * const { answer } = await client.search('what is notte?', { outputType: 'sourcedAnswer' });
12823
+ * ```
12824
+ */
12825
+ search(query: string, options?: SearchOptions & {
12826
+ outputType?: 'searchResults';
12827
+ }): Promise<SearchResultsResponse>;
12828
+ search(query: string, options: SearchOptions & {
12829
+ outputType: 'sourcedAnswer';
12830
+ }): Promise<SearchSourcedAnswerResponse>;
12831
+ search(query: string, options: SearchOptions & {
12832
+ outputType: 'structured';
12833
+ }): Promise<SearchStructuredResponse>;
12834
+ search(query: string, options: SearchOptions): Promise<SearchResponse>;
12835
+ /** Anything API (`POST /anything/start`). */
12836
+ get anything(): NotteAnything;
12837
+ /** Workspace secrets (`/secrets`). */
12838
+ get secrets(): NotteSecrets;
12839
+ /** Usage and billing (`/usage`, `/usage/logs`). */
12840
+ get usage(): NotteUsage;
11472
12841
  /**
11473
12842
  * Personas client for listing and managing personas
11474
12843
  */
@@ -11480,13 +12849,30 @@ declare class NotteClient {
11480
12849
  */
11481
12850
  getClient(): Client;
11482
12851
  /**
11483
- * Scrape a webpage directly (without session)
12852
+ * Scrape a webpage directly (without session).
12853
+ *
12854
+ * ```ts
12855
+ * const markdown = await client.scrape('https://www.notte.cc', { only_main_content: true });
12856
+ * const product = await client.scrape('https://www.notte.cc', { response_format: Product, instructions: 'Extract the product' });
12857
+ * ```
12858
+ *
12859
+ * With `response_format` or `instructions`, the extracted data is returned
12860
+ * directly and a failed extraction throws `ScrapeFailedError`. Pass
12861
+ * `raiseOnFailure: false` to receive the `StructuredData` wrapper instead.
11484
12862
  */
11485
- scrape(url: string, options?: Omit<GlobalScrapeRequest, 'url'>): Promise<string | any>;
11486
- scrape<T>(url: string, options: Omit<GlobalScrapeRequest, 'url'> & {
11487
- response_format: z.ZodSchema<T>;
11488
- json_schema?: any;
12863
+ scrape(url: string, options?: GlobalScrapeOptions<unknown> & {
12864
+ response_format?: undefined;
12865
+ instructions?: undefined | null;
12866
+ }): Promise<string>;
12867
+ scrape<T>(url: string, options: GlobalScrapeOptions<T> & {
12868
+ response_format: ZodLikeSchema<T>;
12869
+ raiseOnFailure?: true;
11489
12870
  }): Promise<T>;
12871
+ scrape<T>(url: string, options: GlobalScrapeOptions<T> & {
12872
+ response_format: ZodLikeSchema<T>;
12873
+ raiseOnFailure: false;
12874
+ }): Promise<StructuredData<T>>;
12875
+ scrape(url: string, options: GlobalScrapeOptions<unknown>): Promise<ScrapeResult<unknown>>;
11490
12876
  /**
11491
12877
  * Get the client configuration
11492
12878
  */
@@ -11506,9 +12892,17 @@ declare class Encryption {
11506
12892
  decrypt(token: string): string;
11507
12893
  }
11508
12894
 
12895
+ /** Read a JSON cookie file (a list of cookies, like `session.getCookies()` returns). */
12896
+ declare function readCookiesFile(cookieFile: string): Promise<Cookie[]>;
12897
+ /**
12898
+ * Append `cookies` to the JSON list stored in `cookieFile`, creating the file
12899
+ * when it does not exist yet.
12900
+ */
12901
+ declare function createOrAppendCookiesToFile(cookieFile: string, cookies: Cookie[]): Promise<void>;
12902
+
11509
12903
  declare const createClient: (config?: {
11510
12904
  baseUrl?: string;
11511
12905
  token?: string;
11512
12906
  }) => Client;
11513
12907
 
11514
- export { type ActionParameter, type ActionSpace, type ActionSpaceWritable, type AddCredentialsRequest, type AddCredentialsResponse, type AddCreditCardRequest, type AddCreditCardResponse, Agent, type AgentConstructor, type AgentFunctionCodeResponse, type AgentResponse, type AgentRunRequest, type AgentStartData, type AgentStartError, type AgentStartErrors, type AgentStartResponse, type AgentStartResponses, type AgentStatus, type AgentStatusData, type AgentStatusError, type AgentStatusErrors, type AgentStatusResponse, type AgentStatusResponse2, type AgentStatusResponses, type AgentStopData, type AgentStopError, type AgentStopErrors, type AgentStopResponse, type AgentStopResponses, type AgentUpdateHandler, type AnythingStartData, type AnythingStartError, type AnythingStartErrors, type AnythingStartRequest, type AnythingStartResponses, type ApiAgentStartRequest, type ApiExecutionResponse, type ApiExecutionResponseWritable, type ApiSessionStartRequest, type BaseModel, type BaseModelWritable, type BodyFunctionCreateFunctionsPost, type BodyFunctionUpdateFunctionsFunctionIdPost, type BodySessionCookiesSetSessionsSessionIdCookiesPost, type BodyUploadSessionFileSessionsSessionIdFilesPost, type BoundingBox, type CaptchaSolveAction, type CheckActionInput, type CheckActionOutput, type ClickActionInput, type ClickActionOutput, type ClientOptions, type CloseTabAction, type CompletionAction, type ConnectLinkContext, type ConnectLinkContextData, type ConnectLinkContextError, type ConnectLinkContextErrors, type ConnectLinkContextResponse, type ConnectLinkContextResponses, type ConnectLinkCreateRequest, type ConnectLinkCreateResponse, type ConnectLinkMailbox, type ConnectLinkMailboxConnectData, type ConnectLinkMailboxConnectError, type ConnectLinkMailboxConnectErrors, type ConnectLinkMailboxConnectRequest, type ConnectLinkMailboxConnectResponse, type ConnectLinkMailboxConnectResponse2, type ConnectLinkMailboxConnectResponses, type ConnectLinkMailboxSyncData, type ConnectLinkMailboxSyncError, type ConnectLinkMailboxSyncErrors, type ConnectLinkMailboxSyncRequest, type ConnectLinkMailboxSyncResponse, type ConnectLinkMailboxSyncResponses, type ConnectLinkMailboxesData, type ConnectLinkMailboxesError, type ConnectLinkMailboxesErrors, type ConnectLinkMailboxesResponse, type ConnectLinkMailboxesResponses, type ConnectLinkStatusData, type ConnectLinkStatusError, type ConnectLinkStatusErrors, type ConnectLinkStatusResponse, type ConnectLinkStatusResponse2, type ConnectLinkStatusResponses, type ConnectLinkSubmitData, type ConnectLinkSubmitError, type ConnectLinkSubmitErrors, type ConnectLinkSubmitRequest, type ConnectLinkSubmitRequestWritable, type ConnectLinkSubmitResponse, type ConnectLinkSubmitResponses, type Cookie, type Credential, type CredentialsDictInput, type CredentialsDictOutput, type CreditCardDictInput, type CreditCardDictOutput, type DataSpace, type DeleteCredentialsResponse, type DeleteCreditCardResponse, type DeleteFunctionResponse, type DeletePersonaResponse, type DeleteSecretData, type DeleteSecretError, type DeleteSecretErrors, type DeleteSecretResponse, type DeleteSecretResponses, type DeleteSessionFileData, type DeleteSessionFileError, type DeleteSessionFileErrors, type DeleteSessionFileResponse, type DeleteSessionFileResponses, type DeleteVaultResponse, type DownloadFileActionInput, type DownloadFileActionOutput, type DownloadSessionFileData, type DownloadSessionFileError, type DownloadSessionFileErrors, type DownloadSessionFileResponses, type EmailReadAction, type EmailResponse, type EmailVerificationReadAction, Encryption, type EvaluateJsAction, type ExecutionResponse, type ExternalProxy, type FallbackFillActionInput, type FallbackFillActionInputWritable, type FallbackFillActionOutput, type FallbackFillActionOutputWritable, type FileSource, type FillActionInput, type FillActionInputWritable, type FillActionOutput, type FillActionOutputWritable, type FormFillAction, type FormFillActionWritable, type FrameData, type FunctionConstructor, type FunctionCreateData, type FunctionCreateError, type FunctionCreateErrors, type FunctionCreateResponse, type FunctionCreateResponses, type FunctionDeleteData, type FunctionDeleteError, type FunctionDeleteErrors, type FunctionDeleteResponse, type FunctionDeleteResponses, type FunctionDownloadOptions, type FunctionDownloadUrlData, type FunctionDownloadUrlError, type FunctionDownloadUrlErrors, type FunctionDownloadUrlResponse, type FunctionDownloadUrlResponses, type FunctionForkData, type FunctionForkError, type FunctionForkErrors, type FunctionForkResponse, type FunctionForkResponses, type FunctionListItemResponse, type FunctionListItemResponseWritable, type FunctionMetadataUpdateData, type FunctionMetadataUpdateError, type FunctionMetadataUpdateErrors, type FunctionMetadataUpdateRequest, type FunctionMetadataUpdateResponse, type FunctionMetadataUpdateResponses, type FunctionResponse, type FunctionResponseWritable, type FunctionRollbackData, type FunctionRollbackError, type FunctionRollbackErrors, type FunctionRollbackRequest, type FunctionRollbackResponse, type FunctionRollbackResponses, type FunctionRunGetMetadataData, type FunctionRunGetMetadataError, type FunctionRunGetMetadataErrors, type FunctionRunGetMetadataResponse, type FunctionRunGetMetadataResponses, type FunctionRunListItemResponse, type FunctionRunListItemResponseWritable, type FunctionRunOptions, type FunctionRunStartData, type FunctionRunStartError, type FunctionRunStartErrors, type FunctionRunStartResponses, type FunctionRunStartResult, type FunctionRunStopData, type FunctionRunStopError, type FunctionRunStopErrors, type FunctionRunStopResponse, type FunctionRunStopResponses, type FunctionRunUpdateMetadataData, type FunctionRunUpdateMetadataError, type FunctionRunUpdateMetadataErrors, type FunctionRunUpdateMetadataResponse, type FunctionRunUpdateMetadataResponses, type FunctionRunUpdateRequest, type FunctionRuntimeHealthData, type FunctionRuntimeHealthError, type FunctionRuntimeHealthErrors, type FunctionRuntimeHealthResponse, type FunctionRuntimeHealthResponse2, type FunctionRuntimeHealthResponses, type FunctionScheduleCreateRequest, type FunctionScheduleDeleteData, type FunctionScheduleDeleteError, type FunctionScheduleDeleteErrors, type FunctionScheduleDeleteResponse, type FunctionScheduleDeleteResponses, type FunctionScheduleSetData, type FunctionScheduleSetError, type FunctionScheduleSetErrors, type FunctionScheduleSetResponse, type FunctionScheduleSetResponses, type FunctionSource, type FunctionUpdateData, type FunctionUpdateError, type FunctionUpdateErrors, type FunctionUpdateResponse, type FunctionUpdateResponses, type FunctionUrlOptions, type FunctionWithLinkResponse, type FunctionWithLinkResponseWritable, type GetCookiesResponse, type GetCredentialsResponse, type GetCreditCardResponse, type GetFunctionRunResponse, type GetFunctionRunResponseWritable, type GetScriptData, type GetScriptError, type GetScriptErrors, type GetScriptResponse, type GetScriptResponses, type GetSecretData, type GetSecretError, type GetSecretErrors, type GetSecretResponse, type GetSecretResponses, type GetSessionScriptData, type GetSessionScriptError, type GetSessionScriptErrors, type GetSessionScriptResponse, type GetSessionScriptResponses, type GetUsageData, type GetUsageError, type GetUsageErrors, type GetUsageLogsData, type GetUsageLogsError, type GetUsageLogsErrors, type GetUsageLogsResponse, type GetUsageLogsResponses, type GetUsageResponse, type GetUsageResponses, type GlobalScrapeRequest, type GoBackAction, type GoForwardAction, type GotoAction, type GotoNewTabAction, type HealthCheckData, type HealthCheckResponse, type HealthCheckResponses, type HealthResponse, type HelpAction, type HttpValidationError, type ImageCategory, type ImageData, type ImprovePromptData, type ImprovePromptError, type ImprovePromptErrors, type ImprovePromptRequest, type ImprovePromptResponse, type ImprovePromptResponse2, type ImprovePromptResponses, type LegacyAgentStatusResponse, type ListAgentsData, type ListAgentsError, type ListAgentsErrors, type ListAgentsResponse, type ListAgentsResponses, type ListCredentialsResponse, type ListFunctionRunsByFunctionIdData, type ListFunctionRunsByFunctionIdError, type ListFunctionRunsByFunctionIdErrors, type ListFunctionRunsByFunctionIdResponse, type ListFunctionRunsByFunctionIdResponses, type ListFunctionsData, type ListFunctionsError, type ListFunctionsErrors, type ListFunctionsResponse, type ListFunctionsResponses, type ListPersonasData, type ListPersonasError, type ListPersonasErrors, type ListPersonasResponse, type ListPersonasResponses, type ListSecretsData, type ListSecretsError, type ListSecretsErrors, type ListSecretsResponse, type ListSecretsResponses, type ListSessionFilesData, type ListSessionFilesError, type ListSessionFilesErrors, type ListSessionFilesResponse, type ListSessionFilesResponses, type ListSessionsData, type ListSessionsError, type ListSessionsErrors, type ListSessionsResponse, type ListSessionsResponses, type ListVaultsData, type ListVaultsError, type ListVaultsErrors, type ListVaultsResponse, type ListVaultsResponses, type LlmModel, type MailboxConnectRequest, type MailboxConnectResponse, type MailboxConnectTokenData, type MailboxConnectTokenError, type MailboxConnectTokenErrors, type MailboxConnectTokenResponse, type MailboxConnectTokenResponses, type MailboxConnection, type MailboxDeleteData, type MailboxDeleteError, type MailboxDeleteErrors, type MailboxDeleteResponse, type MailboxDeleteResponses, type MailboxGetData, type MailboxGetError, type MailboxGetErrors, type MailboxGetResponse, type MailboxGetResponses, type MailboxListData, type MailboxListError, type MailboxListErrors, type MailboxListResponse, type MailboxListResponse2, type MailboxListResponses, type MailboxSyncData, type MailboxSyncError, type MailboxSyncErrors, type MailboxSyncRequest, type MailboxSyncResponse, type MailboxSyncResponses, type MailboxUpdateData, type MailboxUpdateError, type MailboxUpdateErrors, type MailboxUpdateRequest, type MailboxUpdateResponse, type MailboxUpdateResponses, type ManagedAuthConnectLinkCreateData, type ManagedAuthConnectLinkCreateError, type ManagedAuthConnectLinkCreateErrors, type ManagedAuthConnectLinkCreateResponse, type ManagedAuthConnectLinkCreateResponses, type ManagedAuthCredentials, type ManagedAuthCredentialsWritable, type MessageReadOptions, type MintProxyCredentialsData, type MintProxyCredentialsError, type MintProxyCredentialsErrors, type MintProxyCredentialsResponse, type MintProxyCredentialsResponses, type MultiFactorFillActionInput, type MultiFactorFillActionInputWritable, type MultiFactorFillActionOutput, type MultiFactorFillActionOutputWritable, type NetworkBatchFile, type NetworkLogsResponse, type NodeSelectors, NotteClient, type NotteClientConfig, NotteFunction, NottePersona, type NotteProxy, NotteVault, type NudgePromptData, type NudgePromptError, type NudgePromptErrors, type NudgePromptRequest, type NudgePromptResponse, type NudgePromptResponse2, type NudgePromptResponses, type Observation, type ObservationWritable, type ObserveRequest, type Options, type PageExecuteData, type PageExecuteError, type PageExecuteErrors, type PageExecuteResponse, type PageExecuteResponses, type PageObserveData, type PageObserveError, type PageObserveErrors, type PageObserveResponse, type PageObserveResponses, type PageScrapeData, type PageScrapeError, type PageScrapeErrors, type PageScrapeResponse, type PageScrapeResponses, type PageScreenshotData, type PageScreenshotError, type PageScreenshotErrors, type PageScreenshotResponses, type PaginatedResponseAgentResponse, type PaginatedResponseAgentResponseWritable, type PaginatedResponseFunctionListItemResponse, type PaginatedResponseFunctionListItemResponseWritable, type PaginatedResponseFunctionRunListItemResponse, type PaginatedResponseFunctionRunListItemResponseWritable, type PaginatedResponsePersonaResponse, type PaginatedResponsePersonaResponseWritable, type PaginatedResponseProfileResponse, type PaginatedResponseProfileResponseWritable, type PaginatedResponseSessionResponse, type PaginatedResponseSessionResponseWritable, type PaginatedResponseUsageLog, type PaginatedResponseUsageLogWritable, type PaginatedResponseVault, type PaginatedResponseVaultWritable, type ParameterInfo, type PersonaConstructor, type PersonaCreateData, type PersonaCreateError, type PersonaCreateErrors, type PersonaCreateRequest, type PersonaCreateResponse, type PersonaCreateResponses, type PersonaDeleteData, type PersonaDeleteError, type PersonaDeleteErrors, type PersonaDeleteResponse, type PersonaDeleteResponses, type PersonaEmailsListData, type PersonaEmailsListError, type PersonaEmailsListErrors, type PersonaEmailsListResponse, type PersonaEmailsListResponses, type PersonaGetData, type PersonaGetError, type PersonaGetErrors, type PersonaGetResponse, type PersonaGetResponses, type PersonaListOptions, type PersonaResponse, type PersonaSmsListData, type PersonaSmsListError, type PersonaSmsListErrors, type PersonaSmsListResponse, type PersonaSmsListResponses, type PersonaUpdateData, type PersonaUpdateError, type PersonaUpdateErrors, type PersonaUpdateRequest, type PersonaUpdateResponse, type PersonaUpdateResponses, type PressKeyAction, type ProfileCookiesGetData, type ProfileCookiesGetError, type ProfileCookiesGetErrors, type ProfileCookiesGetResponse, type ProfileCookiesGetResponses, type ProfileCookiesImportRequest, type ProfileCookiesImportResponse, type ProfileCookiesSetData, type ProfileCookiesSetError, type ProfileCookiesSetErrors, type ProfileCookiesSetResponse, type ProfileCookiesSetResponses, type ProfileCreateData, type ProfileCreateError, type ProfileCreateErrors, type ProfileCreateRequest, type ProfileCreateResponse, type ProfileCreateResponses, type ProfileDeleteData, type ProfileDeleteError, type ProfileDeleteErrors, type ProfileDeleteResponse, type ProfileDeleteResponse2, type ProfileDeleteResponses, type ProfileDuplicateData, type ProfileDuplicateError, type ProfileDuplicateErrors, type ProfileDuplicateRequest, type ProfileDuplicateResponse, type ProfileDuplicateResponses, type ProfileGetData, type ProfileGetError, type ProfileGetErrors, type ProfileGetResponse, type ProfileGetResponses, type ProfileListData, type ProfileListError, type ProfileListErrors, type ProfileListResponse, type ProfileListResponses, type ProfileResponse, type ProxyCredentialRequest, type ProxyCredentialResponse, type ProxyGeolocationCountry, type ReadyCheckData, type ReadyCheckResponse, type ReadyCheckResponses, type ReloadAction, type ReplayResponse, type RootModelAny, type RunFunctionRequest, type RuntimePackage, type ScheduleDeleteResponse, type ScheduleResponse, type SchemaGenerationResponse, type ScrapeAction, type ScrapeFromHtmlData, type ScrapeFromHtmlError, type ScrapeFromHtmlErrors, type ScrapeFromHtmlRequest, type ScrapeFromHtmlResponse, type ScrapeFromHtmlResponses, type ScrapeRequest, type ScrapeSchemaResponse, type ScrapeWebpageData, type ScrapeWebpageError, type ScrapeWebpageErrors, type ScrapeWebpageResponse, type ScrapeWebpageResponses, type Screenshot, type ScrollDownAction, type ScrollUpAction, type SearchRequest, type SearchWebData, type SearchWebError, type SearchWebErrors, type SearchWebResponses, type SecretListResponse, type SecretMetadata, type SecretNamespace, type SecretStoreRequest, type SecretValueResponse, type SelectDropdownOptionActionInput, type SelectDropdownOptionActionInputWritable, type SelectDropdownOptionActionOutput, type SelectDropdownOptionActionOutputWritable, type SerializedError, Session, type SessionCookiesGetData, type SessionCookiesGetError, type SessionCookiesGetErrors, type SessionCookiesGetResponse, type SessionCookiesGetResponses, type SessionCookiesSetData, type SessionCookiesSetError, type SessionCookiesSetErrors, type SessionCookiesSetResponse, type SessionCookiesSetResponses, type SessionDebugInfoData, type SessionDebugInfoError, type SessionDebugInfoErrors, type SessionDebugInfoResponse, type SessionDebugInfoResponses, type SessionDebugResponse, type SessionFile, SessionFiles, type SessionFilesPage, type SessionNetworkLogsData, type SessionNetworkLogsError, type SessionNetworkLogsErrors, type SessionNetworkLogsResponse, type SessionNetworkLogsResponses, type SessionOffsetData, type SessionOffsetError, type SessionOffsetErrors, type SessionOffsetResponse, type SessionOffsetResponse2, type SessionOffsetResponses, type SessionOptions, type SessionProfile, type SessionReplayData, type SessionReplayError, type SessionReplayErrors, type SessionReplayResponse, type SessionReplayResponses, type SessionResponse, type SessionResponseWritable, type SessionStartData, type SessionStartError, type SessionStartErrors, type SessionStartResponse, type SessionStartResponses, type SessionStatusData, type SessionStatusError, type SessionStatusErrors, type SessionStatusResponse, type SessionStatusResponses, type SessionStopData, type SessionStopError, type SessionStopErrors, type SessionStopResponse, type SessionStopResponses, type SmsReadAction, type SmsResponse, type SnapshotMetadata, type SpaceCategory, type StoreSecretData, type StoreSecretError, type StoreSecretErrors, type StoreSecretResponse, type StoreSecretResponses, type StructuredDataBaseModel, type SubscriptionType, type SwitchTabAction, type TabSessionDebugResponse, type TabsData, type TailnetProxy, type UpdateFunctionRunResponse, type UpdateFunctionRunResponseWritable, type UploadFileActionInput, type UploadFileActionOutput, type UploadSessionFileData, type UploadSessionFileError, type UploadSessionFileErrors, type UploadSessionFileResponse, type UploadSessionFileResponses, type UsageLog, type UsageResponse, type ValidationError, type Vault, type VaultConstructor, type VaultCreateData, type VaultCreateError, type VaultCreateErrors, type VaultCreateRequest, type VaultCreateResponse, type VaultCreateResponses, type VaultCredentialsAddData, type VaultCredentialsAddError, type VaultCredentialsAddErrors, type VaultCredentialsAddResponse, type VaultCredentialsAddResponses, type VaultCredentialsDeleteData, type VaultCredentialsDeleteError, type VaultCredentialsDeleteErrors, type VaultCredentialsDeleteResponse, type VaultCredentialsDeleteResponses, type VaultCredentialsGetData, type VaultCredentialsGetError, type VaultCredentialsGetErrors, type VaultCredentialsGetResponse, type VaultCredentialsGetResponses, type VaultCredentialsListData, type VaultCredentialsListError, type VaultCredentialsListErrors, type VaultCredentialsListResponse, type VaultCredentialsListResponses, type VaultCreditCardDeleteData, type VaultCreditCardDeleteError, type VaultCreditCardDeleteErrors, type VaultCreditCardDeleteResponse, type VaultCreditCardDeleteResponses, type VaultCreditCardGetData, type VaultCreditCardGetError, type VaultCreditCardGetErrors, type VaultCreditCardGetResponse, type VaultCreditCardGetResponses, type VaultCreditCardSetData, type VaultCreditCardSetError, type VaultCreditCardSetErrors, type VaultCreditCardSetResponse, type VaultCreditCardSetResponses, type VaultDeleteData, type VaultDeleteError, type VaultDeleteErrors, type VaultDeleteResponse, type VaultDeleteResponses, type VaultUpdateData, type VaultUpdateError, type VaultUpdateErrors, type VaultUpdateRequest, type VaultUpdateResponse, type VaultUpdateResponses, type ViewportData, type WaitAction, type WebSocketUrls, agentStart, agentStatus, agentStop, anythingStart, client, connectLinkContext, connectLinkMailboxConnect, connectLinkMailboxSync, connectLinkMailboxes, connectLinkStatus, connectLinkSubmit, createClient, NotteClient as default, deleteSecret, deleteSessionFile, downloadSessionFile, functionCreate, functionDelete, functionDownloadUrl, functionFork, functionMetadataUpdate, functionRollback, functionRunGetMetadata, functionRunStart, functionRunStop, functionRunUpdateMetadata, functionRuntimeHealth, functionScheduleDelete, functionScheduleSet, functionUpdate, getScript, getSecret, getSessionScript, getUsage, getUsageLogs, healthCheck, improvePrompt, listAgents, listFunctionRunsByFunctionId, listFunctions, listPersonas, listSecrets, listSessionFiles, listSessions, listVaults, mailboxConnectToken, mailboxDelete, mailboxGet, mailboxList, mailboxSync, mailboxUpdate, managedAuthConnectLinkCreate, mintProxyCredentials, nudgePrompt, pageExecute, pageObserve, pageScrape, pageScreenshot, personaCreate, personaDelete, personaEmailsList, personaGet, personaSmsList, personaUpdate, profileCookiesGet, profileCookiesSet, profileCreate, profileDelete, profileDuplicate, profileGet, profileList, readyCheck, scrapeFromHtml, scrapeWebpage, searchWeb, sessionCookiesGet, sessionCookiesSet, sessionDebugInfo, sessionNetworkLogs, sessionOffset, sessionReplay, sessionStart, sessionStatus, sessionStop, storeSecret, uploadSessionFile, vaultCreate, vaultCredentialsAdd, vaultCredentialsDelete, vaultCredentialsGet, vaultCredentialsList, vaultCreditCardDelete, vaultCreditCardGet, vaultCreditCardSet, vaultDelete, vaultUpdate };
12908
+ export { ActionExecutionError, type ActionInput, type ActionOfType, type ActionParameter, type ActionSpace, type ActionSpaceWritable, type ActionType, type AddCredentialsRequest, type AddCredentialsResponse, type AddCreditCardRequest, type AddCreditCardResponse, Agent, type AgentConstructor, type AgentFunctionCodeResponse, type AgentListOptions, type AgentResponse, type AgentRunRequest, type AgentStartData, type AgentStartError, type AgentStartErrors, type AgentStartResponse, type AgentStartResponses, type AgentStatus, type AgentStatusData, type AgentStatusError, type AgentStatusErrors, type AgentStatusResponse, type AgentStatusResponse2, type AgentStatusResponses, type AgentStopData, type AgentStopError, type AgentStopErrors, type AgentStopResponse, type AgentStopResponses, type AgentUpdateHandler, type AnythingStartData, type AnythingStartError, type AnythingStartErrors, type AnythingStartOptions, type AnythingStartRequest, type AnythingStartResponse, type AnythingStartResponses, type ApiAgentStartRequest, type ApiExecutionResponse, type ApiExecutionResponseWritable, type ApiSessionStartRequest, AuthenticationError, type BaseModel, type BaseModelWritable, type BodyFunctionCreateFunctionsPost, type BodyFunctionUpdateFunctionsFunctionIdPost, type BodySessionCookiesSetSessionsSessionIdCookiesPost, type BodyUploadSessionFileSessionsSessionIdFilesPost, type BoundingBox, CAPTCHA_SOLVE_TIMEOUT_MS, CLUSTER_OVERLOAD_RETRY_DELAY_MS, CREDENTIAL_FIELDS, type CaptchaSolveAction, type CheckActionInput, type CheckActionOutput, type ClickActionInput, type ClickActionOutput, type ClientOptions, type CloseTabAction, type CompletionAction, type ConnectLinkContext, type ConnectLinkContextData, type ConnectLinkContextError, type ConnectLinkContextErrors, type ConnectLinkContextResponse, type ConnectLinkContextResponses, type ConnectLinkCreateRequest, type ConnectLinkCreateResponse, type ConnectLinkMailbox, type ConnectLinkMailboxConnectData, type ConnectLinkMailboxConnectError, type ConnectLinkMailboxConnectErrors, type ConnectLinkMailboxConnectRequest, type ConnectLinkMailboxConnectResponse, type ConnectLinkMailboxConnectResponse2, type ConnectLinkMailboxConnectResponses, type ConnectLinkMailboxSyncData, type ConnectLinkMailboxSyncError, type ConnectLinkMailboxSyncErrors, type ConnectLinkMailboxSyncRequest, type ConnectLinkMailboxSyncResponse, type ConnectLinkMailboxSyncResponses, type ConnectLinkMailboxesData, type ConnectLinkMailboxesError, type ConnectLinkMailboxesErrors, type ConnectLinkMailboxesResponse, type ConnectLinkMailboxesResponses, type ConnectLinkStatusData, type ConnectLinkStatusError, type ConnectLinkStatusErrors, type ConnectLinkStatusResponse, type ConnectLinkStatusResponse2, type ConnectLinkStatusResponses, type ConnectLinkSubmitData, type ConnectLinkSubmitError, type ConnectLinkSubmitErrors, type ConnectLinkSubmitRequest, type ConnectLinkSubmitRequestWritable, type ConnectLinkSubmitResponse, type ConnectLinkSubmitResponses, type Cookie, type Credential, type CredentialField, type CredentialsDictInput, type CredentialsDictOutput, type CreditCardDictInput, type CreditCardDictOutput, DEFAULT_NOTTE_API_URL, DEFAULT_REQUEST_TIMEOUT_MS, type DataSpace, type DeleteCredentialsResponse, type DeleteCreditCardResponse, type DeleteFunctionResponse, type DeletePersonaResponse, type DeleteSecretData, type DeleteSecretError, type DeleteSecretErrors, type DeleteSecretResponse, type DeleteSecretResponses, type DeleteSessionFileData, type DeleteSessionFileError, type DeleteSessionFileErrors, type DeleteSessionFileResponse, type DeleteSessionFileResponses, type DeleteVaultResponse, type DownloadFileActionInput, type DownloadFileActionOutput, type DownloadSessionFileData, type DownloadSessionFileError, type DownloadSessionFileErrors, type DownloadSessionFileResponses, type EmailReadAction, type EmailResponse, type EmailVerificationReadAction, Encryption, type EvaluateJsAction, EvaluateJsNoDataError, type ExecuteAction, type ExecuteOptions, type ExecutionResponse, type ExternalProxy, FUNCTION_RUN_ENDPOINTS, FUNCTION_RUN_TIMEOUT_MS, FailedToRunCloudFunctionError, type FallbackFillActionInput, type FallbackFillActionInputWritable, type FallbackFillActionOutput, type FallbackFillActionOutputWritable, type FetchData, FetchResponseDecodeError, type FileDownloadOptions, FileExistsError, type FileListOptions, FileNotFoundError, type FileSource, type FillActionInput, type FillActionInputWritable, type FillActionOutput, type FillActionOutputWritable, type FormFillAction, type FormFillActionWritable, type FrameData, type FunctionConstructor, type FunctionConstructorCreate, type FunctionConstructorWithId, type FunctionCreateData, type FunctionCreateError, type FunctionCreateErrors, type FunctionCreateResponse, type FunctionCreateResponses, type FunctionDeleteData, type FunctionDeleteError, type FunctionDeleteErrors, type FunctionDeleteResponse, type FunctionDeleteResponses, type FunctionDownloadOptions, type FunctionDownloadUrlData, type FunctionDownloadUrlError, type FunctionDownloadUrlErrors, type FunctionDownloadUrlResponse, type FunctionDownloadUrlResponses, type FunctionForkData, type FunctionForkError, type FunctionForkErrors, type FunctionForkResponse, type FunctionForkResponses, type FunctionGetOptions, type FunctionListItemResponse, type FunctionListItemResponseWritable, type FunctionListOptions, type FunctionMetadataUpdateData, type FunctionMetadataUpdateError, type FunctionMetadataUpdateErrors, type FunctionMetadataUpdateOptions, type FunctionMetadataUpdateRequest, type FunctionMetadataUpdateResponse, type FunctionMetadataUpdateResponses, type FunctionResponse, type FunctionResponseWritable, type FunctionRollbackData, type FunctionRollbackError, type FunctionRollbackErrors, type FunctionRollbackOptions, type FunctionRollbackRequest, type FunctionRollbackResponse, type FunctionRollbackResponses, type FunctionRunCreateOptions, type FunctionRunCreateResult, type FunctionRunGetMetadataData, type FunctionRunGetMetadataError, type FunctionRunGetMetadataErrors, type FunctionRunGetMetadataResponse, type FunctionRunGetMetadataResponses, type FunctionRunListItemResponse, type FunctionRunListItemResponseWritable, type FunctionRunListOptions, type FunctionRunOptions, type FunctionRunResponse, type FunctionRunResult, type FunctionRunStartData, type FunctionRunStartError, type FunctionRunStartErrors, type FunctionRunStartResponses, type FunctionRunStartResult, type FunctionRunStatus, type FunctionRunStopData, type FunctionRunStopError, type FunctionRunStopErrors, type FunctionRunStopResponse, type FunctionRunStopResponses, type FunctionRunUpdateMetadataData, type FunctionRunUpdateMetadataError, type FunctionRunUpdateMetadataErrors, type FunctionRunUpdateMetadataResponse, type FunctionRunUpdateMetadataResponses, type FunctionRunUpdateRequest, type FunctionRuntime, type FunctionRuntimeHealthData, type FunctionRuntimeHealthError, type FunctionRuntimeHealthErrors, type FunctionRuntimeHealthResponse, type FunctionRuntimeHealthResponse2, type FunctionRuntimeHealthResponses, type FunctionScheduleCreateRequest, type FunctionScheduleDeleteData, type FunctionScheduleDeleteError, type FunctionScheduleDeleteErrors, type FunctionScheduleDeleteResponse, type FunctionScheduleDeleteResponses, type FunctionScheduleOptions, type FunctionScheduleSetData, type FunctionScheduleSetError, type FunctionScheduleSetErrors, type FunctionScheduleSetResponse, type FunctionScheduleSetResponses, type FunctionSource, type FunctionUpdateData, type FunctionUpdateError, type FunctionUpdateErrors, type FunctionUpdateOptions, type FunctionUpdateResponse, type FunctionUpdateResponses, type FunctionUrlOptions, type FunctionWithLinkResponse, type FunctionWithLinkResponseWritable, type GetCookiesResponse, type GetCredentialsResponse, type GetCreditCardResponse, type GetFunctionRunResponse, type GetFunctionRunResponseWritable, type GetScriptData, type GetScriptError, type GetScriptErrors, type GetScriptResponse, type GetScriptResponses, type GetSecretData, type GetSecretError, type GetSecretErrors, type GetSecretResponse, type GetSecretResponses, type GetSessionScriptData, type GetSessionScriptError, type GetSessionScriptErrors, type GetSessionScriptResponse, type GetSessionScriptResponses, type GetUsageData, type GetUsageError, type GetUsageErrors, type GetUsageLogsData, type GetUsageLogsError, type GetUsageLogsErrors, type GetUsageLogsResponse, type GetUsageLogsResponses, type GetUsageResponse, type GetUsageResponses, type GlobalScrapeOptions, type GlobalScrapeRequest, type GoBackAction, type GoForwardAction, type GotoAction, type GotoNewTabAction, type HealthCheckData, type HealthCheckResponse, type HealthCheckResponses, type HealthResponse, type HelpAction, type HttpValidationError, type ImageCategory, type ImageData, type ImprovePromptData, type ImprovePromptError, type ImprovePromptErrors, type ImprovePromptRequest, type ImprovePromptResponse, type ImprovePromptResponse2, type ImprovePromptResponses, InvalidRequestError, type LegacyAgentStatusResponse, type ListAgentsData, type ListAgentsError, type ListAgentsErrors, type ListAgentsResponse, type ListAgentsResponses, type ListCredentialsResponse, type ListFunctionRunsByFunctionIdData, type ListFunctionRunsByFunctionIdError, type ListFunctionRunsByFunctionIdErrors, type ListFunctionRunsByFunctionIdResponse, type ListFunctionRunsByFunctionIdResponses, type ListFunctionsData, type ListFunctionsError, type ListFunctionsErrors, type ListFunctionsResponse, type ListFunctionsResponses, type ListPersonasData, type ListPersonasError, type ListPersonasErrors, type ListPersonasResponse, type ListPersonasResponses, type ListSecretsData, type ListSecretsError, type ListSecretsErrors, type ListSecretsResponse, type ListSecretsResponses, type ListSessionFilesData, type ListSessionFilesError, type ListSessionFilesErrors, type ListSessionFilesResponse, type ListSessionFilesResponses, type ListSessionsData, type ListSessionsError, type ListSessionsErrors, type ListSessionsResponse, type ListSessionsResponses, type ListVaultsData, type ListVaultsError, type ListVaultsErrors, type ListVaultsResponse, type ListVaultsResponses, type LlmModel, type MailboxConnectRequest, type MailboxConnectResponse, type MailboxConnectTokenData, type MailboxConnectTokenError, type MailboxConnectTokenErrors, type MailboxConnectTokenResponse, type MailboxConnectTokenResponses, type MailboxConnection, type MailboxDeleteData, type MailboxDeleteError, type MailboxDeleteErrors, type MailboxDeleteResponse, type MailboxDeleteResponses, type MailboxGetData, type MailboxGetError, type MailboxGetErrors, type MailboxGetResponse, type MailboxGetResponses, type MailboxListData, type MailboxListError, type MailboxListErrors, type MailboxListResponse, type MailboxListResponse2, type MailboxListResponses, type MailboxSyncData, type MailboxSyncError, type MailboxSyncErrors, type MailboxSyncRequest, type MailboxSyncResponse, type MailboxSyncResponses, type MailboxUpdateData, type MailboxUpdateError, type MailboxUpdateErrors, type MailboxUpdateRequest, type MailboxUpdateResponse, type MailboxUpdateResponses, type ManagedAuthConnectLinkCreateData, type ManagedAuthConnectLinkCreateError, type ManagedAuthConnectLinkCreateErrors, type ManagedAuthConnectLinkCreateResponse, type ManagedAuthConnectLinkCreateResponses, type ManagedAuthCredentials, type ManagedAuthCredentialsWritable, type MessageReadOptions, type MultiFactorFillActionInput, type MultiFactorFillActionInputWritable, type MultiFactorFillActionOutput, type MultiFactorFillActionOutputWritable, type NetworkBatchFile, type NetworkLogsResponse, type NodeSelectors, NotteAPIError, type NotteAPIErrorBody, NotteAPIExecutionError, NotteAnything, NotteClient, type NotteClientConfig, NotteError, NotteFunction, NottePersona, type NotteProxy, NotteSecrets, NotteTimeoutError, NotteUsage, NotteVault, type NudgePromptData, type NudgePromptError, type NudgePromptErrors, type NudgePromptRequest, type NudgePromptResponse, type NudgePromptResponse2, type NudgePromptResponses, type Observation, type ObservationWritable, type ObserveRequest, type Options, type PageExecuteData, type PageExecuteError, type PageExecuteErrors, type PageExecuteResponse, type PageExecuteResponses, PageFetchHTTPError, type PageFetchOptions, PageFetchResponse, type PageObserveData, type PageObserveError, type PageObserveErrors, type PageObserveResponse, type PageObserveResponses, type PageScrapeData, type PageScrapeError, type PageScrapeErrors, type PageScrapeResponse, type PageScrapeResponses, type PageScreenshotData, type PageScreenshotError, type PageScreenshotErrors, type PageScreenshotResponses, type PaginatedResponseAgentResponse, type PaginatedResponseAgentResponseWritable, type PaginatedResponseFunctionListItemResponse, type PaginatedResponseFunctionListItemResponseWritable, type PaginatedResponseFunctionRunListItemResponse, type PaginatedResponseFunctionRunListItemResponseWritable, type PaginatedResponsePersonaResponse, type PaginatedResponsePersonaResponseWritable, type PaginatedResponseProfileResponse, type PaginatedResponseProfileResponseWritable, type PaginatedResponseSessionResponse, type PaginatedResponseSessionResponseWritable, type PaginatedResponseUsageLog, type PaginatedResponseUsageLogWritable, type PaginatedResponseVault, type PaginatedResponseVaultWritable, type ParameterInfo, type PerceptionType, type PersonaConstructor, type PersonaCreateData, type PersonaCreateError, type PersonaCreateErrors, type PersonaCreateRequest, type PersonaCreateResponse, type PersonaCreateResponses, type PersonaDeleteData, type PersonaDeleteError, type PersonaDeleteErrors, type PersonaDeleteResponse, type PersonaDeleteResponses, type PersonaEmailsListData, type PersonaEmailsListError, type PersonaEmailsListErrors, type PersonaEmailsListResponse, type PersonaEmailsListResponses, type PersonaGetData, type PersonaGetError, type PersonaGetErrors, type PersonaGetResponse, type PersonaGetResponses, type PersonaListOptions, type PersonaResponse, type PersonaResponseWithInternalEmail, type PersonaSmsListData, type PersonaSmsListError, type PersonaSmsListErrors, type PersonaSmsListResponse, type PersonaSmsListResponses, type PersonaUpdateData, type PersonaUpdateError, type PersonaUpdateErrors, type PersonaUpdateRequest, type PersonaUpdateResponse, type PersonaUpdateResponses, type PressKeyAction, type ProfileCookiesGetData, type ProfileCookiesGetError, type ProfileCookiesGetErrors, type ProfileCookiesGetResponse, type ProfileCookiesGetResponses, type ProfileCookiesImportRequest, type ProfileCookiesImportResponse, type ProfileCookiesSetData, type ProfileCookiesSetError, type ProfileCookiesSetErrors, type ProfileCookiesSetResponse, type ProfileCookiesSetResponses, type ProfileCreateData, type ProfileCreateError, type ProfileCreateErrors, type ProfileCreateRequest, type ProfileCreateResponse, type ProfileCreateResponses, type ProfileDeleteData, type ProfileDeleteError, type ProfileDeleteErrors, type ProfileDeleteResponse, type ProfileDeleteResponse2, type ProfileDeleteResponses, type ProfileDuplicateData, type ProfileDuplicateError, type ProfileDuplicateErrors, type ProfileDuplicateRequest, type ProfileDuplicateResponse, type ProfileDuplicateResponses, type ProfileGetData, type ProfileGetError, type ProfileGetErrors, type ProfileGetResponse, type ProfileGetResponses, type ProfileListData, type ProfileListError, type ProfileListErrors, type ProfileListResponse, type ProfileListResponses, type ProfileResponse, type ProxyGeolocationCountry, RUN_API_KEY_HEADER, type ReadyCheckData, type ReadyCheckResponse, type ReadyCheckResponses, type ReloadAction, RemoteFileStorage, type ReplayMissingResponse, type ReplayOptions, type ReplayResponse, type RetryOptions, type RootModelAny, type RunFunctionRequest, type RuntimePackage, SESSION_START_TRIES, type ScheduleDeleteResponse, type ScheduleResponse, type SchemaGenerationResponse, type ScrapeAction, ScrapeFailedError, type ScrapeFromHtmlData, type ScrapeFromHtmlError, type ScrapeFromHtmlErrors, type ScrapeFromHtmlRequest, type ScrapeFromHtmlResponse, type ScrapeFromHtmlResponses, type ScrapeOptions, type ScrapeRequest, type ScrapeResult, type ScrapeSchemaResponse, type ScrapeWebpageData, type ScrapeWebpageError, type ScrapeWebpageErrors, type ScrapeWebpageResponse, type ScrapeWebpageResponses, type Screenshot, type ScrollDownAction, type ScrollUpAction, type SearchOptions, type SearchRequest, type SearchResponse, type SearchResultItem, type SearchResultsResponse, type SearchSource, type SearchSourcedAnswerResponse, type SearchStructuredResponse, type SearchWebData, type SearchWebError, type SearchWebErrors, type SearchWebResponses, type SecretListOptions, type SecretListResponse, type SecretMetadata, type SecretNamespace, type SecretStoreOptions, type SecretStoreRequest, type SecretValueResponse, type SelectDropdownOptionActionInput, type SelectDropdownOptionActionInputWritable, type SelectDropdownOptionActionOutput, type SelectDropdownOptionActionOutputWritable, type SerializedError, Session, type SessionCloseReason, type SessionCookiesGetData, type SessionCookiesGetError, type SessionCookiesGetErrors, type SessionCookiesGetResponse, type SessionCookiesGetResponses, type SessionCookiesSetData, type SessionCookiesSetError, type SessionCookiesSetErrors, type SessionCookiesSetResponse, type SessionCookiesSetResponses, type SessionDebugInfoData, type SessionDebugInfoError, type SessionDebugInfoErrors, type SessionDebugInfoResponse, type SessionDebugInfoResponses, type SessionDebugResponse, type SessionFile, SessionFiles, type SessionFilesPage, type SessionListOptions, type SessionNetworkLogsData, type SessionNetworkLogsError, type SessionNetworkLogsErrors, type SessionNetworkLogsResponse, type SessionNetworkLogsResponses, type SessionOffsetData, type SessionOffsetError, type SessionOffsetErrors, type SessionOffsetResponse, type SessionOffsetResponse2, type SessionOffsetResponses, type SessionOptions, type SessionProfile, type SessionReplayData, type SessionReplayError, type SessionReplayErrors, type SessionReplayResponse, type SessionReplayResponses, type SessionResponse, type SessionResponseWritable, type SessionScrapeOptions, type SessionScriptOptions, type SessionStartData, type SessionStartError, type SessionStartErrors, type SessionStartResponse, type SessionStartResponses, type SessionStatusData, type SessionStatusError, type SessionStatusErrors, type SessionStatusResponse, type SessionStatusResponses, type SessionStopData, type SessionStopError, type SessionStopErrors, type SessionStopResponse, type SessionStopResponses, type SmsReadAction, type SmsResponse, type SnapshotMetadata, type SpaceCategory, type StoreSecretData, type StoreSecretError, type StoreSecretErrors, type StoreSecretResponse, type StoreSecretResponses, type StructuredData, type StructuredDataBaseModel, type SubscriptionType, type SwitchTabAction, TIMEOUT_HEADER, type TabSessionDebugResponse, type TabsData, type TailnetProxy, type UpdateFunctionRunResponse, type UpdateFunctionRunResponseWritable, type UploadFileActionInput, type UploadFileActionOutput, type UploadSessionFileData, type UploadSessionFileError, type UploadSessionFileErrors, type UploadSessionFileResponse, type UploadSessionFileResponses, type UploadableFile, type UsageLog, type UsageLogEndpoint, type UsageLogsOptions, type UsageOptions, type UsageResponse, type ValidationError, type Vault, type VaultConstructor, type VaultConstructorCreate, type VaultConstructorWithId, type VaultCreateData, type VaultCreateError, type VaultCreateErrors, type VaultCreateRequest, type VaultCreateResponse, type VaultCreateResponses, type VaultCredentialsAddData, type VaultCredentialsAddError, type VaultCredentialsAddErrors, type VaultCredentialsAddResponse, type VaultCredentialsAddResponses, type VaultCredentialsDeleteData, type VaultCredentialsDeleteError, type VaultCredentialsDeleteErrors, type VaultCredentialsDeleteResponse, type VaultCredentialsDeleteResponses, type VaultCredentialsGetData, type VaultCredentialsGetError, type VaultCredentialsGetErrors, type VaultCredentialsGetResponse, type VaultCredentialsGetResponses, type VaultCredentialsListData, type VaultCredentialsListError, type VaultCredentialsListErrors, type VaultCredentialsListResponse, type VaultCredentialsListResponses, type VaultCreditCardDeleteData, type VaultCreditCardDeleteError, type VaultCreditCardDeleteErrors, type VaultCreditCardDeleteResponse, type VaultCreditCardDeleteResponses, type VaultCreditCardGetData, type VaultCreditCardGetError, type VaultCreditCardGetErrors, type VaultCreditCardGetResponse, type VaultCreditCardGetResponses, type VaultCreditCardSetData, type VaultCreditCardSetError, type VaultCreditCardSetErrors, type VaultCreditCardSetResponse, type VaultCreditCardSetResponses, type VaultDeleteData, type VaultDeleteError, type VaultDeleteErrors, type VaultDeleteResponse, type VaultDeleteResponses, type VaultListOptions, type VaultUpdateData, type VaultUpdateError, type VaultUpdateErrors, type VaultUpdateRequest, type VaultUpdateResponse, type VaultUpdateResponses, type ViewportData, type WaitAction, type WebSocketUrls, type ZodLikeSchema, actions, agentStart, agentStatus, agentStop, anythingStart, buildFetchScript, checkForLatestVersion, client, connectLinkContext, connectLinkMailboxConnect, connectLinkMailboxSync, connectLinkMailboxes, connectLinkStatus, connectLinkSubmit, createClient, createOrAppendCookiesToFile, NotteClient as default, deleteSecret, deleteSessionFile, downloadSessionFile, functionCreate, functionDelete, functionDownloadUrl, functionFork, functionMetadataUpdate, functionRollback, functionRunGetMetadata, functionRunStart, functionRunStop, functionRunUpdateMetadata, functionRuntimeHealth, functionScheduleDelete, functionScheduleSet, functionUpdate, getRootDomain, getScript, getSecret, getSessionScript, getUsage, getUsageLogs, healthCheck, improvePrompt, installServerOwnedDialogPolicy, isCaptchaSolveAction, isValidMfaSecret, listAgents, listFunctionRunsByFunctionId, listFunctions, listPersonas, listSecrets, listSessionFiles, listSessions, listVaults, mailboxConnectToken, mailboxDelete, mailboxGet, mailboxList, mailboxSync, mailboxUpdate, managedAuthConnectLinkCreate, nudgePrompt, observeServerOwnedDialog, pageExecute, pageObserve, pageScrape, pageScreenshot, parseAgentStatusMessage, personaCreate, personaDelete, personaEmailsList, personaGet, personaSmsList, personaUpdate, prepareAgentRequest, processScrapeResponse, profileCookiesGet, profileCookiesSet, profileCreate, profileDelete, profileDuplicate, profileGet, profileList, readCookiesFile, readyCheck, responseFromEvaluated, retry, sanitizeFilename, scrapeFromHtml, scrapeWebpage, searchWeb, sessionCookiesGet, sessionCookiesSet, sessionDebugInfo, sessionNetworkLogs, sessionOffset, sessionReplay, sessionStart, sessionStatus, sessionStop, startVersionCheck, storeSecret, uploadSessionFile, validateCredentials, validateMfaSecret, validateUrl, vaultCreate, vaultCredentialsAdd, vaultCredentialsDelete, vaultCredentialsGet, vaultCredentialsList, vaultCreditCardDelete, vaultCreditCardGet, vaultCreditCardSet, vaultDelete, vaultUpdate };