chat-heimerdinger 0.1.12 → 0.1.15
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 -22
- package/dist/daemon-entry.js +17 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -110807,7 +110807,7 @@ var require_view2 = __commonJS((exports, module) => {
|
|
|
110807
110807
|
var debug = require_src4()("express:view");
|
|
110808
110808
|
var path = __require("node:path");
|
|
110809
110809
|
var fs = __require("node:fs");
|
|
110810
|
-
var
|
|
110810
|
+
var dirname3 = path.dirname;
|
|
110811
110811
|
var basename2 = path.basename;
|
|
110812
110812
|
var extname = path.extname;
|
|
110813
110813
|
var join3 = path.join;
|
|
@@ -110846,7 +110846,7 @@ var require_view2 = __commonJS((exports, module) => {
|
|
|
110846
110846
|
for (var i2 = 0;i2 < roots.length && !path2; i2++) {
|
|
110847
110847
|
var root = roots[i2];
|
|
110848
110848
|
var loc = resolve(root, name);
|
|
110849
|
-
var dir =
|
|
110849
|
+
var dir = dirname3(loc);
|
|
110850
110850
|
var file = basename2(loc);
|
|
110851
110851
|
path2 = this.resolve(dir, file);
|
|
110852
110852
|
}
|
|
@@ -117575,11 +117575,15 @@ function _getDefaultLogLevel() {
|
|
|
117575
117575
|
var consola = createConsola2();
|
|
117576
117576
|
|
|
117577
117577
|
// src/constants.ts
|
|
117578
|
+
import { readFileSync } from "node:fs";
|
|
117578
117579
|
import { homedir } from "node:os";
|
|
117579
|
-
import { join } from "node:path";
|
|
117580
|
+
import { join, dirname } from "node:path";
|
|
117581
|
+
import { fileURLToPath } from "node:url";
|
|
117582
|
+
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
117583
|
+
var pkg = JSON.parse(readFileSync(join(__dirname2, "..", "package.json"), "utf-8"));
|
|
117580
117584
|
var APP_NAME = "heimerdinger";
|
|
117581
117585
|
var CLI_NAME = "hmdg";
|
|
117582
|
-
var VERSION =
|
|
117586
|
+
var VERSION = pkg.version;
|
|
117583
117587
|
var HOME_DIR = homedir();
|
|
117584
117588
|
var CONFIG_DIR = join(HOME_DIR, ".heimerdinger");
|
|
117585
117589
|
var CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
@@ -118256,8 +118260,8 @@ var be = async (s2, n2) => {
|
|
|
118256
118260
|
};
|
|
118257
118261
|
|
|
118258
118262
|
// src/services/config-manager.ts
|
|
118259
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
118260
|
-
import { dirname } from "node:path";
|
|
118263
|
+
import { existsSync, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
118264
|
+
import { dirname as dirname2 } from "node:path";
|
|
118261
118265
|
class ConfigManager {
|
|
118262
118266
|
configPath;
|
|
118263
118267
|
config;
|
|
@@ -118270,7 +118274,7 @@ class ConfigManager {
|
|
|
118270
118274
|
if (!existsSync(this.configPath)) {
|
|
118271
118275
|
return { ...DEFAULT_CONFIG };
|
|
118272
118276
|
}
|
|
118273
|
-
const content =
|
|
118277
|
+
const content = readFileSync2(this.configPath, "utf-8");
|
|
118274
118278
|
if (!content.trim()) {
|
|
118275
118279
|
return { ...DEFAULT_CONFIG };
|
|
118276
118280
|
}
|
|
@@ -118292,7 +118296,7 @@ class ConfigManager {
|
|
|
118292
118296
|
};
|
|
118293
118297
|
}
|
|
118294
118298
|
save() {
|
|
118295
|
-
const dir =
|
|
118299
|
+
const dir = dirname2(this.configPath);
|
|
118296
118300
|
if (!existsSync(dir)) {
|
|
118297
118301
|
mkdirSync(dir, { recursive: true });
|
|
118298
118302
|
}
|
|
@@ -118636,7 +118640,7 @@ var initCommand = new Command("init").description("Initialize heimerdinger confi
|
|
|
118636
118640
|
|
|
118637
118641
|
// src/commands/logs.ts
|
|
118638
118642
|
import { spawn } from "node:child_process";
|
|
118639
|
-
import { existsSync as existsSync2, readFileSync as
|
|
118643
|
+
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
118640
118644
|
var logsCommand = new Command("logs").description("View service logs").option("-f, --follow", "Follow log output").option("-n, --lines <number>", "Number of lines to show", "50").action(async (options) => {
|
|
118641
118645
|
if (!existsSync2(LOG_FILE)) {
|
|
118642
118646
|
consola.warn("No log file found. Service may not have been started yet.");
|
|
@@ -118659,7 +118663,7 @@ var logsCommand = new Command("logs").description("View service logs").option("-
|
|
|
118659
118663
|
proc.on("close", () => resolve());
|
|
118660
118664
|
});
|
|
118661
118665
|
} else {
|
|
118662
|
-
const content =
|
|
118666
|
+
const content = readFileSync3(LOG_FILE, "utf-8");
|
|
118663
118667
|
const allLines = content.split(`
|
|
118664
118668
|
`).filter(Boolean);
|
|
118665
118669
|
const lastLines = allLines.slice(-lines);
|
|
@@ -118677,7 +118681,7 @@ import { existsSync as existsSync4 } from "node:fs";
|
|
|
118677
118681
|
|
|
118678
118682
|
// src/services/claude-code.ts
|
|
118679
118683
|
import { execSync, spawn as spawn2 } from "node:child_process";
|
|
118680
|
-
import { existsSync as existsSync3, readFileSync as
|
|
118684
|
+
import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync } from "node:fs";
|
|
118681
118685
|
import { basename, join as join2 } from "node:path";
|
|
118682
118686
|
class ClaudeCodeService {
|
|
118683
118687
|
claudeConfigPath;
|
|
@@ -118756,7 +118760,7 @@ class ClaudeCodeService {
|
|
|
118756
118760
|
let mcpServers = {};
|
|
118757
118761
|
try {
|
|
118758
118762
|
if (existsSync3(this.claudeConfigPath)) {
|
|
118759
|
-
const content =
|
|
118763
|
+
const content = readFileSync4(this.claudeConfigPath, "utf-8");
|
|
118760
118764
|
const config = JSON.parse(content);
|
|
118761
118765
|
const projectConfig = config.projects?.[decodedPath];
|
|
118762
118766
|
if (projectConfig) {
|
|
@@ -118795,7 +118799,7 @@ class ClaudeCodeService {
|
|
|
118795
118799
|
if (!existsSync3(indexPath)) {
|
|
118796
118800
|
return [];
|
|
118797
118801
|
}
|
|
118798
|
-
const content =
|
|
118802
|
+
const content = readFileSync4(indexPath, "utf-8");
|
|
118799
118803
|
const index = JSON.parse(content);
|
|
118800
118804
|
return index.entries.sort((a3, b3) => new Date(b3.modified).getTime() - new Date(a3.modified).getTime());
|
|
118801
118805
|
} catch {
|
|
@@ -119086,12 +119090,12 @@ var projectsCommand = new Command("projects").description("List Claude Code proj
|
|
|
119086
119090
|
|
|
119087
119091
|
// src/commands/start.ts
|
|
119088
119092
|
import { spawnSync } from "node:child_process";
|
|
119089
|
-
import { dirname as
|
|
119093
|
+
import { dirname as dirname4, join as join5 } from "node:path";
|
|
119090
119094
|
|
|
119091
119095
|
// src/services/service-manager.ts
|
|
119092
119096
|
import { execSync as execSync3, spawn as spawn4 } from "node:child_process";
|
|
119093
|
-
import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as
|
|
119094
|
-
import { dirname as
|
|
119097
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync6, unlinkSync as unlinkSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
119098
|
+
import { dirname as dirname3, join as join4 } from "node:path";
|
|
119095
119099
|
|
|
119096
119100
|
// src/services/server.ts
|
|
119097
119101
|
import { existsSync as existsSync7, unlinkSync as unlinkSync2, writeFileSync as writeFileSync4 } from "node:fs";
|
|
@@ -120182,7 +120186,7 @@ class SlackAdapter {
|
|
|
120182
120186
|
}
|
|
120183
120187
|
|
|
120184
120188
|
// src/services/message-processor.ts
|
|
120185
|
-
import { existsSync as existsSync6, readFileSync as
|
|
120189
|
+
import { existsSync as existsSync6, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "node:fs";
|
|
120186
120190
|
|
|
120187
120191
|
// src/services/whisper.ts
|
|
120188
120192
|
import { execSync as execSync2, spawn as spawn3 } from "node:child_process";
|
|
@@ -120349,7 +120353,7 @@ class MessageProcessor {
|
|
|
120349
120353
|
loadState() {
|
|
120350
120354
|
try {
|
|
120351
120355
|
if (existsSync6(SESSIONS_STATE_FILE)) {
|
|
120352
|
-
const content =
|
|
120356
|
+
const content = readFileSync5(SESSIONS_STATE_FILE, "utf-8");
|
|
120353
120357
|
const state = JSON.parse(content);
|
|
120354
120358
|
for (const [channel, channelState] of Object.entries(state.channels || {})) {
|
|
120355
120359
|
this.userStates.set(channel, channelState);
|
|
@@ -121500,7 +121504,7 @@ Shutting down...`);
|
|
|
121500
121504
|
mkdirSync3(LOG_DIR, { recursive: true });
|
|
121501
121505
|
}
|
|
121502
121506
|
const cliPath = new URL(import.meta.url).pathname;
|
|
121503
|
-
const distDir =
|
|
121507
|
+
const distDir = dirname3(cliPath);
|
|
121504
121508
|
const daemonScript = join4(distDir, "daemon-entry.js");
|
|
121505
121509
|
consola.debug("Daemon paths:", { distDir, daemonScript, LOG_FILE });
|
|
121506
121510
|
if (!existsSync8(daemonScript)) {
|
|
@@ -121568,7 +121572,7 @@ Shutting down...`);
|
|
|
121568
121572
|
} catch {}
|
|
121569
121573
|
}
|
|
121570
121574
|
async writePidFile(pid) {
|
|
121571
|
-
const dir =
|
|
121575
|
+
const dir = dirname3(this.pidFile);
|
|
121572
121576
|
if (!existsSync8(dir)) {
|
|
121573
121577
|
mkdirSync3(dir, { recursive: true });
|
|
121574
121578
|
}
|
|
@@ -121579,7 +121583,7 @@ Shutting down...`);
|
|
|
121579
121583
|
if (!existsSync8(this.pidFile)) {
|
|
121580
121584
|
return null;
|
|
121581
121585
|
}
|
|
121582
|
-
const content =
|
|
121586
|
+
const content = readFileSync6(this.pidFile, "utf-8");
|
|
121583
121587
|
const pid = Number.parseInt(content.trim(), 10);
|
|
121584
121588
|
return Number.isNaN(pid) ? null : pid;
|
|
121585
121589
|
} catch {
|
|
@@ -121648,7 +121652,7 @@ var startCommand = new Command("start").description("Start the heimerdinger serv
|
|
|
121648
121652
|
consola.info(`Press Ctrl+C to stop.
|
|
121649
121653
|
`);
|
|
121650
121654
|
const cliPath = new URL(import.meta.url).pathname;
|
|
121651
|
-
const projectRoot =
|
|
121655
|
+
const projectRoot = dirname4(dirname4(cliPath));
|
|
121652
121656
|
const serverScript = join5(projectRoot, "src", "services", "daemon-entry.ts");
|
|
121653
121657
|
const tsxPath = join5(projectRoot, "node_modules", ".bin", "tsx");
|
|
121654
121658
|
const result = spawnSync(tsxPath, [serverScript], {
|
package/dist/daemon-entry.js
CHANGED
|
@@ -108645,7 +108645,7 @@ var require_view2 = __commonJS((exports, module) => {
|
|
|
108645
108645
|
var debug = require_src3()("express:view");
|
|
108646
108646
|
var path = __require("node:path");
|
|
108647
108647
|
var fs = __require("node:fs");
|
|
108648
|
-
var
|
|
108648
|
+
var dirname3 = path.dirname;
|
|
108649
108649
|
var basename = path.basename;
|
|
108650
108650
|
var extname = path.extname;
|
|
108651
108651
|
var join2 = path.join;
|
|
@@ -108684,7 +108684,7 @@ var require_view2 = __commonJS((exports, module) => {
|
|
|
108684
108684
|
for (var i2 = 0;i2 < roots.length && !path2; i2++) {
|
|
108685
108685
|
var root = roots[i2];
|
|
108686
108686
|
var loc = resolve(root, name);
|
|
108687
|
-
var dir =
|
|
108687
|
+
var dir = dirname3(loc);
|
|
108688
108688
|
var file = basename(loc);
|
|
108689
108689
|
path2 = this.resolve(dir, file);
|
|
108690
108690
|
}
|
|
@@ -115397,13 +115397,17 @@ function _getDefaultLogLevel() {
|
|
|
115397
115397
|
var consola = createConsola2();
|
|
115398
115398
|
|
|
115399
115399
|
// src/services/config-manager.ts
|
|
115400
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
115401
|
-
import { dirname } from "node:path";
|
|
115400
|
+
import { existsSync, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
115401
|
+
import { dirname as dirname2 } from "node:path";
|
|
115402
115402
|
|
|
115403
115403
|
// src/constants.ts
|
|
115404
|
+
import { readFileSync } from "node:fs";
|
|
115404
115405
|
import { homedir } from "node:os";
|
|
115405
|
-
import { join } from "node:path";
|
|
115406
|
-
|
|
115406
|
+
import { join, dirname } from "node:path";
|
|
115407
|
+
import { fileURLToPath } from "node:url";
|
|
115408
|
+
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
115409
|
+
var pkg = JSON.parse(readFileSync(join(__dirname2, "..", "package.json"), "utf-8"));
|
|
115410
|
+
var VERSION = pkg.version;
|
|
115407
115411
|
var HOME_DIR = homedir();
|
|
115408
115412
|
var CONFIG_DIR = join(HOME_DIR, ".heimerdinger");
|
|
115409
115413
|
var CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
@@ -115457,7 +115461,7 @@ class ConfigManager {
|
|
|
115457
115461
|
if (!existsSync(this.configPath)) {
|
|
115458
115462
|
return { ...DEFAULT_CONFIG };
|
|
115459
115463
|
}
|
|
115460
|
-
const content =
|
|
115464
|
+
const content = readFileSync2(this.configPath, "utf-8");
|
|
115461
115465
|
if (!content.trim()) {
|
|
115462
115466
|
return { ...DEFAULT_CONFIG };
|
|
115463
115467
|
}
|
|
@@ -115479,7 +115483,7 @@ class ConfigManager {
|
|
|
115479
115483
|
};
|
|
115480
115484
|
}
|
|
115481
115485
|
save() {
|
|
115482
|
-
const dir =
|
|
115486
|
+
const dir = dirname2(this.configPath);
|
|
115483
115487
|
if (!existsSync(dir)) {
|
|
115484
115488
|
mkdirSync(dir, { recursive: true });
|
|
115485
115489
|
}
|
|
@@ -116615,11 +116619,11 @@ class SlackAdapter {
|
|
|
116615
116619
|
}
|
|
116616
116620
|
|
|
116617
116621
|
// src/services/message-processor.ts
|
|
116618
|
-
import { existsSync as existsSync4, readFileSync as
|
|
116622
|
+
import { existsSync as existsSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
116619
116623
|
|
|
116620
116624
|
// src/services/claude-code.ts
|
|
116621
116625
|
import { execSync, spawn } from "node:child_process";
|
|
116622
|
-
import { existsSync as existsSync2, readFileSync as
|
|
116626
|
+
import { existsSync as existsSync2, readFileSync as readFileSync3, readdirSync } from "node:fs";
|
|
116623
116627
|
import { basename, join as join2 } from "node:path";
|
|
116624
116628
|
class ClaudeCodeService {
|
|
116625
116629
|
claudeConfigPath;
|
|
@@ -116698,7 +116702,7 @@ class ClaudeCodeService {
|
|
|
116698
116702
|
let mcpServers = {};
|
|
116699
116703
|
try {
|
|
116700
116704
|
if (existsSync2(this.claudeConfigPath)) {
|
|
116701
|
-
const content =
|
|
116705
|
+
const content = readFileSync3(this.claudeConfigPath, "utf-8");
|
|
116702
116706
|
const config = JSON.parse(content);
|
|
116703
116707
|
const projectConfig = config.projects?.[decodedPath];
|
|
116704
116708
|
if (projectConfig) {
|
|
@@ -116737,7 +116741,7 @@ class ClaudeCodeService {
|
|
|
116737
116741
|
if (!existsSync2(indexPath)) {
|
|
116738
116742
|
return [];
|
|
116739
116743
|
}
|
|
116740
|
-
const content =
|
|
116744
|
+
const content = readFileSync3(indexPath, "utf-8");
|
|
116741
116745
|
const index = JSON.parse(content);
|
|
116742
116746
|
return index.entries.sort((a2, b2) => new Date(b2.modified).getTime() - new Date(a2.modified).getTime());
|
|
116743
116747
|
} catch {
|
|
@@ -117087,7 +117091,7 @@ class MessageProcessor {
|
|
|
117087
117091
|
loadState() {
|
|
117088
117092
|
try {
|
|
117089
117093
|
if (existsSync4(SESSIONS_STATE_FILE)) {
|
|
117090
|
-
const content =
|
|
117094
|
+
const content = readFileSync4(SESSIONS_STATE_FILE, "utf-8");
|
|
117091
117095
|
const state = JSON.parse(content);
|
|
117092
117096
|
for (const [channel, channelState] of Object.entries(state.channels || {})) {
|
|
117093
117097
|
this.userStates.set(channel, channelState);
|