@threadbase-sh/scanner 0.16.0 → 0.16.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.16.0";
8
+ var version = "0.16.1";
9
9
 
10
10
  // src/logger.ts
11
11
  import pino from "pino";
@@ -1362,6 +1362,7 @@ function reduceCodexEntry(acc, entry, tier) {
1362
1362
  if (role !== "user" && role !== "assistant") return;
1363
1363
  const text = extractCodexText(payload.content);
1364
1364
  if (!text) return;
1365
+ if (acc.messageCount === 0 && role === "user" && isCodexInjectedContext(text)) return;
1365
1366
  const sender = role;
1366
1367
  acc.messageCount++;
1367
1368
  acc.lastMessageSender = sender;
@@ -1395,7 +1396,10 @@ function finalizeCodexMeta(acc, filePath, account, tier) {
1395
1396
  kind,
1396
1397
  externalSessionId: acc.sessionId || void 0,
1397
1398
  sessionId,
1398
- sessionName: "",
1399
+ // Mirrors the Claude reducer: a rollout carries no slug, so the opening turn
1400
+ // is the only human-readable name source. Only useful because the injected
1401
+ // AGENTS.md turn is skipped above — otherwise every title would be that blob.
1402
+ sessionName: deriveSessionNameFromFirstMessage(acc.firstUser),
1399
1403
  projectPath,
1400
1404
  projectName: getShortProjectName3(projectPath),
1401
1405
  account,
@@ -1418,6 +1422,10 @@ function finalizeCodexMeta(acc, filePath, account, tier) {
1418
1422
  lastPrompt: acc.lastUser?.text || void 0
1419
1423
  };
1420
1424
  }
1425
+ function isCodexInjectedContext(text) {
1426
+ if (text.startsWith("# AGENTS.md") || text.includes("<INSTRUCTIONS>")) return true;
1427
+ return text.startsWith("<permissions instructions>") || text.includes("Filesystem sandboxing defines");
1428
+ }
1421
1429
  function getShortProjectName3(fullPath) {
1422
1430
  return fullPath.split("/").filter(Boolean).slice(-3).join("/");
1423
1431
  }
@@ -1685,7 +1693,7 @@ import { mkdirSync } from "fs";
1685
1693
  import { dirname as dirname3 } from "path";
1686
1694
 
1687
1695
  // src/persistent/schema.ts
1688
- var SCHEMA_VERSION = 6;
1696
+ var SCHEMA_VERSION = 7;
1689
1697
  var SCHEMA_SQL = `
1690
1698
  CREATE TABLE IF NOT EXISTS conversation_files (
1691
1699
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -1920,6 +1928,21 @@ function runMigrations(db) {
1920
1928
  }
1921
1929
  }
1922
1930
  }
1931
+ if (current >= 1 && current < 7 && tableExists(db, "conversation_files")) {
1932
+ const assignments = [];
1933
+ if (hasColumn(db, "conversation_files", "last_indexed_offset")) {
1934
+ assignments.push("last_indexed_offset = 0");
1935
+ }
1936
+ if (hasColumn(db, "conversation_files", "last_indexed_line")) {
1937
+ assignments.push("last_indexed_line = 0");
1938
+ }
1939
+ if (hasColumn(db, "conversation_files", "reducer_state")) {
1940
+ assignments.push("reducer_state = NULL");
1941
+ }
1942
+ if (assignments.length > 0) {
1943
+ db.exec(`UPDATE conversation_files SET ${assignments.join(", ")}`);
1944
+ }
1945
+ }
1923
1946
  db.exec(SCHEMA_SQL);
1924
1947
  db.pragma(`user_version = ${SCHEMA_VERSION}`);
1925
1948
  }