@threadbase-sh/scanner 0.24.0 → 0.24.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/cli.js CHANGED
@@ -5,7 +5,7 @@ import { Command } from "commander";
5
5
  import pino2 from "pino";
6
6
 
7
7
  // package.json
8
- var version = "0.24.0";
8
+ var version = "0.24.1";
9
9
 
10
10
  // src/logger.ts
11
11
  import pino from "pino";
@@ -966,8 +966,6 @@ function initialReducerState() {
966
966
  lastMessageSender: "user",
967
967
  agentId: "",
968
968
  isSidechain: false,
969
- isTeammate: false,
970
- firstUserSeen: false,
971
969
  firstMessage: null,
972
970
  lastMessage: null,
973
971
  lastPrompt: "",
@@ -1007,10 +1005,6 @@ function reduceLine(state, entry, tier) {
1007
1005
  return;
1008
1006
  }
1009
1007
  if (state.model === null && msg?.model) state.model = msg.model;
1010
- if (type === "user" && !state.firstUserSeen) {
1011
- state.firstUserSeen = true;
1012
- if (isTeammateContent(msg?.content)) state.isTeammate = true;
1013
- }
1014
1008
  const content = extractTextContent(msg?.content);
1015
1009
  const hasToolUseResult = type === "user" && entry.toolUseResult != null;
1016
1010
  const isOnlyToolResult = hasToolUseResult && isOnlyToolResultContent(msg?.content);
@@ -1077,7 +1071,9 @@ function finalizeMeta(state, filePath, account, tier) {
1077
1071
  // A sidechain line's `sessionId` IS the parent's id — that is exactly the
1078
1072
  // conflation `subagentId` exists to undo, so it is the parent UUID here.
1079
1073
  parentSessionUuid: isSidechain && state.sessionId ? state.sessionId : void 0,
1080
- isTeammate: state.isTeammate,
1074
+ // A teammate's records carry teamName; the lead's never do, yet the lead
1075
+ // receives <teammate-message> tags too, so the tag is not the discriminator.
1076
+ isTeammate: Boolean(state.teamName),
1081
1077
  teamName: state.teamName || null,
1082
1078
  toolNames: state.toolNames,
1083
1079
  firstMessage: state.firstMessage,
@@ -1255,12 +1251,6 @@ function isOnlyToolResultContent(content) {
1255
1251
  if (!Array.isArray(content)) return false;
1256
1252
  return content.length > 0 && content.every((item) => item?.type === "tool_result");
1257
1253
  }
1258
- function isTeammateContent(content) {
1259
- const raw = typeof content === "string" ? content : Array.isArray(content) ? content.map(
1260
- (item) => typeof item === "string" ? item : item?.type === "text" ? item.text ?? "" : ""
1261
- ).join("") : "";
1262
- return raw.includes("<teammate-message");
1263
- }
1264
1254
  function extractThinking(content) {
1265
1255
  if (!Array.isArray(content)) return { content: "", signature: "" };
1266
1256
  const blocks = content.filter((item) => item?.type === "thinking");