@heidi-dang/oh-my-opencode 3.11.0 → 3.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/cli/index.js +104 -15
- package/dist/cli/master-login/index.d.ts +4 -0
- package/dist/index.js +978 -762
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/ygka-interceptor.d.ts +4 -0
- package/dist/shared/ygka-transport.d.ts +19 -0
- package/package.json +16 -16
package/dist/cli/index.js
CHANGED
|
@@ -6720,6 +6720,15 @@ var init_model_suggestion_retry = __esm(() => {
|
|
|
6720
6720
|
var init_opencode_server_auth = __esm(() => {
|
|
6721
6721
|
init_logger();
|
|
6722
6722
|
});
|
|
6723
|
+
|
|
6724
|
+
// src/shared/ygka-transport.ts
|
|
6725
|
+
var init_ygka_transport = () => {};
|
|
6726
|
+
|
|
6727
|
+
// src/shared/ygka-interceptor.ts
|
|
6728
|
+
var init_ygka_interceptor = __esm(() => {
|
|
6729
|
+
init_ygka_transport();
|
|
6730
|
+
init_logger();
|
|
6731
|
+
});
|
|
6723
6732
|
// src/shared/opencode-http-api.ts
|
|
6724
6733
|
var init_opencode_http_api = __esm(() => {
|
|
6725
6734
|
init_opencode_server_auth();
|
|
@@ -6906,6 +6915,7 @@ var init_shared = __esm(() => {
|
|
|
6906
6915
|
init_tmux();
|
|
6907
6916
|
init_model_suggestion_retry();
|
|
6908
6917
|
init_opencode_server_auth();
|
|
6918
|
+
init_ygka_interceptor();
|
|
6909
6919
|
init_opencode_http_api();
|
|
6910
6920
|
init_port_utils();
|
|
6911
6921
|
init_git_worktree();
|
|
@@ -8623,7 +8633,7 @@ var {
|
|
|
8623
8633
|
// package.json
|
|
8624
8634
|
var package_default = {
|
|
8625
8635
|
name: "@heidi-dang/oh-my-opencode",
|
|
8626
|
-
version: "3.
|
|
8636
|
+
version: "3.12.0",
|
|
8627
8637
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
8628
8638
|
main: "dist/index.js",
|
|
8629
8639
|
types: "dist/index.d.ts",
|
|
@@ -8644,7 +8654,7 @@ var package_default = {
|
|
|
8644
8654
|
"./schema.json": "./dist/oh-my-opencode.schema.json"
|
|
8645
8655
|
},
|
|
8646
8656
|
scripts: {
|
|
8647
|
-
build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
|
|
8657
|
+
build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external playwright && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi --external playwright && bun run build:schema",
|
|
8648
8658
|
"build:all": "bun run build && bun run build:binaries",
|
|
8649
8659
|
"build:binaries": "bun run script/build-binaries.ts",
|
|
8650
8660
|
"build:schema": "bun run script/build-schema.ts",
|
|
@@ -8695,20 +8705,21 @@ var package_default = {
|
|
|
8695
8705
|
"@types/js-yaml": "^4.0.9",
|
|
8696
8706
|
"@types/picomatch": "^3.0.2",
|
|
8697
8707
|
"bun-types": "1.3.6",
|
|
8708
|
+
playwright: "^1.58.2",
|
|
8698
8709
|
typescript: "^5.7.3"
|
|
8699
8710
|
},
|
|
8700
8711
|
optionalDependencies: {
|
|
8701
|
-
"@heidi-dang/oh-my-opencode-darwin-arm64": "3.
|
|
8702
|
-
"@heidi-dang/oh-my-opencode-darwin-x64": "3.
|
|
8703
|
-
"@heidi-dang/oh-my-opencode-darwin-x64-baseline": "3.
|
|
8704
|
-
"@heidi-dang/oh-my-opencode-linux-arm64": "3.
|
|
8705
|
-
"@heidi-dang/oh-my-opencode-linux-arm64-musl": "3.
|
|
8706
|
-
"@heidi-dang/oh-my-opencode-linux-x64": "3.
|
|
8707
|
-
"@heidi-dang/oh-my-opencode-linux-x64-baseline": "3.
|
|
8708
|
-
"@heidi-dang/oh-my-opencode-linux-x64-musl": "3.
|
|
8709
|
-
"@heidi-dang/oh-my-opencode-linux-x64-musl-baseline": "3.
|
|
8710
|
-
"@heidi-dang/oh-my-opencode-windows-x64": "3.
|
|
8711
|
-
"@heidi-dang/oh-my-opencode-windows-x64-baseline": "3.
|
|
8712
|
+
"@heidi-dang/oh-my-opencode-darwin-arm64": "3.10.0",
|
|
8713
|
+
"@heidi-dang/oh-my-opencode-darwin-x64": "3.10.0",
|
|
8714
|
+
"@heidi-dang/oh-my-opencode-darwin-x64-baseline": "3.10.0",
|
|
8715
|
+
"@heidi-dang/oh-my-opencode-linux-arm64": "3.10.0",
|
|
8716
|
+
"@heidi-dang/oh-my-opencode-linux-arm64-musl": "3.10.0",
|
|
8717
|
+
"@heidi-dang/oh-my-opencode-linux-x64": "3.10.0",
|
|
8718
|
+
"@heidi-dang/oh-my-opencode-linux-x64-baseline": "3.10.0",
|
|
8719
|
+
"@heidi-dang/oh-my-opencode-linux-x64-musl": "3.10.0",
|
|
8720
|
+
"@heidi-dang/oh-my-opencode-linux-x64-musl-baseline": "3.10.0",
|
|
8721
|
+
"@heidi-dang/oh-my-opencode-windows-x64": "3.10.0",
|
|
8722
|
+
"@heidi-dang/oh-my-opencode-windows-x64-baseline": "3.10.0"
|
|
8712
8723
|
},
|
|
8713
8724
|
overrides: {
|
|
8714
8725
|
"@opencode-ai/sdk": "^1.2.17"
|
|
@@ -8717,8 +8728,7 @@ var package_default = {
|
|
|
8717
8728
|
"@ast-grep/cli",
|
|
8718
8729
|
"@ast-grep/napi",
|
|
8719
8730
|
"@code-yeongyu/comment-checker"
|
|
8720
|
-
]
|
|
8721
|
-
_commit: "04ec7f79655072d3b6127195966daf0b36bd042e"
|
|
8731
|
+
]
|
|
8722
8732
|
};
|
|
8723
8733
|
|
|
8724
8734
|
// src/cli/cli-installer.ts
|
|
@@ -29417,6 +29427,81 @@ function createMcpOAuthCommand() {
|
|
|
29417
29427
|
return mcp;
|
|
29418
29428
|
}
|
|
29419
29429
|
|
|
29430
|
+
// src/cli/master-login/index.ts
|
|
29431
|
+
var import_picocolors23 = __toESM(require_picocolors(), 1);
|
|
29432
|
+
import { writeFileSync as writeFileSync12, mkdirSync as mkdirSync8, existsSync as existsSync30 } from "fs";
|
|
29433
|
+
import { join as join29, dirname as dirname11 } from "path";
|
|
29434
|
+
import * as os5 from "os";
|
|
29435
|
+
var playWrightModule = import("playwright");
|
|
29436
|
+
async function masterLogin(options) {
|
|
29437
|
+
const configPath = join29(os5.homedir(), ".ygka_config.json");
|
|
29438
|
+
if (existsSync30(configPath) && !options.force) {
|
|
29439
|
+
console.log(`${import_picocolors23.default.yellow("[exists]")} ${import_picocolors23.default.dim(configPath)}`);
|
|
29440
|
+
console.log(import_picocolors23.default.dim("YGKA config already exists. Use --force to overwrite."));
|
|
29441
|
+
return 0;
|
|
29442
|
+
}
|
|
29443
|
+
console.log(import_picocolors23.default.cyan("\uD83D\uDE80 Launching browser for ChatGPT login..."));
|
|
29444
|
+
console.log(import_picocolors23.default.dim("Please log in to chat.openai.com in the window that appears."));
|
|
29445
|
+
console.log(import_picocolors23.default.dim("Once logged in, return here. I will automatically detect the session."));
|
|
29446
|
+
const { chromium } = await playWrightModule;
|
|
29447
|
+
const browser = await chromium.launch({ headless: false });
|
|
29448
|
+
const context = await browser.newContext();
|
|
29449
|
+
const page = await context.newPage();
|
|
29450
|
+
await page.goto("https://chat.openai.com/auth/login");
|
|
29451
|
+
let sessionToken = null;
|
|
29452
|
+
const startTime = Date.now();
|
|
29453
|
+
const timeout = 300000;
|
|
29454
|
+
const spinner = ["|", "/", "-", "\\"];
|
|
29455
|
+
let spinnerIdx = 0;
|
|
29456
|
+
while (Date.now() - startTime < timeout) {
|
|
29457
|
+
const cookies = await context.cookies();
|
|
29458
|
+
const sessionCookie = cookies.find((c) => c.name === "__Secure-next-auth.session-token");
|
|
29459
|
+
if (sessionCookie) {
|
|
29460
|
+
sessionToken = sessionCookie.value;
|
|
29461
|
+
break;
|
|
29462
|
+
}
|
|
29463
|
+
process.stdout.write(`\r${import_picocolors23.default.blue(spinner[spinnerIdx])} Waiting for login... `);
|
|
29464
|
+
spinnerIdx = (spinnerIdx + 1) % spinner.length;
|
|
29465
|
+
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
29466
|
+
}
|
|
29467
|
+
process.stdout.write("\r");
|
|
29468
|
+
if (!sessionToken) {
|
|
29469
|
+
console.error(import_picocolors23.default.red(`
|
|
29470
|
+
[error] Login timed out or session token not found.`));
|
|
29471
|
+
await browser.close();
|
|
29472
|
+
return 1;
|
|
29473
|
+
}
|
|
29474
|
+
console.log(import_picocolors23.default.green(`
|
|
29475
|
+
[ok] Session token captured successfully!`));
|
|
29476
|
+
let accessToken;
|
|
29477
|
+
try {
|
|
29478
|
+
const sessionResponse = await page.evaluate(async () => {
|
|
29479
|
+
try {
|
|
29480
|
+
const res = await fetch("/api/auth/session");
|
|
29481
|
+
return await res.json();
|
|
29482
|
+
} catch (e2) {
|
|
29483
|
+
return null;
|
|
29484
|
+
}
|
|
29485
|
+
});
|
|
29486
|
+
accessToken = sessionResponse?.accessToken;
|
|
29487
|
+
} catch (e2) {}
|
|
29488
|
+
await browser.close();
|
|
29489
|
+
const config2 = {
|
|
29490
|
+
session_token: sessionToken,
|
|
29491
|
+
access_token: accessToken,
|
|
29492
|
+
browser_name: "playwright-internal"
|
|
29493
|
+
};
|
|
29494
|
+
try {
|
|
29495
|
+
mkdirSync8(dirname11(configPath), { recursive: true });
|
|
29496
|
+
writeFileSync12(configPath, JSON.stringify(config2, null, 2), "utf-8");
|
|
29497
|
+
console.log(`${import_picocolors23.default.green("[ok]")} Saved YGKA config to ${import_picocolors23.default.white(configPath)}`);
|
|
29498
|
+
return 0;
|
|
29499
|
+
} catch (err) {
|
|
29500
|
+
console.error(import_picocolors23.default.red(`[error] Failed to write config: ${err instanceof Error ? err.message : String(err)}`));
|
|
29501
|
+
return 1;
|
|
29502
|
+
}
|
|
29503
|
+
}
|
|
29504
|
+
|
|
29420
29505
|
// src/cli/cli-program.ts
|
|
29421
29506
|
var VERSION2 = package_default.version;
|
|
29422
29507
|
var program2 = new Command;
|
|
@@ -29543,6 +29628,10 @@ Examples:
|
|
|
29543
29628
|
program2.command("version").description("Show version information").action(() => {
|
|
29544
29629
|
console.log(`oh-my-opencode v${VERSION2}`);
|
|
29545
29630
|
});
|
|
29631
|
+
program2.command("master-login").description("Login to ChatGPT and capture session for Master agent (YGKA)").option("--force", "Overwrite existing session configuration").action(async (options) => {
|
|
29632
|
+
const exitCode = await masterLogin({ force: options.force ?? false });
|
|
29633
|
+
process.exit(exitCode);
|
|
29634
|
+
});
|
|
29546
29635
|
program2.addCommand(createMcpOAuthCommand());
|
|
29547
29636
|
function runCli() {
|
|
29548
29637
|
program2.parse();
|