@threadbase-sh/streamer 1.24.7 → 1.26.0

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
@@ -6,6 +6,7 @@ import { Logger as Logger$1 } from 'pino';
6
6
  import { HttpBindings } from '@hono/node-server';
7
7
  import { ServerResponse, IncomingMessage } from 'http';
8
8
  import { WebSocket } from 'ws';
9
+ import { FileStatEntry, ConversationMeta } from '@threadbase-sh/scanner';
9
10
  import Database from 'better-sqlite3';
10
11
  import { z } from 'zod';
11
12
  import { Pool } from 'pg';
@@ -306,6 +307,7 @@ interface ServerConfig {
306
307
  logMenubarRequests?: boolean;
307
308
  browseRoot?: string;
308
309
  publicUrl?: string;
310
+ browserCors?: string;
309
311
  disableDb?: boolean;
310
312
  scanProfiles?: Array<{
311
313
  id: string;
@@ -321,6 +323,7 @@ interface ServerConfig {
321
323
  tailSize?: number;
322
324
  directoryScanDebounceMs?: number;
323
325
  defaultSystemPrompt?: string;
326
+ defaultPermissionMode?: "acceptEdits" | "manual";
324
327
  }
325
328
  interface PTYManagerOptions {
326
329
  onOutput?: (sessionId: string, data: string) => void;
@@ -340,11 +343,13 @@ interface StartSessionOptions {
340
343
  projectPath: string;
341
344
  projectName?: string;
342
345
  branch?: string;
346
+ permissionMode?: "acceptEdits" | "manual";
343
347
  }
344
348
  interface StartFreshSessionOptions {
345
349
  projectPath: string;
346
350
  projectName?: string;
347
351
  systemPrompt?: string;
352
+ permissionMode?: "acceptEdits" | "manual";
348
353
  }
349
354
  interface SessionRunner {
350
355
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -431,7 +436,9 @@ declare class ConversationCache {
431
436
  * share the same connection. Internal API; not part of the public surface.
432
437
  */
433
438
  getDatabase(): Database.Database;
434
- getAgentEntrypoints(): ReadonlySet<string>;
439
+ private agentEntrypointsKey;
440
+ private classifyAgentFile;
441
+ isAgentFileCached(filePath: string): boolean;
435
442
  static open(dbPath: string, tailSize?: number, migrationsDir?: string, options?: ConversationCacheOptions): ConversationCache;
436
443
  close(): void;
437
444
  getPopularProjects(limit: number): Array<{
@@ -471,6 +478,10 @@ declare class ConversationCache {
471
478
  mtimeMs: number;
472
479
  size: number;
473
480
  }>;
481
+ getScannerStatCache(): Map<string, {
482
+ stat: FileStatEntry;
483
+ meta: ConversationMeta;
484
+ }>;
474
485
  getMetaById(id: string): ConversationListItem | null;
475
486
  setConversationProjectId(conversationId: string, projectId: string): void;
476
487
  markAsStreamer(id: string): void;
@@ -707,6 +718,7 @@ type ApiDeps = {
707
718
  };
708
719
  publicUrl: string | null;
709
720
  browseRoot: string | null;
721
+ browserCors: string | undefined;
710
722
  ptyManager: LiveSessionManager;
711
723
  sessionStore: SessionStore;
712
724
  wsHub: WSHub;
@@ -828,6 +840,7 @@ declare class PTYManager implements SessionRunner {
828
840
  private firstChunkAt;
829
841
  private chunkIndex;
830
842
  private lastChunkAt;
843
+ private quietCheckers;
831
844
  private startPromises;
832
845
  constructor(options?: PTYManagerOptions);
833
846
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -848,6 +861,7 @@ declare class PTYManager implements SessionRunner {
848
861
  dispose(): void;
849
862
  private handleOutput;
850
863
  private detectLivePrompts;
864
+ private handleQuiet;
851
865
  private markReady;
852
866
  private handleExit;
853
867
  }
@@ -881,12 +895,14 @@ declare class StreamerServer {
881
895
  private disableDb;
882
896
  private browseRoot;
883
897
  private publicUrl;
898
+ private browserCors;
884
899
  private pairTokens;
885
900
  private exchangeAttempts;
886
901
  private sessionStartAttempts;
887
902
  private sessionInputAttempts;
888
903
  private ptyGracePeriodMs;
889
904
  private defaultSystemPrompt;
905
+ private defaultPermissionMode;
890
906
  private ptyGraceTimers;
891
907
  private sessionSubscribers;
892
908
  private clientIdToWs;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { Logger as Logger$1 } from 'pino';
6
6
  import { HttpBindings } from '@hono/node-server';
7
7
  import { ServerResponse, IncomingMessage } from 'http';
8
8
  import { WebSocket } from 'ws';
9
+ import { FileStatEntry, ConversationMeta } from '@threadbase-sh/scanner';
9
10
  import Database from 'better-sqlite3';
10
11
  import { z } from 'zod';
11
12
  import { Pool } from 'pg';
@@ -306,6 +307,7 @@ interface ServerConfig {
306
307
  logMenubarRequests?: boolean;
307
308
  browseRoot?: string;
308
309
  publicUrl?: string;
310
+ browserCors?: string;
309
311
  disableDb?: boolean;
310
312
  scanProfiles?: Array<{
311
313
  id: string;
@@ -321,6 +323,7 @@ interface ServerConfig {
321
323
  tailSize?: number;
322
324
  directoryScanDebounceMs?: number;
323
325
  defaultSystemPrompt?: string;
326
+ defaultPermissionMode?: "acceptEdits" | "manual";
324
327
  }
325
328
  interface PTYManagerOptions {
326
329
  onOutput?: (sessionId: string, data: string) => void;
@@ -340,11 +343,13 @@ interface StartSessionOptions {
340
343
  projectPath: string;
341
344
  projectName?: string;
342
345
  branch?: string;
346
+ permissionMode?: "acceptEdits" | "manual";
343
347
  }
344
348
  interface StartFreshSessionOptions {
345
349
  projectPath: string;
346
350
  projectName?: string;
347
351
  systemPrompt?: string;
352
+ permissionMode?: "acceptEdits" | "manual";
348
353
  }
349
354
  interface SessionRunner {
350
355
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -431,7 +436,9 @@ declare class ConversationCache {
431
436
  * share the same connection. Internal API; not part of the public surface.
432
437
  */
433
438
  getDatabase(): Database.Database;
434
- getAgentEntrypoints(): ReadonlySet<string>;
439
+ private agentEntrypointsKey;
440
+ private classifyAgentFile;
441
+ isAgentFileCached(filePath: string): boolean;
435
442
  static open(dbPath: string, tailSize?: number, migrationsDir?: string, options?: ConversationCacheOptions): ConversationCache;
436
443
  close(): void;
437
444
  getPopularProjects(limit: number): Array<{
@@ -471,6 +478,10 @@ declare class ConversationCache {
471
478
  mtimeMs: number;
472
479
  size: number;
473
480
  }>;
481
+ getScannerStatCache(): Map<string, {
482
+ stat: FileStatEntry;
483
+ meta: ConversationMeta;
484
+ }>;
474
485
  getMetaById(id: string): ConversationListItem | null;
475
486
  setConversationProjectId(conversationId: string, projectId: string): void;
476
487
  markAsStreamer(id: string): void;
@@ -707,6 +718,7 @@ type ApiDeps = {
707
718
  };
708
719
  publicUrl: string | null;
709
720
  browseRoot: string | null;
721
+ browserCors: string | undefined;
710
722
  ptyManager: LiveSessionManager;
711
723
  sessionStore: SessionStore;
712
724
  wsHub: WSHub;
@@ -828,6 +840,7 @@ declare class PTYManager implements SessionRunner {
828
840
  private firstChunkAt;
829
841
  private chunkIndex;
830
842
  private lastChunkAt;
843
+ private quietCheckers;
831
844
  private startPromises;
832
845
  constructor(options?: PTYManagerOptions);
833
846
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -848,6 +861,7 @@ declare class PTYManager implements SessionRunner {
848
861
  dispose(): void;
849
862
  private handleOutput;
850
863
  private detectLivePrompts;
864
+ private handleQuiet;
851
865
  private markReady;
852
866
  private handleExit;
853
867
  }
@@ -881,12 +895,14 @@ declare class StreamerServer {
881
895
  private disableDb;
882
896
  private browseRoot;
883
897
  private publicUrl;
898
+ private browserCors;
884
899
  private pairTokens;
885
900
  private exchangeAttempts;
886
901
  private sessionStartAttempts;
887
902
  private sessionInputAttempts;
888
903
  private ptyGracePeriodMs;
889
904
  private defaultSystemPrompt;
905
+ private defaultPermissionMode;
890
906
  private ptyGraceTimers;
891
907
  private sessionSubscribers;
892
908
  private clientIdToWs;