feat(companion): add typed wait helpers for stream events
This commit is contained in:
@@ -459,6 +459,22 @@ export class CompanionRuntimeClient {
|
||||
});
|
||||
}
|
||||
|
||||
waitForAgentStream<TData = unknown>(options?: {
|
||||
timeoutMs?: number;
|
||||
predicate?: CompanionEventPredicate<TData>;
|
||||
signal?: AbortSignal;
|
||||
}): Promise<TData> {
|
||||
return this.waitForEvent<TData>(COMPANION_EVENT_NAMES.agentStream, options);
|
||||
}
|
||||
|
||||
waitForAgentTyping<TData = unknown>(options?: {
|
||||
timeoutMs?: number;
|
||||
predicate?: CompanionEventPredicate<TData>;
|
||||
signal?: AbortSignal;
|
||||
}): Promise<TData> {
|
||||
return this.waitForEvent<TData>(COMPANION_EVENT_NAMES.agentTyping, options);
|
||||
}
|
||||
|
||||
async call<T>(method: string, params?: Record<string, unknown>): Promise<T> {
|
||||
if (!this.connected) {
|
||||
if (!this.autoConnect) {
|
||||
|
||||
Reference in New Issue
Block a user