browser-use-sdk 0.1.1 → 0.2.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.
Files changed (168) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +10 -10
  3. package/client.d.mts +9 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +9 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/lib/parse.d.mts +5 -9
  12. package/lib/parse.d.mts.map +1 -1
  13. package/lib/parse.d.ts +5 -9
  14. package/lib/parse.d.ts.map +1 -1
  15. package/lib/parse.js +7 -7
  16. package/lib/parse.js.map +1 -1
  17. package/lib/parse.mjs +7 -7
  18. package/lib/parse.mjs.map +1 -1
  19. package/lib/stream.d.mts +15 -0
  20. package/lib/stream.d.mts.map +1 -0
  21. package/lib/stream.d.ts +15 -0
  22. package/lib/stream.d.ts.map +1 -0
  23. package/lib/stream.js +44 -0
  24. package/lib/stream.js.map +1 -0
  25. package/lib/stream.mjs +41 -0
  26. package/lib/stream.mjs.map +1 -0
  27. package/lib/types.d.mts +75 -0
  28. package/lib/types.d.mts.map +1 -0
  29. package/lib/types.d.ts +75 -0
  30. package/lib/types.d.ts.map +1 -0
  31. package/lib/types.js +14 -0
  32. package/lib/types.js.map +1 -0
  33. package/lib/types.mjs +10 -0
  34. package/lib/types.mjs.map +1 -0
  35. package/package.json +1 -1
  36. package/resources/agent-profiles.d.mts +94 -14
  37. package/resources/agent-profiles.d.mts.map +1 -1
  38. package/resources/agent-profiles.d.ts +94 -14
  39. package/resources/agent-profiles.d.ts.map +1 -1
  40. package/resources/agent-profiles.js +91 -6
  41. package/resources/agent-profiles.js.map +1 -1
  42. package/resources/agent-profiles.mjs +91 -6
  43. package/resources/agent-profiles.mjs.map +1 -1
  44. package/resources/browser-profiles.d.mts +91 -10
  45. package/resources/browser-profiles.d.mts.map +1 -1
  46. package/resources/browser-profiles.d.ts +91 -10
  47. package/resources/browser-profiles.d.ts.map +1 -1
  48. package/resources/browser-profiles.js +92 -6
  49. package/resources/browser-profiles.js.map +1 -1
  50. package/resources/browser-profiles.mjs +92 -6
  51. package/resources/browser-profiles.mjs.map +1 -1
  52. package/resources/index.d.mts +4 -3
  53. package/resources/index.d.mts.map +1 -1
  54. package/resources/index.d.ts +4 -3
  55. package/resources/index.d.ts.map +1 -1
  56. package/resources/index.js +3 -1
  57. package/resources/index.js.map +1 -1
  58. package/resources/index.mjs +1 -0
  59. package/resources/index.mjs.map +1 -1
  60. package/resources/sessions/index.d.mts +1 -1
  61. package/resources/sessions/index.d.mts.map +1 -1
  62. package/resources/sessions/index.d.ts +1 -1
  63. package/resources/sessions/index.d.ts.map +1 -1
  64. package/resources/sessions/index.js.map +1 -1
  65. package/resources/sessions/index.mjs.map +1 -1
  66. package/resources/sessions/public-share.d.mts +59 -6
  67. package/resources/sessions/public-share.d.mts.map +1 -1
  68. package/resources/sessions/public-share.d.ts +59 -6
  69. package/resources/sessions/public-share.d.ts.map +1 -1
  70. package/resources/sessions/public-share.js +62 -4
  71. package/resources/sessions/public-share.js.map +1 -1
  72. package/resources/sessions/public-share.mjs +62 -4
  73. package/resources/sessions/public-share.mjs.map +1 -1
  74. package/resources/sessions/sessions.d.mts +117 -22
  75. package/resources/sessions/sessions.d.mts.map +1 -1
  76. package/resources/sessions/sessions.d.ts +117 -22
  77. package/resources/sessions/sessions.d.ts.map +1 -1
  78. package/resources/sessions/sessions.js +80 -3
  79. package/resources/sessions/sessions.js.map +1 -1
  80. package/resources/sessions/sessions.mjs +80 -3
  81. package/resources/sessions/sessions.mjs.map +1 -1
  82. package/resources/tasks.d.mts +332 -108
  83. package/resources/tasks.d.mts.map +1 -1
  84. package/resources/tasks.d.ts +332 -108
  85. package/resources/tasks.d.ts.map +1 -1
  86. package/resources/tasks.js +207 -22
  87. package/resources/tasks.js.map +1 -1
  88. package/resources/tasks.mjs +207 -22
  89. package/resources/tasks.mjs.map +1 -1
  90. package/resources/users/index.d.mts +3 -0
  91. package/resources/users/index.d.mts.map +1 -0
  92. package/resources/users/index.d.ts +3 -0
  93. package/resources/users/index.d.ts.map +1 -0
  94. package/resources/users/index.js +9 -0
  95. package/resources/users/index.js.map +1 -0
  96. package/resources/users/index.mjs +4 -0
  97. package/resources/users/index.mjs.map +1 -0
  98. package/resources/users/me/files.d.mts +64 -0
  99. package/resources/users/me/files.d.mts.map +1 -0
  100. package/resources/users/me/files.d.ts +64 -0
  101. package/resources/users/me/files.d.ts.map +1 -0
  102. package/resources/users/me/files.js +43 -0
  103. package/resources/users/me/files.js.map +1 -0
  104. package/resources/users/me/files.mjs +39 -0
  105. package/resources/users/me/files.mjs.map +1 -0
  106. package/resources/users/me/index.d.mts +3 -0
  107. package/resources/users/me/index.d.mts.map +1 -0
  108. package/resources/users/me/index.d.ts +3 -0
  109. package/resources/users/me/index.d.ts.map +1 -0
  110. package/resources/users/me/index.js +9 -0
  111. package/resources/users/me/index.js.map +1 -0
  112. package/resources/users/me/index.mjs +4 -0
  113. package/resources/users/me/index.mjs.map +1 -0
  114. package/resources/users/me/me.d.mts +50 -0
  115. package/resources/users/me/me.d.mts.map +1 -0
  116. package/resources/users/me/me.d.ts +50 -0
  117. package/resources/users/me/me.d.ts.map +1 -0
  118. package/resources/users/me/me.js +41 -0
  119. package/resources/users/me/me.js.map +1 -0
  120. package/resources/users/me/me.mjs +36 -0
  121. package/resources/users/me/me.mjs.map +1 -0
  122. package/resources/users/me.d.mts +2 -0
  123. package/resources/users/me.d.mts.map +1 -0
  124. package/resources/users/me.d.ts +2 -0
  125. package/resources/users/me.d.ts.map +1 -0
  126. package/resources/users/me.js +6 -0
  127. package/resources/users/me.js.map +1 -0
  128. package/resources/users/me.mjs +3 -0
  129. package/resources/users/me.mjs.map +1 -0
  130. package/resources/users/users.d.mts +10 -0
  131. package/resources/users/users.d.mts.map +1 -0
  132. package/resources/users/users.d.ts +10 -0
  133. package/resources/users/users.d.ts.map +1 -0
  134. package/resources/users/users.js +17 -0
  135. package/resources/users/users.js.map +1 -0
  136. package/resources/users/users.mjs +12 -0
  137. package/resources/users/users.mjs.map +1 -0
  138. package/resources/users.d.mts +2 -0
  139. package/resources/users.d.mts.map +1 -0
  140. package/resources/users.d.ts +2 -0
  141. package/resources/users.d.ts.map +1 -0
  142. package/resources/users.js +6 -0
  143. package/resources/users.js.map +1 -0
  144. package/resources/users.mjs +3 -0
  145. package/resources/users.mjs.map +1 -0
  146. package/src/client.ts +21 -14
  147. package/src/lib/parse.ts +12 -24
  148. package/src/lib/stream.ts +70 -0
  149. package/src/lib/types.ts +73 -0
  150. package/src/resources/agent-profiles.ts +101 -19
  151. package/src/resources/browser-profiles.ts +95 -12
  152. package/src/resources/index.ts +9 -7
  153. package/src/resources/sessions/index.ts +1 -1
  154. package/src/resources/sessions/public-share.ts +64 -8
  155. package/src/resources/sessions/sessions.ts +130 -26
  156. package/src/resources/tasks.ts +479 -146
  157. package/src/resources/users/index.ts +4 -0
  158. package/src/resources/users/me/files.ts +95 -0
  159. package/src/resources/users/me/index.ts +4 -0
  160. package/src/resources/users/me/me.ts +68 -0
  161. package/src/resources/users/me.ts +3 -0
  162. package/src/resources/users/users.ts +15 -0
  163. package/src/resources/users.ts +3 -0
  164. package/src/version.ts +1 -1
  165. package/version.d.mts +1 -1
  166. package/version.d.ts +1 -1
  167. package/version.js +1 -1
  168. package/version.mjs +1 -1
