@oya-ai/browser 1.0.78 → 1.0.80
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 +10 -4
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +10 -4
- package/package.json +1 -1
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
|
}
|
|
@@ -501,7 +501,13 @@ var Oya = class {
|
|
|
501
501
|
await this.http.request("DELETE", `/api/personas/${id}/mfa`);
|
|
502
502
|
}
|
|
503
503
|
};
|
|
504
|
-
/**
|
|
504
|
+
/**
|
|
505
|
+
* This key's settings: LLM credentials, browser provider, solver.
|
|
506
|
+
*
|
|
507
|
+
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
508
|
+
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
509
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides its default model.
|
|
510
|
+
*/
|
|
505
511
|
config = {
|
|
506
512
|
get: () => this.http.request("GET", "/api/config"),
|
|
507
513
|
set: (values) => this.http.request("POST", "/api/config", values)
|
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). */
|
|
@@ -692,7 +694,13 @@ declare class Oya {
|
|
|
692
694
|
}>;
|
|
693
695
|
clearMfa: (id: string) => Promise<void>;
|
|
694
696
|
};
|
|
695
|
-
/**
|
|
697
|
+
/**
|
|
698
|
+
* This key's settings: LLM credentials, browser provider, solver.
|
|
699
|
+
*
|
|
700
|
+
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
701
|
+
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
702
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides its default model.
|
|
703
|
+
*/
|
|
696
704
|
readonly config: {
|
|
697
705
|
get: <T = Record<string, unknown>>() => Promise<T>;
|
|
698
706
|
set: <T = Record<string, unknown>>(values: Record<string, unknown>) => Promise<T>;
|
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). */
|
|
@@ -692,7 +694,13 @@ declare class Oya {
|
|
|
692
694
|
}>;
|
|
693
695
|
clearMfa: (id: string) => Promise<void>;
|
|
694
696
|
};
|
|
695
|
-
/**
|
|
697
|
+
/**
|
|
698
|
+
* This key's settings: LLM credentials, browser provider, solver.
|
|
699
|
+
*
|
|
700
|
+
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
701
|
+
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
702
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides its default model.
|
|
703
|
+
*/
|
|
696
704
|
readonly config: {
|
|
697
705
|
get: <T = Record<string, unknown>>() => Promise<T>;
|
|
698
706
|
set: <T = Record<string, unknown>>(values: Record<string, unknown>) => Promise<T>;
|
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
|
}
|
|
@@ -471,7 +471,13 @@ var Oya = class {
|
|
|
471
471
|
await this.http.request("DELETE", `/api/personas/${id}/mfa`);
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
|
-
/**
|
|
474
|
+
/**
|
|
475
|
+
* This key's settings: LLM credentials, browser provider, solver.
|
|
476
|
+
*
|
|
477
|
+
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
478
|
+
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
479
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides its default model.
|
|
480
|
+
*/
|
|
475
481
|
config = {
|
|
476
482
|
get: () => this.http.request("GET", "/api/config"),
|
|
477
483
|
set: (values) => this.http.request("POST", "/api/config", values)
|
package/package.json
CHANGED