@youdie006/prodex 0.16.12 → 0.16.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/chatgpt-browser.js +38 -2
- package/dist/cli-args.js +1 -0
- package/dist/cli-help.js +3 -3
- package/dist/cli-pro.js +3 -0
- package/package.json +1 -1
package/dist/chatgpt-browser.js
CHANGED
|
@@ -933,7 +933,26 @@ async function selectModelReasoning(cdp, options) {
|
|
|
933
933
|
throw new Error(button.reason ?? "Could not open the ChatGPT model selector");
|
|
934
934
|
}
|
|
935
935
|
try {
|
|
936
|
-
|
|
936
|
+
// The hover-verified click can be transiently refused right after a page
|
|
937
|
+
// transition (measured live: the just-closed create-project modal's
|
|
938
|
+
// overlay still covered the selector for a beat, and one refusal aborted
|
|
939
|
+
// the whole send). Retry briefly with FRESH coordinates; a persistent
|
|
940
|
+
// cover still fails with the refusal message.
|
|
941
|
+
const clickDeadline = Date.now() + 5_000;
|
|
942
|
+
for (;;) {
|
|
943
|
+
try {
|
|
944
|
+
await verifiedClickAt(cdp, button.x, button.y, "model selector");
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
catch (error) {
|
|
948
|
+
if (Date.now() >= clickDeadline || !/Refusing to click/.test(error instanceof Error ? error.message : String(error)))
|
|
949
|
+
throw error;
|
|
950
|
+
await sleep(700);
|
|
951
|
+
const fresh = await cdp.evaluate(modelButtonRectExpression());
|
|
952
|
+
if (fresh.ok && fresh.x !== undefined && fresh.y !== undefined)
|
|
953
|
+
button = fresh;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
937
956
|
const opened = await waitForExpressionTrue(cdp, menuOpenExpression(), MENU_OPEN_TIMEOUT_MS);
|
|
938
957
|
if (!opened)
|
|
939
958
|
throw new Error("ChatGPT model menu did not open after clicking the selector");
|
|
@@ -1205,7 +1224,24 @@ export async function sendChatGptPrompt(options) {
|
|
|
1205
1224
|
if (normalizedTargetUrl)
|
|
1206
1225
|
assertChatGptTargetUrlMatches(status.url, normalizedTargetUrl);
|
|
1207
1226
|
assertVisibleChatGptTab(status.visibilityState, status.url, normalizedTargetUrl);
|
|
1208
|
-
|
|
1227
|
+
let busyBlocker = chatGptBusyBlocker(status.generating);
|
|
1228
|
+
if (busyBlocker && (options.busyWaitMs ?? 0) > 0) {
|
|
1229
|
+
// Queue behind the in-flight response instead of failing: shared-tab
|
|
1230
|
+
// contention (another agent or the user mid-generation) is a when, not an
|
|
1231
|
+
// if. Bounded, and a mid-wait page blocker (usage limit etc.) still throws.
|
|
1232
|
+
const busyDeadline = Date.now() + (options.busyWaitMs ?? 0);
|
|
1233
|
+
emitProgress("waiting", "tab busy with another response; waiting");
|
|
1234
|
+
while (busyBlocker && Date.now() < busyDeadline) {
|
|
1235
|
+
await sleep(3_000);
|
|
1236
|
+
status = await evaluateOnPage(page, statusExpression());
|
|
1237
|
+
const midBlocker = detectChatGptPageBlocker(status);
|
|
1238
|
+
if (midBlocker)
|
|
1239
|
+
throw new ChatGptBrowserBlockerError(midBlocker);
|
|
1240
|
+
busyBlocker = chatGptBusyBlocker(status.generating);
|
|
1241
|
+
if (busyBlocker)
|
|
1242
|
+
emitProgress("waiting", "tab busy with another response; waiting");
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1209
1245
|
if (busyBlocker) {
|
|
1210
1246
|
throw new ChatGptBrowserBlockerError(busyBlocker);
|
|
1211
1247
|
}
|
package/dist/cli-args.js
CHANGED
package/dist/cli-help.js
CHANGED
|
@@ -25,7 +25,7 @@ Ask / consult commands:
|
|
|
25
25
|
prodex pro browser smoke [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000]
|
|
26
26
|
prodex pro browser models [--source-cli /absolute/path/to/dist/cli.js] [--port 9333] [--timeout-ms 15000] # read-only list of model menu options
|
|
27
27
|
prodex pro browser projects [--source-cli /absolute/path/to/dist/cli.js] [--port 9333] [--timeout-ms 15000] # read-only list of sidebar project names (for --project)
|
|
28
|
-
prodex pro browser ask [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000] [--target-url url --confirm-target] [--new-chat] [--stdin] [--json] [--auto-login|--no-auto-login] [--file path] [--model Pro] [--pro-mode 기본|확장] [--effort 즉시|중간|높음|"매우 높음"] [--project "name" | --project-new "name"] "prompt" # explicit visible-browser send
|
|
28
|
+
prodex pro browser ask [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000] [--busy-wait-ms 600000] [--target-url url --confirm-target] [--new-chat] [--stdin] [--json] [--auto-login|--no-auto-login] [--file path] [--model Pro] [--pro-mode 기본|확장] [--effort 즉시|중간|높음|"매우 높음"] [--project "name" | --project-new "name"] "prompt" # explicit visible-browser send
|
|
29
29
|
prodex pro latest [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo]
|
|
30
30
|
prodex pro list [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo]
|
|
31
31
|
prodex pro show <task-id|latest> [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo]
|
|
@@ -251,8 +251,8 @@ export function printProBrowserHelp(stdout, sourceCli) {
|
|
|
251
251
|
: "prodex pro browser smoke [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000]";
|
|
252
252
|
const selectionUsage = '[--model Pro] [--pro-mode 기본|확장] [--effort 즉시|중간|높음|"매우 높음"] [--project "name" | --project-new "name"]';
|
|
253
253
|
const askUsage = sourceCli
|
|
254
|
-
? `${cli} pro browser ask${sourceCliOption} [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000] [--target-url url --confirm-target] [--new-chat] [--stdin] [--json] [--auto-login|--no-auto-login] [--file path] ${selectionUsage} "prompt"`
|
|
255
|
-
: `prodex pro browser ask [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000] [--target-url url --confirm-target] [--new-chat] [--stdin] [--json] [--auto-login|--no-auto-login] [--file path] ${selectionUsage} "prompt"`;
|
|
254
|
+
? `${cli} pro browser ask${sourceCliOption} [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000] [--busy-wait-ms 600000] [--target-url url --confirm-target] [--new-chat] [--stdin] [--json] [--auto-login|--no-auto-login] [--file path] ${selectionUsage} "prompt"`
|
|
255
|
+
: `prodex pro browser ask [--source-cli /absolute/path/to/dist/cli.js] [--cwd /absolute/path/to/repo] [--port 9333] [--timeout-ms 90000] [--busy-wait-ms 600000] [--target-url url --confirm-target] [--new-chat] [--stdin] [--json] [--auto-login|--no-auto-login] [--file path] ${selectionUsage} "prompt"`;
|
|
256
256
|
const modelsUsage = sourceCli
|
|
257
257
|
? `${cli} pro browser models${sourceCliOption} [--port 9333] [--timeout-ms 15000]`
|
|
258
258
|
: "prodex pro browser models [--source-cli /absolute/path/to/dist/cli.js] [--port 9333] [--timeout-ms 15000]";
|
package/dist/cli-pro.js
CHANGED
|
@@ -145,6 +145,7 @@ export async function runProCommand(rest, io, runCliFn) {
|
|
|
145
145
|
const straySendFlag = [
|
|
146
146
|
"--port",
|
|
147
147
|
"--timeout-ms",
|
|
148
|
+
"--busy-wait-ms",
|
|
148
149
|
"--target-url",
|
|
149
150
|
"--confirm-target",
|
|
150
151
|
"--project",
|
|
@@ -594,6 +595,7 @@ export async function runAskProCommand(rest, io) {
|
|
|
594
595
|
...(selectionEffort ? { effort: selectionEffort } : {})
|
|
595
596
|
};
|
|
596
597
|
const browserPort = hasSendMode ? resolveCdpPort(readPortFlag(parsedAskPro.optionArgs, "--port")) : undefined;
|
|
598
|
+
const busyWaitMs = readPositiveIntegerFlag(parsedAskPro.optionArgs, "--busy-wait-ms");
|
|
597
599
|
// Pro extended can legitimately think for minutes, so its default timeout is
|
|
598
600
|
// higher; an explicit --timeout-ms always wins.
|
|
599
601
|
const defaultBrowserTimeoutMs = selectionProMode === "확장" ? 300_000 : 90_000;
|
|
@@ -659,6 +661,7 @@ export async function runAskProCommand(rest, io) {
|
|
|
659
661
|
targetUrl: normalizedTargetUrl,
|
|
660
662
|
timeoutMs: browserTimeoutMs,
|
|
661
663
|
...(newChat ? { newChat: true } : {}),
|
|
664
|
+
...(busyWaitMs !== undefined ? { busyWaitMs } : {}),
|
|
662
665
|
project: selectionProject,
|
|
663
666
|
projectNew: selectionProjectNew,
|
|
664
667
|
model: selectionModel,
|