@@ -3,17 +3,71 @@ import { APIPromise } from "../../core/api-promise.js";
3
3
  import { RequestOptions } from "../../internal/request-options.js";
4
4
  export declare class PublicShare extends APIResource {
5
5
  /**
6
- * Create Session Public Share
6
+ * Create a public share for a session.
7
+ *
8
+ * Generates a public sharing link that allows anyone with the URL to view the
9
+ * session and its tasks. If a public share already exists for the session, it will
10
+ * return the existing share instead of creating a new one.
11
+ *
12
+ * Public shares are useful for:
13
+ *
14
+ * - Sharing results with clients or team members
15
+ * - Demonstrating AI agent capabilities
16
+ * - Collaborative review of automated tasks
17
+ *
18
+ * Args:
19
+ *
20
+ * - session_id: The unique identifier of the agent session to share
21
+ *
22
+ * Returns:
23
+ *
24
+ * - Public share information including the share URL and usage statistics
25
+ *
26
+ * Raises:
27
+ *
28
+ * - 404: If the user agent session doesn't exist
7
29
  */
8
30
  create(sessionID: string, options?: RequestOptions): APIPromise<ShareView>;
9
31
  /**
10
- * Get Session Public Share
32
+ * Get information about the public share for a session.
33
+ *
34
+ * Retrieves details about the public sharing link for a session, including the
35
+ * share token, public URL, view count, and last viewed timestamp. This is useful
36
+ * for monitoring how your shared sessions are being accessed.
37
+ *
38
+ * Args:
39
+ *
40
+ * - session_id: The unique identifier of the agent session
41
+ *
42
+ * Returns:
43
+ *
44
+ * - Public share information including the share URL and usage statistics
45
+ *
46
+ * Raises:
47
+ *
48
+ * - 404: If the user agent session doesn't exist or doesn't have a public share
11
49
  */
12
50
  retrieve(sessionID: string, options?: RequestOptions): APIPromise<ShareView>;
13
51
  /**
14
- * Delete Session Public Share
52
+ * Remove the public share for a session.
53
+ *
54
+ * Deletes the public sharing link for a session, making it no longer accessible to
55
+ * anyone with the previous share URL. This is useful for removing access to
56
+ * sensitive sessions or when you no longer want to share the results.
57
+ *
58
+ * Args:
59
+ *
60
+ * - session_id: The unique identifier of the agent session
61
+ *
62
+ * Returns:
63
+ *
64
+ * - 204 No Content on successful deletion (idempotent)
65
+ *
66
+ * Raises:
67
+ *
68
+ * - 404: If the user agent session doesn't exist
15
69
  */
16
- delete(sessionID: string, options?: RequestOptions): APIPromise<unknown>;
70
+ delete(sessionID: string, options?: RequestOptions): APIPromise<void>;
17
71
  }
