@threadbase-sh/streamer 1.16.0 → 1.17.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 +536 -10
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +534 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -1
- package/dist/index.d.ts +58 -1
- package/dist/index.js +534 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -134,6 +134,22 @@ interface DiscoveredProcess {
|
|
|
134
134
|
conversationId: string | null;
|
|
135
135
|
startedAt: Date;
|
|
136
136
|
}
|
|
137
|
+
interface AskOption {
|
|
138
|
+
label: string;
|
|
139
|
+
description: string;
|
|
140
|
+
preview?: string;
|
|
141
|
+
}
|
|
142
|
+
interface AskQuestion {
|
|
143
|
+
question: string;
|
|
144
|
+
header: string;
|
|
145
|
+
multiSelect: boolean;
|
|
146
|
+
options: AskOption[];
|
|
147
|
+
}
|
|
148
|
+
interface PermissionOption {
|
|
149
|
+
index: number;
|
|
150
|
+
label: string;
|
|
151
|
+
answerKeys?: string;
|
|
152
|
+
}
|
|
137
153
|
type WSMessage = {
|
|
138
154
|
type: "terminal_output";
|
|
139
155
|
sessionId: string;
|
|
@@ -157,6 +173,24 @@ type WSMessage = {
|
|
|
157
173
|
type: "conversation_events";
|
|
158
174
|
sessionId: string;
|
|
159
175
|
lines: string[];
|
|
176
|
+
} | {
|
|
177
|
+
type: "question";
|
|
178
|
+
sessionId: string;
|
|
179
|
+
toolUseId: string;
|
|
180
|
+
questions: AskQuestion[];
|
|
181
|
+
} | {
|
|
182
|
+
type: "question_cancelled";
|
|
183
|
+
sessionId: string;
|
|
184
|
+
toolUseId: string;
|
|
185
|
+
} | {
|
|
186
|
+
type: "permission";
|
|
187
|
+
sessionId: string;
|
|
188
|
+
prompt?: string;
|
|
189
|
+
options: PermissionOption[];
|
|
190
|
+
cursor?: number;
|
|
191
|
+
} | {
|
|
192
|
+
type: "permission_cancelled";
|
|
193
|
+
sessionId: string;
|
|
160
194
|
} | {
|
|
161
195
|
type: "ping";
|
|
162
196
|
ts: number;
|
|
@@ -266,6 +300,13 @@ interface PTYManagerOptions {
|
|
|
266
300
|
onOutput?: (sessionId: string, data: string) => void;
|
|
267
301
|
onStatusChange?: (session: ManagedSession) => void;
|
|
268
302
|
onReady?: (session: ManagedSession) => void;
|
|
303
|
+
onPermissionChange?: (sessionId: string, gate: {
|
|
304
|
+
prompt?: string;
|
|
305
|
+
options: PermissionOption[];
|
|
306
|
+
cursor?: number;
|
|
307
|
+
} | null) => void;
|
|
308
|
+
onLiveQuestion?: (sessionId: string, questions: AskQuestion[]) => void;
|
|
309
|
+
onLiveQuestionGone?: (sessionId: string) => void;
|
|
269
310
|
logger?: Logger;
|
|
270
311
|
}
|
|
271
312
|
interface StartSessionOptions {
|
|
@@ -535,6 +576,12 @@ declare class PTYManager {
|
|
|
535
576
|
private onOutput;
|
|
536
577
|
private onStatusChange;
|
|
537
578
|
private onReady;
|
|
579
|
+
private onPermissionChange;
|
|
580
|
+
private onLiveQuestion;
|
|
581
|
+
private onLiveQuestionGone;
|
|
582
|
+
private permissionOpen;
|
|
583
|
+
private lastScreenQuestionKey;
|
|
584
|
+
private shellPromptOpen;
|
|
538
585
|
private pendingReady;
|
|
539
586
|
private queuedInputs;
|
|
540
587
|
private log;
|
|
@@ -558,6 +605,7 @@ declare class PTYManager {
|
|
|
558
605
|
listSessions(): ManagedSession[];
|
|
559
606
|
dispose(): void;
|
|
560
607
|
private handleOutput;
|
|
608
|
+
private detectLivePrompts;
|
|
561
609
|
private markReady;
|
|
562
610
|
private handleExit;
|
|
563
611
|
}
|
|
@@ -595,6 +643,7 @@ type ApiDeps = {
|
|
|
595
643
|
handleGetSession: (sessionId: string, res: ServerResponse) => void;
|
|
596
644
|
handleGetOutput: (sessionId: string, res: ServerResponse) => void;
|
|
597
645
|
handleSendInput: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
646
|
+
handleSendAnswer: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
598
647
|
handleCancel: (sessionId: string, res: ServerResponse) => void;
|
|
599
648
|
handleStopSession: (sessionId: string, res: ServerResponse) => Promise<void>;
|
|
600
649
|
handleSetSessionName: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
@@ -689,6 +738,9 @@ declare class StreamerServer {
|
|
|
689
738
|
private wsHub;
|
|
690
739
|
private fileWatcher;
|
|
691
740
|
private sessionFileMap;
|
|
741
|
+
private pendingQuestions;
|
|
742
|
+
private pendingQuestionKey;
|
|
743
|
+
private pendingPermission;
|
|
692
744
|
private scanner;
|
|
693
745
|
private scannerReady;
|
|
694
746
|
private scannerStale;
|
|
@@ -752,6 +804,7 @@ declare class StreamerServer {
|
|
|
752
804
|
private checkExchangeRateLimit;
|
|
753
805
|
private handleListConversations;
|
|
754
806
|
private handleConversationsCount;
|
|
807
|
+
private refreshCountInBackground;
|
|
755
808
|
private handleSessionsCount;
|
|
756
809
|
private handleGetRecentSessions;
|
|
757
810
|
private handleGetPopularProjects;
|
|
@@ -770,6 +823,10 @@ declare class StreamerServer {
|
|
|
770
823
|
private handleResume;
|
|
771
824
|
private enrichResumedSessionAsync;
|
|
772
825
|
private handleSendInput;
|
|
826
|
+
private cancelPendingQuestion;
|
|
827
|
+
private handleLiveQuestion;
|
|
828
|
+
private handlePermissionChange;
|
|
829
|
+
private handleSendAnswer;
|
|
773
830
|
private handleUploadFile;
|
|
774
831
|
private handleGetOutput;
|
|
775
832
|
private handleCancel;
|
|
@@ -835,4 +892,4 @@ declare class ConversationWatcher {
|
|
|
835
892
|
private readNewLines;
|
|
836
893
|
}
|
|
837
894
|
|
|
838
|
-
export { type AgentClient, type AgentClientOpts, type AgentConfig, type AppendArgs, type ConversationListResponse, ConversationWatcher, type ConversationWriter, type DbConfig, type DiscoveredProcess, type ManagedSession, PTYManager, type PTYManagerOptions, type ProgressDedupeLRU, type ServerConfig, type SessionCursor, type SessionListPage, type SessionListQuery, type SessionResponse, type SessionSortKey, type SessionStatus, SessionStore, type SortOrder, type StartFreshSessionOptions, type StartSessionOptions, StreamerServer, WSHub, type WSMessage, createAgentClient, createConversationWriter, createPool, createProgressDedupeLRU, createProgressRoutes, discoverClaudeProcesses, generateApiKey, getDbConfig, isDbEnabled, loadOrCreateApiKey, maskConnectionString, readAgentConfig, validateApiKey };
|
|
895
|
+
export { type AgentClient, type AgentClientOpts, type AgentConfig, type AppendArgs, type AskOption, type AskQuestion, type ConversationListResponse, ConversationWatcher, type ConversationWriter, type DbConfig, type DiscoveredProcess, type ManagedSession, PTYManager, type PTYManagerOptions, type PermissionOption, type ProgressDedupeLRU, type ServerConfig, type SessionCursor, type SessionListPage, type SessionListQuery, type SessionResponse, type SessionSortKey, type SessionStatus, SessionStore, type SortOrder, type StartFreshSessionOptions, type StartSessionOptions, StreamerServer, WSHub, type WSMessage, createAgentClient, createConversationWriter, createPool, createProgressDedupeLRU, createProgressRoutes, discoverClaudeProcesses, generateApiKey, getDbConfig, isDbEnabled, loadOrCreateApiKey, maskConnectionString, readAgentConfig, validateApiKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,22 @@ interface DiscoveredProcess {
|
|
|
134
134
|
conversationId: string | null;
|
|
135
135
|
startedAt: Date;
|
|
136
136
|
}
|
|
137
|
+
interface AskOption {
|
|
138
|
+
label: string;
|
|
139
|
+
description: string;
|
|
140
|
+
preview?: string;
|
|
141
|
+
}
|
|
142
|
+
interface AskQuestion {
|
|
143
|
+
question: string;
|
|
144
|
+
header: string;
|
|
145
|
+
multiSelect: boolean;
|
|
146
|
+
options: AskOption[];
|
|
147
|
+
}
|
|
148
|
+
interface PermissionOption {
|
|
149
|
+
index: number;
|
|
150
|
+
label: string;
|
|
151
|
+
answerKeys?: string;
|
|
152
|
+
}
|
|
137
153
|
type WSMessage = {
|
|
138
154
|
type: "terminal_output";
|
|
139
155
|
sessionId: string;
|
|
@@ -157,6 +173,24 @@ type WSMessage = {
|
|
|
157
173
|
type: "conversation_events";
|
|
158
174
|
sessionId: string;
|
|
159
175
|
lines: string[];
|
|
176
|
+
} | {
|
|
177
|
+
type: "question";
|
|
178
|
+
sessionId: string;
|
|
179
|
+
toolUseId: string;
|
|
180
|
+
questions: AskQuestion[];
|
|
181
|
+
} | {
|
|
182
|
+
type: "question_cancelled";
|
|
183
|
+
sessionId: string;
|
|
184
|
+
toolUseId: string;
|
|
185
|
+
} | {
|
|
186
|
+
type: "permission";
|
|
187
|
+
sessionId: string;
|
|
188
|
+
prompt?: string;
|
|
189
|
+
options: PermissionOption[];
|
|
190
|
+
cursor?: number;
|
|
191
|
+
} | {
|
|
192
|
+
type: "permission_cancelled";
|
|
193
|
+
sessionId: string;
|
|
160
194
|
} | {
|
|
161
195
|
type: "ping";
|
|
162
196
|
ts: number;
|
|
@@ -266,6 +300,13 @@ interface PTYManagerOptions {
|
|
|
266
300
|
onOutput?: (sessionId: string, data: string) => void;
|
|
267
301
|
onStatusChange?: (session: ManagedSession) => void;
|
|
268
302
|
onReady?: (session: ManagedSession) => void;
|
|
303
|
+
onPermissionChange?: (sessionId: string, gate: {
|
|
304
|
+
prompt?: string;
|
|
305
|
+
options: PermissionOption[];
|
|
306
|
+
cursor?: number;
|
|
307
|
+
} | null) => void;
|
|
308
|
+
onLiveQuestion?: (sessionId: string, questions: AskQuestion[]) => void;
|
|
309
|
+
onLiveQuestionGone?: (sessionId: string) => void;
|
|
269
310
|
logger?: Logger;
|
|
270
311
|
}
|
|
271
312
|
interface StartSessionOptions {
|
|
@@ -535,6 +576,12 @@ declare class PTYManager {
|
|
|
535
576
|
private onOutput;
|
|
536
577
|
private onStatusChange;
|
|
537
578
|
private onReady;
|
|
579
|
+
private onPermissionChange;
|
|
580
|
+
private onLiveQuestion;
|
|
581
|
+
private onLiveQuestionGone;
|
|
582
|
+
private permissionOpen;
|
|
583
|
+
private lastScreenQuestionKey;
|
|
584
|
+
private shellPromptOpen;
|
|
538
585
|
private pendingReady;
|
|
539
586
|
private queuedInputs;
|
|
540
587
|
private log;
|
|
@@ -558,6 +605,7 @@ declare class PTYManager {
|
|
|
558
605
|
listSessions(): ManagedSession[];
|
|
559
606
|
dispose(): void;
|
|
560
607
|
private handleOutput;
|
|
608
|
+
private detectLivePrompts;
|
|
561
609
|
private markReady;
|
|
562
610
|
private handleExit;
|
|
563
611
|
}
|
|
@@ -595,6 +643,7 @@ type ApiDeps = {
|
|
|
595
643
|
handleGetSession: (sessionId: string, res: ServerResponse) => void;
|
|
596
644
|
handleGetOutput: (sessionId: string, res: ServerResponse) => void;
|
|
597
645
|
handleSendInput: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
646
|
+
handleSendAnswer: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
598
647
|
handleCancel: (sessionId: string, res: ServerResponse) => void;
|
|
599
648
|
handleStopSession: (sessionId: string, res: ServerResponse) => Promise<void>;
|
|
600
649
|
handleSetSessionName: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
@@ -689,6 +738,9 @@ declare class StreamerServer {
|
|
|
689
738
|
private wsHub;
|
|
690
739
|
private fileWatcher;
|
|
691
740
|
private sessionFileMap;
|
|
741
|
+
private pendingQuestions;
|
|
742
|
+
private pendingQuestionKey;
|
|
743
|
+
private pendingPermission;
|
|
692
744
|
private scanner;
|
|
693
745
|
private scannerReady;
|
|
694
746
|
private scannerStale;
|
|
@@ -752,6 +804,7 @@ declare class StreamerServer {
|
|
|
752
804
|
private checkExchangeRateLimit;
|
|
753
805
|
private handleListConversations;
|
|
754
806
|
private handleConversationsCount;
|
|
807
|
+
private refreshCountInBackground;
|
|
755
808
|
private handleSessionsCount;
|
|
756
809
|
private handleGetRecentSessions;
|
|
757
810
|
private handleGetPopularProjects;
|
|
@@ -770,6 +823,10 @@ declare class StreamerServer {
|
|
|
770
823
|
private handleResume;
|
|
771
824
|
private enrichResumedSessionAsync;
|
|
772
825
|
private handleSendInput;
|
|
826
|
+
private cancelPendingQuestion;
|
|
827
|
+
private handleLiveQuestion;
|
|
828
|
+
private handlePermissionChange;
|
|
829
|
+
private handleSendAnswer;
|
|
773
830
|
private handleUploadFile;
|
|
774
831
|
private handleGetOutput;
|
|
775
832
|
private handleCancel;
|
|
@@ -835,4 +892,4 @@ declare class ConversationWatcher {
|
|
|
835
892
|
private readNewLines;
|
|
836
893
|
}
|
|
837
894
|
|
|
838
|
-
export { type AgentClient, type AgentClientOpts, type AgentConfig, type AppendArgs, type ConversationListResponse, ConversationWatcher, type ConversationWriter, type DbConfig, type DiscoveredProcess, type ManagedSession, PTYManager, type PTYManagerOptions, type ProgressDedupeLRU, type ServerConfig, type SessionCursor, type SessionListPage, type SessionListQuery, type SessionResponse, type SessionSortKey, type SessionStatus, SessionStore, type SortOrder, type StartFreshSessionOptions, type StartSessionOptions, StreamerServer, WSHub, type WSMessage, createAgentClient, createConversationWriter, createPool, createProgressDedupeLRU, createProgressRoutes, discoverClaudeProcesses, generateApiKey, getDbConfig, isDbEnabled, loadOrCreateApiKey, maskConnectionString, readAgentConfig, validateApiKey };
|
|
895
|
+
export { type AgentClient, type AgentClientOpts, type AgentConfig, type AppendArgs, type AskOption, type AskQuestion, type ConversationListResponse, ConversationWatcher, type ConversationWriter, type DbConfig, type DiscoveredProcess, type ManagedSession, PTYManager, type PTYManagerOptions, type PermissionOption, type ProgressDedupeLRU, type ServerConfig, type SessionCursor, type SessionListPage, type SessionListQuery, type SessionResponse, type SessionSortKey, type SessionStatus, SessionStore, type SortOrder, type StartFreshSessionOptions, type StartSessionOptions, StreamerServer, WSHub, type WSMessage, createAgentClient, createConversationWriter, createPool, createProgressDedupeLRU, createProgressRoutes, discoverClaudeProcesses, generateApiKey, getDbConfig, isDbEnabled, loadOrCreateApiKey, maskConnectionString, readAgentConfig, validateApiKey };
|