@threadbase-sh/streamer 1.31.0 → 1.31.2

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.d.cts CHANGED
@@ -1090,6 +1090,15 @@ declare class StreamerServer {
1090
1090
  private getScanner;
1091
1091
  private getFreshScanner;
1092
1092
  private rescanForRefresh;
1093
+ /**
1094
+ * The projects dirs disk discovery should walk — the single source of truth
1095
+ * for "where do this server's JSONLs live", mirroring the warm-up watcher
1096
+ * (see listen()). Derived from the enabled scanProfiles' configDirs, or the
1097
+ * real ~/.claude/projects when no profiles are configured. An all-disabled
1098
+ * profile set intentionally yields [] (nothing to discover), matching the
1099
+ * watcher — it does NOT fall back to home in that case.
1100
+ */
1101
+ private projectsDirs;
1093
1102
  private findJsonlPath;
1094
1103
  private readCwdFromJsonl;
1095
1104
  /**
package/dist/index.d.ts CHANGED
@@ -1090,6 +1090,15 @@ declare class StreamerServer {
1090
1090
  private getScanner;
1091
1091
  private getFreshScanner;
1092
1092
  private rescanForRefresh;
1093
+ /**
1094
+ * The projects dirs disk discovery should walk — the single source of truth
1095
+ * for "where do this server's JSONLs live", mirroring the warm-up watcher
1096
+ * (see listen()). Derived from the enabled scanProfiles' configDirs, or the
1097
+ * real ~/.claude/projects when no profiles are configured. An all-disabled
1098
+ * profile set intentionally yields [] (nothing to discover), matching the
1099
+ * watcher — it does NOT fall back to home in that case.
1100
+ */
1101
+ private projectsDirs;
1093
1102
  private findJsonlPath;
1094
1103
  private readCwdFromJsonl;
1095
1104
  /**
package/dist/index.js CHANGED
@@ -6544,14 +6544,8 @@ var StreamerServer = class {
6544
6544
  this.conversationsRepo = new ConversationsRepository(this.cache);
6545
6545
  this.sessionsRepo = new SessionsRepository(this.sessionStore);
6546
6546
  this.cacheMetadataRepo = new CacheMetadataRepository(db);
6547
- if (this.scanProfiles && this.scanProfiles.length > 0) {
6548
- for (const profile of this.scanProfiles) {
6549
- if (profile.enabled) {
6550
- this.fileWatcher.watchDirectory(join15(profile.configDir, "projects"));
6551
- }
6552
- }
6553
- } else {
6554
- this.fileWatcher.watchDirectory(join15(homedir7(), ".claude", "projects"));
6547
+ for (const dir of this.projectsDirs()) {
6548
+ this.fileWatcher.watchDirectory(dir);
6555
6549
  }
6556
6550
  } catch (err) {
6557
6551
  const message = err instanceof Error ? err.message : String(err);
@@ -7132,20 +7126,35 @@ var StreamerServer = class {
7132
7126
  await this.scannerReady;
7133
7127
  return scanner;
7134
7128
  }
7129
+ /**
7130
+ * The projects dirs disk discovery should walk — the single source of truth
7131
+ * for "where do this server's JSONLs live", mirroring the warm-up watcher
7132
+ * (see listen()). Derived from the enabled scanProfiles' configDirs, or the
7133
+ * real ~/.claude/projects when no profiles are configured. An all-disabled
7134
+ * profile set intentionally yields [] (nothing to discover), matching the
7135
+ * watcher — it does NOT fall back to home in that case.
7136
+ */
7137
+ projectsDirs() {
7138
+ if (this.scanProfiles && this.scanProfiles.length > 0) {
7139
+ return this.scanProfiles.filter((p) => p.enabled).map((p) => join15(p.configDir, "projects"));
7140
+ }
7141
+ return [join15(homedir7(), ".claude", "projects")];
7142
+ }
7135
7143
  findJsonlPath(uuid) {
7136
- const projectsDir = join15(homedir7(), ".claude", "projects");
7137
- if (!existsSync8(projectsDir)) return null;
7138
7144
  const filename = `${uuid}.jsonl`;
7139
- for (const dir of readdirSync4(projectsDir)) {
7140
- const fp = join15(projectsDir, dir, filename);
7141
- if (existsSync8(fp)) return fp;
7142
- const projectDir = join15(projectsDir, dir);
7143
- try {
7144
- for (const sub of readdirSync4(projectDir)) {
7145
- const subagentPath = join15(projectDir, sub, "subagents", filename);
7146
- if (existsSync8(subagentPath)) return subagentPath;
7145
+ for (const projectsDir of this.projectsDirs()) {
7146
+ if (!existsSync8(projectsDir)) continue;
7147
+ for (const dir of readdirSync4(projectsDir)) {
7148
+ const fp = join15(projectsDir, dir, filename);
7149
+ if (existsSync8(fp)) return fp;
7150
+ const projectDir = join15(projectsDir, dir);
7151
+ try {
7152
+ for (const sub of readdirSync4(projectDir)) {
7153
+ const subagentPath = join15(projectDir, sub, "subagents", filename);
7154
+ if (existsSync8(subagentPath)) return subagentPath;
7155
+ }
7156
+ } catch {
7147
7157
  }
7148
- } catch {
7149
7158
  }
7150
7159
  }
7151
7160
  return null;
@@ -7692,7 +7701,10 @@ var StreamerServer = class {
7692
7701
  const projectPath = jsonlCwd ?? conv?.projectPath;
7693
7702
  if (!projectPath) {
7694
7703
  if (!conv && !jsonlPath) {
7695
- json(res, 404, { error: "Conversation not found" });
7704
+ json(res, 404, {
7705
+ error: "Conversation history file is missing; it can no longer be resumed",
7706
+ code: "history_file_missing"
7707
+ });
7696
7708
  return;
7697
7709
  }
7698
7710
  json(res, 400, { error: "Could not determine project path" });