18
72
  /**
19
73
  * View model for representing a public share of a session.
@@ -29,8 +83,7 @@ export interface ShareView {
29
83
  viewCount: number;
30
84
  lastViewedAt?: string | null;
31
85
  }
32
- export type PublicShareDeleteResponse = unknown;
33
86
  export declare namespace PublicShare {
34
- export { type ShareView as ShareView, type PublicShareDeleteResponse as PublicShareDeleteResponse };
87
+ export { type ShareView as ShareView };
35
88
  }
36
89
  //# sourceMappingURL=public-share.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-share.d.ts","sourceRoot":"","sources":["../../src/resources/sessions/public-share.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAI1E;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAI5E;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAGzE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC;AAEhD,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EAAE,KAAK,SAAS,IAAI,SAAS,EAAE,KAAK,yBAAyB,IAAI,yBAAyB,EAAE,CAAC;CACrG"}
1
+ {"version":3,"file":"public-share.d.ts","sourceRoot":"","sources":["../../src/resources/sessions/public-share.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAI1E;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAI5E;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAMtE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EAAE,KAAK,SAAS,IAAI,SAAS,EAAE,CAAC;CACxC"}
@@ -3,25 +3,83 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PublicShare = void 0;
5
5
  const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
6
7
  const path_1 = require("../../internal/utils/path.js");
7
8
  class PublicShare extends resource_1.APIResource {
8
9
  /**
9
- * Create Session Public Share
10
+ * Create a public share for a session.
11
+ *
12
+ * Generates a public sharing link that allows anyone with the URL to view the
13
+ * session and its tasks. If a public share already exists for the session, it will
14
+ * return the existing share instead of creating a new one.
15
+ *
16
+ * Public shares are useful for:
17
+ *
18
+ * - Sharing results with clients or team members
19
+ * - Demonstrating AI agent capabilities
20
+ * - Collaborative review of automated tasks
21
+ *
22
+ * Args:
23
+ *
24
+ * - session_id: The unique identifier of the agent session to share
25
+ *
26
+ * Returns:
27
+ *
28
+ * - Public share information including the share URL and usage statistics
29
+ *
30
+ * Raises:
31
+ *
32
+ * - 404: If the user agent session doesn't exist
10
33
  */
