@hengyuliu/agenthub-daemon 0.1.0 → 0.1.1
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/index.js +12 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -553,6 +553,7 @@ import { homedir } from "os";
|
|
|
553
553
|
var CLAUDE_PROJECTS_DIR = joinPath(homedir(), ".claude", "projects");
|
|
554
554
|
var READ_BUDGET_BYTES = 5 * 1024 * 1024;
|
|
555
555
|
var SNIPPET_PROBE_BYTES = 64 * 1024;
|
|
556
|
+
var TAIL_PROBE_BYTES = 64 * 1024;
|
|
556
557
|
var SNIPPET_MAX_CHARS = 200;
|
|
557
558
|
function decodeProjectDir(rawName) {
|
|
558
559
|
if (rawName.startsWith("-")) {
|
|
@@ -644,12 +645,18 @@ async function readSessionMeta(filePath, sizeBytes) {
|
|
|
644
645
|
}
|
|
645
646
|
const fd = await fs.open(filePath, "r");
|
|
646
647
|
try {
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
|
|
648
|
+
const headSize = Math.min(SNIPPET_PROBE_BYTES, sizeBytes);
|
|
649
|
+
const headBuf = Buffer.alloc(headSize);
|
|
650
|
+
await fd.read(headBuf, 0, headSize, 0);
|
|
651
|
+
const head = parseBuffer(headBuf, true);
|
|
652
|
+
const tailSize = Math.min(TAIL_PROBE_BYTES, sizeBytes);
|
|
653
|
+
const tailOffset = sizeBytes - tailSize;
|
|
654
|
+
const tailBuf = Buffer.alloc(tailSize);
|
|
655
|
+
await fd.read(tailBuf, 0, tailSize, tailOffset);
|
|
656
|
+
const tail = parseBuffer(tailBuf, true);
|
|
650
657
|
return {
|
|
651
|
-
customTitle:
|
|
652
|
-
snippet:
|
|
658
|
+
customTitle: tail.customTitle ?? head.customTitle,
|
|
659
|
+
snippet: head.snippet,
|
|
653
660
|
messageCount: Math.max(0, Math.round(sizeBytes / 1500))
|
|
654
661
|
};
|
|
655
662
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hengyuliu/agenthub-daemon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "AgentHub local daemon — connects your machine to AgentHub and bridges AI agent runtimes (Claude/Codex/Cursor/Gemini) to the cloud bus",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|