@threadbase-sh/streamer 1.24.6 → 1.25.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';
@@ -315,11 +316,13 @@ interface ServerConfig {
315
316
  emoji: string;
316
317
  }>;
317
318
  codexRoots?: string[];
319
+ scannerPersistent?: boolean;
318
320
  ptyGracePeriodMs?: number;
319
321
  cacheDir?: string;
320
322
  tailSize?: number;
321
323
  directoryScanDebounceMs?: number;
322
324
  defaultSystemPrompt?: string;
325
+ defaultPermissionMode?: "acceptEdits" | "manual";
323
326
  }
324
327
  interface PTYManagerOptions {
325
328
  onOutput?: (sessionId: string, data: string) => void;
@@ -339,11 +342,13 @@ interface StartSessionOptions {
339
342
  projectPath: string;
340
343
  projectName?: string;
341
344
  branch?: string;
345
+ permissionMode?: "acceptEdits" | "manual";
342
346
  }
343
347
  interface StartFreshSessionOptions {
344
348
  projectPath: string;
345
349
  projectName?: string;
346
350
  systemPrompt?: string;
351
+ permissionMode?: "acceptEdits" | "manual";
347
352
  }
348
353
  interface SessionRunner {
349
354
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -430,7 +435,9 @@ declare class ConversationCache {
430
435
  * share the same connection. Internal API; not part of the public surface.
431
436
  */
432
437
  getDatabase(): Database.Database;
433
- getAgentEntrypoints(): ReadonlySet<string>;
438
+ private agentEntrypointsKey;
439
+ private classifyAgentFile;
440
+ isAgentFileCached(filePath: string): boolean;
434
441
  static open(dbPath: string, tailSize?: number, migrationsDir?: string, options?: ConversationCacheOptions): ConversationCache;
435
442
  close(): void;
436
443
  getPopularProjects(limit: number): Array<{
@@ -470,6 +477,10 @@ declare class ConversationCache {
470
477
  mtimeMs: number;
471
478
  size: number;
472
479
  }>;
480
+ getScannerStatCache(): Map<string, {
481
+ stat: FileStatEntry;
482
+ meta: ConversationMeta;
483
+ }>;
473
484
  getMetaById(id: string): ConversationListItem | null;
474
485
  setConversationProjectId(conversationId: string, projectId: string): void;
475
486
  markAsStreamer(id: string): void;
@@ -827,6 +838,7 @@ declare class PTYManager implements SessionRunner {
827
838
  private firstChunkAt;
828
839
  private chunkIndex;
829
840
  private lastChunkAt;
841
+ private quietCheckers;
830
842
  private startPromises;
831
843
  constructor(options?: PTYManagerOptions);
832
844
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -847,6 +859,7 @@ declare class PTYManager implements SessionRunner {
847
859
  dispose(): void;
848
860
  private handleOutput;
849
861
  private detectLivePrompts;
862
+ private handleQuiet;
850
863
  private markReady;
851
864
  private handleExit;
852
865
  }
@@ -886,6 +899,7 @@ declare class StreamerServer {
886
899
  private sessionInputAttempts;
887
900
  private ptyGracePeriodMs;
888
901
  private defaultSystemPrompt;
902
+ private defaultPermissionMode;
889
903
  private ptyGraceTimers;
890
904
  private sessionSubscribers;
891
905
  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';
@@ -315,11 +316,13 @@ interface ServerConfig {
315
316
  emoji: string;
316
317
  }>;
317
318
  codexRoots?: string[];
319
+ scannerPersistent?: boolean;
318
320
  ptyGracePeriodMs?: number;
319
321
  cacheDir?: string;
320
322
  tailSize?: number;
321
323
  directoryScanDebounceMs?: number;
322
324
  defaultSystemPrompt?: string;
325
+ defaultPermissionMode?: "acceptEdits" | "manual";
323
326
  }
324
327
  interface PTYManagerOptions {
325
328
  onOutput?: (sessionId: string, data: string) => void;
@@ -339,11 +342,13 @@ interface StartSessionOptions {
339
342
  projectPath: string;
340
343
  projectName?: string;
341
344
  branch?: string;
345
+ permissionMode?: "acceptEdits" | "manual";
342
346
  }
343
347
  interface StartFreshSessionOptions {
344
348
  projectPath: string;
345
349
  projectName?: string;
346
350
  systemPrompt?: string;
351
+ permissionMode?: "acceptEdits" | "manual";
347
352
  }
348
353
  interface SessionRunner {
349
354
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -430,7 +435,9 @@ declare class ConversationCache {
430
435
  * share the same connection. Internal API; not part of the public surface.
431
436
  */
432
437
  getDatabase(): Database.Database;
433
- getAgentEntrypoints(): ReadonlySet<string>;
438
+ private agentEntrypointsKey;
439
+ private classifyAgentFile;
440
+ isAgentFileCached(filePath: string): boolean;
434
441
  static open(dbPath: string, tailSize?: number, migrationsDir?: string, options?: ConversationCacheOptions): ConversationCache;
435
442
  close(): void;
436
443
  getPopularProjects(limit: number): Array<{
@@ -470,6 +477,10 @@ declare class ConversationCache {
470
477
  mtimeMs: number;
471
478
  size: number;
472
479
  }>;
480
+ getScannerStatCache(): Map<string, {
481
+ stat: FileStatEntry;
482
+ meta: ConversationMeta;
483
+ }>;
473
484
  getMetaById(id: string): ConversationListItem | null;
474
485
  setConversationProjectId(conversationId: string, projectId: string): void;
475
486
  markAsStreamer(id: string): void;
@@ -827,6 +838,7 @@ declare class PTYManager implements SessionRunner {
827
838
  private firstChunkAt;
828
839
  private chunkIndex;
829
840
  private lastChunkAt;
841
+ private quietCheckers;
830
842
  private startPromises;
831
843
  constructor(options?: PTYManagerOptions);
832
844
  start(sessionId: string, options: StartSessionOptions): Promise<ManagedSession>;
@@ -847,6 +859,7 @@ declare class PTYManager implements SessionRunner {
847
859
  dispose(): void;
848
860
  private handleOutput;
849
861
  private detectLivePrompts;
862
+ private handleQuiet;
850
863
  private markReady;
851
864
  private handleExit;
852
865
  }
@@ -886,6 +899,7 @@ declare class StreamerServer {
886
899
  private sessionInputAttempts;
887
900
  private ptyGracePeriodMs;
888
901
  private defaultSystemPrompt;
902
+ private defaultPermissionMode;
889
903
  private ptyGraceTimers;
890
904
  private sessionSubscribers;
891
905
  private clientIdToWs;