haansi 0.1.27 → 0.1.28
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 +29 -5
- package/package.json +1 -1
package/dist/haansi.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports2, module2) {
|
|
40
40
|
module2.exports = {
|
|
41
41
|
name: "haansi",
|
|
42
|
-
version: "0.1.
|
|
42
|
+
version: "0.1.28",
|
|
43
43
|
description: "Haansi CLI - Session collector and MCP server for Claude Code & OpenAI Codex",
|
|
44
44
|
bin: {
|
|
45
45
|
haansi: "./dist/haansi.js"
|
|
@@ -961,9 +961,9 @@ function extractGitInfo(projectDir, sessionTimestamp, sessionBranch) {
|
|
|
961
961
|
try {
|
|
962
962
|
git(["rev-parse", "--is-inside-work-tree"]);
|
|
963
963
|
} catch (err) {
|
|
964
|
-
logger.warn("Git metadata skipped \u2014 not a resolvable git repo", {
|
|
964
|
+
logger.warn("Git metadata skipped \u2014 cwd not a resolvable git repo", {
|
|
965
965
|
projectDir,
|
|
966
|
-
reason: err?.code === "ENOENT" ? "
|
|
966
|
+
reason: err?.code === "ENOENT" ? "cwd-missing" : err?.status === 128 ? "not-a-git-repo" : "git-check-failed",
|
|
967
967
|
error: err?.message?.slice(0, 200)
|
|
968
968
|
});
|
|
969
969
|
return empty;
|
|
@@ -51219,7 +51219,7 @@ var require_view = __commonJS({
|
|
|
51219
51219
|
var debug = require_src()("express:view");
|
|
51220
51220
|
var path = require("node:path");
|
|
51221
51221
|
var fs = require("node:fs");
|
|
51222
|
-
var
|
|
51222
|
+
var dirname3 = path.dirname;
|
|
51223
51223
|
var basename3 = path.basename;
|
|
51224
51224
|
var extname = path.extname;
|
|
51225
51225
|
var join12 = path.join;
|
|
@@ -51258,7 +51258,7 @@ var require_view = __commonJS({
|
|
|
51258
51258
|
for (var i = 0; i < roots.length && !path2; i++) {
|
|
51259
51259
|
var root = roots[i];
|
|
51260
51260
|
var loc = resolve4(root, name);
|
|
51261
|
-
var dir =
|
|
51261
|
+
var dir = dirname3(loc);
|
|
51262
51262
|
var file2 = basename3(loc);
|
|
51263
51263
|
path2 = this.resolve(dir, file2);
|
|
51264
51264
|
}
|
|
@@ -57930,6 +57930,29 @@ function findHaansiBin() {
|
|
|
57930
57930
|
);
|
|
57931
57931
|
}
|
|
57932
57932
|
}
|
|
57933
|
+
function warnIfStaleDevBundle(haansiPath) {
|
|
57934
|
+
try {
|
|
57935
|
+
const bundle = (0, import_node_fs6.realpathSync)(haansiPath);
|
|
57936
|
+
const repoRoot = (0, import_node_path5.dirname)((0, import_node_path5.dirname)((0, import_node_path5.dirname)((0, import_node_path5.dirname)(bundle))));
|
|
57937
|
+
const sources = [
|
|
57938
|
+
"apps/service-capture/claude-sessions/collector.ts",
|
|
57939
|
+
"apps/service-capture/claude-sessions/collector-daemon.ts",
|
|
57940
|
+
"apps/service-capture/common/agents/codex.ts",
|
|
57941
|
+
"apps/service-capture/common/agents/claude-code.ts"
|
|
57942
|
+
].map((p) => (0, import_node_path5.join)(repoRoot, p));
|
|
57943
|
+
if (!(0, import_node_fs6.existsSync)(sources[0])) return;
|
|
57944
|
+
const bundleMtime = (0, import_node_fs6.statSync)(bundle).mtimeMs;
|
|
57945
|
+
const newestSrc = Math.max(
|
|
57946
|
+
...sources.filter(import_node_fs6.existsSync).map((p) => (0, import_node_fs6.statSync)(p).mtimeMs)
|
|
57947
|
+
);
|
|
57948
|
+
if (newestSrc > bundleMtime) {
|
|
57949
|
+
console.warn(
|
|
57950
|
+
"\n\u26A0\uFE0F The compiled CLI bundle is OLDER than the collector source.\n The daemon runs the bundle, so it would start with stale code.\n Rebuild first: npm run build --workspace apps/cli\n then re-run: haansi setup-daemon\n"
|
|
57951
|
+
);
|
|
57952
|
+
}
|
|
57953
|
+
} catch {
|
|
57954
|
+
}
|
|
57955
|
+
}
|
|
57933
57956
|
function buildPlist(haansiPath) {
|
|
57934
57957
|
const binDir = haansiPath.replace(/\/[^/]+$/, "");
|
|
57935
57958
|
const path = `${binDir}:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin`;
|
|
@@ -57976,6 +57999,7 @@ async function setupDaemon(uninstall) {
|
|
|
57976
57999
|
return;
|
|
57977
58000
|
}
|
|
57978
58001
|
const haansiPath = findHaansiBin();
|
|
58002
|
+
warnIfStaleDevBundle(haansiPath);
|
|
57979
58003
|
(0, import_node_fs6.mkdirSync)((0, import_node_path5.join)((0, import_node_os5.homedir)(), ".haansi"), { recursive: true });
|
|
57980
58004
|
(0, import_node_fs6.writeFileSync)(PLIST_PATH, buildPlist(haansiPath), "utf-8");
|
|
57981
58005
|
try {
|