@threadbase-sh/streamer 1.19.1 → 1.21.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
@@ -279,6 +279,8 @@ interface SessionCursor {
279
279
  interface ServerConfig {
280
280
  port: number;
281
281
  apiKey?: string;
282
+ /** 'cli' when --api-key was passed; rotation persists in-memory only and reverts on restart */
283
+ apiKeySource?: "config" | "cli";
282
284
  localNoAuth?: boolean;
283
285
  verbose?: boolean;
284
286
  logMenubarRequests?: boolean;
@@ -297,6 +299,7 @@ interface ServerConfig {
297
299
  cacheDir?: string;
298
300
  tailSize?: number;
299
301
  directoryScanDebounceMs?: number;
302
+ defaultSystemPrompt?: string;
300
303
  }
301
304
  interface PTYManagerOptions {
302
305
  onOutput?: (sessionId: string, data: string) => void;
@@ -631,6 +634,10 @@ type ApiDeps = {
631
634
  apiKey: string;
632
635
  localNoAuth: boolean;
633
636
  logMenubarRequests: boolean;
637
+ rotateApiKey: () => {
638
+ newKey: string;
639
+ persisted: boolean;
640
+ };
634
641
  publicUrl: string | null;
635
642
  browseRoot: string | null;
636
643
  ptyManager: PTYManager;
@@ -661,8 +668,8 @@ type ApiDeps = {
661
668
  handleConversationsCount: (url: URL, res: ServerResponse) => Promise<void>;
662
669
  handleGetConversation: (id: string, url: URL, res: ServerResponse, ifNoneMatch?: string) => Promise<void>;
663
670
  handleSearch: (url: URL, res: ServerResponse) => Promise<void>;
671
+ handleListProjects: (url: URL, res: ServerResponse) => void;
664
672
  handleGetPopularProjects: (url: URL, res: ServerResponse) => void;
665
- handleListProjectChats: (url: URL, res: ServerResponse) => Promise<void>;
666
673
  handlePairStart: (res: ServerResponse) => void;
667
674
  handlePairExchange: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
668
675
  handleBrowse: (url: URL, res: ServerResponse) => Promise<void>;
@@ -754,6 +761,7 @@ declare class StreamerServer {
754
761
  private binding;
755
762
  private cacheReady;
756
763
  private apiKey;
764
+ private apiKeySource;
757
765
  private localNoAuth;
758
766
  private logMenubarRequests;
759
767
  private verbose;
@@ -765,7 +773,10 @@ declare class StreamerServer {
765
773
  private publicUrl;
766
774
  private pairTokens;
767
775
  private exchangeAttempts;
776
+ private sessionStartAttempts;
777
+ private sessionInputAttempts;
768
778
  private ptyGracePeriodMs;
779
+ private defaultSystemPrompt;
769
780
  private ptyGraceTimers;
770
781
  private sessionSubscribers;
771
782
  private clientIdToWs;
@@ -810,14 +821,17 @@ declare class StreamerServer {
810
821
  private handleRequest;
811
822
  private handlePairStart;
812
823
  private handlePairExchange;
824
+ private rotateApiKey;
825
+ private checkRateLimit;
813
826
  private checkExchangeRateLimit;
827
+ private checkSessionStartRateLimit;
828
+ private checkSessionInputRateLimit;
814
829
  private handleListConversations;
815
830
  private handleConversationsCount;
816
831
  private refreshCountInBackground;
817
832
  private handleSessionsCount;
818
833
  private handleGetRecentSessions;
819
834
  private handleGetPopularProjects;
820
- private handleListProjectChats;
821
835
  private buildStatCache;
822
836
  private codexScanOpts;
823
837
  private getScanner;
package/dist/index.d.ts CHANGED
@@ -279,6 +279,8 @@ interface SessionCursor {
279
279
  interface ServerConfig {
280
280
  port: number;
281
281
  apiKey?: string;
282
+ /** 'cli' when --api-key was passed; rotation persists in-memory only and reverts on restart */
283
+ apiKeySource?: "config" | "cli";
282
284
  localNoAuth?: boolean;
283
285
  verbose?: boolean;
284
286
  logMenubarRequests?: boolean;
@@ -297,6 +299,7 @@ interface ServerConfig {
297
299
  cacheDir?: string;
298
300
  tailSize?: number;
299
301
  directoryScanDebounceMs?: number;
302
+ defaultSystemPrompt?: string;
300
303
  }
301
304
  interface PTYManagerOptions {
302
305
  onOutput?: (sessionId: string, data: string) => void;
@@ -631,6 +634,10 @@ type ApiDeps = {
631
634
  apiKey: string;
632
635
  localNoAuth: boolean;
633
636
  logMenubarRequests: boolean;
637
+ rotateApiKey: () => {
638
+ newKey: string;
639
+ persisted: boolean;
640
+ };
634
641
  publicUrl: string | null;
635
642
  browseRoot: string | null;
636
643
  ptyManager: PTYManager;
@@ -661,8 +668,8 @@ type ApiDeps = {
661
668
  handleConversationsCount: (url: URL, res: ServerResponse) => Promise<void>;
662
669
  handleGetConversation: (id: string, url: URL, res: ServerResponse, ifNoneMatch?: string) => Promise<void>;
663
670
  handleSearch: (url: URL, res: ServerResponse) => Promise<void>;
671
+ handleListProjects: (url: URL, res: ServerResponse) => void;
664
672
  handleGetPopularProjects: (url: URL, res: ServerResponse) => void;
665
- handleListProjectChats: (url: URL, res: ServerResponse) => Promise<void>;
666
673
  handlePairStart: (res: ServerResponse) => void;
667
674
  handlePairExchange: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
668
675
  handleBrowse: (url: URL, res: ServerResponse) => Promise<void>;
@@ -754,6 +761,7 @@ declare class StreamerServer {
754
761
  private binding;
755
762
  private cacheReady;
756
763
  private apiKey;
764
+ private apiKeySource;
757
765
  private localNoAuth;
758
766
  private logMenubarRequests;
759
767
  private verbose;
@@ -765,7 +773,10 @@ declare class StreamerServer {
765
773
  private publicUrl;
766
774
  private pairTokens;
767
775
  private exchangeAttempts;
776
+ private sessionStartAttempts;
777
+ private sessionInputAttempts;
768
778
  private ptyGracePeriodMs;
779
+ private defaultSystemPrompt;
769
780
  private ptyGraceTimers;
770
781
  private sessionSubscribers;
771
782
  private clientIdToWs;
@@ -810,14 +821,17 @@ declare class StreamerServer {
810
821
  private handleRequest;
811
822
  private handlePairStart;
812
823
  private handlePairExchange;
824
+ private rotateApiKey;
825
+ private checkRateLimit;
813
826
  private checkExchangeRateLimit;
827
+ private checkSessionStartRateLimit;
828
+ private checkSessionInputRateLimit;
814
829
  private handleListConversations;
815
830
  private handleConversationsCount;
816
831
  private refreshCountInBackground;
817
832
  private handleSessionsCount;
818
833
  private handleGetRecentSessions;
819
834
  private handleGetPopularProjects;
820
- private handleListProjectChats;
821
835
  private buildStatCache;
822
836
  private codexScanOpts;
823
837
  private getScanner;