@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/index.cjs CHANGED
@@ -830,8 +830,6 @@ function initialReducerState() {
830
830
  lastMessageSender: "user",
831
831
  agentId: "",
832
832
  isSidechain: false,
833
- isTeammate: false,
834
- firstUserSeen: false,
835
833
  firstMessage: null,
836
834
  lastMessage: null,
837
835
  lastPrompt: "",
@@ -871,10 +869,6 @@ function reduceLine(state, entry, tier) {
871
869
  return;
872
870
  }
873
871
  if (state.model === null && msg?.model) state.model = msg.model;
874
- if (type === "user" && !state.firstUserSeen) {
875
- state.firstUserSeen = true;
876
- if (isTeammateContent(msg?.content)) state.isTeammate = true;
877
- }
878
872
  const content = extractTextContent(msg?.content);
879
873
  const hasToolUseResult = type === "user" && entry.toolUseResult != null;
880
874
  const isOnlyToolResult = hasToolUseResult && isOnlyToolResultContent(msg?.content);
@@ -941,7 +935,9 @@ function finalizeMeta(state, filePath, account, tier) {
941
935
  // A sidechain line's `sessionId` IS the parent's id — that is exactly the
942
936
  // conflation `subagentId` exists to undo, so it is the parent UUID here.
943
937
  parentSessionUuid: isSidechain && state.sessionId ? state.sessionId : void 0,
944
- isTeammate: state.isTeammate,
938
+ // A teammate's records carry teamName; the lead's never do, yet the lead
939
+ // receives <teammate-message> tags too, so the tag is not the discriminator.
940
+ isTeammate: Boolean(state.teamName),
945
941
  teamName: state.teamName || null,
946
942
  toolNames: state.toolNames,
947
943
  firstMessage: state.firstMessage,
@@ -1119,12 +1115,6 @@ function isOnlyToolResultContent(content) {
1119
1115
  if (!Array.isArray(content)) return false;
1120
1116
  return content.length > 0 && content.every((item) => item?.type === "tool_result");
1121
1117
  }
1122
- function isTeammateContent(content) {
1123
- const raw = typeof content === "string" ? content : Array.isArray(content) ? content.map(
1124
- (item) => typeof item === "string" ? item : item?.type === "text" ? item.text ?? "" : ""
1125
- ).join("") : "";
1126
- return raw.includes("<teammate-message");
1127
- }
1128
1118
  function extractThinking(content) {
1129
1119
  if (!Array.isArray(content)) return { content: "", signature: "" };
1130
1120
  const blocks = content.filter((item) => item?.type === "thinking");