@schuttdev/gigai 0.1.0-beta.18 → 0.1.0-beta.19
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/{dist-4DHEQIOT.js → dist-IQVGU6KW.js} +22 -0
- package/dist/index.js +17 -10
- package/package.json +1 -1
|
@@ -1472,6 +1472,27 @@ async function uninstallDaemon() {
|
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
|
+
async function stopServer() {
|
|
1476
|
+
const { execFileSync } = await import("child_process");
|
|
1477
|
+
let pids = [];
|
|
1478
|
+
try {
|
|
1479
|
+
const out = execFileSync("pgrep", ["-f", "gigai server start"], { encoding: "utf8" });
|
|
1480
|
+
pids = out.trim().split("\n").map(Number).filter((pid) => pid && pid !== process.pid);
|
|
1481
|
+
} catch {
|
|
1482
|
+
}
|
|
1483
|
+
if (pids.length === 0) {
|
|
1484
|
+
console.log("No running gigai server found.");
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
for (const pid of pids) {
|
|
1488
|
+
try {
|
|
1489
|
+
process.kill(pid, "SIGTERM");
|
|
1490
|
+
console.log(`Stopped gigai server (PID ${pid})`);
|
|
1491
|
+
} catch (e) {
|
|
1492
|
+
console.error(`Failed to stop PID ${pid}: ${e.message}`);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1475
1496
|
async function startServer() {
|
|
1476
1497
|
const { values } = parseArgs({
|
|
1477
1498
|
options: {
|
|
@@ -1531,6 +1552,7 @@ export {
|
|
|
1531
1552
|
loadConfig,
|
|
1532
1553
|
runInit,
|
|
1533
1554
|
startServer,
|
|
1555
|
+
stopServer,
|
|
1534
1556
|
uninstallDaemon,
|
|
1535
1557
|
unwrapTool,
|
|
1536
1558
|
wrapCli,
|
package/dist/index.js
CHANGED
|
@@ -577,7 +577,7 @@ function runCitty() {
|
|
|
577
577
|
dev: { type: "boolean", description: "Development mode (no HTTPS)" }
|
|
578
578
|
},
|
|
579
579
|
async run({ args }) {
|
|
580
|
-
const { startServer } = await import("./dist-
|
|
580
|
+
const { startServer } = await import("./dist-IQVGU6KW.js");
|
|
581
581
|
const extraArgs = [];
|
|
582
582
|
if (args.config) extraArgs.push("--config", args.config);
|
|
583
583
|
if (args.dev) extraArgs.push("--dev");
|
|
@@ -588,7 +588,7 @@ function runCitty() {
|
|
|
588
588
|
init: defineCommand({
|
|
589
589
|
meta: { name: "init", description: "Interactive setup wizard" },
|
|
590
590
|
async run() {
|
|
591
|
-
const { runInit } = await import("./dist-
|
|
591
|
+
const { runInit } = await import("./dist-IQVGU6KW.js");
|
|
592
592
|
await runInit();
|
|
593
593
|
}
|
|
594
594
|
}),
|
|
@@ -598,7 +598,7 @@ function runCitty() {
|
|
|
598
598
|
config: { type: "string", alias: "c", description: "Config file path" }
|
|
599
599
|
},
|
|
600
600
|
async run({ args }) {
|
|
601
|
-
const { generateServerPairingCode } = await import("./dist-
|
|
601
|
+
const { generateServerPairingCode } = await import("./dist-IQVGU6KW.js");
|
|
602
602
|
await generateServerPairingCode(args.config);
|
|
603
603
|
}
|
|
604
604
|
}),
|
|
@@ -608,17 +608,24 @@ function runCitty() {
|
|
|
608
608
|
config: { type: "string", alias: "c", description: "Config file path" }
|
|
609
609
|
},
|
|
610
610
|
async run({ args }) {
|
|
611
|
-
const { installDaemon } = await import("./dist-
|
|
611
|
+
const { installDaemon } = await import("./dist-IQVGU6KW.js");
|
|
612
612
|
await installDaemon(args.config);
|
|
613
613
|
}
|
|
614
614
|
}),
|
|
615
615
|
uninstall: defineCommand({
|
|
616
616
|
meta: { name: "uninstall", description: "Remove background service" },
|
|
617
617
|
async run() {
|
|
618
|
-
const { uninstallDaemon } = await import("./dist-
|
|
618
|
+
const { uninstallDaemon } = await import("./dist-IQVGU6KW.js");
|
|
619
619
|
await uninstallDaemon();
|
|
620
620
|
}
|
|
621
621
|
}),
|
|
622
|
+
stop: defineCommand({
|
|
623
|
+
meta: { name: "stop", description: "Stop the running gigai server" },
|
|
624
|
+
async run() {
|
|
625
|
+
const { stopServer } = await import("./dist-IQVGU6KW.js");
|
|
626
|
+
await stopServer();
|
|
627
|
+
}
|
|
628
|
+
}),
|
|
622
629
|
status: defineCommand({
|
|
623
630
|
meta: { name: "status", description: "Show server status" },
|
|
624
631
|
async run() {
|
|
@@ -642,21 +649,21 @@ function runCitty() {
|
|
|
642
649
|
cli: defineCommand({
|
|
643
650
|
meta: { name: "cli", description: "Wrap a CLI command" },
|
|
644
651
|
async run() {
|
|
645
|
-
const { wrapCli } = await import("./dist-
|
|
652
|
+
const { wrapCli } = await import("./dist-IQVGU6KW.js");
|
|
646
653
|
await wrapCli();
|
|
647
654
|
}
|
|
648
655
|
}),
|
|
649
656
|
mcp: defineCommand({
|
|
650
657
|
meta: { name: "mcp", description: "Wrap an MCP server" },
|
|
651
658
|
async run() {
|
|
652
|
-
const { wrapMcp } = await import("./dist-
|
|
659
|
+
const { wrapMcp } = await import("./dist-IQVGU6KW.js");
|
|
653
660
|
await wrapMcp();
|
|
654
661
|
}
|
|
655
662
|
}),
|
|
656
663
|
script: defineCommand({
|
|
657
664
|
meta: { name: "script", description: "Wrap a script" },
|
|
658
665
|
async run() {
|
|
659
|
-
const { wrapScript } = await import("./dist-
|
|
666
|
+
const { wrapScript } = await import("./dist-IQVGU6KW.js");
|
|
660
667
|
await wrapScript();
|
|
661
668
|
}
|
|
662
669
|
}),
|
|
@@ -666,7 +673,7 @@ function runCitty() {
|
|
|
666
673
|
path: { type: "positional", description: "Path to config file", required: true }
|
|
667
674
|
},
|
|
668
675
|
async run({ args }) {
|
|
669
|
-
const { wrapImport } = await import("./dist-
|
|
676
|
+
const { wrapImport } = await import("./dist-IQVGU6KW.js");
|
|
670
677
|
await wrapImport(args.path);
|
|
671
678
|
}
|
|
672
679
|
})
|
|
@@ -678,7 +685,7 @@ function runCitty() {
|
|
|
678
685
|
name: { type: "positional", description: "Tool name", required: true }
|
|
679
686
|
},
|
|
680
687
|
async run({ args }) {
|
|
681
|
-
const { unwrapTool } = await import("./dist-
|
|
688
|
+
const { unwrapTool } = await import("./dist-IQVGU6KW.js");
|
|
682
689
|
await unwrapTool(args.name);
|
|
683
690
|
}
|
|
684
691
|
});
|