@oya-ai/cli 1.0.77 → 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.js +9 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -158,18 +158,19 @@ var Browser = class {
|
|
|
158
158
|
return result;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
-
* Natural-language control, using this key's configured model. Refer to
|
|
162
|
-
*
|
|
163
|
-
*
|
|
161
|
+
* Natural-language control, using this key's configured model. Refer to values as
|
|
162
|
+
* `{{name}}` in the prompt. `data` the agent can read, so it can split a name or pick
|
|
163
|
+
* the matching option; `secrets` it never sees. It types both through placeholders,
|
|
164
|
+
* with filters like `{{name|first}}`, so a playbook saved from the run stores no values.
|
|
164
165
|
*/
|
|
165
|
-
async ask(prompt, { data } = {}) {
|
|
166
|
+
async ask(prompt, { data, secrets } = {}) {
|
|
166
167
|
const res = await this.http.request(
|
|
167
168
|
"POST",
|
|
168
169
|
`/api/browsers/${this.id}/chat`,
|
|
169
|
-
{ messages: [{ role: "user", content: prompt }], data },
|
|
170
|
+
{ messages: [{ role: "user", content: prompt }], data, secrets },
|
|
170
171
|
6e5
|
|
171
172
|
);
|
|
172
|
-
if (res.error) throw new OyaError(res.error, 500, res);
|
|
173
|
+
if (res.error) throw new OyaError(res.error, res.status ?? 500, res);
|
|
173
174
|
return res.text;
|
|
174
175
|
}
|
|
175
176
|
/**
|
|
@@ -194,7 +195,7 @@ var Browser = class {
|
|
|
194
195
|
{ variables: data, autoHeal },
|
|
195
196
|
6e5
|
|
196
197
|
);
|
|
197
|
-
if (res.error) throw new OyaError(res.error, 500, res);
|
|
198
|
+
if (res.error) throw new OyaError(res.error, res.status ?? 500, res);
|
|
198
199
|
return res;
|
|
199
200
|
}
|
|
200
201
|
/**
|
|
@@ -337,7 +338,7 @@ var Run = class {
|
|
|
337
338
|
return result;
|
|
338
339
|
}
|
|
339
340
|
if (run2.status === "failed") {
|
|
340
|
-
const failure = new OyaError(run2.error || "Run failed", 500, run2);
|
|
341
|
+
const failure = new OyaError(run2.error || "Run failed", run2.errorStatus ?? 500, run2);
|
|
341
342
|
await call(() => cb.onFailure?.(failure));
|
|
342
343
|
throw failure;
|
|
343
344
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oya-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.79",
|
|
4
4
|
"description": "Command line for the Oya browser control plane.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://browser.getoya.ai",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@oya-ai/browser": "1.0.
|
|
42
|
+
"@oya-ai/browser": "1.0.79",
|
|
43
43
|
"@types/node": "^20.19.43",
|
|
44
44
|
"tsup": "^8.0.0",
|
|
45
45
|
"typescript": "^5.4.0"
|