junis 0.2.3 → 0.2.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/cli/index.js +22 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "junis",
|
|
34
|
-
version: "0.2.
|
|
34
|
+
version: "0.2.4",
|
|
35
35
|
description: "One-line device control for AI agents",
|
|
36
36
|
bin: {
|
|
37
37
|
junis: "dist/cli/index.js"
|
|
@@ -1339,7 +1339,9 @@ function startDaemon(port) {
|
|
|
1339
1339
|
const err = import_fs2.default.openSync(LOG_FILE, "a");
|
|
1340
1340
|
const child = (0, import_child_process4.spawn)(nodePath, [scriptPath, "start", "--daemon", "--port", String(port)], {
|
|
1341
1341
|
detached: true,
|
|
1342
|
-
stdio: ["ignore", out, err]
|
|
1342
|
+
stdio: ["ignore", out, err],
|
|
1343
|
+
env: { ...process.env }
|
|
1344
|
+
// JUNIS_API_URL, JUNIS_WS_URL 등 현재 env 상속
|
|
1343
1345
|
});
|
|
1344
1346
|
child.unref();
|
|
1345
1347
|
const pid = child.pid;
|
|
@@ -1388,6 +1390,12 @@ var ServiceManager = class {
|
|
|
1388
1390
|
<string>${import_os2.default.homedir()}</string>
|
|
1389
1391
|
<key>PATH</key>
|
|
1390
1392
|
<string>${process.env.PATH ?? "/usr/local/bin:/usr/bin:/bin"}</string>
|
|
1393
|
+
${process.env.JUNIS_API_URL ? `<key>JUNIS_API_URL</key>
|
|
1394
|
+
<string>${process.env.JUNIS_API_URL}</string>` : ""}
|
|
1395
|
+
${process.env.JUNIS_WS_URL ? `<key>JUNIS_WS_URL</key>
|
|
1396
|
+
<string>${process.env.JUNIS_WS_URL}</string>` : ""}
|
|
1397
|
+
${process.env.JUNIS_WEB_URL ? `<key>JUNIS_WEB_URL</key>
|
|
1398
|
+
<string>${process.env.JUNIS_WEB_URL}</string>` : ""}
|
|
1391
1399
|
</dict>
|
|
1392
1400
|
<key>RunAtLoad</key>
|
|
1393
1401
|
<true/>
|
|
@@ -1419,6 +1427,9 @@ Restart=always
|
|
|
1419
1427
|
RestartSec=5
|
|
1420
1428
|
Environment=HOME=${import_os2.default.homedir()}
|
|
1421
1429
|
Environment=PATH=${process.env.PATH ?? "/usr/local/bin:/usr/bin:/bin"}
|
|
1430
|
+
${process.env.JUNIS_API_URL ? `Environment=JUNIS_API_URL=${process.env.JUNIS_API_URL}` : ""}
|
|
1431
|
+
${process.env.JUNIS_WS_URL ? `Environment=JUNIS_WS_URL=${process.env.JUNIS_WS_URL}` : ""}
|
|
1432
|
+
${process.env.JUNIS_WEB_URL ? `Environment=JUNIS_WEB_URL=${process.env.JUNIS_WEB_URL}` : ""}
|
|
1422
1433
|
StandardOutput=append:${LOG_FILE}
|
|
1423
1434
|
StandardError=append:${LOG_FILE}
|
|
1424
1435
|
|
|
@@ -1514,6 +1525,7 @@ function printStep1(port) {
|
|
|
1514
1525
|
import_commander.program.command("start", { isDefault: true }).description("Junis \uC5D0\uC774\uC804\uD2B8\uC640 \uC5F0\uACB0 \uC2DC\uC791").option("--local", "\uB85C\uCEEC MCP \uC11C\uBC84\uB9CC \uC2E4\uD589 (\uD074\uB77C\uC6B0\uB4DC \uC5F0\uACB0 \uC5C6\uC74C)").option("--port <number>", "\uD3EC\uD2B8 \uBC88\uD638", "3000").option("--reset", "\uAE30\uC874 \uC778\uC99D \uCD08\uAE30\uD654 \uD6C4 \uC7AC\uB85C\uADF8\uC778").option("--daemon", "\uB370\uBAAC \uBAA8\uB4DC\uB85C \uC2E4\uD589 (\uB0B4\uBD80\uC6A9, launchd/systemd\uC5D0\uC11C \uC0AC\uC6A9)").action(async (options) => {
|
|
1515
1526
|
const port = parseInt(options.port, 10);
|
|
1516
1527
|
if (options.daemon) {
|
|
1528
|
+
writePid(process.pid);
|
|
1517
1529
|
if (options.local) {
|
|
1518
1530
|
await startMCPServer(port);
|
|
1519
1531
|
return;
|
|
@@ -1661,13 +1673,18 @@ import_commander.program.command("start", { isDefault: true }).description("Juni
|
|
|
1661
1673
|
import_commander.program.command("stop").description("\uBC31\uADF8\uB77C\uC6B4\uB4DC \uC11C\uBE44\uC2A4 \uC911\uC9C0 \uBC0F \uC790\uB3D9\uC2DC\uC791 \uD574\uC81C").action(async () => {
|
|
1662
1674
|
const stopped = stopDaemon();
|
|
1663
1675
|
const svc = new ServiceManager();
|
|
1664
|
-
|
|
1665
|
-
|
|
1676
|
+
let serviceUninstalled = false;
|
|
1677
|
+
try {
|
|
1678
|
+
await svc.uninstall();
|
|
1679
|
+
serviceUninstalled = true;
|
|
1680
|
+
} catch {
|
|
1681
|
+
}
|
|
1682
|
+
if (stopped || serviceUninstalled) {
|
|
1666
1683
|
console.log("\u2705 Junis \uC11C\uBE44\uC2A4\uAC00 \uC911\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
1684
|
+
console.log(" \uC790\uB3D9\uC2DC\uC791\uC774 \uD574\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
1667
1685
|
} else {
|
|
1668
1686
|
console.log("\u2139\uFE0F \uC2E4\uD589 \uC911\uC778 Junis \uD504\uB85C\uC138\uC2A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1669
1687
|
}
|
|
1670
|
-
console.log(" \uC790\uB3D9\uC2DC\uC791\uC774 \uD574\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
1671
1688
|
});
|
|
1672
1689
|
import_commander.program.command("logout").description("\uC778\uC99D \uC815\uBCF4 \uC0AD\uC81C").action(() => {
|
|
1673
1690
|
clearConfig();
|