@youdie006/prodex 0.16.5 → 0.16.6
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 +1 -1
- package/dist/cli-pro.js +34 -9
- package/dist/repo-write.js +6 -0
- package/package.json +1 -1
package/dist/chatgpt-browser.js
CHANGED
|
@@ -1742,7 +1742,7 @@ function composerExpressionHelpers() {
|
|
|
1742
1742
|
};
|
|
1743
1743
|
`;
|
|
1744
1744
|
}
|
|
1745
|
-
function answerExpression() {
|
|
1745
|
+
export function answerExpression() {
|
|
1746
1746
|
const excludedTextSelector = JSON.stringify(CHATGPT_RUNTIME_BLOCKER_TEXT_EXCLUDED_ANCESTORS);
|
|
1747
1747
|
const blockerScanExcludedSelector = JSON.stringify(CHATGPT_BLOCKER_SCAN_EXCLUDED_ANCESTORS);
|
|
1748
1748
|
const streamingSelector = JSON.stringify(CHATGPT_STREAMING_SELECTOR);
|
package/dist/cli-pro.js
CHANGED
|
@@ -297,17 +297,31 @@ export async function runProCommand(rest, io, runCliFn) {
|
|
|
297
297
|
if (printProBrowserHelpIfRequested(browserArgs, "pro browser models", io, { valueFlags: ["--port", "--timeout-ms", "--source-cli"] }))
|
|
298
298
|
return 0;
|
|
299
299
|
assertOnlyOptions(browserArgs, "pro browser models", ["--port", "--timeout-ms", "--source-cli"]);
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
const modelsSourceCli = resolveOptionalFileFlag(io.cwd, browserArgs, "--source-cli");
|
|
301
|
+
const modelsPort = readPortFlag(browserArgs, "--port");
|
|
302
|
+
let listed;
|
|
303
|
+
try {
|
|
304
|
+
listed = await listChatGptModelOptions({
|
|
305
|
+
port: modelsPort,
|
|
306
|
+
timeoutMs: readPositiveIntegerFlag(browserArgs, "--timeout-ms")
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
// Keep the next step actionable for a custom --port: the raw blocker
|
|
311
|
+
// suggests the default-port login command, which would not fix a
|
|
312
|
+
// 9444-style setup.
|
|
313
|
+
const blocker = sourceAwareBrowserBlocker(browserSendBlockerFromError(error), modelsSourceCli, {
|
|
314
|
+
...(modelsPort !== undefined && modelsPort !== DEFAULT_CDP_PORT ? { port: modelsPort } : {})
|
|
315
|
+
});
|
|
316
|
+
throw new Error(blocker.next_step ? `${blocker.message} Next: ${blocker.next_step}` : errorMessage(error));
|
|
317
|
+
}
|
|
304
318
|
io.stdout("Model menu options in the visible ChatGPT tab (read-only; nothing was selected):");
|
|
305
319
|
for (const option of listed.options) {
|
|
306
320
|
const marker = option.checked ? "*" : " ";
|
|
307
321
|
const suffix = option.kind === "submenu" ? " (has sub-variants; not selectable via --model yet)" : "";
|
|
308
322
|
io.stdout(`${marker} ${option.label}${suffix}`);
|
|
309
323
|
}
|
|
310
|
-
io.stdout("Use radio entries with `pro browser ask --model/--effort
|
|
324
|
+
io.stdout("Use radio entries with `pro browser ask --model/--effort` (e.g. --model Pro).");
|
|
311
325
|
return 0;
|
|
312
326
|
}
|
|
313
327
|
throw unknownSubcommandError("pro browser", browserSubcommand, ["login", "ask", "smoke", "check", "models"]);
|
|
@@ -1197,10 +1211,21 @@ export async function printProductCheck(store, io, args, configCwd = io.cwd) {
|
|
|
1197
1211
|
catch {
|
|
1198
1212
|
// config unreadable: already reported by the config line above
|
|
1199
1213
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1214
|
+
let browserStatus;
|
|
1215
|
+
try {
|
|
1216
|
+
browserStatus = await getChatGptBrowserStatus({
|
|
1217
|
+
port: resolveCdpPort(readPortFlag(args, "--port")),
|
|
1218
|
+
timeoutMs: readPositiveIntegerFlag(args, "--timeout-ms") ?? 1500
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
catch (error) {
|
|
1222
|
+
// A reachable-but-broken page (e.g. a failing in-page evaluate) must show
|
|
1223
|
+
// as a check failure like doctor does, not crash the whole check with an
|
|
1224
|
+
// internal "Runtime.evaluate failed".
|
|
1225
|
+
io.stdout(`chatgpt: check failed - ${errorMessage(error)}`);
|
|
1226
|
+
io.stdout("next: Reload the ChatGPT tab in the dedicated browser (or rerun `prodex pro browser login`), then retry.");
|
|
1227
|
+
return false;
|
|
1228
|
+
}
|
|
1204
1229
|
const browserCommandOptions = {
|
|
1205
1230
|
cwd: setupHintCwd,
|
|
1206
1231
|
port: readPortFlag(args, "--port") ?? undefined
|
package/dist/repo-write.js
CHANGED
|
@@ -77,6 +77,12 @@ export async function applyRepoWriteDryRun(root, store, input) {
|
|
|
77
77
|
const current = await readWritableExistingFile(root, metadata.path);
|
|
78
78
|
const currentPreimage = sha256(current.content);
|
|
79
79
|
if (currentPreimage !== input.preimage_sha256) {
|
|
80
|
+
// A retry after a successful apply sees the file already holding the new
|
|
81
|
+
// content - name that instead of the generic conflict message so the
|
|
82
|
+
// caller can tell "already done" from "someone else changed the file".
|
|
83
|
+
if (currentPreimage === metadata.new_sha256) {
|
|
84
|
+
throw new Error(`Write for ${metadata.path} was already applied (the file already matches the reviewed content). Re-run repo_write_file_dry_run if you need a new change.`);
|
|
85
|
+
}
|
|
80
86
|
throw new Error(`File preimage changed for ${metadata.path}`);
|
|
81
87
|
}
|
|
82
88
|
const newContent = await readDryRunReplacementContent(store, metadata);
|