@optima-chat/browser-cli 0.11.0 → 0.12.0
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 +6 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -274,7 +274,7 @@ var BrowserAPI = class {
|
|
|
274
274
|
async getScreenshot(sessionId) {
|
|
275
275
|
return requestBinary(`/api/sessions/${sessionId}/screenshot`);
|
|
276
276
|
}
|
|
277
|
-
async runRecipeScript(name, params, pollMs = 2e3, timeoutMs = 36e4) {
|
|
277
|
+
async runRecipeScript(name, params, pollMs = 2e3, timeoutMs = 36e4, timeoutHint) {
|
|
278
278
|
const started = await request(`/api/scripts/${name}/run`, {
|
|
279
279
|
method: "POST",
|
|
280
280
|
body: JSON.stringify({ params })
|
|
@@ -295,7 +295,7 @@ var BrowserAPI = class {
|
|
|
295
295
|
}
|
|
296
296
|
if (Date.now() >= deadline) {
|
|
297
297
|
throw new Error(
|
|
298
|
-
`recipe ${name} did not finish within ${Math.round(timeoutMs / 1e3)}s (task ${started.id})`
|
|
298
|
+
`recipe ${name} did not finish within ${Math.round(timeoutMs / 1e3)}s (task ${started.id})` + (timeoutHint ? ` \u2014\u2014 ${timeoutHint}` : "")
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
301
|
await new Promise((r) => setTimeout(r, pollMs));
|
|
@@ -1099,7 +1099,8 @@ function registerZiNiaoCommands(program2) {
|
|
|
1099
1099
|
// src/commands/recipes.ts
|
|
1100
1100
|
import { writeFileSync as writeFileSync4 } from "fs";
|
|
1101
1101
|
import { resolve as resolve2 } from "path";
|
|
1102
|
-
var PUBLISH_TIMEOUT_MS =
|
|
1102
|
+
var PUBLISH_TIMEOUT_MS = 18e5;
|
|
1103
|
+
var PUBLISH_TIMEOUT_HINT = "\u4EFB\u52A1\u4ECD\u5728\u540E\u7AEF\u8FD0\u884C,\u89C6\u9891\u53EF\u80FD\u5DF2\u7ECF\u53D1\u51FA\u53BB\u4E86\u3002\u53D1\u5E03\u72B6\u6001\u672A\u77E5 \u2014\u2014 \u8BF7\u5230\u5356\u5BB6\u540E\u53F0\u786E\u8BA4,\u4E0D\u8981\u91CD\u8DD1\u672C\u547D\u4EE4(\u4F1A\u53D1\u51FA\u91CD\u590D\u89C6\u9891)\u3002";
|
|
1103
1104
|
async function runExport(script, params, out, timeoutMs) {
|
|
1104
1105
|
const outPath = resolve2(out);
|
|
1105
1106
|
const result = await api.runRecipeScript(script, { ...params, out_path: outPath }, 2e3, timeoutMs);
|
|
@@ -1153,7 +1154,8 @@ function registerRecipeCommands(program2) {
|
|
|
1153
1154
|
"tiktok_video_publish",
|
|
1154
1155
|
params,
|
|
1155
1156
|
2e3,
|
|
1156
|
-
PUBLISH_TIMEOUT_MS
|
|
1157
|
+
PUBLISH_TIMEOUT_MS,
|
|
1158
|
+
PUBLISH_TIMEOUT_HINT
|
|
1157
1159
|
);
|
|
1158
1160
|
console.log(result.detail);
|
|
1159
1161
|
} catch (err) {
|