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