@threadbase-sh/streamer 1.20.0 → 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/cli.cjs +442 -616
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +154 -316
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +159 -321
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
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;
|
|
@@ -632,6 +634,10 @@ type ApiDeps = {
|
|
|
632
634
|
apiKey: string;
|
|
633
635
|
localNoAuth: boolean;
|
|
634
636
|
logMenubarRequests: boolean;
|
|
637
|
+
rotateApiKey: () => {
|
|
638
|
+
newKey: string;
|
|
639
|
+
persisted: boolean;
|
|
640
|
+
};
|
|
635
641
|
publicUrl: string | null;
|
|
636
642
|
browseRoot: string | null;
|
|
637
643
|
ptyManager: PTYManager;
|
|
@@ -662,8 +668,8 @@ type ApiDeps = {
|
|
|
662
668
|
handleConversationsCount: (url: URL, res: ServerResponse) => Promise<void>;
|
|
663
669
|
handleGetConversation: (id: string, url: URL, res: ServerResponse, ifNoneMatch?: string) => Promise<void>;
|
|
664
670
|
handleSearch: (url: URL, res: ServerResponse) => Promise<void>;
|
|
671
|
+
handleListProjects: (url: URL, res: ServerResponse) => void;
|
|
665
672
|
handleGetPopularProjects: (url: URL, res: ServerResponse) => void;
|
|
666
|
-
handleListProjectChats: (url: URL, res: ServerResponse) => Promise<void>;
|
|
667
673
|
handlePairStart: (res: ServerResponse) => void;
|
|
668
674
|
handlePairExchange: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
669
675
|
handleBrowse: (url: URL, res: ServerResponse) => Promise<void>;
|
|
@@ -755,6 +761,7 @@ declare class StreamerServer {
|
|
|
755
761
|
private binding;
|
|
756
762
|
private cacheReady;
|
|
757
763
|
private apiKey;
|
|
764
|
+
private apiKeySource;
|
|
758
765
|
private localNoAuth;
|
|
759
766
|
private logMenubarRequests;
|
|
760
767
|
private verbose;
|
|
@@ -766,6 +773,8 @@ declare class StreamerServer {
|
|
|
766
773
|
private publicUrl;
|
|
767
774
|
private pairTokens;
|
|
768
775
|
private exchangeAttempts;
|
|
776
|
+
private sessionStartAttempts;
|
|
777
|
+
private sessionInputAttempts;
|
|
769
778
|
private ptyGracePeriodMs;
|
|
770
779
|
private defaultSystemPrompt;
|
|
771
780
|
private ptyGraceTimers;
|
|
@@ -812,14 +821,17 @@ declare class StreamerServer {
|
|
|
812
821
|
private handleRequest;
|
|
813
822
|
private handlePairStart;
|
|
814
823
|
private handlePairExchange;
|
|
824
|
+
private rotateApiKey;
|
|
825
|
+
private checkRateLimit;
|
|
815
826
|
private checkExchangeRateLimit;
|
|
827
|
+
private checkSessionStartRateLimit;
|
|
828
|
+
private checkSessionInputRateLimit;
|
|
816
829
|
private handleListConversations;
|
|
817
830
|
private handleConversationsCount;
|
|
818
831
|
private refreshCountInBackground;
|
|
819
832
|
private handleSessionsCount;
|
|
820
833
|
private handleGetRecentSessions;
|
|
821
834
|
private handleGetPopularProjects;
|
|
822
|
-
private handleListProjectChats;
|
|
823
835
|
private buildStatCache;
|
|
824
836
|
private codexScanOpts;
|
|
825
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;
|
|
@@ -632,6 +634,10 @@ type ApiDeps = {
|
|
|
632
634
|
apiKey: string;
|
|
633
635
|
localNoAuth: boolean;
|
|
634
636
|
logMenubarRequests: boolean;
|
|
637
|
+
rotateApiKey: () => {
|
|
638
|
+
newKey: string;
|
|
639
|
+
persisted: boolean;
|
|
640
|
+
};
|
|
635
641
|
publicUrl: string | null;
|
|
636
642
|
browseRoot: string | null;
|
|
637
643
|
ptyManager: PTYManager;
|
|
@@ -662,8 +668,8 @@ type ApiDeps = {
|
|
|
662
668
|
handleConversationsCount: (url: URL, res: ServerResponse) => Promise<void>;
|
|
663
669
|
handleGetConversation: (id: string, url: URL, res: ServerResponse, ifNoneMatch?: string) => Promise<void>;
|
|
664
670
|
handleSearch: (url: URL, res: ServerResponse) => Promise<void>;
|
|
671
|
+
handleListProjects: (url: URL, res: ServerResponse) => void;
|
|
665
672
|
handleGetPopularProjects: (url: URL, res: ServerResponse) => void;
|
|
666
|
-
handleListProjectChats: (url: URL, res: ServerResponse) => Promise<void>;
|
|
667
673
|
handlePairStart: (res: ServerResponse) => void;
|
|
668
674
|
handlePairExchange: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
669
675
|
handleBrowse: (url: URL, res: ServerResponse) => Promise<void>;
|
|
@@ -755,6 +761,7 @@ declare class StreamerServer {
|
|
|
755
761
|
private binding;
|
|
756
762
|
private cacheReady;
|
|
757
763
|
private apiKey;
|
|
764
|
+
private apiKeySource;
|
|
758
765
|
private localNoAuth;
|
|
759
766
|
private logMenubarRequests;
|
|
760
767
|
private verbose;
|
|
@@ -766,6 +773,8 @@ declare class StreamerServer {
|
|
|
766
773
|
private publicUrl;
|
|
767
774
|
private pairTokens;
|
|
768
775
|
private exchangeAttempts;
|
|
776
|
+
private sessionStartAttempts;
|
|
777
|
+
private sessionInputAttempts;
|
|
769
778
|
private ptyGracePeriodMs;
|
|
770
779
|
private defaultSystemPrompt;
|
|
771
780
|
private ptyGraceTimers;
|
|
@@ -812,14 +821,17 @@ declare class StreamerServer {
|
|
|
812
821
|
private handleRequest;
|
|
813
822
|
private handlePairStart;
|
|
814
823
|
private handlePairExchange;
|
|
824
|
+
private rotateApiKey;
|
|
825
|
+
private checkRateLimit;
|
|
815
826
|
private checkExchangeRateLimit;
|
|
827
|
+
private checkSessionStartRateLimit;
|
|
828
|
+
private checkSessionInputRateLimit;
|
|
816
829
|
private handleListConversations;
|
|
817
830
|
private handleConversationsCount;
|
|
818
831
|
private refreshCountInBackground;
|
|
819
832
|
private handleSessionsCount;
|
|
820
833
|
private handleGetRecentSessions;
|
|
821
834
|
private handleGetPopularProjects;
|
|
822
|
-
private handleListProjectChats;
|
|
823
835
|
private buildStatCache;
|
|
824
836
|
private codexScanOpts;
|
|
825
837
|
private getScanner;
|