haansi 0.1.6 → 0.1.7
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/haansi.js +23 -12
- package/package.json +1 -1
package/dist/haansi.js
CHANGED
|
@@ -486,12 +486,12 @@ var init_logger = __esm({
|
|
|
486
486
|
}
|
|
487
487
|
debug(message, context) {
|
|
488
488
|
if (this.level <= 0 /* DEBUG */) {
|
|
489
|
-
console.
|
|
489
|
+
console.error(this.formatMessage("DEBUG", message, context));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
info(message, context) {
|
|
493
493
|
if (this.level <= 1 /* INFO */) {
|
|
494
|
-
console.
|
|
494
|
+
console.error(this.formatMessage("INFO", message, context));
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
warn(message, context) {
|
|
@@ -56869,6 +56869,14 @@ var setup_mcp_exports = {};
|
|
|
56869
56869
|
__export(setup_mcp_exports, {
|
|
56870
56870
|
setupMcp: () => setupMcp
|
|
56871
56871
|
});
|
|
56872
|
+
function resolveHaansiBin() {
|
|
56873
|
+
try {
|
|
56874
|
+
const binPath = (0, import_node_child_process.execSync)("which haansi", { encoding: "utf-8" }).trim();
|
|
56875
|
+
if (binPath) return binPath;
|
|
56876
|
+
} catch {
|
|
56877
|
+
}
|
|
56878
|
+
return "haansi";
|
|
56879
|
+
}
|
|
56872
56880
|
async function setupMcp() {
|
|
56873
56881
|
let config6 = {};
|
|
56874
56882
|
if ((0, import_node_fs2.existsSync)(CLAUDE_JSON)) {
|
|
@@ -56883,23 +56891,26 @@ async function setupMcp() {
|
|
|
56883
56891
|
if (!config6.mcpServers) {
|
|
56884
56892
|
config6.mcpServers = {};
|
|
56885
56893
|
}
|
|
56894
|
+
const haansiBin = resolveHaansiBin();
|
|
56886
56895
|
config6.mcpServers["haansi-solutions"] = {
|
|
56887
|
-
command:
|
|
56888
|
-
args: ["
|
|
56896
|
+
command: haansiBin,
|
|
56897
|
+
args: ["mcp-server"]
|
|
56889
56898
|
};
|
|
56890
56899
|
(0, import_node_fs2.writeFileSync)(CLAUDE_JSON, JSON.stringify(config6, null, 2) + "\n", "utf-8");
|
|
56891
56900
|
console.log(`MCP server configured in ${CLAUDE_JSON}`);
|
|
56901
|
+
console.log(` command: ${haansiBin} mcp-server`);
|
|
56892
56902
|
console.log(
|
|
56893
|
-
"
|
|
56903
|
+
"\nRestart Claude Code to activate the haansi-solutions MCP server."
|
|
56894
56904
|
);
|
|
56895
56905
|
}
|
|
56896
|
-
var import_node_fs2, import_node_path2, import_node_os2, CLAUDE_JSON;
|
|
56906
|
+
var import_node_fs2, import_node_path2, import_node_os2, import_node_child_process, CLAUDE_JSON;
|
|
56897
56907
|
var init_setup_mcp = __esm({
|
|
56898
56908
|
"src/commands/setup-mcp.ts"() {
|
|
56899
56909
|
"use strict";
|
|
56900
56910
|
import_node_fs2 = require("node:fs");
|
|
56901
56911
|
import_node_path2 = require("node:path");
|
|
56902
56912
|
import_node_os2 = require("node:os");
|
|
56913
|
+
import_node_child_process = require("node:child_process");
|
|
56903
56914
|
CLAUDE_JSON = (0, import_node_path2.join)((0, import_node_os2.homedir)(), ".claude.json");
|
|
56904
56915
|
}
|
|
56905
56916
|
});
|
|
@@ -56911,7 +56922,7 @@ __export(setup_daemon_exports, {
|
|
|
56911
56922
|
});
|
|
56912
56923
|
function findHaansiBin() {
|
|
56913
56924
|
try {
|
|
56914
|
-
return (0,
|
|
56925
|
+
return (0, import_node_child_process2.execSync)("which haansi", { encoding: "utf-8" }).trim();
|
|
56915
56926
|
} catch {
|
|
56916
56927
|
throw new Error(
|
|
56917
56928
|
"Could not find haansi in PATH. Make sure it is installed globally (npm install -g haansi)."
|
|
@@ -56955,7 +56966,7 @@ async function setupDaemon(uninstall) {
|
|
|
56955
56966
|
return;
|
|
56956
56967
|
}
|
|
56957
56968
|
try {
|
|
56958
|
-
(0,
|
|
56969
|
+
(0, import_node_child_process2.execSync)(`launchctl unload "${PLIST_PATH}"`, { stdio: "pipe" });
|
|
56959
56970
|
} catch {
|
|
56960
56971
|
}
|
|
56961
56972
|
(0, import_node_fs3.unlinkSync)(PLIST_PATH);
|
|
@@ -56966,10 +56977,10 @@ async function setupDaemon(uninstall) {
|
|
|
56966
56977
|
(0, import_node_fs3.mkdirSync)((0, import_node_path3.join)((0, import_node_os3.homedir)(), ".haansi"), { recursive: true });
|
|
56967
56978
|
(0, import_node_fs3.writeFileSync)(PLIST_PATH, buildPlist(haansiPath), "utf-8");
|
|
56968
56979
|
try {
|
|
56969
|
-
(0,
|
|
56980
|
+
(0, import_node_child_process2.execSync)(`launchctl unload "${PLIST_PATH}"`, { stdio: "pipe" });
|
|
56970
56981
|
} catch {
|
|
56971
56982
|
}
|
|
56972
|
-
(0,
|
|
56983
|
+
(0, import_node_child_process2.execSync)(`launchctl load "${PLIST_PATH}"`, { stdio: "inherit" });
|
|
56973
56984
|
console.log("Daemon installed and started.");
|
|
56974
56985
|
console.log(`Plist : ${PLIST_PATH}`);
|
|
56975
56986
|
console.log(`Logs : ${LOG_FILE}`);
|
|
@@ -56977,11 +56988,11 @@ async function setupDaemon(uninstall) {
|
|
|
56977
56988
|
The daemon will start automatically on every login.`);
|
|
56978
56989
|
console.log(`To uninstall: haansi setup-daemon --uninstall`);
|
|
56979
56990
|
}
|
|
56980
|
-
var
|
|
56991
|
+
var import_node_child_process2, import_node_fs3, import_node_path3, import_node_os3, PLIST_LABEL, PLIST_PATH, LOG_FILE;
|
|
56981
56992
|
var init_setup_daemon = __esm({
|
|
56982
56993
|
"src/commands/setup-daemon.ts"() {
|
|
56983
56994
|
"use strict";
|
|
56984
|
-
|
|
56995
|
+
import_node_child_process2 = require("node:child_process");
|
|
56985
56996
|
import_node_fs3 = require("node:fs");
|
|
56986
56997
|
import_node_path3 = require("node:path");
|
|
56987
56998
|
import_node_os3 = require("node:os");
|