@oya-ai/browser 1.0.78 → 1.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -199,7 +199,7 @@ var Browser = class {
199
199
  { messages: [{ role: "user", content: prompt }], data, secrets },
200
200
  6e5
201
201
  );
202
- if (res.error) throw new OyaError(res.error, 500, res);
202
+ if (res.error) throw new OyaError(res.error, res.status ?? 500, res);
203
203
  return res.text;
204
204
  }
205
205
  /**
@@ -224,7 +224,7 @@ var Browser = class {
224
224
  { variables: data, autoHeal },
225
225
  6e5
226
226
  );
227
- if (res.error) throw new OyaError(res.error, 500, res);
227
+ if (res.error) throw new OyaError(res.error, res.status ?? 500, res);
228
228
  return res;
229
229
  }
230
230
  /**
@@ -367,7 +367,7 @@ var Run = class {
367
367
  return result;
368
368
  }
369
369
  if (run.status === "failed") {
370
- const failure = new OyaError(run.error || "Run failed", 500, run);
370
+ const failure = new OyaError(run.error || "Run failed", run.errorStatus ?? 500, run);
371
371
  await call(() => cb.onFailure?.(failure));
372
372
  throw failure;
373
373
  }
package/dist/index.d.cts CHANGED
@@ -109,6 +109,8 @@ interface RunInfo {
109
109
  attention: AttentionRequest | null;
110
110
  result?: RunResult;
111
111
  error?: string;
112
+ /** HTTP-style status of a failure: 429 when a quota stopped the run. */
113
+ errorStatus?: number;
112
114
  }
113
115
  interface SubmitOptions {
114
116
  /** Task values the agent can read; for a playbook, its variables (secret ones included). */
package/dist/index.d.ts CHANGED
@@ -109,6 +109,8 @@ interface RunInfo {
109
109
  attention: AttentionRequest | null;
110
110
  result?: RunResult;
111
111
  error?: string;
112
+ /** HTTP-style status of a failure: 429 when a quota stopped the run. */
113
+ errorStatus?: number;
112
114
  }
113
115
  interface SubmitOptions {
114
116
  /** Task values the agent can read; for a playbook, its variables (secret ones included). */
package/dist/index.js CHANGED
@@ -169,7 +169,7 @@ var Browser = class {
169
169
  { messages: [{ role: "user", content: prompt }], data, secrets },
170
170
  6e5
171
171
  );
172
- if (res.error) throw new OyaError(res.error, 500, res);
172
+ if (res.error) throw new OyaError(res.error, res.status ?? 500, res);
173
173
  return res.text;
174
174
  }
175
175
  /**
@@ -194,7 +194,7 @@ var Browser = class {
194
194
  { variables: data, autoHeal },
195
195
  6e5
196
196
  );
197
- if (res.error) throw new OyaError(res.error, 500, res);
197
+ if (res.error) throw new OyaError(res.error, res.status ?? 500, res);
198
198
  return res;
199
199
  }
200
200
  /**
@@ -337,7 +337,7 @@ var Run = class {
337
337
  return result;
338
338
  }
339
339
  if (run.status === "failed") {
340
- const failure = new OyaError(run.error || "Run failed", 500, run);
340
+ const failure = new OyaError(run.error || "Run failed", run.errorStatus ?? 500, run);
341
341
  await call(() => cb.onFailure?.(failure));
342
342
  throw failure;
343
343
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oya-ai/browser",
3
- "version": "1.0.78",
3
+ "version": "1.0.79",
4
4
  "description": "Rotate thousands of browsers behind one API — personas, proxies, stealth, CAPTCHA and MFA.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://browser.getoya.ai",