11
34
  create(sessionID, options) {
12
35
  return this._client.post((0, path_1.path) `/sessions/${sessionID}/public-share`, options);
13
36
  }
14
37
  /**
15
- * Get Session Public Share
38
+ * Get information about the public share for a session.
39
+ *
40
+ * Retrieves details about the public sharing link for a session, including the
41
+ * share token, public URL, view count, and last viewed timestamp. This is useful
42
+ * for monitoring how your shared sessions are being accessed.
43
+ *
44
+ * Args:
45
+ *
46
+ * - session_id: The unique identifier of the agent session
47
+ *
48
+ * Returns:
49
+ *
50
+ * - Public share information including the share URL and usage statistics
51
+ *
52
+ * Raises:
53
+ *
54
+ * - 404: If the user agent session doesn't exist or doesn't have a public share
16
55
  */
17
56
  retrieve(sessionID, options) {
18
57
  return this._client.get((0, path_1.path) `/sessions/${sessionID}/public-share`, options);
19
58
  }
20
59
  /**
21
- * Delete Session Public Share
60
+ * Remove the public share for a session.
61
+ *
62
+ * Deletes the public sharing link for a session, making it no longer accessible to
63
+ * anyone with the previous share URL. This is useful for removing access to
64
+ * sensitive sessions or when you no longer want to share the results.
65
+ *
66
+ * Args:
67
+ *
68
+ * - session_id: The unique identifier of the agent session
69
+ *
70
+ * Returns:
71
+ *
72
+ * - 204 No Content on successful deletion (idempotent)
73
+ *
74
+ * Raises:
75
+ *
76
+ * - 404: If the user agent session doesn't exist
22
77
  */
23
78
  delete(sessionID, options) {
24
- return this._client.delete((0, path_1.path) `/sessions/${sessionID}/public-share`, options);
79
+ return this._client.delete((0, path_1.path) `/sessions/${sessionID}/public-share`, {
80
+ ...options,
81
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
82
+ });
25
83
  }
26
84
  }
27
85
  exports.PublicShare = PublicShare;
