@andrewting19/oracle 0.9.8 → 0.9.9
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.
|
@@ -12,7 +12,6 @@ import { CHATGPT_URL } from "../browser/constants.js";
|
|
|
12
12
|
import { getCliVersion } from "../version.js";
|
|
13
13
|
import { cleanupStaleProfileState, readDevToolsPort, verifyDevToolsReachable, writeChromePid, writeDevToolsActivePort, } from "../browser/profileState.js";
|
|
14
14
|
import { normalizeChatgptUrl } from "../browser/utils.js";
|
|
15
|
-
import { connectToChrome } from "../browser/chromeLifecycle.js";
|
|
16
15
|
async function findAvailablePort() {
|
|
17
16
|
return await new Promise((resolve, reject) => {
|
|
18
17
|
const srv = net.createServer();
|
|
@@ -299,9 +298,12 @@ export async function serveRemote(options = {}) {
|
|
|
299
298
|
sharedChrome = { host: "127.0.0.1", port: chrome.port };
|
|
300
299
|
console.log(`Shared Chrome launched (pid ${chrome.pid}, port ${chrome.port}, no-startup-window). Concurrent runs will use isolated tabs.`);
|
|
301
300
|
// Sync ChatGPT cookies into the shared Chrome so all tabs are authenticated.
|
|
301
|
+
// With --no-startup-window, there are no targets. Create a temp tab to inject cookies.
|
|
302
302
|
try {
|
|
303
303
|
const { syncCookies } = await import("../browser/cookies.js");
|
|
304
|
-
const
|
|
304
|
+
const CDP = (await import("chrome-remote-interface")).default;
|
|
305
|
+
const tempTarget = await CDP.New({ host: "127.0.0.1", port: chrome.port, url: "about:blank" });
|
|
306
|
+
const client = await CDP({ host: "127.0.0.1", port: chrome.port, target: tempTarget.id });
|
|
305
307
|
const { Network } = client;
|
|
306
308
|
await Network.enable({});
|
|
307
309
|
const syncLogger = ((msg) => { if (msg)
|
|
@@ -312,6 +314,7 @@ export async function serveRemote(options = {}) {
|
|
|
312
314
|
});
|
|
313
315
|
console.log(`Synced ${count} ChatGPT cookies into shared Chrome.`);
|
|
314
316
|
await client.close();
|
|
317
|
+
await CDP.Close({ host: "127.0.0.1", port: chrome.port, id: tempTarget.id });
|
|
315
318
|
}
|
|
316
319
|
catch (cookieErr) {
|
|
317
320
|
const msg = cookieErr instanceof Error ? cookieErr.message : String(cookieErr);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrewting19/oracle",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"description": "CLI wrapper around OpenAI Responses API with GPT-5.4 Pro, GPT-5.4, GPT-5.2, GPT-5.1, and GPT-5.1 Codex high reasoning modes.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/steipete/oracle#readme",
|