ghost-bridge 0.2.2 → 0.2.5
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.js +26 -11
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5453,12 +5453,13 @@ var require_lib = __commonJS({
|
|
|
5453
5453
|
// lib/utils.js
|
|
5454
5454
|
import path from "path";
|
|
5455
5455
|
import os2 from "os";
|
|
5456
|
+
import { fileURLToPath } from "url";
|
|
5456
5457
|
function getClaudeConfigPath() {
|
|
5457
5458
|
const homeDir = os2.homedir();
|
|
5458
5459
|
return path.join(homeDir, ".claude.json");
|
|
5459
5460
|
}
|
|
5460
5461
|
function getExtensionPath() {
|
|
5461
|
-
const __filename2 =
|
|
5462
|
+
const __filename2 = fileURLToPath(import.meta.url);
|
|
5462
5463
|
const currentDir = path.dirname(__filename2);
|
|
5463
5464
|
if (currentDir.endsWith("/dist") || currentDir.endsWith("\\dist")) {
|
|
5464
5465
|
return path.resolve(currentDir, "../extension");
|
|
@@ -5466,7 +5467,7 @@ function getExtensionPath() {
|
|
|
5466
5467
|
return path.resolve(currentDir, "../extension");
|
|
5467
5468
|
}
|
|
5468
5469
|
function getServerPath() {
|
|
5469
|
-
const __filename2 =
|
|
5470
|
+
const __filename2 = fileURLToPath(import.meta.url);
|
|
5470
5471
|
const currentDir = path.dirname(__filename2);
|
|
5471
5472
|
if (currentDir.endsWith("/dist") || currentDir.endsWith("\\dist")) {
|
|
5472
5473
|
return path.resolve(currentDir, "server.js");
|
|
@@ -5474,7 +5475,7 @@ function getServerPath() {
|
|
|
5474
5475
|
return path.resolve(currentDir, "../dist/server.js");
|
|
5475
5476
|
}
|
|
5476
5477
|
function getUserExtensionDir() {
|
|
5477
|
-
return path.join(os2.homedir(), "
|
|
5478
|
+
return path.join(os2.homedir(), "ghost-bridge", "extension");
|
|
5478
5479
|
}
|
|
5479
5480
|
var init_utils = __esm({
|
|
5480
5481
|
"lib/utils.js"() {
|
|
@@ -5487,6 +5488,18 @@ __export(init_exports, {
|
|
|
5487
5488
|
init: () => init
|
|
5488
5489
|
});
|
|
5489
5490
|
import path2 from "path";
|
|
5491
|
+
import { exec } from "child_process";
|
|
5492
|
+
import os3 from "os";
|
|
5493
|
+
function openFolder(folderPath) {
|
|
5494
|
+
const platform = os3.platform();
|
|
5495
|
+
let command = "";
|
|
5496
|
+
if (platform === "darwin") command = `open "${folderPath}"`;
|
|
5497
|
+
else if (platform === "win32") command = `start "" "${folderPath}"`;
|
|
5498
|
+
else command = `xdg-open "${folderPath}"`;
|
|
5499
|
+
exec(command, (err) => {
|
|
5500
|
+
if (err) console.error(source_default.dim("Failed to open folder:", err.message));
|
|
5501
|
+
});
|
|
5502
|
+
}
|
|
5490
5503
|
async function init(options) {
|
|
5491
5504
|
console.log(source_default.bold("\u{1F47B} Ghost Bridge Initialization"));
|
|
5492
5505
|
const configPath = getClaudeConfigPath();
|
|
@@ -5539,6 +5552,8 @@ async function init(options) {
|
|
|
5539
5552
|
console.log(`4. Select the folder: ${source_default.bold(targetExt)}`);
|
|
5540
5553
|
if (!isDryRun) {
|
|
5541
5554
|
await import_fs_extra.default.outputFile(path2.join(targetExt, ".ghost-bridge-managed"), "This folder is managed by ghost-bridge CLI. Do not edit manually.");
|
|
5555
|
+
console.log(source_default.dim("\n\u{1F4C2} Opening extension folder..."));
|
|
5556
|
+
openFolder(targetExt);
|
|
5542
5557
|
}
|
|
5543
5558
|
}
|
|
5544
5559
|
var import_fs_extra;
|
|
@@ -5555,15 +5570,15 @@ var extension_exports = {};
|
|
|
5555
5570
|
__export(extension_exports, {
|
|
5556
5571
|
showExtension: () => showExtension
|
|
5557
5572
|
});
|
|
5558
|
-
import { exec } from "child_process";
|
|
5559
|
-
import
|
|
5560
|
-
function
|
|
5561
|
-
const platform =
|
|
5573
|
+
import { exec as exec2 } from "child_process";
|
|
5574
|
+
import os4 from "os";
|
|
5575
|
+
function openFolder2(path4) {
|
|
5576
|
+
const platform = os4.platform();
|
|
5562
5577
|
let command = "";
|
|
5563
5578
|
if (platform === "darwin") command = `open "${path4}"`;
|
|
5564
5579
|
else if (platform === "win32") command = `start "" "${path4}"`;
|
|
5565
5580
|
else command = `xdg-open "${path4}"`;
|
|
5566
|
-
|
|
5581
|
+
exec2(command, (err) => {
|
|
5567
5582
|
if (err) console.error("Failed to open folder:", err);
|
|
5568
5583
|
});
|
|
5569
5584
|
}
|
|
@@ -5583,7 +5598,7 @@ async function showExtension(options) {
|
|
|
5583
5598
|
console.log('3. Click "Load unpacked" and select the directory above.');
|
|
5584
5599
|
if (options.open) {
|
|
5585
5600
|
console.log(source_default.dim("Opening folder..."));
|
|
5586
|
-
|
|
5601
|
+
openFolder2(extDir);
|
|
5587
5602
|
}
|
|
5588
5603
|
}
|
|
5589
5604
|
var import_fs_extra2;
|
|
@@ -5665,10 +5680,10 @@ var {
|
|
|
5665
5680
|
|
|
5666
5681
|
// bin/ghost-bridge.js
|
|
5667
5682
|
init_source();
|
|
5668
|
-
import { fileURLToPath } from "url";
|
|
5683
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
5669
5684
|
import path3 from "path";
|
|
5670
5685
|
import fs4 from "fs";
|
|
5671
|
-
var __filename =
|
|
5686
|
+
var __filename = fileURLToPath2(import.meta.url);
|
|
5672
5687
|
var __dirname = path3.dirname(__filename);
|
|
5673
5688
|
var packageJsonParams = JSON.parse(
|
|
5674
5689
|
fs4.readFileSync(path3.join(__dirname, "../package.json"), "utf-8")
|