browser-use-sdk 2.0.11 → 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 +25 -6
- package/dist/cjs/api/resources/skills/client/Client.js +85 -8
- package/dist/cjs/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.js +3 -0
- 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/RollbackSkillSkillsSkillIdRollbackPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skills/client/requests/RollbackSkillSkillsSkillIdRollbackPostRequest.js +3 -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 +3 -2
- 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/CannotRollbackPublicSkillError.d.ts +6 -0
- package/dist/cjs/api/types/CannotRollbackPublicSkillError.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 +15 -1
- package/dist/cjs/api/types/ParameterSchema.d.ts +1 -0
- package/dist/cjs/api/types/ParameterType.d.ts +1 -0
- package/dist/cjs/api/types/ParameterType.js +1 -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 +19 -3
- 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 +10 -6
- package/dist/cjs/api/types/index.js +10 -6
- 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 +25 -6
- package/dist/esm/api/resources/skills/client/Client.mjs +85 -8
- package/dist/esm/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.mjs +2 -0
- 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/RollbackSkillSkillsSkillIdRollbackPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/skills/client/requests/RollbackSkillSkillsSkillIdRollbackPostRequest.mjs +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 +3 -2
- 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/CannotRollbackPublicSkillError.d.mts +6 -0
- package/dist/esm/api/types/CannotRollbackPublicSkillError.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 +15 -1
- package/dist/esm/api/types/ParameterSchema.d.mts +1 -0
- package/dist/esm/api/types/ParameterType.d.mts +1 -0
- package/dist/esm/api/types/ParameterType.mjs +1 -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 +19 -3
- 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 +10 -6
- package/dist/esm/api/types/index.mjs +10 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +83 -82
- package/reference.md +232 -15
|
@@ -50,7 +50,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
52
52
|
class SkillsMarketplace {
|
|
53
|
-
constructor(_options) {
|
|
53
|
+
constructor(_options = {}) {
|
|
54
54
|
this._options = _options;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -70,7 +70,7 @@ class SkillsMarketplace {
|
|
|
70
70
|
__listSkills() {
|
|
71
71
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
72
72
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73
|
-
const { pageSize, pageNumber, query, fromDate, toDate } = request;
|
|
73
|
+
const { pageSize, pageNumber, query, category, fromDate, toDate } = request;
|
|
74
74
|
const _queryParams = {};
|
|
75
75
|
if (pageSize != null) {
|
|
76
76
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -81,6 +81,9 @@ class SkillsMarketplace {
|
|
|
81
81
|
if (query !== undefined) {
|
|
82
82
|
_queryParams.query = query;
|
|
83
83
|
}
|
|
84
|
+
if (category !== undefined) {
|
|
85
|
+
_queryParams.category = category;
|
|
86
|
+
}
|
|
84
87
|
if (fromDate !== undefined) {
|
|
85
88
|
_queryParams.fromDate = fromDate;
|
|
86
89
|
}
|
|
@@ -137,7 +140,7 @@ class SkillsMarketplace {
|
|
|
137
140
|
/**
|
|
138
141
|
* Get details of a specific public skill from the marketplace.
|
|
139
142
|
*
|
|
140
|
-
* @param {BrowserUse.
|
|
143
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillSlugGetRequest} request
|
|
141
144
|
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
145
|
*
|
|
143
146
|
* @throws {@link BrowserUse.NotFoundError}
|
|
@@ -145,7 +148,7 @@ class SkillsMarketplace {
|
|
|
145
148
|
*
|
|
146
149
|
* @example
|
|
147
150
|
* await client.skillsMarketplace.getSkill({
|
|
148
|
-
*
|
|
151
|
+
* skill_slug: "skill_slug"
|
|
149
152
|
* })
|
|
150
153
|
*/
|
|
151
154
|
getSkill(request, requestOptions) {
|
|
@@ -154,10 +157,10 @@ class SkillsMarketplace {
|
|
|
154
157
|
__getSkill(request, requestOptions) {
|
|
155
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
159
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
157
|
-
const {
|
|
160
|
+
const { skill_slug: skillSlug } = request;
|
|
158
161
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
162
|
const _response = yield core.fetcher({
|
|
160
|
-
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(
|
|
163
|
+
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)}`),
|
|
161
164
|
method: "GET",
|
|
162
165
|
headers: _headers,
|
|
163
166
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -192,7 +195,7 @@ class SkillsMarketplace {
|
|
|
192
195
|
rawResponse: _response.rawResponse,
|
|
193
196
|
});
|
|
194
197
|
case "timeout":
|
|
195
|
-
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{
|
|
198
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{skill_slug}.");
|
|
196
199
|
case "unknown":
|
|
197
200
|
throw new errors.BrowserUseError({
|
|
198
201
|
message: _response.error.errorMessage,
|
|
@@ -271,6 +274,83 @@ class SkillsMarketplace {
|
|
|
271
274
|
}
|
|
272
275
|
});
|
|
273
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Execute a skill with the provided parameters.
|
|
279
|
+
*
|
|
280
|
+
* @param {BrowserUse.ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest} request
|
|
281
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
282
|
+
*
|
|
283
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
284
|
+
* @throws {@link BrowserUse.PaymentRequiredError}
|
|
285
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
286
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* await client.skillsMarketplace.executeSkill({
|
|
290
|
+
* skill_id: "skill_id",
|
|
291
|
+
* body: {}
|
|
292
|
+
* })
|
|
293
|
+
*/
|
|
294
|
+
executeSkill(request, requestOptions) {
|
|
295
|
+
return core.HttpResponsePromise.fromPromise(this.__executeSkill(request, requestOptions));
|
|
296
|
+
}
|
|
297
|
+
__executeSkill(request, requestOptions) {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
300
|
+
const { skill_id: skillId, body: _body } = request;
|
|
301
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
302
|
+
const _response = yield core.fetcher({
|
|
303
|
+
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`),
|
|
304
|
+
method: "POST",
|
|
305
|
+
headers: _headers,
|
|
306
|
+
contentType: "application/json",
|
|
307
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
308
|
+
requestType: "json",
|
|
309
|
+
body: _body,
|
|
310
|
+
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,
|
|
311
|
+
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,
|
|
312
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
313
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
314
|
+
logging: this._options.logging,
|
|
315
|
+
});
|
|
316
|
+
if (_response.ok) {
|
|
317
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
318
|
+
}
|
|
319
|
+
if (_response.error.reason === "status-code") {
|
|
320
|
+
switch (_response.error.statusCode) {
|
|
321
|
+
case 400:
|
|
322
|
+
throw new BrowserUse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
323
|
+
case 402:
|
|
324
|
+
throw new BrowserUse.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
325
|
+
case 404:
|
|
326
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
327
|
+
case 422:
|
|
328
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
329
|
+
default:
|
|
330
|
+
throw new errors.BrowserUseError({
|
|
331
|
+
statusCode: _response.error.statusCode,
|
|
332
|
+
body: _response.error.body,
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
switch (_response.error.reason) {
|
|
338
|
+
case "non-json":
|
|
339
|
+
throw new errors.BrowserUseError({
|
|
340
|
+
statusCode: _response.error.statusCode,
|
|
341
|
+
body: _response.error.rawBody,
|
|
342
|
+
rawResponse: _response.rawResponse,
|
|
343
|
+
});
|
|
344
|
+
case "timeout":
|
|
345
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /marketplace/skills/{skill_id}/execute.");
|
|
346
|
+
case "unknown":
|
|
347
|
+
throw new errors.BrowserUseError({
|
|
348
|
+
message: _response.error.errorMessage,
|
|
349
|
+
rawResponse: _response.rawResponse,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
274
354
|
_getCustomAuthorizationHeaders() {
|
|
275
355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
276
356
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
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.js";
|
|
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.js";
|
|
2
|
-
export type {
|
|
2
|
+
export type { ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest } from "./ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.js";
|
|
3
|
+
export type { GetSkillMarketplaceSkillsSkillSlugGetRequest } from "./GetSkillMarketplaceSkillsSkillSlugGetRequest.js";
|
|
3
4
|
export type { ListSkillsMarketplaceSkillsGetRequest } from "./ListSkillsMarketplaceSkillsGetRequest.js";
|
|
@@ -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.
|
|
@@ -61,7 +61,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
61
61
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
62
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
63
63
|
class Tasks {
|
|
64
|
-
constructor(_options) {
|
|
64
|
+
constructor(_options = {}) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -146,9 +146,15 @@ class Tasks {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
+
* Create and start a new task.
|
|
150
|
+
*
|
|
149
151
|
* You can either:
|
|
150
|
-
* 1. Start a new task (auto
|
|
151
|
-
* 2. Start a new task in an existing session (
|
|
152
|
+
* 1. Start a new task without a sessionId (auto-creates a session with US proxy by default)
|
|
153
|
+
* 2. Start a new task in an existing session (reuse for follow-up tasks or custom configuration)
|
|
154
|
+
*
|
|
155
|
+
* Important: Proxy configuration (proxyCountryCode) is a session-level setting, not a task-level setting.
|
|
156
|
+
* To use a custom proxy location, create a session first via POST /sessions with your desired proxyCountryCode,
|
|
157
|
+
* then pass that sessionId when creating tasks.
|
|
152
158
|
*
|
|
153
159
|
* @param {BrowserUse.CreateTaskRequest} request
|
|
154
160
|
* @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
|
*
|
|
@@ -61,7 +61,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
61
61
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
62
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
63
63
|
class Workflows {
|
|
64
|
-
constructor(_options) {
|
|
64
|
+
constructor(_options = {}) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -471,6 +471,90 @@ class Workflows {
|
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* Create a workflow from an existing agent task's recorded history.
|
|
476
|
+
*
|
|
477
|
+
* This endpoint creates a workflow by using the browser-use rerun history
|
|
478
|
+
* feature. The task must have completed with history stored in S3.
|
|
479
|
+
*
|
|
480
|
+
* The workflow creation process:
|
|
481
|
+
* 1. Creates a new workflow record in pending state
|
|
482
|
+
* 2. Triggers an Inngest event to process the task history
|
|
483
|
+
* 3. The Inngest handler downloads history, detects variables, and updates the workflow
|
|
484
|
+
*
|
|
485
|
+
* Use GET /workflows/{workflow_id} to poll for creation completion.
|
|
486
|
+
*
|
|
487
|
+
* @param {BrowserUse.WorkflowCreateFromTaskRequest} request
|
|
488
|
+
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
489
|
+
*
|
|
490
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
491
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
492
|
+
*
|
|
493
|
+
* @example
|
|
494
|
+
* await client.workflows.createWorkflowFromTask({
|
|
495
|
+
* name: "name",
|
|
496
|
+
* taskId: "taskId",
|
|
497
|
+
* sessionId: "sessionId"
|
|
498
|
+
* })
|
|
499
|
+
*/
|
|
500
|
+
createWorkflowFromTask(request, requestOptions) {
|
|
501
|
+
return core.HttpResponsePromise.fromPromise(this.__createWorkflowFromTask(request, requestOptions));
|
|
502
|
+
}
|
|
503
|
+
__createWorkflowFromTask(request, requestOptions) {
|
|
504
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
505
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
506
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
507
|
+
const _response = yield core.fetcher({
|
|
508
|
+
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"),
|
|
509
|
+
method: "POST",
|
|
510
|
+
headers: _headers,
|
|
511
|
+
contentType: "application/json",
|
|
512
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
513
|
+
requestType: "json",
|
|
514
|
+
body: request,
|
|
515
|
+
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,
|
|
516
|
+
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,
|
|
517
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
518
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
519
|
+
logging: this._options.logging,
|
|
520
|
+
});
|
|
521
|
+
if (_response.ok) {
|
|
522
|
+
return {
|
|
523
|
+
data: _response.body,
|
|
524
|
+
rawResponse: _response.rawResponse,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
if (_response.error.reason === "status-code") {
|
|
528
|
+
switch (_response.error.statusCode) {
|
|
529
|
+
case 404:
|
|
530
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
531
|
+
case 422:
|
|
532
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
533
|
+
default:
|
|
534
|
+
throw new errors.BrowserUseError({
|
|
535
|
+
statusCode: _response.error.statusCode,
|
|
536
|
+
body: _response.error.body,
|
|
537
|
+
rawResponse: _response.rawResponse,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
switch (_response.error.reason) {
|
|
542
|
+
case "non-json":
|
|
543
|
+
throw new errors.BrowserUseError({
|
|
544
|
+
statusCode: _response.error.statusCode,
|
|
545
|
+
body: _response.error.rawBody,
|
|
546
|
+
rawResponse: _response.rawResponse,
|
|
547
|
+
});
|
|
548
|
+
case "timeout":
|
|
549
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /workflows/from-task.");
|
|
550
|
+
case "unknown":
|
|
551
|
+
throw new errors.BrowserUseError({
|
|
552
|
+
message: _response.error.errorMessage,
|
|
553
|
+
rawResponse: _response.rawResponse,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
}
|
|
474
558
|
/**
|
|
475
559
|
* Get a presigned URL to upload workflow YAML directly to S3 from the browser.
|
|
476
560
|
*
|
|
@@ -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.js";
|
|
10
10
|
export type { ListWorkflowExecutionsWorkflowsWorkflowIdExecutionsGetRequest } from "./ListWorkflowExecutionsWorkflowsWorkflowIdExecutionsGetRequest.js";
|
|
11
11
|
export type { ListWorkflowsWorkflowsGetRequest } from "./ListWorkflowsWorkflowsGetRequest.js";
|
|
12
|
+
export type { WorkflowCreateFromTaskRequest } from "./WorkflowCreateFromTaskRequest.js";
|
|
12
13
|
export type { WorkflowCreateRequest } from "./WorkflowCreateRequest.js";
|
|
13
14
|
export type { WorkflowExecuteRequest } from "./WorkflowExecuteRequest.js";
|
|
14
15
|
export type { WorkflowGenerateRequest } from "./WorkflowGenerateRequest.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type * as BrowserUse from "../index.js";
|
|
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,18 +5,32 @@ import type * as BrowserUse from "../index.js";
|
|
|
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
|
-
parameters: BrowserUse.
|
|
19
|
+
parameters: BrowserUse.ParameterSchema[];
|
|
14
20
|
/** Output schema of the skill */
|
|
15
21
|
outputSchema: Record<string, unknown>;
|
|
16
22
|
/** Current version of the skill */
|
|
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";
|