@andrewting19/oracle 0.9.3 → 0.9.4
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/src/remote/server.js +21 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ 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 { launchChrome } from "../browser/chromeLifecycle.js";
|
|
15
|
+
import { launchChrome, connectToChrome } from "../browser/chromeLifecycle.js";
|
|
16
16
|
async function findAvailablePort() {
|
|
17
17
|
return await new Promise((resolve, reject) => {
|
|
18
18
|
const srv = net.createServer();
|
|
@@ -277,6 +277,26 @@ export async function serveRemote(options = {}) {
|
|
|
277
277
|
const chrome = await launchChrome({ headless: false, hideWindow: true }, userDataDir, console.log);
|
|
278
278
|
sharedChrome = { host: "127.0.0.1", port: chrome.port };
|
|
279
279
|
console.log(`Shared Chrome launched (pid ${chrome.pid}, port ${chrome.port}). Concurrent runs will use isolated tabs.`);
|
|
280
|
+
// Sync ChatGPT cookies into the shared Chrome so all tabs are authenticated.
|
|
281
|
+
// Uses syncCookies which reads from the host's Chrome profile and injects via CDP.
|
|
282
|
+
try {
|
|
283
|
+
const { syncCookies } = await import("../browser/cookies.js");
|
|
284
|
+
const client = await connectToChrome(chrome.port, console.log);
|
|
285
|
+
const { Network } = client;
|
|
286
|
+
await Network.enable({});
|
|
287
|
+
const syncLogger = ((msg) => { if (msg)
|
|
288
|
+
console.log(`[shared-chrome] ${msg}`); });
|
|
289
|
+
syncLogger.verbose = false;
|
|
290
|
+
const count = await syncCookies(Network, CHATGPT_URL, "Default", syncLogger, {
|
|
291
|
+
allowErrors: true,
|
|
292
|
+
});
|
|
293
|
+
console.log(`Synced ${count} ChatGPT cookies into shared Chrome.`);
|
|
294
|
+
await client.close();
|
|
295
|
+
}
|
|
296
|
+
catch (cookieErr) {
|
|
297
|
+
const msg = cookieErr instanceof Error ? cookieErr.message : String(cookieErr);
|
|
298
|
+
console.log(`Warning: failed to sync cookies into shared Chrome (${msg}). Runs may need to authenticate.`);
|
|
299
|
+
}
|
|
280
300
|
// Clean up Chrome on process exit
|
|
281
301
|
const killChrome = async () => {
|
|
282
302
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrewting19/oracle",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
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",
|