@mendable/firecrawl-js 4.13.0-beta.2 → 4.13.0-beta.3

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.
@@ -8,7 +8,7 @@ var require_package = __commonJS({
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@mendable/firecrawl-js",
11
- version: "4.13.0-beta.2",
11
+ version: "4.13.0-beta.3",
12
12
  description: "JavaScript SDK for Firecrawl API",
13
13
  main: "dist/index.js",
14
14
  types: "dist/index.d.ts",
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ var require_package = __commonJS({
35
35
  "package.json"(exports2, module2) {
36
36
  module2.exports = {
37
37
  name: "@mendable/firecrawl-js",
38
- version: "4.13.0-beta.2",
38
+ version: "4.13.0-beta.3",
39
39
  description: "JavaScript SDK for Firecrawl API",
40
40
  main: "dist/index.js",
41
41
  types: "dist/index.d.ts",
@@ -931,8 +931,8 @@ async function cancelAgent(http, jobId) {
931
931
  // src/v2/methods/browser.ts
932
932
  async function browser(http, args = {}) {
933
933
  const body = {};
934
- if (args.ttlTotal != null) body.ttlTotal = args.ttlTotal;
935
- if (args.ttlWithoutActivity != null) body.ttlWithoutActivity = args.ttlWithoutActivity;
934
+ if (args.ttl != null) body.ttl = args.ttl;
935
+ if (args.activityTtl != null) body.activityTtl = args.activityTtl;
936
936
  if (args.streamWebView != null) body.streamWebView = args.streamWebView;
937
937
  try {
938
938
  const res = await http.post("/v2/browser", body);
@@ -946,8 +946,9 @@ async function browser(http, args = {}) {
946
946
  async function browserExecute(http, sessionId, args) {
947
947
  const body = {
948
948
  code: args.code,
949
- language: args.language ?? "python"
949
+ language: args.language ?? "bash"
950
950
  };
951
+ if (args.timeout != null) body.timeout = args.timeout;
951
952
  try {
952
953
  const res = await http.post(
953
954
  `/v2/browser/${sessionId}/execute`,
@@ -1481,8 +1482,8 @@ var FirecrawlClient = class {
1481
1482
  // Browser
1482
1483
  /**
1483
1484
  * Create a new browser session.
1484
- * @param args Session options (ttlTotal, ttlWithoutActivity, streamWebView).
1485
- * @returns Session id and CDP URL.
1485
+ * @param args Session options (ttl, activityTtl, streamWebView).
1486
+ * @returns Session id, CDP URL, live view URL, and expiration time.
1486
1487
  */
1487
1488
  async browser(args = {}) {
1488
1489
  return browser(this.http, args);
@@ -1490,8 +1491,8 @@ var FirecrawlClient = class {
1490
1491
  /**
1491
1492
  * Execute code in a browser session.
1492
1493
  * @param sessionId Browser session id.
1493
- * @param args Code and language to execute.
1494
- * @returns Execution result.
1494
+ * @param args Code, language ("python" | "node" | "bash"), and optional timeout.
1495
+ * @returns Execution result including stdout, stderr, exitCode, and killed status.
1495
1496
  */
1496
1497
  async browserExecute(sessionId, args) {
1497
1498
  return browserExecute(this.http, sessionId, args);
package/dist/index.d.cts CHANGED
@@ -559,15 +559,22 @@ interface BrowserCreateResponse {
559
559
  id?: string;
560
560
  cdpUrl?: string;
561
561
  liveViewUrl?: string;
562
+ expiresAt?: string;
562
563
  error?: string;
563
564
  }
564
565
  interface BrowserExecuteResponse {
565
566
  success: boolean;
567
+ stdout?: string;
566
568
  result?: string;
569
+ stderr?: string;
570
+ exitCode?: number;
571
+ killed?: boolean;
567
572
  error?: string;
568
573
  }
569
574
  interface BrowserDeleteResponse {
570
575
  success: boolean;
576
+ sessionDurationMs?: number;
577
+ creditsBilled?: number;
571
578
  error?: string;
572
579
  }
573
580
  interface BrowserSession {
@@ -637,13 +644,14 @@ declare function prepareAgentPayload(args: {
637
644
  declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
638
645
 
639
646
  declare function browser(http: HttpClient, args?: {
640
- ttlTotal?: number;
641
- ttlWithoutActivity?: number;
647
+ ttl?: number;
648
+ activityTtl?: number;
642
649
  streamWebView?: boolean;
643
650
  }): Promise<BrowserCreateResponse>;
644
651
  declare function browserExecute(http: HttpClient, sessionId: string, args: {
645
652
  code: string;
646
- language?: "python" | "js";
653
+ language?: "python" | "node" | "bash";
654
+ timeout?: number;
647
655
  }): Promise<BrowserExecuteResponse>;
648
656
  declare function listBrowsers(http: HttpClient, args?: {
649
657
  status?: "active" | "destroyed";
@@ -856,15 +864,15 @@ declare class FirecrawlClient {
856
864
  cancelAgent(jobId: string): Promise<boolean>;
857
865
  /**
858
866
  * Create a new browser session.
859
- * @param args Session options (ttlTotal, ttlWithoutActivity, streamWebView).
860
- * @returns Session id and CDP URL.
867
+ * @param args Session options (ttl, activityTtl, streamWebView).
868
+ * @returns Session id, CDP URL, live view URL, and expiration time.
861
869
  */
862
870
  browser(args?: Parameters<typeof browser>[1]): Promise<BrowserCreateResponse>;
863
871
  /**
864
872
  * Execute code in a browser session.
865
873
  * @param sessionId Browser session id.
866
- * @param args Code and language to execute.
867
- * @returns Execution result.
874
+ * @param args Code, language ("python" | "node" | "bash"), and optional timeout.
875
+ * @returns Execution result including stdout, stderr, exitCode, and killed status.
868
876
  */
869
877
  browserExecute(sessionId: string, args: Parameters<typeof browserExecute>[2]): Promise<BrowserExecuteResponse>;
870
878
  /**
package/dist/index.d.ts CHANGED
@@ -559,15 +559,22 @@ interface BrowserCreateResponse {
559
559
  id?: string;
560
560
  cdpUrl?: string;
561
561
  liveViewUrl?: string;
562
+ expiresAt?: string;
562
563
  error?: string;
563
564
  }
564
565
  interface BrowserExecuteResponse {
565
566
  success: boolean;
567
+ stdout?: string;
566
568
  result?: string;
569
+ stderr?: string;
570
+ exitCode?: number;
571
+ killed?: boolean;
567
572
  error?: string;
568
573
  }
569
574
  interface BrowserDeleteResponse {
570
575
  success: boolean;
576
+ sessionDurationMs?: number;
577
+ creditsBilled?: number;
571
578
  error?: string;
572
579
  }
573
580
  interface BrowserSession {
@@ -637,13 +644,14 @@ declare function prepareAgentPayload(args: {
637
644
  declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
638
645
 
639
646
  declare function browser(http: HttpClient, args?: {
640
- ttlTotal?: number;
641
- ttlWithoutActivity?: number;
647
+ ttl?: number;
648
+ activityTtl?: number;
642
649
  streamWebView?: boolean;
643
650
  }): Promise<BrowserCreateResponse>;
644
651
  declare function browserExecute(http: HttpClient, sessionId: string, args: {
645
652
  code: string;
646
- language?: "python" | "js";
653
+ language?: "python" | "node" | "bash";
654
+ timeout?: number;
647
655
  }): Promise<BrowserExecuteResponse>;
648
656
  declare function listBrowsers(http: HttpClient, args?: {
649
657
  status?: "active" | "destroyed";
@@ -856,15 +864,15 @@ declare class FirecrawlClient {
856
864
  cancelAgent(jobId: string): Promise<boolean>;
857
865
  /**
858
866
  * Create a new browser session.
859
- * @param args Session options (ttlTotal, ttlWithoutActivity, streamWebView).
860
- * @returns Session id and CDP URL.
867
+ * @param args Session options (ttl, activityTtl, streamWebView).
868
+ * @returns Session id, CDP URL, live view URL, and expiration time.
861
869
  */
862
870
  browser(args?: Parameters<typeof browser>[1]): Promise<BrowserCreateResponse>;
863
871
  /**
864
872
  * Execute code in a browser session.
865
873
  * @param sessionId Browser session id.
866
- * @param args Code and language to execute.
867
- * @returns Execution result.
874
+ * @param args Code, language ("python" | "node" | "bash"), and optional timeout.
875
+ * @returns Execution result including stdout, stderr, exitCode, and killed status.
868
876
  */
869
877
  browserExecute(sessionId: string, args: Parameters<typeof browserExecute>[2]): Promise<BrowserExecuteResponse>;
870
878
  /**
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-VEC6CWSH.js";
3
+ } from "./chunk-WBUKU64H.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -815,8 +815,8 @@ async function cancelAgent(http, jobId) {
815
815
  // src/v2/methods/browser.ts
816
816
  async function browser(http, args = {}) {
817
817
  const body = {};
818
- if (args.ttlTotal != null) body.ttlTotal = args.ttlTotal;
819
- if (args.ttlWithoutActivity != null) body.ttlWithoutActivity = args.ttlWithoutActivity;
818
+ if (args.ttl != null) body.ttl = args.ttl;
819
+ if (args.activityTtl != null) body.activityTtl = args.activityTtl;
820
820
  if (args.streamWebView != null) body.streamWebView = args.streamWebView;
821
821
  try {
822
822
  const res = await http.post("/v2/browser", body);
@@ -830,8 +830,9 @@ async function browser(http, args = {}) {
830
830
  async function browserExecute(http, sessionId, args) {
831
831
  const body = {
832
832
  code: args.code,
833
- language: args.language ?? "python"
833
+ language: args.language ?? "bash"
834
834
  };
835
+ if (args.timeout != null) body.timeout = args.timeout;
835
836
  try {
836
837
  const res = await http.post(
837
838
  `/v2/browser/${sessionId}/execute`,
@@ -1365,8 +1366,8 @@ var FirecrawlClient = class {
1365
1366
  // Browser
1366
1367
  /**
1367
1368
  * Create a new browser session.
1368
- * @param args Session options (ttlTotal, ttlWithoutActivity, streamWebView).
1369
- * @returns Session id and CDP URL.
1369
+ * @param args Session options (ttl, activityTtl, streamWebView).
1370
+ * @returns Session id, CDP URL, live view URL, and expiration time.
1370
1371
  */
1371
1372
  async browser(args = {}) {
1372
1373
  return browser(this.http, args);
@@ -1374,8 +1375,8 @@ var FirecrawlClient = class {
1374
1375
  /**
1375
1376
  * Execute code in a browser session.
1376
1377
  * @param sessionId Browser session id.
1377
- * @param args Code and language to execute.
1378
- * @returns Execution result.
1378
+ * @param args Code, language ("python" | "node" | "bash"), and optional timeout.
1379
+ * @returns Execution result including stdout, stderr, exitCode, and killed status.
1379
1380
  */
1380
1381
  async browserExecute(sessionId, args) {
1381
1382
  return browserExecute(this.http, sessionId, args);
@@ -1464,7 +1465,7 @@ var FirecrawlApp = class {
1464
1465
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
1465
1466
  return process.env.npm_package_version;
1466
1467
  }
1467
- const packageJson = await import("./package-BBT366VN.js");
1468
+ const packageJson = await import("./package-Q6GJF2UB.js");
1468
1469
  return packageJson.default.version;
1469
1470
  } catch (error) {
1470
1471
  const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
@@ -1,4 +1,4 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-VEC6CWSH.js";
3
+ } from "./chunk-WBUKU64H.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl-js",
3
- "version": "4.13.0-beta.2",
3
+ "version": "4.13.0-beta.3",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/v2/client.ts CHANGED
@@ -311,8 +311,8 @@ export class FirecrawlClient {
311
311
  // Browser
312
312
  /**
313
313
  * Create a new browser session.
314
- * @param args Session options (ttlTotal, ttlWithoutActivity, streamWebView).
315
- * @returns Session id and CDP URL.
314
+ * @param args Session options (ttl, activityTtl, streamWebView).
315
+ * @returns Session id, CDP URL, live view URL, and expiration time.
316
316
  */
317
317
  async browser(
318
318
  args: Parameters<typeof browserMethod>[1] = {}
@@ -322,8 +322,8 @@ export class FirecrawlClient {
322
322
  /**
323
323
  * Execute code in a browser session.
324
324
  * @param sessionId Browser session id.
325
- * @param args Code and language to execute.
326
- * @returns Execution result.
325
+ * @param args Code, language ("python" | "node" | "bash"), and optional timeout.
326
+ * @returns Execution result including stdout, stderr, exitCode, and killed status.
327
327
  */
328
328
  async browserExecute(
329
329
  sessionId: string,
@@ -10,14 +10,14 @@ import { normalizeAxiosError, throwForBadResponse } from "../utils/errorHandler"
10
10
  export async function browser(
11
11
  http: HttpClient,
12
12
  args: {
13
- ttlTotal?: number;
14
- ttlWithoutActivity?: number;
13
+ ttl?: number;
14
+ activityTtl?: number;
15
15
  streamWebView?: boolean;
16
16
  } = {}
17
17
  ): Promise<BrowserCreateResponse> {
18
18
  const body: Record<string, unknown> = {};
19
- if (args.ttlTotal != null) body.ttlTotal = args.ttlTotal;
20
- if (args.ttlWithoutActivity != null) body.ttlWithoutActivity = args.ttlWithoutActivity;
19
+ if (args.ttl != null) body.ttl = args.ttl;
20
+ if (args.activityTtl != null) body.activityTtl = args.activityTtl;
21
21
  if (args.streamWebView != null) body.streamWebView = args.streamWebView;
22
22
 
23
23
  try {
@@ -35,13 +35,15 @@ export async function browserExecute(
35
35
  sessionId: string,
36
36
  args: {
37
37
  code: string;
38
- language?: "python" | "js";
38
+ language?: "python" | "node" | "bash";
39
+ timeout?: number;
39
40
  }
40
41
  ): Promise<BrowserExecuteResponse> {
41
42
  const body: Record<string, unknown> = {
42
43
  code: args.code,
43
- language: args.language ?? "python",
44
+ language: args.language ?? "bash",
44
45
  };
46
+ if (args.timeout != null) body.timeout = args.timeout;
45
47
 
46
48
  try {
47
49
  const res = await http.post<BrowserExecuteResponse>(
package/src/v2/types.ts CHANGED
@@ -690,17 +690,24 @@ export interface BrowserCreateResponse {
690
690
  id?: string;
691
691
  cdpUrl?: string;
692
692
  liveViewUrl?: string;
693
+ expiresAt?: string;
693
694
  error?: string;
694
695
  }
695
696
 
696
697
  export interface BrowserExecuteResponse {
697
698
  success: boolean;
699
+ stdout?: string;
698
700
  result?: string;
701
+ stderr?: string;
702
+ exitCode?: number;
703
+ killed?: boolean;
699
704
  error?: string;
700
705
  }
701
706
 
702
707
  export interface BrowserDeleteResponse {
703
708
  success: boolean;
709
+ sessionDurationMs?: number;
710
+ creditsBilled?: number;
704
711
  error?: string;
705
712
  }
706
713