claude-code-kanban 2.2.0-rc.1 → 2.2.0-rc.10
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/hooks/agent-spy.sh +7 -2
- package/lib/parsers.js +37 -1
- package/package.json +2 -2
- package/public/app.js +853 -113
- package/public/index.html +36 -4
- package/public/style.css +308 -5
- package/server.js +169 -38
package/hooks/agent-spy.sh
CHANGED
|
@@ -104,12 +104,17 @@ if [ "$EVENT" = "SubagentStart" ]; then
|
|
|
104
104
|
{"agentId":"$AGENT_ID","type":"$AGENT_TYPE_RAW","status":"active","startedAt":"$TS","updatedAt":"$TS"}
|
|
105
105
|
EOF
|
|
106
106
|
# Write name→id mapping for TeammateIdle resolution
|
|
107
|
-
#
|
|
107
|
+
# Delete previous file only if not active (idle/stopped = teammate re-spawn, active = parallel subagent)
|
|
108
108
|
if [ -n "$AGENT_TYPE_RAW" ]; then
|
|
109
109
|
MAP_FILE="$DIR/_name-${AGENT_TYPE_RAW}.id"
|
|
110
110
|
if [ -f "$MAP_FILE" ]; then
|
|
111
111
|
OLD_ID=$(cat "$MAP_FILE")
|
|
112
|
-
[ -n "$OLD_ID" ] && [ "$OLD_ID" != "$AGENT_ID" ]
|
|
112
|
+
if [ -n "$OLD_ID" ] && [ "$OLD_ID" != "$AGENT_ID" ]; then
|
|
113
|
+
OLD_FILE="$DIR/$OLD_ID.json"
|
|
114
|
+
OLD_STATUS=""
|
|
115
|
+
[ -f "$OLD_FILE" ] && OLD_STATUS=$(jq -r '.status // ""' "$OLD_FILE" 2>/dev/null)
|
|
116
|
+
[ "$OLD_STATUS" != "active" ] && rm -f "$OLD_FILE"
|
|
117
|
+
fi
|
|
113
118
|
fi
|
|
114
119
|
echo -n "$AGENT_ID" > "$MAP_FILE"
|
|
115
120
|
fi
|
package/lib/parsers.js
CHANGED
|
@@ -613,6 +613,41 @@ function findTerminatedTeammates(jsonlPath) {
|
|
|
613
613
|
return terminated;
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
+
function extractPromptFromTranscript(jsonlPath) {
|
|
617
|
+
const { openSync, readSync, closeSync } = fs;
|
|
618
|
+
const MAX_READ = 65536;
|
|
619
|
+
const CHUNK = 4096;
|
|
620
|
+
const fd = openSync(jsonlPath, 'r');
|
|
621
|
+
try {
|
|
622
|
+
let accumulated = '';
|
|
623
|
+
const buf = Buffer.alloc(CHUNK);
|
|
624
|
+
while (accumulated.length < MAX_READ) {
|
|
625
|
+
const bytesRead = readSync(fd, buf, 0, CHUNK, null);
|
|
626
|
+
if (bytesRead === 0) break;
|
|
627
|
+
accumulated += buf.toString('utf8', 0, bytesRead);
|
|
628
|
+
const nlIdx = accumulated.indexOf('\n');
|
|
629
|
+
if (nlIdx === -1) continue;
|
|
630
|
+
const firstLine = accumulated.slice(0, nlIdx);
|
|
631
|
+
try {
|
|
632
|
+
const obj = JSON.parse(firstLine);
|
|
633
|
+
if (obj.type === 'user') {
|
|
634
|
+
const content = obj.message?.content;
|
|
635
|
+
if (typeof content === 'string') return content.slice(0, 500);
|
|
636
|
+
if (Array.isArray(content)) {
|
|
637
|
+
for (const b of content) {
|
|
638
|
+
if (b.type === 'text' && b.text) return b.text.slice(0, 500);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
} catch (_) {}
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
} finally {
|
|
646
|
+
closeSync(fd);
|
|
647
|
+
}
|
|
648
|
+
return null;
|
|
649
|
+
}
|
|
650
|
+
|
|
616
651
|
module.exports = {
|
|
617
652
|
parseTask,
|
|
618
653
|
parseAgent,
|
|
@@ -624,5 +659,6 @@ module.exports = {
|
|
|
624
659
|
readRecentMessages,
|
|
625
660
|
buildAgentProgressMap,
|
|
626
661
|
readCompactSummaries,
|
|
627
|
-
findTerminatedTeammates
|
|
662
|
+
findTerminatedTeammates,
|
|
663
|
+
extractPromptFromTranscript
|
|
628
664
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-kanban",
|
|
3
|
-
"version": "2.2.0-rc.
|
|
3
|
+
"version": "2.2.0-rc.10",
|
|
4
4
|
"description": "A web-based Kanban board for viewing Claude Code tasks with agent teams support",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node server.js",
|
|
11
|
-
"dev": "node server.js
|
|
11
|
+
"dev": "node --watch server.js",
|
|
12
12
|
"test": "node --test test/contracts.test.js",
|
|
13
13
|
"test:hooks": "bash tests/test-agent-spy.sh",
|
|
14
14
|
"validate:schemas": "node test/validate-live-schemas.js",
|