@@ -1 +1 @@
1
- {"version":3,"file":"public-share.js","sourceRoot":"","sources":["../../src/resources/sessions/public-share.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;OAEG;IACH,MAAM,CAA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;YACpE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA9ED,kCA8EC"}
@@ -1,24 +1,82 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
3
4
  import { path } from "../../internal/utils/path.mjs";
4
5
  export class PublicShare extends APIResource {
5
6
  /**
6
- * Create Session Public Share
7
+ * Create a public share for a session.
8
+ *
9
+ * Generates a public sharing link that allows anyone with the URL to view the
10
+ * session and its tasks. If a public share already exists for the session, it will
11
+ * return the existing share instead of creating a new one.
12
+ *
13
+ * Public shares are useful for:
14
+ *
15
+ * - Sharing results with clients or team members
16
+ * - Demonstrating AI agent capabilities
17
+ * - Collaborative review of automated tasks
18
+ *
19
+ * Args:
20
+ *
21
+ * - session_id: The unique identifier of the agent session to share
22
+ *
23
+ * Returns:
24
+ *
25
+ * - Public share information including the share URL and usage statistics
26
+ *
27
+ * Raises:
28
+ *
29
+ * - 404: If the user agent session doesn't exist
7
30
  */
8
31
  create(sessionID, options) {
9
32
  return this._client.post(path `/sessions/${sessionID}/public-share`, options);
10
33
  }
11
34
  /**
12
- * Get Session Public Share
35
+ * Get information about the public share for a session.
36
+ *
37
+ * Retrieves details about the public sharing link for a session, including the
38
+ * share token, public URL, view count, and last viewed timestamp. This is useful
39
+ * for monitoring how your shared sessions are being accessed.
40
+ *
41
+ * Args:
42
+ *
43
+ * - session_id: The unique identifier of the agent session
44
+ *
45
+ * Returns:
46
+ *
47
+ * - Public share information including the share URL and usage statistics
48
+ *
49
+ * Raises:
50
+ *
51
+ * - 404: If the user agent session doesn't exist or doesn't have a public share
13
52
  */
14
53
  retrieve(sessionID, options) {
15
54
  return this._client.get(path `/sessions/${sessionID}/public-share`, options);
16
55
  }
17
56
  /**
18
- * Delete Session Public Share
57
+ * Remove the public share for a session.
58
+ *
59
+ * Deletes the public sharing link for a session, making it no longer accessible to
60
+ * anyone with the previous share URL. This is useful for removing access to
61
+ * sensitive sessions or when you no longer want to share the results.
62
+ *
63
+ * Args:
64
+ *
65
+ * - session_id: The unique identifier of the agent session
66
+ *
67
+ * Returns:
68
+ *
69
+ * - 204 No Content on successful deletion (idempotent)
70
+ *
71
+ * Raises:
72
+ *
73
+ * - 404: If the user agent session doesn't exist
19
74
  */
20
75
  delete(sessionID, options) {
21
- return this._client.delete(path `/sessions/${sessionID}/public-share`, options);
76
+ return this._client.delete(path `/sessions/${sessionID}/public-share`, {
77
+ ...options,
78
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
79
+ });
22
80
  }
23
81
  }
24
82
  //# sourceMappingURL=public-share.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-share.mjs","sourceRoot":"","sources":["../../src/resources/sessions/public-share.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,eAAe,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,SAAS,eAAe,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,SAAS,eAAe,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;CACF"}
1
+ {"version":3,"file":"public-share.mjs","sourceRoot":"","sources":["../../src/resources/sessions/public-share.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,eAAe,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,SAAS,eAAe,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,SAAS,eAAe,EAAE;YACpE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,30 +1,101 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
+ import * as SessionsAPI from "./sessions.mjs";
2
3
  import * as TasksAPI from "../tasks.mjs";
3
4
  import * as PublicShareAPI from "./public-share.mjs";
4
- import { PublicShare, PublicShareDeleteResponse, ShareView } from "./public-share.mjs";
5
+ import { PublicShare, ShareView } from "./public-share.mjs";
5
6
  import { APIPromise } from "../../core/api-promise.mjs";
6
7
  import { RequestOptions } from "../../internal/request-options.mjs";
7
8
  export declare class Sessions extends APIResource {
8
9
  publicShare: PublicShareAPI.PublicShare;
9
10
  /**
10
- * Get Session
11
+ * Get detailed information about a specific AI agent session.
12
+ *
13
+ * Retrieves comprehensive information about a session, including its current
14
+ * status, live browser URL (if active), recording URL (if completed), and optional
15
+ * task details. This endpoint is useful for monitoring active sessions or
16
+ * reviewing completed ones.
17
+ *
18
+ * Args:
19
+ *
20
+ * - session_id: The unique identifier of the agent session
21
+ * - params: Optional parameters to control what data is included
22
+ *
23
+ * Returns:
24
+ *
25
+ * - Complete session information including status, URLs, and optional task details
26
+ *
27
+ * Raises:
28
+ *
29
+ * - 404: If the user agent session doesn't exist
11
30
  */
12
31
  retrieve(sessionID: string, query?: SessionRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<SessionView>;
13
32
  /**
14
- * Update Session
33
+ * Update a session's status or perform actions on it.
34
+ *
35
+ * Currently supports stopping a session, which will:
36
+ *
37
+ * 1. Stop any running tasks in the session
38
+ * 2. End the browser session
39
+ * 3. Generate a recording URL if available
40
+ * 4. Update the session status to 'stopped'
41
+ *
42
+ * This is useful for manually stopping long-running sessions or when you want to
43
+ * end a session before all tasks are complete.
44
+ *
45
+ * Args:
46
+ *
47
+ * - session_id: The unique identifier of the agent session to update
48
+ * - request: The action to perform on the session
49
+ *
50
+ * Returns:
51
+ *
52
+ * - The updated session information including the new status and recording URL
53
+ *
54
+ * Raises:
55
+ *
56
+ * - 404: If the user agent session doesn't exist
15
57
  */
16
58
  update(sessionID: string, body: SessionUpdateParams, options?: RequestOptions): APIPromise<SessionView>;
17
59
  /**
18
- * List Sessions
60
+ * Get a paginated list of all AI agent sessions for the authenticated user.
61
+ *
62
+ * AI agent sessions represent active or completed browsing sessions where your AI
63
+ * agents perform tasks. Each session can contain multiple tasks and maintains
64
+ * browser state throughout the session lifecycle.
65
+ *
66
+ * You can filter sessions by status and optionally include task details for each
67
+ * session.
68
+ *
69
+ * Returns:
70
+ *
71
+ * - A paginated list of agent sessions
72
+ * - Total count of sessions
73
+ * - Page information for navigation
74
+ * - Optional task details for each session (if requested)
19
75
  */
20
76
  list(query?: SessionListParams | null | undefined, options?: RequestOptions): APIPromise<SessionListResponse>;
77
+ /**
78
+ * Delete a session and all its associated data.
79
+ *
80
+ * Permanently removes a session and all its tasks, browser data, and public
81
+ * shares. This action cannot be undone. Use this endpoint to clean up old sessions
82
+ * and free up storage space.
83
+ *
84
+ * Args:
85
+ *
86
+ * - session_id: The unique identifier of the agent session to delete
87
+ *
88
+ * Returns:
89
+ *
90
+ * - 204 No Content on successful deletion (idempotent)
91
+ */
92
+ delete(sessionID: string, options?: RequestOptions): APIPromise<void>;
21
93
  }
22
94
  /**
23
95
  * Enumeration of possible (browser) session states
24
96
  *
25
- * Attributes: ACTIVE: Session is currently active and running (aka browser is
26
- * running) STOPPED: Session has been stopped and is no longer active (aka browser
27
- * is stopped)
97
+ * Attributes: ACTIVE: Session is currently active and running (browser is running)
98
+ * STOPPED: Session has been stopped and is no longer active (browser is stopped)
28
99
  */
29
100
  export type SessionStatus = 'active' | 'stopped';
30
101
  /**
@@ -32,11 +103,11 @@ export type SessionStatus = 'active' | 'stopped';
32
103
  *
33
104
  * Attributes: id: Unique identifier for the session. status: Current status of the
34
105
  * session (active/stopped). live_url: URL where the browser can be viewed live in
35
- * real-time. record_url: URL to access the recorded session playback. started_at:
36
- * Timestamp when the session was created and started. finished_at: Timestamp when
37
- * the session was stopped (None if still active). tasks: List of tasks associated
38
- * with this session (optional). public_share_url: URL to access the public share
39
- * of the session (optional).
106
+ * real-time. started_at: Timestamp when the session was created and started.
107
+ * finished_at: Timestamp when the session was stopped (None if still active).
108
+ * tasks: Optional list of tasks associated with this session. record_url: URL to
109
+ * access the recorded session playback. public_share_url: Optional URL to access
110
+ * the public share of the session.
40
111
  */
41
112
  export interface SessionView {
42
113
  id: string;
@@ -44,16 +115,15 @@ export interface SessionView {
44
115
  /**
45
116
  * Enumeration of possible (browser) session states
46
117
  *
47
- * Attributes: ACTIVE: Session is currently active and running (aka browser is
48
- * running) STOPPED: Session has been stopped and is no longer active (aka browser
49
- * is stopped)
118
+ * Attributes: ACTIVE: Session is currently active and running (browser is running)
119
+ * STOPPED: Session has been stopped and is no longer active (browser is stopped)
50
120
  */
51
121
  status: SessionStatus;
52
122
  finishedAt?: string | null;
53
123
  liveUrl?: string | null;
54
124
  publicShareUrl?: string | null;
55
125
  recordUrl?: string | null;
56
- tasks?: Array<TasksAPI.TaskView> | null;
126
+ tasks?: Array<TasksAPI.TaskItemView> | null;
57
127
  }
58
128
  /**
59
129
  * Response model for paginated session list requests
@@ -61,11 +131,36 @@ export interface SessionView {
61
131
  * Attributes: items: List of session views for the current page
62
132
  */
63
133
  export interface SessionListResponse {
64
- items: Array<SessionView>;
134
+ items: Array<SessionListResponse.Item>;
65
135
  pageNumber: number;
66
136
  pageSize: number;
67
137
  totalItems: number;
68
138
  }
139
+ export declare namespace SessionListResponse {
140
+ /**
141
+ * View model for representing a (browser) session with its associated tasks.
142
+ *
143
+ * Attributes: id: Unique identifier for the session. status: Current status of the
144
+ * session (active/stopped). live_url: URL where the browser can be viewed live in
145
+ * real-time. started_at: Timestamp when the session was created and started.
146
+ * finished_at: Timestamp when the session was stopped (None if still active).
147
+ * tasks: Optional list of tasks associated with this session.
148
+ */
149
+ interface Item {
150
+ id: string;
151
+ startedAt: string;
152
+ /**
153
+ * Enumeration of possible (browser) session states
154
+ *
155
+ * Attributes: ACTIVE: Session is currently active and running (browser is running)
156
+ * STOPPED: Session has been stopped and is no longer active (browser is stopped)
157
+ */
158
+ status: SessionsAPI.SessionStatus;
159
+ finishedAt?: string | null;
160
+ liveUrl?: string | null;
161
+ tasks?: Array<TasksAPI.TaskItemView> | null;
162
+ }
163
+ }
69
164
  export interface SessionRetrieveParams {
70
165
  includeTasks?: boolean;
71
166
  }
@@ -73,7 +168,8 @@ export interface SessionUpdateParams {
73
168
  /**
74
169
  * Available actions that can be performed on a session
75
170
  *
76
- * Attributes: STOP: Stop the session and all its associated tasks
171
+ * Attributes: STOP: Stop the session and all its associated tasks (cannot be
172
+ * undone)
77
173
  */
78
174
  action: 'stop';
79
175
  }
@@ -81,9 +177,8 @@ export interface SessionListParams {
81
177
  /**
82
178
  * Enumeration of possible (browser) session states
83
179
  *
84
- * Attributes: ACTIVE: Session is currently active and running (aka browser is
85
- * running) STOPPED: Session has been stopped and is no longer active (aka browser
86
- * is stopped)
180
+ * Attributes: ACTIVE: Session is currently active and running (browser is running)
181
+ * STOPPED: Session has been stopped and is no longer active (browser is stopped)
87
182
  */
88
183
  filterBy?: SessionStatus | null;
89
184
  includeTasks?: boolean;
@@ -92,6 +187,6 @@ export interface SessionListParams {
92
187
  }
93
188
  export declare namespace Sessions {
94
189
  export { type SessionStatus as SessionStatus, type SessionView as SessionView, type SessionListResponse as SessionListResponse, type SessionRetrieveParams as SessionRetrieveParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
95
- export { PublicShare as PublicShare, type ShareView as ShareView, type PublicShareDeleteResponse as PublicShareDeleteResponse, };
190
+ export { PublicShare as PublicShare, type ShareView as ShareView };
96
191
  }
97
192
  //# sourceMappingURL=sessions.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.d.mts","sourceRoot":"","sources":["../../src/resources/sessions/sessions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,KAAK,cAAc;OACnB,EAAE,WAAW,EAAE,yBAAyB,EAAE,SAAS,EAAE;OACrD,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IAEvF;;OAEG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC;IAI1B;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE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