browser-use-sdk 2.0.12 → 2.0.13
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/cjs/BaseClient.d.ts +1 -1
- package/dist/cjs/Client.d.ts +1 -1
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/cjs/api/resources/billing/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/billing/client/Client.js +2 -2
- package/dist/cjs/api/resources/browsers/client/Client.d.ts +9 -7
- package/dist/cjs/api/resources/browsers/client/Client.js +9 -7
- package/dist/cjs/api/resources/browsers/client/requests/CreateBrowserSessionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/files/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/files/client/Client.js +1 -1
- package/dist/cjs/api/resources/profiles/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/profiles/client/Client.js +1 -1
- package/dist/cjs/api/resources/sessions/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/sessions/client/Client.js +1 -1
- package/dist/cjs/api/resources/sessions/client/requests/CreateSessionRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skills/client/Client.d.ts +6 -4
- package/dist/cjs/api/resources/skills/client/Client.js +12 -5
- package/dist/cjs/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.d.ts +12 -0
- package/dist/cjs/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.js +3 -0
- package/dist/cjs/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skills/client/requests/UpdateSkillRequest.d.ts +5 -2
- package/dist/cjs/api/resources/skills/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/skillsMarketplace/client/Client.d.ts +24 -5
- package/dist/cjs/api/resources/skillsMarketplace/client/Client.js +87 -7
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.d.ts +12 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/tasks/client/Client.d.ts +9 -3
- package/dist/cjs/api/resources/tasks/client/Client.js +9 -3
- package/dist/cjs/api/resources/tasks/client/requests/CreateTaskRequest.d.ts +2 -0
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +29 -1
- package/dist/cjs/api/resources/workflows/client/Client.js +85 -1
- package/dist/cjs/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.d.ts +18 -0
- package/dist/cjs/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.js +3 -0
- package/dist/cjs/api/resources/workflows/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/AccountNotFoundError.d.ts +1 -1
- package/dist/cjs/api/types/AccountView.d.ts +5 -5
- package/dist/cjs/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.d.ts +6 -0
- package/dist/cjs/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.js +3 -0
- package/dist/cjs/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.d.ts +6 -0
- package/dist/cjs/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.js +3 -0
- package/dist/cjs/api/types/CommonUtilsErrorsInsufficientCreditsError.d.ts +6 -0
- package/dist/cjs/api/types/CommonUtilsErrorsInsufficientCreditsError.js +3 -0
- package/dist/cjs/api/types/EnabledSkillsLimitExceededError.d.ts +6 -0
- package/dist/cjs/api/types/EnabledSkillsLimitExceededError.js +3 -0
- package/dist/cjs/api/types/ExecuteSkillRequest.d.ts +7 -0
- package/dist/cjs/api/types/ExecuteSkillRequest.js +3 -0
- package/dist/cjs/api/types/MarketplaceSkillResponse.d.ts +14 -0
- package/dist/cjs/api/types/SessionItemView.d.ts +2 -0
- package/dist/cjs/api/types/SessionStatus.d.ts +3 -3
- package/dist/cjs/api/types/SessionStatus.js +3 -3
- package/dist/cjs/api/types/SessionTimeoutLimitExceededError.d.ts +1 -1
- package/dist/cjs/api/types/SessionView.d.ts +2 -0
- package/dist/cjs/api/types/SkillCategory.d.ts +20 -0
- package/dist/cjs/api/types/SkillCategory.js +23 -0
- package/dist/cjs/api/types/SkillResponse.d.ts +14 -2
- package/dist/cjs/api/types/SkillsGenerationStatus.d.ts +1 -0
- package/dist/cjs/api/types/SkillsGenerationStatus.js +1 -0
- package/dist/cjs/api/types/WorkflowCreateFromTaskResponse.d.ts +11 -0
- package/dist/cjs/api/types/WorkflowCreateFromTaskResponse.js +3 -0
- package/dist/cjs/api/types/WorkflowExecutionResponse.d.ts +4 -0
- package/dist/cjs/api/types/WorkflowExecutionStateView.d.ts +4 -0
- package/dist/cjs/api/types/WorkflowExecutionStepView.d.ts +4 -4
- package/dist/cjs/api/types/WorkflowGenerationStateView.d.ts +6 -0
- package/dist/cjs/api/types/WorkflowItemView.d.ts +7 -0
- package/dist/cjs/api/types/WorkflowResponse.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +7 -2
- package/dist/cjs/api/types/index.js +7 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +1 -1
- package/dist/esm/Client.d.mts +1 -1
- package/dist/esm/Client.mjs +3 -3
- package/dist/esm/api/errors/ForbiddenError.d.mts +1 -2
- package/dist/esm/api/resources/billing/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/billing/client/Client.mjs +2 -2
- package/dist/esm/api/resources/browsers/client/Client.d.mts +9 -7
- package/dist/esm/api/resources/browsers/client/Client.mjs +9 -7
- package/dist/esm/api/resources/browsers/client/requests/CreateBrowserSessionRequest.d.mts +1 -1
- package/dist/esm/api/resources/files/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/files/client/Client.mjs +1 -1
- package/dist/esm/api/resources/profiles/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/profiles/client/Client.mjs +1 -1
- package/dist/esm/api/resources/sessions/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/sessions/client/Client.mjs +1 -1
- package/dist/esm/api/resources/sessions/client/requests/CreateSessionRequest.d.mts +2 -0
- package/dist/esm/api/resources/skills/client/Client.d.mts +6 -4
- package/dist/esm/api/resources/skills/client/Client.mjs +12 -5
- package/dist/esm/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.d.mts +12 -0
- package/dist/esm/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.mjs +2 -0
- package/dist/esm/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/skills/client/requests/UpdateSkillRequest.d.mts +5 -2
- package/dist/esm/api/resources/skills/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/skillsMarketplace/client/Client.d.mts +24 -5
- package/dist/esm/api/resources/skillsMarketplace/client/Client.mjs +87 -7
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.d.mts +12 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/tasks/client/Client.d.mts +9 -3
- package/dist/esm/api/resources/tasks/client/Client.mjs +9 -3
- package/dist/esm/api/resources/tasks/client/requests/CreateTaskRequest.d.mts +2 -0
- package/dist/esm/api/resources/workflows/client/Client.d.mts +29 -1
- package/dist/esm/api/resources/workflows/client/Client.mjs +85 -1
- package/dist/esm/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.d.mts +18 -0
- package/dist/esm/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.mjs +2 -0
- package/dist/esm/api/resources/workflows/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/AccountNotFoundError.d.mts +1 -1
- package/dist/esm/api/types/AccountView.d.mts +5 -5
- package/dist/esm/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.d.mts +6 -0
- package/dist/esm/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.mjs +2 -0
- package/dist/esm/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.d.mts +6 -0
- package/dist/esm/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.mjs +2 -0
- package/dist/esm/api/types/CommonUtilsErrorsInsufficientCreditsError.d.mts +6 -0
- package/dist/esm/api/types/CommonUtilsErrorsInsufficientCreditsError.mjs +2 -0
- package/dist/esm/api/types/EnabledSkillsLimitExceededError.d.mts +6 -0
- package/dist/esm/api/types/EnabledSkillsLimitExceededError.mjs +2 -0
- package/dist/esm/api/types/ExecuteSkillRequest.d.mts +7 -0
- package/dist/esm/api/types/ExecuteSkillRequest.mjs +2 -0
- package/dist/esm/api/types/MarketplaceSkillResponse.d.mts +14 -0
- package/dist/esm/api/types/SessionItemView.d.mts +2 -0
- package/dist/esm/api/types/SessionStatus.d.mts +3 -3
- package/dist/esm/api/types/SessionStatus.mjs +3 -3
- package/dist/esm/api/types/SessionTimeoutLimitExceededError.d.mts +1 -1
- package/dist/esm/api/types/SessionView.d.mts +2 -0
- package/dist/esm/api/types/SkillCategory.d.mts +20 -0
- package/dist/esm/api/types/SkillCategory.mjs +20 -0
- package/dist/esm/api/types/SkillResponse.d.mts +14 -2
- package/dist/esm/api/types/SkillsGenerationStatus.d.mts +1 -0
- package/dist/esm/api/types/SkillsGenerationStatus.mjs +1 -0
- package/dist/esm/api/types/WorkflowCreateFromTaskResponse.d.mts +11 -0
- package/dist/esm/api/types/WorkflowCreateFromTaskResponse.mjs +2 -0
- package/dist/esm/api/types/WorkflowExecutionResponse.d.mts +4 -0
- package/dist/esm/api/types/WorkflowExecutionStateView.d.mts +4 -0
- package/dist/esm/api/types/WorkflowExecutionStepView.d.mts +4 -4
- package/dist/esm/api/types/WorkflowGenerationStateView.d.mts +6 -0
- package/dist/esm/api/types/WorkflowItemView.d.mts +7 -0
- package/dist/esm/api/types/WorkflowResponse.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +7 -2
- package/dist/esm/api/types/index.mjs +7 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +83 -82
- package/reference.md +166 -14
|
@@ -14,7 +14,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
14
14
|
import * as errors from "../../../../errors/index.mjs";
|
|
15
15
|
import * as BrowserUse from "../../../index.mjs";
|
|
16
16
|
export class SkillsMarketplace {
|
|
17
|
-
constructor(_options) {
|
|
17
|
+
constructor(_options = {}) {
|
|
18
18
|
this._options = _options;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -34,7 +34,7 @@ export class SkillsMarketplace {
|
|
|
34
34
|
__listSkills() {
|
|
35
35
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
36
36
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
37
|
-
const { pageSize, pageNumber, query, fromDate, toDate } = request;
|
|
37
|
+
const { pageSize, pageNumber, query, category, fromDate, toDate } = request;
|
|
38
38
|
const _queryParams = {};
|
|
39
39
|
if (pageSize != null) {
|
|
40
40
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -45,6 +45,9 @@ export class SkillsMarketplace {
|
|
|
45
45
|
if (query !== undefined) {
|
|
46
46
|
_queryParams.query = query;
|
|
47
47
|
}
|
|
48
|
+
if (category !== undefined) {
|
|
49
|
+
_queryParams.category = category;
|
|
50
|
+
}
|
|
48
51
|
if (fromDate !== undefined) {
|
|
49
52
|
_queryParams.fromDate = fromDate;
|
|
50
53
|
}
|
|
@@ -101,7 +104,7 @@ export class SkillsMarketplace {
|
|
|
101
104
|
/**
|
|
102
105
|
* Get details of a specific public skill from the marketplace.
|
|
103
106
|
*
|
|
104
|
-
* @param {BrowserUse.
|
|
107
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillSlugGetRequest} request
|
|
105
108
|
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
106
109
|
*
|
|
107
110
|
* @throws {@link BrowserUse.NotFoundError}
|
|
@@ -109,7 +112,7 @@ export class SkillsMarketplace {
|
|
|
109
112
|
*
|
|
110
113
|
* @example
|
|
111
114
|
* await client.skillsMarketplace.getSkill({
|
|
112
|
-
*
|
|
115
|
+
* skill_slug: "skill_slug"
|
|
113
116
|
* })
|
|
114
117
|
*/
|
|
115
118
|
getSkill(request, requestOptions) {
|
|
@@ -118,10 +121,10 @@ export class SkillsMarketplace {
|
|
|
118
121
|
__getSkill(request, requestOptions) {
|
|
119
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
123
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
121
|
-
const {
|
|
124
|
+
const { skill_slug: skillSlug } = request;
|
|
122
125
|
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
123
126
|
const _response = yield core.fetcher({
|
|
124
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `marketplace/skills/${core.url.encodePathParam(
|
|
127
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `marketplace/skills/${core.url.encodePathParam(skillSlug)}`),
|
|
125
128
|
method: "GET",
|
|
126
129
|
headers: _headers,
|
|
127
130
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -156,7 +159,7 @@ export class SkillsMarketplace {
|
|
|
156
159
|
rawResponse: _response.rawResponse,
|
|
157
160
|
});
|
|
158
161
|
case "timeout":
|
|
159
|
-
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{
|
|
162
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{skill_slug}.");
|
|
160
163
|
case "unknown":
|
|
161
164
|
throw new errors.BrowserUseError({
|
|
162
165
|
message: _response.error.errorMessage,
|
|
@@ -235,6 +238,83 @@ export class SkillsMarketplace {
|
|
|
235
238
|
}
|
|
236
239
|
});
|
|
237
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Execute a skill with the provided parameters.
|
|
243
|
+
*
|
|
244
|
+
* @param {BrowserUse.ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest} request
|
|
245
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
246
|
+
*
|
|
247
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
248
|
+
* @throws {@link BrowserUse.PaymentRequiredError}
|
|
249
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
250
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* await client.skillsMarketplace.executeSkill({
|
|
254
|
+
* skill_id: "skill_id",
|
|
255
|
+
* body: {}
|
|
256
|
+
* })
|
|
257
|
+
*/
|
|
258
|
+
executeSkill(request, requestOptions) {
|
|
259
|
+
return core.HttpResponsePromise.fromPromise(this.__executeSkill(request, requestOptions));
|
|
260
|
+
}
|
|
261
|
+
__executeSkill(request, requestOptions) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
264
|
+
const { skill_id: skillId, body: _body } = request;
|
|
265
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
266
|
+
const _response = yield core.fetcher({
|
|
267
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `marketplace/skills/${core.url.encodePathParam(skillId)}/execute`),
|
|
268
|
+
method: "POST",
|
|
269
|
+
headers: _headers,
|
|
270
|
+
contentType: "application/json",
|
|
271
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
272
|
+
requestType: "json",
|
|
273
|
+
body: _body,
|
|
274
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
275
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
276
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
277
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
278
|
+
logging: this._options.logging,
|
|
279
|
+
});
|
|
280
|
+
if (_response.ok) {
|
|
281
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
282
|
+
}
|
|
283
|
+
if (_response.error.reason === "status-code") {
|
|
284
|
+
switch (_response.error.statusCode) {
|
|
285
|
+
case 400:
|
|
286
|
+
throw new BrowserUse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
287
|
+
case 402:
|
|
288
|
+
throw new BrowserUse.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
289
|
+
case 404:
|
|
290
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
291
|
+
case 422:
|
|
292
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
293
|
+
default:
|
|
294
|
+
throw new errors.BrowserUseError({
|
|
295
|
+
statusCode: _response.error.statusCode,
|
|
296
|
+
body: _response.error.body,
|
|
297
|
+
rawResponse: _response.rawResponse,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
switch (_response.error.reason) {
|
|
302
|
+
case "non-json":
|
|
303
|
+
throw new errors.BrowserUseError({
|
|
304
|
+
statusCode: _response.error.statusCode,
|
|
305
|
+
body: _response.error.rawBody,
|
|
306
|
+
rawResponse: _response.rawResponse,
|
|
307
|
+
});
|
|
308
|
+
case "timeout":
|
|
309
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /marketplace/skills/{skill_id}/execute.");
|
|
310
|
+
case "unknown":
|
|
311
|
+
throw new errors.BrowserUseError({
|
|
312
|
+
message: _response.error.errorMessage,
|
|
313
|
+
rawResponse: _response.rawResponse,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
238
318
|
_getCustomAuthorizationHeaders() {
|
|
239
319
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
320
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* skill_id: "skill_id",
|
|
6
|
+
* body: {}
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest {
|
|
10
|
+
skill_id: string;
|
|
11
|
+
body: BrowserUse.ExecuteSkillRequest;
|
|
12
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {}
|
|
@@ -6,6 +7,7 @@ export interface ListSkillsMarketplaceSkillsGetRequest {
|
|
|
6
7
|
pageSize?: number;
|
|
7
8
|
pageNumber?: number;
|
|
8
9
|
query?: string | null;
|
|
10
|
+
category?: BrowserUse.SkillCategory | null;
|
|
9
11
|
fromDate?: string | null;
|
|
10
12
|
toDate?: string | null;
|
|
11
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { CloneSkillMarketplaceSkillsSkillIdClonePostRequest } from "./CloneSkillMarketplaceSkillsSkillIdClonePostRequest.mjs";
|
|
2
|
-
export type {
|
|
2
|
+
export type { ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest } from "./ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.mjs";
|
|
3
|
+
export type { GetSkillMarketplaceSkillsSkillSlugGetRequest } from "./GetSkillMarketplaceSkillsSkillSlugGetRequest.mjs";
|
|
3
4
|
export type { ListSkillsMarketplaceSkillsGetRequest } from "./ListSkillsMarketplaceSkillsGetRequest.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace Tasks {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Tasks {
|
|
11
11
|
protected readonly _options: Tasks.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Tasks.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get paginated list of AI agent tasks with optional filtering by session and status.
|
|
15
15
|
*
|
|
@@ -24,9 +24,15 @@ export declare class Tasks {
|
|
|
24
24
|
listTasks(request?: BrowserUse.ListTasksTasksGetRequest, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<BrowserUse.TaskListResponse>;
|
|
25
25
|
private __listTasks;
|
|
26
26
|
/**
|
|
27
|
+
* Create and start a new task.
|
|
28
|
+
*
|
|
27
29
|
* You can either:
|
|
28
|
-
* 1. Start a new task (auto
|
|
29
|
-
* 2. Start a new task in an existing session (
|
|
30
|
+
* 1. Start a new task without a sessionId (auto-creates a session with US proxy by default)
|
|
31
|
+
* 2. Start a new task in an existing session (reuse for follow-up tasks or custom configuration)
|
|
32
|
+
*
|
|
33
|
+
* Important: Proxy configuration (proxyCountryCode) is a session-level setting, not a task-level setting.
|
|
34
|
+
* To use a custom proxy location, create a session first via POST /sessions with your desired proxyCountryCode,
|
|
35
|
+
* then pass that sessionId when creating tasks.
|
|
30
36
|
*
|
|
31
37
|
* @param {BrowserUse.CreateTaskRequest} request
|
|
32
38
|
* @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -25,7 +25,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
25
25
|
import * as errors from "../../../../errors/index.mjs";
|
|
26
26
|
import * as BrowserUse from "../../../index.mjs";
|
|
27
27
|
export class Tasks {
|
|
28
|
-
constructor(_options) {
|
|
28
|
+
constructor(_options = {}) {
|
|
29
29
|
this._options = _options;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -110,9 +110,15 @@ export class Tasks {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
+
* Create and start a new task.
|
|
114
|
+
*
|
|
113
115
|
* You can either:
|
|
114
|
-
* 1. Start a new task (auto
|
|
115
|
-
* 2. Start a new task in an existing session (
|
|
116
|
+
* 1. Start a new task without a sessionId (auto-creates a session with US proxy by default)
|
|
117
|
+
* 2. Start a new task in an existing session (reuse for follow-up tasks or custom configuration)
|
|
118
|
+
*
|
|
119
|
+
* Important: Proxy configuration (proxyCountryCode) is a session-level setting, not a task-level setting.
|
|
120
|
+
* To use a custom proxy location, create a session first via POST /sessions with your desired proxyCountryCode,
|
|
121
|
+
* then pass that sessionId when creating tasks.
|
|
116
122
|
*
|
|
117
123
|
* @param {BrowserUse.CreateTaskRequest} request
|
|
118
124
|
* @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -42,6 +42,8 @@ export interface CreateTaskRequest {
|
|
|
42
42
|
judgeGroundTruth?: string | null;
|
|
43
43
|
/** The LLM model to use for judging. If not provided, uses the default judge LLM. */
|
|
44
44
|
judgeLlm?: BrowserUse.SupportedLlMs | null;
|
|
45
|
+
/** List of skill IDs to enable for this task. Use ['*'] to enable all available skills for the project. */
|
|
46
|
+
skillIds?: string[] | null;
|
|
45
47
|
}
|
|
46
48
|
export declare namespace CreateTaskRequest {
|
|
47
49
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace Workflows {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Workflows {
|
|
11
11
|
protected readonly _options: Workflows.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Workflows.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get paginated list of workflows with optional filtering.
|
|
15
15
|
*
|
|
@@ -102,6 +102,34 @@ export declare class Workflows {
|
|
|
102
102
|
*/
|
|
103
103
|
getWorkflowGenerationState(request: BrowserUse.GetWorkflowGenerationStateWorkflowsWorkflowIdGenerationStateGetRequest, requestOptions?: Workflows.RequestOptions): core.HttpResponsePromise<BrowserUse.WorkflowGenerationStateView>;
|
|
104
104
|
private __getWorkflowGenerationState;
|
|
105
|
+
/**
|
|
106
|
+
* Create a workflow from an existing agent task's recorded history.
|
|
107
|
+
*
|
|
108
|
+
* This endpoint creates a workflow by using the browser-use rerun history
|
|
109
|
+
* feature. The task must have completed with history stored in S3.
|
|
110
|
+
*
|
|
111
|
+
* The workflow creation process:
|
|
112
|
+
* 1. Creates a new workflow record in pending state
|
|
113
|
+
* 2. Triggers an Inngest event to process the task history
|
|
114
|
+
* 3. The Inngest handler downloads history, detects variables, and updates the workflow
|
|
115
|
+
*
|
|
116
|
+
* Use GET /workflows/{workflow_id} to poll for creation completion.
|
|
117
|
+
*
|
|
118
|
+
* @param {BrowserUse.WorkflowCreateFromTaskRequest} request
|
|
119
|
+
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
+
*
|
|
121
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
122
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* await client.workflows.createWorkflowFromTask({
|
|
126
|
+
* name: "name",
|
|
127
|
+
* taskId: "taskId",
|
|
128
|
+
* sessionId: "sessionId"
|
|
129
|
+
* })
|
|
130
|
+
*/
|
|
131
|
+
createWorkflowFromTask(request: BrowserUse.WorkflowCreateFromTaskRequest, requestOptions?: Workflows.RequestOptions): core.HttpResponsePromise<BrowserUse.WorkflowCreateFromTaskResponse>;
|
|
132
|
+
private __createWorkflowFromTask;
|
|
105
133
|
/**
|
|
106
134
|
* Get a presigned URL to upload workflow YAML directly to S3 from the browser.
|
|
107
135
|
*
|
|
@@ -25,7 +25,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
25
25
|
import * as errors from "../../../../errors/index.mjs";
|
|
26
26
|
import * as BrowserUse from "../../../index.mjs";
|
|
27
27
|
export class Workflows {
|
|
28
|
-
constructor(_options) {
|
|
28
|
+
constructor(_options = {}) {
|
|
29
29
|
this._options = _options;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -435,6 +435,90 @@ export class Workflows {
|
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* Create a workflow from an existing agent task's recorded history.
|
|
440
|
+
*
|
|
441
|
+
* This endpoint creates a workflow by using the browser-use rerun history
|
|
442
|
+
* feature. The task must have completed with history stored in S3.
|
|
443
|
+
*
|
|
444
|
+
* The workflow creation process:
|
|
445
|
+
* 1. Creates a new workflow record in pending state
|
|
446
|
+
* 2. Triggers an Inngest event to process the task history
|
|
447
|
+
* 3. The Inngest handler downloads history, detects variables, and updates the workflow
|
|
448
|
+
*
|
|
449
|
+
* Use GET /workflows/{workflow_id} to poll for creation completion.
|
|
450
|
+
*
|
|
451
|
+
* @param {BrowserUse.WorkflowCreateFromTaskRequest} request
|
|
452
|
+
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
453
|
+
*
|
|
454
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
455
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* await client.workflows.createWorkflowFromTask({
|
|
459
|
+
* name: "name",
|
|
460
|
+
* taskId: "taskId",
|
|
461
|
+
* sessionId: "sessionId"
|
|
462
|
+
* })
|
|
463
|
+
*/
|
|
464
|
+
createWorkflowFromTask(request, requestOptions) {
|
|
465
|
+
return core.HttpResponsePromise.fromPromise(this.__createWorkflowFromTask(request, requestOptions));
|
|
466
|
+
}
|
|
467
|
+
__createWorkflowFromTask(request, requestOptions) {
|
|
468
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
469
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
470
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
471
|
+
const _response = yield core.fetcher({
|
|
472
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, "workflows/from-task"),
|
|
473
|
+
method: "POST",
|
|
474
|
+
headers: _headers,
|
|
475
|
+
contentType: "application/json",
|
|
476
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
477
|
+
requestType: "json",
|
|
478
|
+
body: request,
|
|
479
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
480
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
481
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
482
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
483
|
+
logging: this._options.logging,
|
|
484
|
+
});
|
|
485
|
+
if (_response.ok) {
|
|
486
|
+
return {
|
|
487
|
+
data: _response.body,
|
|
488
|
+
rawResponse: _response.rawResponse,
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
if (_response.error.reason === "status-code") {
|
|
492
|
+
switch (_response.error.statusCode) {
|
|
493
|
+
case 404:
|
|
494
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
495
|
+
case 422:
|
|
496
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
497
|
+
default:
|
|
498
|
+
throw new errors.BrowserUseError({
|
|
499
|
+
statusCode: _response.error.statusCode,
|
|
500
|
+
body: _response.error.body,
|
|
501
|
+
rawResponse: _response.rawResponse,
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
switch (_response.error.reason) {
|
|
506
|
+
case "non-json":
|
|
507
|
+
throw new errors.BrowserUseError({
|
|
508
|
+
statusCode: _response.error.statusCode,
|
|
509
|
+
body: _response.error.rawBody,
|
|
510
|
+
rawResponse: _response.rawResponse,
|
|
511
|
+
});
|
|
512
|
+
case "timeout":
|
|
513
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /workflows/from-task.");
|
|
514
|
+
case "unknown":
|
|
515
|
+
throw new errors.BrowserUseError({
|
|
516
|
+
message: _response.error.errorMessage,
|
|
517
|
+
rawResponse: _response.rawResponse,
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}
|
|
438
522
|
/**
|
|
439
523
|
* Get a presigned URL to upload workflow YAML directly to S3 from the browser.
|
|
440
524
|
*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* name: "name",
|
|
5
|
+
* taskId: "taskId",
|
|
6
|
+
* sessionId: "sessionId"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface WorkflowCreateFromTaskRequest {
|
|
10
|
+
/** Name for the new workflow */
|
|
11
|
+
name: string;
|
|
12
|
+
/** ID of the agent task to create workflow from */
|
|
13
|
+
taskId: string;
|
|
14
|
+
/** ID of the agent session containing the task */
|
|
15
|
+
sessionId: string;
|
|
16
|
+
/** Optional description for the workflow */
|
|
17
|
+
description?: string | null;
|
|
18
|
+
}
|
|
@@ -9,6 +9,7 @@ export type { GetWorkflowWorkflowsWorkflowIdGetRequest } from "./GetWorkflowWork
|
|
|
9
9
|
export type { ListAllExecutionsWorkflowsExecutionsGetRequest } from "./ListAllExecutionsWorkflowsExecutionsGetRequest.mjs";
|
|
10
10
|
export type { ListWorkflowExecutionsWorkflowsWorkflowIdExecutionsGetRequest } from "./ListWorkflowExecutionsWorkflowsWorkflowIdExecutionsGetRequest.mjs";
|
|
11
11
|
export type { ListWorkflowsWorkflowsGetRequest } from "./ListWorkflowsWorkflowsGetRequest.mjs";
|
|
12
|
+
export type { WorkflowCreateFromTaskRequest } from "./WorkflowCreateFromTaskRequest.mjs";
|
|
12
13
|
export type { WorkflowCreateRequest } from "./WorkflowCreateRequest.mjs";
|
|
13
14
|
export type { WorkflowExecuteRequest } from "./WorkflowExecuteRequest.mjs";
|
|
14
15
|
export type { WorkflowGenerateRequest } from "./WorkflowGenerateRequest.mjs";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type * as BrowserUse from "../index.mjs";
|
|
2
2
|
/**
|
|
3
|
-
* View model for account information
|
|
3
|
+
* View model for account information.
|
|
4
4
|
*/
|
|
5
5
|
export interface AccountView {
|
|
6
6
|
/** The name of the user */
|
|
7
7
|
name?: string | null;
|
|
8
|
-
/** The monthly credits balance in USD */
|
|
9
|
-
monthlyCreditsBalanceUsd: number;
|
|
10
|
-
/** The additional credits balance in USD */
|
|
11
|
-
additionalCreditsBalanceUsd: number;
|
|
12
8
|
/** The total credits balance in USD */
|
|
13
9
|
totalCreditsBalanceUsd: number;
|
|
10
|
+
/** Monthly subscription credits balance in USD */
|
|
11
|
+
monthlyCreditsBalanceUsd: number;
|
|
12
|
+
/** Additional top-up credits balance in USD */
|
|
13
|
+
additionalCreditsBalanceUsd: number;
|
|
14
14
|
/** The rate limit for the account */
|
|
15
15
|
rateLimit: number;
|
|
16
16
|
/** The plan information */
|
|
@@ -5,10 +5,16 @@ import type * as BrowserUse from "../index.mjs";
|
|
|
5
5
|
export interface MarketplaceSkillResponse {
|
|
6
6
|
/** Unique identifier for the skill */
|
|
7
7
|
id: string;
|
|
8
|
+
/** URL-friendly slug for the skill */
|
|
9
|
+
slug: string;
|
|
8
10
|
/** Title of the skill (shows up in the public view) */
|
|
9
11
|
title: string;
|
|
10
12
|
/** Description of the skill (shows up in the public view) */
|
|
11
13
|
description: string;
|
|
14
|
+
/** Categories of the skill */
|
|
15
|
+
categories: BrowserUse.SkillCategory[];
|
|
16
|
+
/** Domains/websites this skill interacts with */
|
|
17
|
+
domains: string[];
|
|
12
18
|
/** Input parameters of the skill */
|
|
13
19
|
parameters: BrowserUse.ParameterSchema[];
|
|
14
20
|
/** Output schema of the skill */
|
|
@@ -17,6 +23,14 @@ export interface MarketplaceSkillResponse {
|
|
|
17
23
|
currentVersion: number | null;
|
|
18
24
|
/** Whether the skill is official (verified by Browser Use) */
|
|
19
25
|
isOfficial: boolean;
|
|
26
|
+
/** Number of times this skill has been cloned */
|
|
27
|
+
cloneCount: number;
|
|
28
|
+
/** URL of the custom skill icon */
|
|
29
|
+
iconUrl?: string | null;
|
|
30
|
+
/** When the skill was first published */
|
|
31
|
+
firstPublishedAt: string;
|
|
32
|
+
/** When the skill was last published */
|
|
33
|
+
lastPublishedAt: string;
|
|
20
34
|
/** Creation timestamp */
|
|
21
35
|
createdAt: string;
|
|
22
36
|
/** Last update timestamp */
|
|
@@ -13,4 +13,6 @@ export interface SessionItemView {
|
|
|
13
13
|
startedAt: string;
|
|
14
14
|
/** Timestamp when the session was stopped (None if still active) */
|
|
15
15
|
finishedAt?: string | null;
|
|
16
|
+
/** Whether tasks in this session share memory and history with each other */
|
|
17
|
+
persistMemory: boolean;
|
|
16
18
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Enumeration of possible
|
|
2
|
+
* Enumeration of possible agent session states
|
|
3
3
|
*
|
|
4
4
|
* Attributes:
|
|
5
|
-
* ACTIVE:
|
|
6
|
-
* STOPPED:
|
|
5
|
+
* ACTIVE: Agent session is currently active and running
|
|
6
|
+
* STOPPED: Agent session has been stopped and is no longer active
|
|
7
7
|
*/
|
|
8
8
|
export declare const SessionStatus: {
|
|
9
9
|
readonly Active: "active";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
/**
|
|
3
|
-
* Enumeration of possible
|
|
3
|
+
* Enumeration of possible agent session states
|
|
4
4
|
*
|
|
5
5
|
* Attributes:
|
|
6
|
-
* ACTIVE:
|
|
7
|
-
* STOPPED:
|
|
6
|
+
* ACTIVE: Agent session is currently active and running
|
|
7
|
+
* STOPPED: Agent session has been stopped and is no longer active
|
|
8
8
|
*/
|
|
9
9
|
export const SessionStatus = {
|
|
10
10
|
Active: "active",
|
|
@@ -17,4 +17,6 @@ export interface SessionView {
|
|
|
17
17
|
tasks: BrowserUse.TaskItemView[];
|
|
18
18
|
/** Optional URL to access the public share of the session */
|
|
19
19
|
publicShareUrl?: string | null;
|
|
20
|
+
/** Whether tasks in this session share memory and history with each other */
|
|
21
|
+
persistMemory?: boolean;
|
|
20
22
|
}
|