Add voice audio, capture and transcript, browser monitor, and DM UI

This commit is contained in:
Fisto
2026-09-14 11:19:06 +02:00
parent 65f0788502
commit c003d9532f
27 changed files with 4479 additions and 239 deletions
+20 -1
View File
@@ -21,7 +21,9 @@ export const PACING = {
idleMinMs: 5000,
idleMaxMs: 20000,
readMinMs: 100,
readMaxMs: 300
readMaxMs: 300,
voiceMinMs: 250,
voiceMaxMs: 750
};
function randomBetween(min: number, max: number): number {
@@ -95,6 +97,23 @@ export function paced<T>(task: () => Promise<T>): Promise<T> {
return run;
}
/** Serialize a voice action with a short gap. Voice state changes are not sends. */
export function pacedVoice<T>(task: () => Promise<T>): Promise<T> {
const delay = randomBetween(PACING.voiceMinMs, PACING.voiceMaxMs);
const run = queue.then(async () => {
await sleep(delay);
if (process.env.DEBUG === "1") {
console.error(`[voice] action (+${delay}ms)`);
}
return task();
});
queue = run.then(
() => undefined,
() => undefined
);
return run;
}
export function getQueryCount(): number {
return queryCount;
}